Video 4, chapter 16

The Logistic Map, Repeating One Equation

How the orbits of the logistic map, the rule that multiplies x by 1 minus x and by a parameter r, can settle at a stable fixed point or on a two-cycle, and how a cobweb diagram draws each step of this discrete dynamical system.

  • Video 4, chapter 16
  • From shapes to changing systems

Take a number between 0 and 1, multiply it by one minus itself and by a fixed number rr, and feed the answer back into the same rule. Can a rule this simple do anything interesting? With r=2r = 2 every start strictly between 00 and 11 drifts toward 1/21/2, while with r=3.2r = 3.2 a start such as 0.20.2 ends up hopping back and forth forever, ever closer to the same two values. This page computes the first steps by hand, draws them as a cobweb diagram, and uses the slope of the curve to explain why one parameter gives a stable fixed point and the other a stable two-cycle.

Key terms

Logistic map

Definition The logistic map is the rule

f(x)=r x (1−x),f(x) = r\,x\,(1 - x),

where the parameter rr is a fixed number with 0≤r≤40 \le r \le 4 and the input xx lies in the interval [0,1][0, 1]. Iterating it means choosing a starting value x0x_0 in [0,1][0, 1] and computing x1=f(x0)x_1 = f(x_0), then x2=f(x1)x_2 = f(x_1), and so on, so that

xn+1=r xn (1−xn).x_{n+1} = r\,x_n\,(1 - x_n).

The values never leave [0,1][0, 1]. For xx in [0,1][0, 1] the product x(1−x)x(1 - x) is never negative and is at most 1/41/4, which it reaches at x=1/2x = 1/2, so f(x)f(x) lies between 00 and r/4r/4, and r/4≤1r/4 \le 1. The surprise is that this one rule, depending on rr, can produce orbits that settle at a single value, orbits that fall into a repeating cycle, and orbits that never repeat at all. For 0≤r≤10 \le r \le 1 every orbit tends to 00. For 1<r≤31 < r \le 3 every start strictly between 00 and 11 tends to the value 1−1/r1 - 1/r. For 3<r<1+6≈3.44953 < r < 1 + \sqrt{6} \approx 3.4495 every start strictly between 00 and 11 approaches a pattern that alternates between two values, except special starts whose orbits land exactly on 1−1/r1 - 1/r. Nothing random is involved, since once rr and x0x_0 are fixed every later value is determined. The rule is often read as a population model, with xx the population as a fraction of some maximum and the factor 1−x1 - x standing for crowding, and the ecologist Robert May made it famous in 1976 as a simple model with very complicated behavior. It is a simplified model, not a forecast for any real population.

In plain words One fixed rule is applied again and again, and each answer becomes the next input. The number rr sets the height of the curve, and that decides whether the values settle down, repeat a pattern or never repeat.

Example Take r=2r = 2 and x0=0.2x_0 = 0.2. The first step gives x1=2⋅0.2⋅0.8=0.32x_1 = 2 \cdot 0.2 \cdot 0.8 = 0.32, and the second gives x2=2⋅0.32⋅0.68=0.4352x_2 = 2 \cdot 0.32 \cdot 0.68 = 0.4352. The table continues with values computed exactly and then rounded.

Step nnValue xnx_nDistance from 1/21/2
000.20.20.30.3
110.320.320.180.18
220.43520.43520.06480.0648
330.491601920.491601920.008398080.00839808
440.499858940.499858940.000141060.00014106
550.499999960.499999960.000000040.00000004

The values close in on 1/21/2, and each distance is exactly twice the square of the one before, as in 0.18=2⋅0.320.18 = 2 \cdot 0.3^2 and 0.0648=2⋅0.1820.0648 = 2 \cdot 0.18^2. The card on stable fixed points explains why.

Discrete dynamical system

Definition A discrete dynamical system consists of a set of possible states and a rule ff that sends each state to a state in the same set. Time moves in whole steps, and the state after one more step is xn+1=f(xn)x_{n+1} = f(x_n). The sequence x0,x1,x2,…x_0, x_1, x_2, \ldots is called the orbit of the starting state x0x_0. The system is deterministic, meaning that the current state alone fixes the next one, with no random choice. The early part of an orbit, before it comes close to its long-term pattern, is called the transient. It has no sharp end, and how long it lasts depends on how close to the pattern one asks the orbit to be. A statement about long-term behavior always concerns one rule, including the value of any parameter such as rr, and one starting state, and it describes what happens as nn grows without bound, which no finite list of steps can show completely.

In plain words A rule and a starting point are all it takes. Feed each output back in as the next input, and the list of values you get is the orbit.

Example Keep the logistic map with r=2r = 2 and change only the start. The start x0=1/2x_0 = 1/2 gives 1/21/2 at every step, because 2⋅12⋅12=122 \cdot \tfrac12 \cdot \tfrac12 = \tfrac12. The start 00 stays at 00, and the start 11 jumps to 00 in one step and stays there. Every start strictly between 00 and 11 approaches 1/21/2, like the orbit of 0.20.2 above. Now keep the start at 0.20.2 and change only the parameter to r=3.2r = 3.2. Rounded to four decimal places, the orbit becomes 0.20.2, 0.5120.512, 0.79950.7995, 0.51290.5129, 0.79950.7995, 0.51300.5130 and so on, and it never settles at one value. Both the rule and the start have to be named before anything can be said about an orbit.

Cobweb diagram

Definition A cobweb diagram draws the orbit of a rule ff on an interval. Draw the graph of y=f(x)y = f(x) and the diagonal line y=xy = x on the same axes, and start at the point (x0,x0)(x_0, x_0) on the diagonal. Move vertically to the graph, which reaches the point (x0,x1)(x_0, x_1) because x1=f(x0)x_1 = f(x_0). Then move horizontally to the diagonal, which reaches (x1,x1)(x_1, x_1). Repeating the two moves visits (x1,x2)(x_1, x_2), (x2,x2)(x_2, x_2), (x2,x3)(x_2, x_3) and so on, and the corners on the diagonal have the orbit x0,x1,x2,…x_0, x_1, x_2, \ldots as their first coordinates. The points where the graph meets the diagonal are exactly the fixed points, because there f(x)=xf(x) = x. When the path returns exactly to a corner it has visited before, the orbit has become a cycle.

In plain words The vertical move applies the rule, and the horizontal move hands the answer back as the next input. The diagonal is where an output turns into an input.

Example For r=2r = 2 the graph is the parabola y=2x(1−x)y = 2x(1 - x). Its highest point is (1/2,1/2)(1/2, 1/2), which lies on the diagonal, and it meets the diagonal at (0,0)(0, 0) and (1/2,1/2)(1/2, 1/2). Starting from x0=0.2x_0 = 0.2, the path goes up from (0.2,0.2)(0.2, 0.2) to (0.2,0.32)(0.2, 0.32), across to (0.32,0.32)(0.32, 0.32), up to (0.32,0.4352)(0.32, 0.4352), across to (0.4352,0.4352)(0.4352, 0.4352), and so on, a staircase that climbs into the corner at (1/2,1/2)(1/2, 1/2). With r=3.2r = 3.2 and the same start, the path does not close in on the crossing at (11/16,11/16)(11/16, 11/16). After a few steps it runs around a square with corners (p,p)(p, p), (p,q)(p, q), (q,q)(q, q) and (q,p)(q, p), where p≈0.5130p \approx 0.5130 and q≈0.7995q \approx 0.7995. That square is the two-cycle of the last card.

Stable fixed point

Definition A fixed point of a rule ff is a state x∗x^* with f(x∗)=x∗f(x^*) = x^*, so the orbit that starts there never moves. The fixed point is stable, also called attracting, when there is an interval around x∗x^* such that every orbit starting in that interval stays in it and converges to x∗x^*. Suppose ff has a slope f′(x)f'(x) that changes continuously near x∗x^*. If ∣f′(x∗)∣<1\lvert f'(x^*) \rvert < 1, then x∗x^* is stable. If ∣f′(x∗)∣>1\lvert f'(x^*) \rvert > 1, then x∗x^* is unstable, and every start close to x∗x^* but different from it is pushed farther from x∗x^* at the next step. If ∣f′(x∗)∣=1\lvert f'(x^*) \rvert = 1, this test decides nothing. The reason is that near x∗x^* each step multiplies the gap x−x∗x - x^* by approximately f′(x∗)f'(x^*). For the logistic map the slope is f′(x)=r(1−2x)f'(x) = r(1 - 2x). The fixed point 00 has slope rr, so it is stable for r<1r < 1 and unstable for r>1r > 1. For r≥1r \ge 1 the second fixed point 1−1/r1 - 1/r has slope 2−r2 - r, so it is stable for 1<r<31 < r < 3 and unstable for r>3r > 3.

