Cycle order in period doubling region

The last four post have looked at the bifurcation diagram for the logistic map.

There was one post on the leftmost region, where there is no branching. Then two posts on the region in the middle where there is period doubling. Then a post about the chaotic region in the end.

This post returns the middle region. Here’s an image zooming in on the first three forks.

The nth region in the period doubling region has period 2n.

I believe, based on empirical results, that in each branching region, the branches are visited in the same order. For example, in the region containing r = 3.5 there are four branches. If we number these from bottom to top, starting with for the lowest branch, I believe a point on branch 0 will go to a point on branch 2, then branch 1, then branch 3. In summary, the cycle order is [0, 2, 1, 3].

Here are the cycle orders for the next three regions.

[0, 4, 6, 2, 1, 5, 3, 7]

[0, 8, 12, 4, 6, 14, 10, 2, 1, 9, 13, 5, 3, 11, 7, 15]

[0, 16, 24, 8, 12, 28, 20, 4, 6, 22, 30, 14, 10, 26, 18, 2, 1, 17, 25, 9, 13, 29, 21, 5, 3, 19, 27, 11, 7, 23, 15, 31]

[0, 32, 48, 16, 24, 56, 40, 8, 12, 44, 60, 28, 20, 52, 36, 4, 6, 38, 54, 22, 30, 62, 46, 14, 10, 42, 58, 26, 18, 50, 34, 2, 1, 33, 49, 17, 25, 57, 41, 9, 13, 45, 61, 29, 21, 53, 37, 5, 3, 35, 51, 19, 27, 59, 43, 11, 7, 39, 55, 23, 15, 47, 31, 63]

Two questions:

  1. Is the cycle order constant within a region of a constant period?
  2. If so, what can be said about the order in general?

I did a little searching into these questions, and one source said there are no known results along these lines. That may or may not be true, but it suggests these are not common questions.

An island of stability in a sea of chaos

The last several posts have been looking at the bifurcation diagram below in slices.

logistic bifurcation diagram

The first post looked at the simple part, corresponding to the horizontal axis r running from 0 to 3.

The next post looked at the first fork, for r between 3 and 3.4495.

The previous post looked at the period doubling region, for r between 3.4495 and 3.56995.

For r greater than about 3.56995 we enter the chaotic region. This post looks at an apparent island of stability inside the chaotic region. This island starts at r = 1 + √8 = 3.8284.

The whitespace indicates an absence of stable cycle points. There are unstable cycle points, infinitely many in fact, as we will soon see. For a small range of r there are three stable cycle points. When r = 3.83, for example, the three cycle points are 0.1561, 0.5047, and 0.9574.

This is significant because period three implies chaos. There is a remarkable theorem that says if a continuous map of a bounded interval to itself has a point with period 3, then it also has points with periods 4, 5, 6, … as well as an uncountable number of points with no period. If there are points with period 4, why can’t we see them? Because they’re unstable. You would have to land exactly on one of these points to go in a cycle. If you’re off by the tiniest amount, which you always are in computer arithmetic, you won’t stay in the cycle.

So even when we’re in the region with three stable points, things are still technically chaotic.

There seems to be something paradoxical about computer demonstrations of chaos. If you have extremely sensitive dependence on initial conditions, how can floating point operations, which are not exact, demonstrate chaos? I would say they can illustrate chaos rather than demonstrate chaos. And sometimes you can do computer calculations which do not have such sensitivity to show that other things are sensitive.

For example, I asserted above that there are points with period 4. Let f be the logistic map with r = 3.83

f(x) = 3.83 x(1 − x)

and define

p(x) = f(f(f(f(x)))),

i.e. four applications of f. Then you can see that there must be a point with period 4 because the graph of p(x) crosses the graph of x.

So while our region of whitespace appears to be empty except for three stable cycle points, there are infinitely many more cyclic points scattered like invisible dust in the region, a set of measure zero that we cannot see.

Spacing between branches

The last couple posts have been looking at the logistic bifurcation diagram a little at a time.

logistic bifurcation diagram

