# Adding a tiny trap to stop chaos

The tent map is the function f: [0, 1] → [0, 1] defined by If you start exactly at x0, then youll stay there permanently as you keep iteratively applying f. 0, 1]

The tent map is a well-known example of a chaotic function. We will demonstrate how a tiny modification of the tent maps keeps connection of the function but avoids turmoil.

Now choose some positive ε less than 1/6 [1] and modify the function f on the period

I = [x0– ε, x0 + ε]

To do this, we specify fε to be the very same as f outside the period I. We then produce a flat spot in the middle of the interval by specifying fε to be x0 on

[x0– ε/ 2, x0 + ε/ 2]

if x > > x1 and x.
Revenge of floating point.
In theory, nearly all starting points ought to result in sequences that converge to x0 in finite time. But it took a reasonable amount of trial and mistake to come up the plot above that highlights this. For many beginning points that I attempted, the sequence of iterates converged to 0.
Now 0 is an unsteady fixed point. This is simple to see: if x ever gets close to 0, the next iterate is 2x, twice as far from 0.
Computers can just represent portions with some power of 2 in the denominator. And I believe the camping tent map (not the customized camping tent map with a trap) will constantly assemble to 0 when starting with a floating point number.
Here are the iterates of the camping tent map starting at (the drifting point representation of) π – 3:.
0 0.283185307179586231 0.56637061435917252 0.86725877128165513 0.26548245743668986 … 29 0.1305046081542968830 0.2610092163085937531 0.522018432617187532 0.95596313476562533 0.0880737304687534 0.176147460937535 0.35229492187536 0.7045898437537 0.590820312538 0.81835937539 0.3632812540 0.726562541 0.54687542 0.9062543 0.187544 0.37545 0.7546 0.547 1.0.
Note that the series does not slip up on 0: it leaps from 1/2 to 0. This does not contract the argument above that points near zero are pushed back away.
[1] Why less than 1/6? So we remain in the same branch of the definition of f. The range from x0 to 1/2 is 1/6.
Achim Clausing, Ducci Matrices. American Mathematical Monthly, December 2018.

If you begin exactly at x0, then youll remain there forever as you keep iteratively using f. We then develop a flat area in the middle of the period by specifying fε to be x0 on

def camping tent( x):.
if x x0 + epsilon:.
return tent( x).

Heres a plot of fε with ε = 0.05.

Now heres a cobweb plot of the iterates of f0.05 starting at π– 3.

x1 = x0 – epsilon/2.
x2 = x0 + epsilon/2.

The iterates of fε constantly assemble to x0 in finite time. In theory, nearly all starting points need to lead to series that converge to x0 in limited time. The range from x0 to 1/2 is 1/6.

and extend fε linearly on the rest of I.

Heres Python code to make the building and construction of fε explicit.

The iterates of fε always converge to x0 in finite time. , if the iterates ever roam into the interval [ x0– ε/ 2, x0 + ε/ 2] They get caught at x0. And due to the fact that the tent map is ergodic, almost all series will roam into the entrapping period.