The logistic equation $x_{n+1} = r \cdot x_n \cdot (1 - x_n)$ is a simple model of population growth that exhibits the route from order to chaos as parameter $r$ changes. Write a loop that starts at $x_0 = 0.5$ and iterates $100$ times. Try:Print the final value of $x$ for each case.
- $r = 2.8$: The sequence quickly settles onto a single fixed number.
- $r = 3.2$: The sequence alternates between 2 numbers (a period-2 cycle).
- $r = 3.9$: The sequence bounces around unpredictably forever in deterministic chaos!
See your results here: