# From Trees to Barcodes and Back Again: Theoretical and Statistical Perspectives
## 4 Stability of the TNS
### Bottleneck Stability
Change of permutation type between \(B\) and \(B^{\prime}\) is more frequent for small \(\lambda\) (Figure 14). Therefore, the previous lemma is usually not applicable for small values of \(\lambda\), for which it is any case not particularly useful, as shown in Figure 10. In Figure 11, we summarize graphically the discussion above. The transposition of bars is studied in detail in the next section. We perform two experiments to illustrate our theoretical results computationally. First, we compute the bottleneck distance between input barcodes \(B\) and output barcodes \(B^{\prime}\), for increasing values of lambda \(\lambda\) from 0.01 to 2 (see Figure 12A1-3). The computational results (average bottleneck distances in red, Figure 12A2) fit the curve of the expected mean of the probability density function (The PDF can be deduced from Equation (2) in the proof of Lemma 4 by taking the derivative of \((1-\exp(-\lambda\varepsilon)(\lambda\varepsilon+1))^{n}\).) well (blue curve). We also compute the cumulative density function for \(0\leq\varepsilon\leq 200\) and \(0\leq\lambda\leq 2\), which we compare to the computational results (red points, Figure 12A3), showing that they match the theoretical prediction (blue colormap) very closely for a wide range of sufficiently large \(\lambda\) (zoom-in, Figure 12A3). However, for very small values of \(\lambda\), the condition \(B\sim B^{\prime}\) is not always satisfied, leading to the observation that, for \(\lambda<0.2\), the computationally computed bottleneck distances are larger than the theoretically expected values. Second, we compute the bottleneck distance between input and output barcodes for various fixed values of \(\lambda\), where the input barcodes arise by gradually decreasing the death time of one bar of an initial barcode \(B\) and thus increasing the distance to the next death time in the sequence (see Figure 12B1-2). All other bars of the initial barcode \(B\) remain the same. We observe that the bottleneck distance depends only on the value of \(\lambda\) and not on the distance between the bars of the input barcode. \[d(B,B^{\prime})=\inf_{\gamma\in\mathfrak{S}_{n}}\sup_{i}|b_{i}-b^{\prime}_{ \gamma(i)}|+|d_{i}-d^{\prime}_{\gamma(i)}|.\]0 (**A**) The \(\ell_{1}\)-distance between the black bullet and the diamond follows an Erlang\((2,\lambda)\) distribution. The interior of the green square defines a bound for the \(\ell_{1}\)-distance from the black bullet that depends on the value of the parameter \(\lambda\). (**B**) If the endpoints of the bars of \(B\) are sufficiently far away from each other and \(B\sim\text{TMD}\circ\text{TNS}(B)\), then, with high probability, taking \(\gamma=I\) will minimize the \(\ell_{1}\)-distance between pairs of endpoints of bars. (**C**) If the endpoints of \(B\) are instead close to each other, then it is more likely that \(B\
ot\sim\text{TMD}\circ\text{TNS}(B)\), so that the optimal choice of \(\gamma\) (represented by red segments) is not the identity. The red distances do not necessarily follow exponential distributions, so the proof of Lemma 4 does not apply.