A simplified algorithm for the topological entropy of multimodal maps

A numerical algorithm to compute the topological entropy of multimodal maps is proposed. This algorithm results from a closed formula containing the so-called min-max symbols, which are closely related to the kneading symbols. Furthermore, it simplifies a previous algorithm, also based on min-max symbols, which was originally proposed for twice differentiable multimodal maps. The new algorithm has been benchmarked against the old one with a number of multimodal maps, the results being reported in the paper. In particular, the comparison is favorable to the new algorithm, except in the unimodal case.


Introduction
Let f be a continuous selfmap of a compact interval [a, b] ⊂ R with a finite number of turning (or critical) points. Such maps are generically called multimodal. Then, the topological entropy of f [1,2], h(f ), can be calculated (along other possibilities) with the formula where ℓ n is shorthand for the lap number of f n , i.e., the number of maximal monotonicity segments of f n , the nth iterate of f [3,4].
In [5,Sect. 7] a numerical algorithm to compute the topological entropy of multimodal maps was proposed. Let us point out that this algorithm generalizes and hence includes a previous one for unimodal maps published in [6]. The algorithm builds on (1) by calculating ℓ n with the help of the min-max symbols of f [5,6,7,8], a generalization of the kneading symbols [9,10]. The min-max symbols of a multimodal map not only locate the iterates of its critical values up to the precision set by the partition defined by its critical points, as the kneading symbols do, but they also display their minimum/maximum (or "critical") character. The interesting point is that such an additional information supposes virtually no extra computational cost. Indeed, it can be read recursively from a look-up table once the min-max symbols of the critical values are known.
In this paper we propose a related algorithm which actually approximates the value of h(f ) given by a closed formula involving also the min-max symbols of f . The new algorithm eliminates a formal restriction that, as it turns out, unnecessarily marred the applicability of the algorithm of [5]. At the same time, it simplifies the computation scheme of the latter. We elaborate upon these two points briefly.
With regard to the formal restriction, the theoretical results of [5] refer to twice differentiable multimodal maps only. However, numerical simulations with piecewise linear maps of constant slope (and alternating sign) suggested that the algorithm of [5] could be applied as well to just continuous maps. In this paper we justify the extension of results from smooth to just continuous maps. Although the proof turns out to be straightforward, this generalization was not explored in the previous papers [5,6] just because these followed the original approach in [7,8], which only considered twice differentiable maps for simplicity.
As for the simplification of the computation scheme, this has to do with the boundary conditions (or the lack of them). Indeed, the algorithm of [5] keeps track of the orbits of the boundary points, thus calculating the exact value of the lap number ℓ n in each computation loop. At the contrary, the new algorithm dispenses with those orbits because they do not affect the limit (1). In fact, Theorem 3 below shows that, as far as the computation of h(f ) is concerned, one may assume that f is boundary-anchored, i.e., f ({a, b}) ⊂ {a, b}. The result is a compact expression for the lap number ℓ n that makes possible a closed formula for h(f ).
In sum, we fill a theoretical gap in the application of the algorithm in [5] by showing that continuity of the maps suffices. Moreover, we abridge the numerical scheme by approximating ℓ n in (1) with a formula which is exact only for boundary-anchored maps but provides the right limit (1) for h(f ).
This paper is organized as follows. To make the paper self-contained, we review in Sect. 2 all the basic concepts, especially the concept of min-max sequences, needed in the following sections. Most importantly, we extend in Theorem 1 the transition rules for min-max symbols from twice differentiable multimodal maps [5] to just continuous ones. In Sect. 3 we introduce some instrumental results which lead in Sect. 4, together with Theorem 3, to a closed formula for h(f ) containing the min-max symbols of f (Theorem 4). A formal proof of Theorem 3 has been shifted to the Appendix in order not to interrupt the flow of ideas. Sect. 5 contains the main result of the paper, namely, an algorithm for the topological entropy of (not necessarily smooth) multimodal maps which approximates the value of h(f ) given in Theorem 4. As way of illustration, this algorithm is put to test in Sect. 6. First, the new, abridged algorithm is benchmarked in Sects. 6.1 to 6.3 against the full-pledged one, Ref. [5], using smooth uni-, bi-, and trimodal maps, respectively, borrowed from [5,6]. Finally, in Sect. 6.4, we also compare both algorithms via piecewise linear, four and five-modal maps of known topological entropy. It turns out that, except in the unimodal case, the new algorithm outperforms the old one.

