# IPython Cookbook, Second Edition, by Cyrille Rossant
import numpy as np
import matplotlib.pyplot as plt

def logistic(r, x):
    return r * x * (1 - x)

iterations = 1000

r=4
x=0.75001
l=[x]
for i in range(iterations):
    x = logistic(r, x)
    l.append(x)

plt.plot(l,'o')
plt.show()