The first post in the series looked at the details of that part of the diagram that looks like the graph of a function, where there parameter r in the logistic map

f(x) = r x(1 − x)

varies from o to 3.

The first branch point occurs at r = 3. When r is exactly equal to 3, almost all starting points converge to the same point, though they converge very slowly. When r is slightly larger than 3 the (stable) iterates no longer converge to a point but instead oscillate between two points.

The second post in this series looked at the first fork, corresponding to values of r from 3 to 1 + √6. For r larger than 1 + √6 the previous stable cycle points become unstable and split into two new cycles each. These new cycles will split (“bifurcate”) into two new cycles, and so on and so on until there are infinitely many cycles and chaos breaks out around r = 3.56995.

This post will look at the horizontal spacing between branch points.

The first branch point occurs when r equals b1 = 3.

The two branches branch again when r crosses b2 = 1 + √6.

The next branch point is b3 = 3.5440903…. Why is there a simple expression for b1 and b2 but not for b3? Everything gets more complicated as r increases. The number b3 is algebraic, the root of a 12th degree polynomial [1].

t12 − 12t11 + 48t10 − 40t9 − 193t8 + 392t7 + 44t6 + 8t5 − 977t4 − 604t3 + 2108t2 + 4913 = 0

The number b4 has algebraic also been shown to be algebraic: someone found a 120-degree polynomial with integer coefficients such that −b4(b4 − 2) is a root [1]. The coefficients in the polynomial vary over 72 orders of magnitude. Perhaps its possible to find polynomials with other branch points as roots, but this doesn’t seem promising or practical.

The spacing between branch points decreases rapidly, becoming infinitely small before chaos breaks out. The ratio of spacings between consecutive branch points converges to a constant, known as Feigenbaum’s constant

δ = 4.66920…

This constant is known to surprising precision. Directly computing the constant to high precision by numerically finding branch points would be impractical, but Feigenbaum came up with an indirect way of computing his constant via a functional equation. The constant δ has been computed at least 1018 digits.

Feigenbaum’s constant does not just apply to the iterations of the logistic map. It’s a “universal” constant in that it applies to a class of dynamical systems.

Previous posts in this series

[1] Jonathan Borwein and David Bailey. Mathematics by Experiment: Plausible Reasoning in the 21st Century. 2004.

The first fork

The previous post looked at iterations of the logistic map

f(x) = r x(1 − x)

for 0 ≤ r ≤ 3. This post will look at the range 3 ≤ r ≤ 1 + √6. If you’re not familiar with the logistic map I’d suggest reading the previous post first then coming back to this one.

The previous post looked at the flat part of the curve below, as well as the arc. This part will look at the first fork of the image, starting where the image first splits and before it splits again. That is, out of this image,

logistic bifurcation diagram

we’re going to zoom in on just this part:

As before, x = (r − 1)/r is a fixed point. This was a stable fixed point for r < 3 but for r > 3 it is an unstable fixed point [1]. For r between 3 and 1 + √6 there is no stable fixed point, but there is a stable cycle.

The two branches are

\frac{r + 1 \pm \sqrt{(r+1)(r-3)}}{2r}

Points near one point of the cycle are thrown to the other point.

Here’s a cobweb plot showing the iterations starting with x = 0.1 and r = π.

cobweb plot

The dark blue box corresponds to the iterations converging to the two points of the cycle at 0.5373 and 0.7810. Here are the numerical values for the first 20 iterates.

    0.2827
    0.6371
    0.7263
    0.6245
    0.7367
    0.6093
    0.7478
    0.5924
    0.7586
    0.5754
    0.7676
    0.5605
    0.7739
    0.5497
    0.7776
    0.5432
    0.7795
    0.5399
    0.7804
    0.5384

If we apply the logistic map an even number of times, looking at iterations of f(f(x)), we get convergence to one branch or the other for almost all starting points. As you might expect from the previous post, convergence is slow for values of r at the beginning and end of the interval.

Note that the slowest convergence, the dotted line on top, corresponds to r = 3.4, close to 1 + √6 = 3.4495.

The slowest convergence comes from the values of r closest to the end points of the interval

