Skip to content

Instantly share code, notes, and snippets.

@kimitoboku
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimitoboku/dade2aac7cbe81f134a1 to your computer and use it in GitHub Desktop.
Save kimitoboku/dade2aac7cbe81f134a1 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
import random
a1 = 1.0
a2 = 4.0
xs = []
a = []
for i in range(100000):
an = a1 + (a2 - a1) * float(i) / 100000
print i
x = random.random()
for j in range(1000):
x = an * x * (1 - x)
a.append(an)
xs.append(x)
plt.plot(a,xs,",")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment