Logistic map

The logistic map is a polynomial mapping (equivalently, recurrence relation) of degree 2, often referred to as an archetypal example of how complex, chaotic behaviour can arise from very simple nonlinear dynamical equations. The map was popularized in a 1976 paper by the biologist Robert May, in part as a discrete-time demographic model analogous to the logistic equation written down by Pierre François Verhulst.
Mathematically, the logistic map is written
where is a number between zero and one, which represents the ratio of existing population to the maximum possible population. 
This nonlinear difference equation is intended to capture two effects:
The usual values of interest for the parameter are those in the interval , so that remains bounded on . The case of the logistic map is a nonlinear transformation of both the bit-shift map and the case of the tent map. If , this leads to negative population sizes. (This problem does not appear in the older Ricker model, which also exhibits chaotic dynamics.) One can also consider values of in the interval , so that remains bounded on .
Characteristics of the map.
Behavior dependent on.
The image below shows the amplitude and frequency content of some logistic map iterates for parameter values ranging from 2 to 4.
By varying the parameter , the following behavior is observed:
For any value of there is at most one stable cycle. If a stable cycle exists, it is globally stable, attracting almost all points. Some values of with a stable cycle of some period have infinitely many unstable cycles of various periods.
The bifurcation diagram at right summarizes this. The horizontal axis shows the possible values of the parameter while the vertical axis shows the set of values of visited asymptotically from almost all initial conditions by the iterates of the logistic equation with that value.
The bifurcation diagram is a self-similar: if we zoom in on the above-mentioned value and focus on one arm of the three, the situation nearby looks like a shrunk and slightly distorted version of the whole diagram. The same is true for all other non-chaotic points. This is an example of the deep and ubiquitous connection between chaos and fractals.
We can also consider negative values of :
Chaos and the logistic map.
The relative simplicity of the logistic map makes it a widely used point of entry into a consideration of the concept of chaos. A rough description of chaos is that chaotic systems exhibit a great sensitivity to initial conditions—a property of the logistic map for most values of between about 3.57 and 4 (as noted above). A common source of such sensitivity to initial conditions is that the map represents a repeated folding and stretching of the space on which it is defined. In the case of the logistic map, the quadratic difference equation describing it may be thought of as a stretching-and-folding operation on the interval .
The following figure illustrates the stretching and folding over a sequence of iterates of the map. Figure (a), left, shows a two-dimensional Poincaré plot of the logistic map's state space for , and clearly shows the quadratic curve of the difference equation (). However, we can embed the same sequence in a three-dimensional state space, in order to investigate the deeper structure of the map. Figure (b), right, demonstrates this, showing how initially nearby points begin to diverge, particularly in those regions of corresponding to the steeper sections of the plot.
This stretching-and-folding does not just produce a gradual divergence of the sequences of iterates, but an exponential divergence (see Lyapunov exponents), evidenced also by the complexity and unpredictability of the chaotic logistic map. In fact, exponential divergence of sequences of iterates explains the connection between chaos and unpredictability: a small error in the supposed initial state of the system will tend to correspond to a large error later in its evolution. Hence, predictions about future states become progressively (indeed, exponentially) worse when there are even very small errors in our knowledge of the initial state. This quality of unpredictability and apparent randomness led the logistic map equation to be used as a pseudo-random number generator in early computers.
Since the map is confined to an interval on the real number line, its dimension is less than or equal to unity. Numerical estimates yield a correlation dimension of (Grassberger, 1983), a Hausdorff dimension of about 0.538 (Grassberger 1981), and an information dimension of approximately 0.5170976 (Grassberger 1983) for (onset of chaos). Note: It can be shown that the correlation dimension is certainly between 0.4926 and 0.5024.
It is often possible, however, to make precise and accurate statements about the "likelihood" of a future state in a chaotic system. If a (possibly chaotic) dynamical system has an attractor, then there exists a probability measure that gives the long-run proportion of time spent by the system in the various regions of the attractor. In the case of the logistic map with parameter and an initial state in , the attractor is also the interval and the probability measure corresponds to the beta distribution with parameters and . Specifically, the invariant measure is
Unpredictability is not randomness, but in some circumstances looks very much like it. Hence, and fortunately, even if we know very little about the initial state of the logistic map (or some other chaotic system), we can still say something about the distribution of states arbitrarily far into the future, and use this knowledge to inform decisions based on the state of the system.
Graphical representation.
The Bifurcation diagram for the logistic map can be visualized with the following Python code:
import numpy as np
import matplotlib.pyplot as plt
interval = (2.8, 4) # start, end
accuracy = 0.0001
reps = 600 # number of repetitions
numtoplot = 200
lims = np.zeros(reps)
fig, biax = plt.subplots()
fig.set_size_inches(16, 9)
lims[0] = np.random.rand()
for r in np.arange(interval[0], interval[1], accuracy):
 for i in range(reps-1):
 lims[i+1] = r*lims[i]*(1-lims[i])
 biax.plot([r]*numtoplot, lims[reps-numtoplot:], 'b.', markersize=.02)