[3, 1 + √6]

defining the first fork and the fastest convergence comes from the values of r in the middle of the interval.

Larger values of r

When r is larger than 1 + √6, the stable cycle points discussed above become unstable, and four new cycle points appear. This is called period doubling. We went from a cycle to a length 2 to a cycle of length 4. The number of periods keeps doubling as r increases, up to a point, around r = 3.56995. Beyond that point is literally chaos, i.e. chaos in the technical sense of the word.

Related posts

[1] A fixed point is stable if points near that point are drawn into that point. A fixed point is unstable if nearby points are repelled away from it.

The simple part of the logistic map isn’t that simple

Five years ago I wrote a blog post entitled Logistic bifurcation diagram in detail. Looking back at that post it doesn’t seem to be that much “in detail,” though it does go into more detail than most popular accounts.

The logistic map is given by

f(x) = r x(1 − x)

where x is a variable between 0 and 1 and r is a parameter between 0 and 4.

If you look at what happens to values of x as you repeatedly apply the logistic map, computing f(x), f(f(x)), f(f(f(x))), …, things get interesting:

logistic bifurcation diagram

This plot shows where the iterations end up as the parameter r varies. When r ≤ 3 the iterates converge to a single fixed point, assuming you start strictly between 0 and 1. When r is a little bigger than 3 the iterates cycle between two attractor points, then for larger r they bounce between 4 points, then 8, then eventually chaos breaks out. Literally.

In the diagram above, it seems the region where 0 ≤ r ≤ 3 is the simple part. And it is, but it’s not that simple. This post will look a little deeper into what’s happening in this part of the diagram.

Four questions

There is a series of questions we can ask about the convergence of a sequence.

  1. Does the sequence converge?
  2. What does it converge to?
  3. How does it converge qualitatively?
  4. How rapidly does it converge?

We know that for 0 ≤ r ≤ 3 the iterates converge to a single point. So the answer to the first question is yes.

For 0 ≤ r ≤ 1 the iterates converge to 0. For 1 ≤ r ≤ 3 the iterates converge to (r − 1)/r. This answers the second question.

The third and fourth questions are more interesting.

Qualitative convergence

When 0 ≤ r < 1 the iterates decrease monotonically to 0.

When 1 ≤ r ≤ 2 the convergence is monotone. If x starts out below the fixed point (r − 1)/r then the convergence is monotone increasing. If x starts out above, the sequence is monotone decreasing.

When 2 < r ≤ 3 the convergence is not monotone; the iterates alternately overshoot and undershoot the fixed point once they get sufficiently close. This is because the derivative of f at the fixed point is negative.

Here is a cobweb plot showing that the convergence when r = 2.9 is not monotone.

In a cobweb plot, monotone convergence looks like a staircase, and oscillating convergence looks like a spiral.

Speed of convergence

In the region 0 < r < 1, convergence is like rn.

In the region 1 < r < 2, convergence is like (2 − r)n.

In the region 2 < r < 3, convergence is also like (2 − r)n, which now alternates sign.

The exceptional cases are r = 1, 2, and 3. Convergence is very slow for r = 1 and 3, and very fast for r = 2.

When r = 2, the distance to the fixed point squares at each step, so convergence is quadratic.

Complex golden convergence

The previous post looked at how iterations of

x \mapsto \sqrt{1 + x}

converge to the golden ratio φ. That post said we could start at any positive x. We could even start at any x > −¾ because that would be enough for the derivative of √(1 + x) to be less than 1, which means the iteration will be a contraction.

We can’t start at any x less than −1 because then our square root would be undefined, assuming we’re working over real numbers. But what if we move over to the complex plane?

If f is a real-valued function of a real variable and|f ′(x)| is bounded by a constant less than 1 on an interval, then f is a contraction on that interval. Is the analogous statement true for a complex-valued function of a complex variable? Indeed it is.

If we start at a distance at least ¼ away from −1 then we have a contraction and the iteration converges to φ. If we start closer than that to −1, then the first step of the iteration will throw us further out to where we then converge.