In plain words A fixed point is a value the rule leaves unchanged. Near it, each step multiplies the small gap from it by roughly the slope of the curve there. A slope between −1-1 and 11 shrinks the gap and pulls nearby values in, and a steeper slope pushes them away.

Example For r=2r = 2 the fixed points are 00 and 1/21/2. Write a value near 1/21/2 as 1/2+e1/2 + e, where ee is the gap. Then

f(12+e)=2(12+e)(12−e)=12−2e2,\begin{aligned} &f\left(\tfrac12 + e\right) \\[0.4em] &\quad = 2\left(\tfrac12 + e\right)\left(\tfrac12 - e\right) \\[0.4em] &\quad = \tfrac12 - 2e^2, \end{aligned}

so a gap ee becomes −2e2-2e^2. The start 0.510.51 has gap 0.010.01 and goes to 0.49980.4998, with gap −0.0002-0.0002. Squaring a small gap makes it far smaller, which is why the table in the first card closed in so quickly, and it matches the slope test, since f′(1/2)=0f'(1/2) = 0. Being at a fixed point and approaching it are different things. The orbit of 1/21/2 never moves, while the orbit of 0.20.2 keeps changing by smaller and smaller amounts and never reaches 1/21/2 exactly, because 1/21/2 is the only value that the rule sends to 1/21/2. The other fixed point 00 is unstable, with slope f′(0)=2f'(0) = 2. The start 0.0010.001 goes to 0.0019980.001998 and then to about 0.0039880.003988, nearly doubling its distance from 00 at each step.

Two-cycle

Definition A two-cycle, or cycle of period two, of a rule ff is a pair of different states pp and qq with f(p)=qf(p) = q and f(q)=pf(q) = p. An orbit that starts at pp alternates p,q,p,q,…p, q, p, q, \ldots forever. Each of pp and qq is a fixed point of the rule applied twice, f(f(x))f(f(x)), but not of ff itself. The two-cycle is stable when there is an interval around each of its points such that every orbit starting in one of these intervals approaches the cycle. When ff has a continuously changing slope, the chain rule shows that the slope of f(f(x))f(f(x)) at pp and at qq is the product f′(p) f′(q)f'(p)\,f'(q), called the multiplier of the cycle. The cycle is stable if the multiplier lies strictly between −1-1 and 11, and unstable if it is larger than 11 in size. Within 0≤r≤40 \le r \le 4, the logistic map has a two-cycle exactly when r>3r > 3, given by

p,q=r+1±D2r,D=(r−3)(r+1),\begin{aligned} p, q &= \frac{r + 1 \pm \sqrt{D}}{2r}, \\[0.4em] D &= (r - 3)(r + 1), \end{aligned}

and its multiplier is 4+2r−r24 + 2r - r^2. That multiplier lies between −1-1 and 11 exactly when 3<r<1+63 < r < 1 + \sqrt{6}.

In plain words A two-cycle is a pattern that repeats every two steps, high, low, high, low. Up and down motion like this is completely regular, and nothing about it is random.

Example Take r=3.2r = 3.2. The fixed point 1−1/3.2=11/16=0.68751 - 1/3.2 = 11/16 = 0.6875 has slope 2−3.2=−1.22 - 3.2 = -1.2, so it is unstable. Here D=0.2⋅4.2=0.84D = 0.2 \cdot 4.2 = 0.84, which gives p≈0.5130p \approx 0.5130 and q≈0.7995q \approx 0.7995, and the multiplier is

4+6.4−10.24=0.16,4 + 6.4 - 10.24 = 0.16,

so the two-cycle is stable, and every two steps a small gap from it shrinks to about 0.160.16 of its size. The orbit of 0.20.2, computed exactly and then rounded, runs 0.5120.512, 0.79950.7995, 0.51290.5129, 0.79950.7995, 0.51300.5130 and so on. Its transient is short, because 0.5120.512 already lies close to pp, and from step 88 on every value is within one millionth of pp or qq. On the cobweb diagram the path settles onto the square loop through pp and qq instead of a staircase into one crossing.

Check yourself

  1. Keep r=2r = 2 but start at x0=0.9x_0 = 0.9. Compute x1x_1, x2x_2 and x3x_3. Which start below 1/21/2 gives the same values from step 11 on?
Show the answer

The steps are x1=2⋅0.9⋅0.1=0.18x_1 = 2 \cdot 0.9 \cdot 0.1 = 0.18, then x2=2⋅0.18⋅0.82=0.2952x_2 = 2 \cdot 0.18 \cdot 0.82 = 0.2952, then