biax.set(xlabel='r', ylabel='x', title='logistic map')
plt.show()
Special cases of the map.
Upper bound when.
Although exact solutions to the recurrence relation are only available in a small number of cases, a closed-form upper bound on the logistic map is known when . There are two aspects of the behavior of the logistic map that should be captured by an upper bound in this regime: the asymptotic geometric decay with constant , and the fast initial decay when is close to 1, driven by the term in the recurrence relation. The following bound captures both of these effects:
Solution when.
The special case of can in fact be solved exactly, as can the case with ; however, the general case can only be predicted statistically. 
The solution when is,
where the initial condition parameter is given by
For rational , after a finite number of iterations maps into a periodic sequence. But almost all are irrational, and, for irrational , never repeats itself – it is non-periodic. This solution equation clearly demonstrates the two key features of chaos – stretching and folding: the factor shows the exponential growth of stretching, which results in sensitive dependence on initial conditions, while the squared sine function keeps folded within the range .
For an equivalent solution in terms of complex numbers instead of trigonometric functions is
where is either of the complex numbers
with modulus equal to 1. Just as the squared sine function in the trigonometric solution leads to neither shrinkage nor expansion of the set of points visited, in the latter solution this effect is accomplished by the unit modulus of .
By contrast, the solution when is
for . Since for any value of other than the unstable fixed point 0, the term goes to 0 as goes to infinity, so goes to the stable fixed point .
Finding cycles of any length when.
For the case, from almost all initial conditions the iterate sequence is chaotic. Nevertheless, there exist an infinite number of initial conditions that lead to cycles, and indeed there exist cycles of length for "all" integers . We can exploit the relationship of the logistic map to the dyadic transformation (also known as the "bit-shift map") to find cycles of any length. If follows the logistic map and follows the "dyadic transformation"
then the two are related by a homeomorphism
The reason that the dyadic transformation is also called the bit-shift map is that when is written in binary notation, the map moves the binary point one place to the right (and if the bit to the left of the binary point has become a "1", this "1" is changed to a "0"). A cycle of length 3, for example, occurs if an iterate has a 3-bit repeating sequence in its binary expansion (which is not also a one-bit repeating sequence): 001, 010, 100, 110, 101, or 011. The iterate 001001001... maps into 010010010..., which maps into 100100100..., which in turn maps into the original 001001001...; so this is a 3-cycle of the bit shift map. And the other three binary-expansion repeating sequences give the 3-cycle 110110110... → 101101101... → 011011011... → 110110110... Either of these 3-cycles can be converted to fraction form: for example, the first-given 3-cycle can be written as → → → . Using the above translation from the bit-shift map to the formula_11 logistic map gives the corresponding logistic cycle 0.611260467... → 0.950484434... → 0.188255099... → 0.611260467... We could similarly translate the other bit-shift 3-cycle into its corresponding logistic cycle. Likewise, cycles of any length can be found in the bit-shift map and then translated into the corresponding logistic cycles.
However, since almost all numbers in are irrational, almost all initial conditions of the bit-shift map lead to the non-periodicity of chaos. This is one way to see that the logistic map is chaotic for almost all initial conditions.
The number of cycles of (minimal) length for the logistic map with (tent map with ) is a known integer sequence : 2, 1, 2, 3, 6, 9, 18, 30, 56, 99, 186, 335, 630, 1161... This tells us that the logistic map with has 2 fixed points, 1 cycle of length 2, 2 cycles of length 3 and so on. This sequence takes a particularly simple form for prime : . For example: 2 ⋅  = 630 is the number of cycles of length 13. Since this case of the logistic map is chaotic for almost all initial conditions, all of these finite-length cycles are unstable.
Related concepts.
Feigenbaum universality of 1-D maps.
Universality of one-dimensional maps with parabolic maxima and Feigenbaum constants formula_12, formula_13 is well visible with map proposed as a toy 
model for discrete laser dynamics: 
formula_14,
where formula_15 stands for electric field amplitude, formula_16 is laser gain as bifurcation parameter. 
The gradual increase of formula_16 at interval formula_18 changes dynamics from regular to chaotic one with qualitatively the same bifurcation diagram as those for logistic map.