To visualize the convergence, let’s look at starting at a circle of points in a circle of radius 10 around φ and tracing the path of each iteration.

For most of the starting points, the iterations converge almost straight toward φ, but points near the negative real axis take a more angular path. The gap in the plot is an artifact of iterations avoiding the disk of radius ¼ around −1. Let’s see what happens when we start on the boundary of this disk.

Next, instead of connecting each point to its next iteration, let’s plot the starting circle, then the image of that circle, and the image of that circle, etc.

The boundary of the disk, the blue circle, is mapped to the orange half-circle, which is then mapped to the green stretched half circle, etc.

Related posts

More Laguerre images

A week or two ago I wrote about Laguerre’s root-finding method and made some associated images. This post gives a couple more examples.

Laguerre’s method is very robust in the sense that it is likely to converge to a root, regardless of the starting point. However, it may be difficult to predict which root the method will end up at. To visualize this, we color points according to which root they converge to.

First, let’s look at the polynomial

(x − 2)(x − 4)(x − 24)

which clearly has roots at 2, 4, and 24. We’ll generate random starting points and color them blue, orange, or green depending on whether they converge to 2, 4, or 24. Here’s the result.

To make this easier to see, let’s split it into each color: blue, orange, and green.

Now let’s change our polynomial by moving the root at 4 to 4i.

(x − 2)(x − 4i)(x − 24)

Here’s the combined result.

And here is each color separately.

As we explained last time, the area taken up by the separate colors seems to exceed the total area. That is because the colors are so intermingled that many of the dots in the images cover some territory that belongs to another color, even though the dots are quite small.

Laguerre’s root finding method

Edmond Laguerre (1834–1886) came up with a method for finding zeros of polynomials. Unlike Newton’s method for finding zeros of general functions, Laguerre’s method is specialized for polynomials. Laguerre’s method converges an order of magnitude faster than Newton’s method, i.e. the error is cubed on each step rather than squared.

The most interesting thing about Laguerre’s method is that it nearly always converges to a root, no matter where you start. Newton’s method, on the other hand, converges quickly if you start sufficiently close to a root. If you don’t start close enough to a root, the method might cycle or go off to infinity.

The first time I taught numerical analysis, the textbook we used began the section on Newton’s method with the following nursery rhyme:

There was a little girl,
Who had a little curl,
Right in the middle of her forehead.
When she was good,
She was very, very good,
But when she was bad, she was horrid.

When Newton’s method is good, it is very, very good, but when it is bad it is horrid.

Laguerre’s method is not well understood. Experiments show that it nearly always converges, but there’s not much theory to explain what’s going on.

The method is robust in that it is very likely to converge to some root, but it may not converge to the root you expected unless you start sufficiently close. The rest of the post illustrates this.

Let’s look at the polynomial

p(x) = 3 + 22x + 20x² + 24x³.

This polynomial has roots at 0.15392, and at -0.3397 ± 0.83468i.

We’ll generate 2,000 random starting points for Laguerre’s method and color its location according to which root it converges to. Points converging to the real root are colored blue, points converging to the root with positive imaginary part are colored orange, and points converging to the root with negative imaginary part are colored green.

Here’s what we get:

This is hard to see, but we can tell that there aren’t many blue dots, about an equal number of orange and green dots, and the latter are thoroughly mixed together. This means the method is unlikely to converge to the real root, and about equally likely to converge to either of the complex roots.

Let’s look at just the starting points that converge to the real root, its basin of attraction. To get more resolution, we’ll generate 100,000 starting points and make the dots smaller.

The convergence region is pinched near the root; you can start fairly near the root along the real axis but converge to one of the complex roots. Notice also that there are scattered points far from the real root that converge to that point.

Next let’s look at the points that converge to the complex root in the upper half plane.

Note that the basin of attraction appears to take up over half the area. But the corresponding basin of attraction for the root in the lower half plane also appears to take up over half the area.

They can’t both take up over half the area. In fact. both take up about 48%. But the two regions are very intertwined. Due to the width of the dots used in plotting, each green dot covers a tiny bit of area that belongs to orange, and vice versa. That is, the fact that both appear to take over half the area shows how commingled they are.