Min-max sequences
For the reader's convenience, we use the same notation as in [5] throughout. Let I be a compact interval [a, b] ⊂ R and f : I → I a piecewise monotone continuous map. Such a map is called l-modal if f has precisely l turning points (i.e., points in (a, b) where f has a local extremum). Sometimes we speak also of multimodal maps, in general, or of unimodal maps in the particular case l = 1. Furthermore, assume henceforth that f has local extrema at c 1 < ... < c l and is strictly monotone in each of the l + 1 intervals In this case we write f ∈ M l (I). When the interval I is clear from the context or unimportant for the argument, we write just M l .
Since the results we obtain below for the calculation of the topological entropy do not depend on the shape of f , i.e., on whether f (c 1 ) is a maximum (positive shape) or a minimum (negative shape), we assume, unless otherwise stated, that f has positive shape. This implies that f (c odd ) are maxima, whereas f (c even ) are minima, where here and hereafter "even" and "odd" stand for even and odd subindices, respectively. Hence f is strictly increasing on the intervals I odd , and strictly decreasing on the intervals I even . The points f (c i ), 1 ≤ i ≤ l, are called the critical values of f although no differentiability of f at c i is assumed when so doing.
Theorem 1. Let f ∈ M l have a positive shape, and n ≥ 1. Then: (c) If f n (x) is a maximum, then Proof. (a) This is a trivial consequence of f having a positive shape.
(b) Suppose that f n (x 0 ) is a minimum with f n (x 0 ) ∈ I odd . Therefore, there exists a neighborhood of x 0 , U (x 0 ), such that f n (x 0 ) ≤ f n (x) for all x ∈ U (x 0 ). Without restriction we may assume that U (x 0 ) ⊂ f −n (I odd ). It follows that for all x ∈ U (x 0 ) because f n (U (x 0 )) ⊂ I odd , an interval where f is increasing. We conclude that f n+1 (x 0 ) is a minimum.
If f n (x 0 ) ∈ I even then we derive from f n ( because this time f n (U (x 0 )) ⊂ I even , an interval where f is decreasing.
(c) This case follows similarly to (b).
The itinerary of x ∈ I under f is a symbolic sequence , defined as follows: The itineraries of the critical values, .., ω i n , ...), 1 ≤ i ≤ l, are defined as follows: where γ i n are kneading symbols.
Thus, the min-max symbols ω i n have an exponential-like notation, where the 'base' belongs to the alphabet {m, M }, and the 'exponent' is a kneading symbol. The extra information of a min-max symbol ω i n as compared to a kneading symbol γ i n is contained, therefore, in the base, which tell us whether f n (c i ) is a minimum (m) or a maximum (M ). Theorem 1 shows that once the symbol ω i n of a map with positive shape is known, the symbol ω i n+1 can be read from the table Let us mention for completeness that if f ∈ M l has negative shape, then the transition rules from ω i n to ω i n+1 read instead. This follows mutatis mutandis as in the proof of Theorem 1 .
The transition rules (2) and (3) substantiate our claim in the Introduction that, from the point of view of the computational cost, min-max sequences and kneading sequences are virtually equivalent.
Therefore, the kneading symbols of f ∈ M l , along with its initial min-max symbols, i.e.
and the transition rules (2) allow to compute the min-max sequences of f ∈ M l in a recursive way.
A final ingredient (proper of min-max sequences) is the following. Let the ith critical line, 1 ≤ i ≤ l, be the line y = c i in the Cartesian product I × I. Min-max symbols split into bad and good symbols with respect to ith critical line. Geometrically, good symbols correspond to local maxima strictly above the line y = c i , or to local minima strictly below the line y = c i . All other min-max symbols are bad by definition with respect to the ith critical line. We use the notation for the set of bad symbols of f ∈ M l with respect to the ith critical line. There are 2(l + 1) bad symbols and 2l good symbols with respect to a given critical line.
Bad symbols appear in all results of [5,6] concerning the computation of the topological entropy of f ∈ M l via min-max symbols. In this sense we may say that bad symbols are the hallmark of this approach.

Auxiliary results
Geometrically s i ν is the number of transversal intersections on the Cartesian plane (x, y) of the curve y = f ν (x) and the straight line y = c i , over the interval (a, b). Note that s i 0 = 1 for all i. To streamline the notation set for ν ≥ 0. In particular, According to [5,Eqn. (31)], the lap number of f n , ℓ n , satisfies for n ≥ 1. In particular, ℓ 1 = ℓ 0 + s 0 = 1 + l.
, that is, K i ν collects the upper and lower indices (k, κ) of the bad symbols with respect to the ith critical line in all the initial blocks ...; ω l 1 , ω l 2 , ..., ω l ν ; of the min-max sequences of f . We note for further reference that K i ν−1 ⊂ K i ν , the set-theoretical difference being Finally, set where S i ν = 0 if K i ν = ∅, and analogously to (5), We say that f ∈ M l is boundary-anchored if f {a, b} ⊂ {a, b}. This boundary condition boils down to for multimodal maps with positive shape, and to for multimodal maps with negative shape. As we will see shortly, boundary-anchored maps have some advantages when calculating the topological entropy.
Theorem 2. Let f ∈ M l be boundary-anchored. Then Proof. Suppose for the time being that f is twice differentiable on [a, b] without any restriction at the boundaries. In this case, it was proved in [5, Theorem 5.3] that where α i ν ,β i ν are binary variables that vanish if f is boundary-anchored. Moreover, the relation (15) follows from the transition rules (2) (or (3) if f has negative shape), which have been proved to hold true also for continuous multimodal maps in Theorem 1. It follows that (15) holds for continuous, multimodal maps as well. In particular, (14) holds for the boundary-anchored ones.
Therefore, the boundary conditions (12) allow us to express s i ν with the help of some (14) and (10). Sum (14) over i from 1 to l to obtain the compact relation between s 0 = l, s 1 , ..., s ν and S ν , for all ν ≥ 1. By (7) this equation can we rewritten as s ν = lℓ ν − S ν , hence