x3=2⋅0.2952⋅0.7048=0.41611392.\begin{aligned} x_3 &= 2 \cdot 0.2952 \cdot 0.7048 \\[0.4em] &= 0.41611392. \end{aligned}

The orbit is closing in on 1/21/2 from below. The gaps from 1/21/2 are 0.40.4, 0.320.32, 0.20480.2048 and 0.083886080.08388608, each twice the square of the one before, just as the formula e↦−2e2e \mapsto -2e^2 predicts. The start 0.10.1 gives the same orbit from step 11 on, since 2⋅0.1⋅0.9=0.182 \cdot 0.1 \cdot 0.9 = 0.18 as well. In general x(1−x)x(1 - x) does not change when xx is replaced by 1−x1 - x, so the starts x0x_0 and 1−x01 - x_0 always share x1x_1.

  1. Take r=3.2r = 3.2. Show that 11/1611/16 is a fixed point. Why does the orbit of 0.20.2 not approach it, and what happens to the orbit of 5/165/16?
Show the answer

The rule gives

f(1116)=3.2⋅1116⋅516=176256=1116,\begin{aligned} f\left(\tfrac{11}{16}\right) &= 3.2 \cdot \frac{11}{16} \cdot \frac{5}{16} \\[0.4em] &= \frac{176}{256} = \frac{11}{16}, \end{aligned}

so 11/1611/16 is a fixed point. Its slope is 3.2 (1−2⋅1116)=−1.23.2\,(1 - 2 \cdot \tfrac{11}{16}) = -1.2, larger than 11 in size, so it is unstable. A gap from it is multiplied by about −1.2-1.2 at each step, so it grows and switches sides. The start 11/16+0.00111/16 + 0.001 has gaps of about 0.0010.001, −0.0012-0.0012, 0.00140.0014 and −0.0017-0.0017 over its first steps. Being a fixed point is not enough for orbits to come to it. The start 5/165/16 is special, because

3.2⋅516⋅1116=1116,3.2 \cdot \frac{5}{16} \cdot \frac{11}{16} = \frac{11}{16},

so it lands exactly on the fixed point after one step and stays there. Only starts that land exactly on 11/1611/16 like this reach it. Every other start strictly between 00 and 11 approaches the two-cycle near 0.51300.5130 and 0.79950.7995.

  1. Take r=1+5≈3.236r = 1 + \sqrt{5} \approx 3.236 and start at x0=1/2x_0 = 1/2. Show that the orbit is a two-cycle, and find its multiplier.
Show the answer

The first step gives x1=r⋅12⋅12=r/4=(1+5)/4≈0.809x_1 = r \cdot \tfrac12 \cdot \tfrac12 = r/4 = (1 + \sqrt{5})/4 \approx 0.809, and then 1−x1=(3−5)/41 - x_1 = (3 - \sqrt{5})/4. The second step gives

x2=(1+5)2(3−5)16=(6+25)(3−5)16.\begin{aligned} x_2 &= \frac{(1 + \sqrt{5})^2 (3 - \sqrt{5})}{16} \\[0.4em] &= \frac{(6 + 2\sqrt{5})(3 - \sqrt{5})}{16}. \end{aligned}

The numerator is 18−65+65−10=818 - 6\sqrt{5} + 6\sqrt{5} - 10 = 8, so x2=8/16=1/2x_2 = 8/16 = 1/2. The orbit alternates between the two different values 1/21/2 and (1+5)/4(1 + \sqrt{5})/4, so it is a two-cycle. Its multiplier is f′(1/2) f′(x1)f'(1/2)\,f'(x_1), and f′(1/2)=r(1−1)=0f'(1/2) = r(1 - 1) = 0, so the multiplier is 00. The formula agrees, since

4+2r−r2=4+(2+25)−(6+25)=0.\begin{aligned} &4 + 2r - r^2 \\[0.4em] &\quad = 4 + (2 + 2\sqrt{5}) \\[0.4em] &\qquad - (6 + 2\sqrt{5}) \\[0.4em] &\quad = 0. \end{aligned}

A multiplier of 00 means that nearby orbits approach the cycle especially fast, as they approach 1/21/2 when r=2r = 2, and it fits the fact that 3.2363.236 lies between 33 and 1+6≈3.4491 + \sqrt{6} \approx 3.449.

How this lesson connects