Related posts

The essence of chaos

logistic bifurcation diagram

Linear systems can show sensitive dependence on initial conditions, but they cannot be chaotic. Only nonlinear systems can be chaotic.

George Datseris and Ulrich Parlitz explain this well in their book Nonlinear Dynamics:

… Sensitive dependence is not sufficient for a definition of chaos. … the state space is first stretched and then folded within itself. This is the defining characteristic of chaotic systems. The stretching part is where sensitive dependence comes from … as state space volumes increase in size … nonlinear dynamics takes over and folds the state space back in on itself. … This is why only nonlinear systems can be chaotic: linear systems with positive Lyapunov exponents always escape to infinity.

Related posts

Hénon’s dynamical system

This post will reproduce a three plots from a paper of Hénon on dynamical systems from 1969 [1].

Let α be a constant, and pick some starting point in the plane, (x0, y0), then update x and y according to

xn+1 = xn cos α − (ynxn²) sin α
yn+1 = xn sin α + (ynxn²) cos α

When I tried out Hénon’s system for random starting points, I didn’t get plots that were as interesting as those in the original paper. Hénon clearly did a lot of experiments to produce the plots chosen for his paper. Because his system is chaotic, small changes to the initial conditions can make enormous differences to the resulting plots.

Hénon lists the starting points used for each plot, and the number of iterations for each. I imagine the number of iterations was chosen in order to stop when points wandered too far from the origin. Even so, I ran into some overflow problems.

I suspect the original calculations were carried out using single precision (32-bit) floating point numbers, while my calculations were carried out with double precision (64-bit) floating point numbers [2]. Since the system is chaotic, this minor difference in the least significant bits could make a difference.

Here is my reproduction of Hénon’s Figure 4:

Here is my reproduction of Figure 5:

And finally Figure 7:

Update: You could use colors to distinguish the trajectories of different starting points. Here’s a color version of Figure 5:

Related posts

For more posts like this, see Dynamical systems & chaos.

Python code

Here is the code that produced the plots. The data starting points and number of iterations were taken from Table 1 of [1].

import matplotlib.pyplot as plt

# Hénon's dynamical system
# M. Hénon. Numerical study of squadratic area-preserving mappings. Quarterly of Applied Mathematics. October 1969 pp. 291--312

def makeplot(c, data):
    s = (1 - c*c)**0.5
    for d in data:
        x, y, n = d
        for _ in range(n):
            if abs(x) < 1 and abs(y) < 1:
                x, y = x*c - (y - x**2)*s, x*s + (y - x**2)*c
                plt.scatter(x, y, s=1, color='b')
    plt.gca().set_aspect("equal")
    plt.show()

fig4 = [
    [0.1,   0,    200],
    [0.2,   0,    360],
    [0.3,   0,    840],
    [0.4,   0,    871],
    [0.5,   0,    327],
    [0.58,  0,   1164],
    [0.61,  0,   1000],
    [0.63,  0.2,  180],
    [0.66,  0.22, 500],
    [0.66,  0,    694],
    [0.73,  0,    681],
    [0.795, 0,    657],
]

makeplot(0.4, fig4)

fig5 = [
    [0.2,   0,    651],
    [0.35,  0,    187],
    [0.44,  0,   1000],
    [0.60, -0.1, 1000],
    [0.68,  0,    250],
    [0.718, 0,   3000],
    [0.75,  0,   1554],
    [0.82,  0,    233],
]

makeplot(0.24, fig5)


fig7 = [
    [0.1, 0, 182],
    [0.15, 0, 1500],
    [0.35, 0, 560],
    [0.54, 0, 210],
    [0.59, 0, 437],
    [0.68, 0, 157],
]

makeplot(-0.01, fig7, "fig7.png")

[1] Michel Hénon. Numerical study of quadratic area-preserving mappings. Quarterly of Applied Mathematics. October 1969 pp. 291–312

[2] “Single” and “double” are historical artifacts. “Double” is now ordinary, and “single” is exceptional.