A closed formula for the topological entropy of multimodal maps
According to [11,Lemma 4.4], the topological entropy of a multimodal map depends only on the kneading sequences, i.e., on the itineraries of the critical values, but not on the itineraries of the boundary points. This entails that one may assume without restriction the boundary conditions (12) or (13) when calculating the topological entropy of l-modal maps with positive or negative shape, respectively. A formal justification is given by the following theorem.
Eqn. (18) provides a closed expression for h(f ) which includes the min-max symbols of f .

A simplified algorithm for the topological entropy
An offshoot of the preceding section is that, when it comes to calculate the topological entropy of a multimodal map, one can resort to the limit (18), whether the map is boundary-anchored or not. Loosely speaking, for ν large enough.
As a matter of fact, the numerical algorithm below estimates h(f ) by 1 ν log sν +Sν l to the desired precision. The core of the algorithm consists of a loop over ν. Each time the algorithm enters the loop, the values of s ν−1 and S ν−1 are updated to s ν and S ν , and the current estimation of h(f ) is compared to the previous one. Note that the computation of (10), while the computation of s i ν , 1 ≤ i ≤ l, requires s i 0 , s i 1 , ..., s i ν−1 , and S i ν , see (14). We summarize next the algorithm resulting from (18) in the following scheme ("A −→ B" stands for "B is computed by means of A").
As said above, the algorithm (A1)-(A5) simplifies the original algorithm [5], which formally consists of the same five steps above but is based on the exact value of the lap number ℓ ν . This entails that the new algorithm needs more loops to output h(f ) with the same parameter ε in the halt criterion (21), although this does not necessarily mean that the overall execution time will be longer since now less computations are required. In fact, we will find both situations in the numerical simulations of Sect. 6.
Furthermore, given a halt criterion ε, the execution time depends as well on the units (i.e., on the base of the logarithm), whichever algorithm is used. For instance, if logarithms to base e are used (i.e., h(f ) in nats) and ν = n nat is the first time that the halt criterion, happens to hold in the computation loop, then Therefore, if the the halt criterion for the computation of h(f ) in bits does not hold when ν = n nat , i.e., ln s nnat + S nnat l − ln s nnat−1 + S nnat−1 l > (ln 2)ε = 0.6932ε, then the algorithm will not exit the computation loop. We conclude that n bit ≥ n nat with both algorithms, where n bit is the exit loop when logarithms to base 2 are employed.
Two final remarks: R1. The parameter ε does not bound the error h(f ) − 1 ν log sν +Sν l but the difference between two consecutive estimations, see (21). The number of exact decimal positions of h(f ) can be found out by taking different ε's , as we will see in the next section. Equivalently, one can control how successive decimal positions of 1 ν log sν +Sν l stabilize with growing ν. Moreover, the smaller h(f ), the smaller ε has to be chosen to achieve a given approximation precision.

R2. According to [4, Thm. 4.2.4], 1
ν log ℓ ν ≥ h(f ) for any ν. We may expect therefore that the numerical approximations (22) converge from above to the true value of the topological entropy with ever more iterations, in spite of the relation ℓ ν = 1 l (s ν + S ν ) holding in general for boundary-anchored maps only.

Numerical simulations
In this section we compute the topological entropy of a variety of multimodal maps. To this end, a code for arbitrary l was written with PYTHON, and run on an Intel(R) Core(TM)2 Duo CPU. All the numerical results will be given with six decimal positions for brevity.
Thus, in Sect. 6.1 to 6.3 we calculate the entropy of families of uni-, bi-, and trimodal maps, respectively, taken from [6] (unimodal case) and [5] (general case). Except for particular values of the parameters, these maps are not boundaryanchored. The purpose of our choice is to compare our entropy plots with the plots published in those references. To complete the picture, we will consider non-smooth maps in Sect. 6.4. The natural choice are piecewise linear maps of constant slope because, in this case, the exact value of the topological entropy is known. In all sections, we are going to compare numerically the performance of the algorithm presented in Sect. 5 with the general algorithm presented in [5,Sect. 7] by means of single maps. For brevity we shall refer to them as the new algorithm and the old one, respectively.
As for the units, the nat is the usual choice in Applied Mathematics and Physics, while the bit is the standard unit in Information Theory and Communication Technologies. In the following subsections we are actually going to use both of them despite the fact that, as shown in Sect. 5, computations with Napierian logarithms are faster to a given precision. To be specific, we use bits in Sect. 6.2, and 6.3 for the sake of comparison with the results published in [5], which are given in that unit.

Simulation with 2-modal maps
Let 0 ≤ v 2 < v 1 ≤ 1 and f v1,v2 : [0, 1] → [0, 1] be defined as [5,Sect. 8.1] These maps have convenient properties for numerical simulations as they share the same fixed critical points, the critical values are precisely the parameters, and the values of f at the endpoints are explicitly given by the parameters as follows:  Fig. 4] except for the vanishing entropy tail, which indicates that ε = 10 −4 is too large a value for obtaining accurate estimates in that parametric region.  Table 2 displays the performance of the new algorithm as compared to the old one when computing h(f 0.9,0.1 ). This time t old > t new for ε = 10 −d , 4 ≤ d ≤ 7 (as in Table 1). Furthermore, we obtain two correct decimal digits of the topological entropy, h(f 0.9,0.1 ) = 0.60... bits, with both algorithms and ε = 10 −6 . Fig. 4 depicts the values of h(f v1,v2 ) for 0 ≤ v 2 ≤ v 1 − 0.5, ε = 10 −4 , and ∆v 1 , ∆v 2 = 0.01.

Simulation with 3-modal maps
The critical points of f v2,v3 are Moreover this family verifies f v2,v3 (0     Table 4: Comparison of performances when computing h(f ) in nats with the 4-modal map of Fig. 7 (left).
Likewise, Table 5 summarizes the computational performance of both algorithms with the 5-modal map. It is worth noting that now both algorithms need the same number of loops for all halt criteria ε, and yet the new algorithm is faster.  Table 5: Comparison of performances when computing h(f ) in nats with the 5-modal map of Fig. 7 (right).
As in the preceding simulations, we conclude from Table 4 and 5 that both algorithms determine two correct decimal positions of the topological entropy of the corresponding map, h(f ) = 0.40... nats. But this time the halt criterion ε = 10 −6 does not suffice; here one has to set ε = 10 −7 to achieve the same precision.

Conclusion
The main contributions of this paper are the following.
(i) In Theorem 1, we proved that the transition rules for min-max symbols (2) and (3), which were derived in [5] for twice differentiable multimodal maps, actually hold true for just continuous ones.
(ii) As a result of Theorem 1, we conclude that the validity of formula (15), which was proved in [5,Theorem 5.3] for twice differentiable multimodal maps, can be extended to continuous maps. For subsequent applications, only the particularization of (15) to boundary-anchored maps (Theorem 2) is needed.
(iii) The results reviewed and proved in Sects. 2 and 3, leads to the closed formula (18) for the topological entropy of multimodal maps. Previously we proved in Theorem 3 that, although ℓ n clearly depends on the boundary conditions, the limit h(f ) = lim n→∞ 1 n log ℓ n does not. (iv) The numerical algorithm proposed in Sect. 5 for the computation of h(f ) amounts to a recursive scheme to approximate the limit in the closed formula (18).
This algorithm is a simplification and, at the same time, a generalization of the recursion scheme proposed in [5] for h(f ). Indeed, it is a simplification because Eqn. (15) was used in [5] to compute the lap number ℓ ν , while the abridged expression (14) is used here. In other words, the new algorithm does not track the orbits of the endpoints. And it is also a generalization because we proved in Theorem 2 that (14) (and (15) for that matter) holds not only for twice differentiable maps (as assumed in [5, Theorem 5.3])) but also for just continuous ones. By the way, this point was numerically checked in Sect. 6.4.
The performances of both algorithms, old and new, were compared in Sect. 6.1 to 6.4 using smooth and non-smooth l-modal maps with 1 ≤ l ≤ 5. In view of the results summarized in Tables 1 to 5, the old algorithm performs better in the unimodal case, while the opposite occurs in the other multimodal cases.
To prove Theorem 3, suppose that f is an l-modal selfmap of the compact interval I with positive shape (the proof for maps with negative shape is analogous). Thus, F ∈ M l (J) has the same critical points and values as f , has the same shape and is boundary-anchored. Note that the shape enters in how f is extended to F .
Moreover, it is easy to check that Ω(F ) = Ω(f ) ∪ C, where C is a closed and F -invariant set that only contains fixed points. Thus, h( F | C ) = 0 and, according to (23) and (24),