convolve1.py demonstrates the central limit theorem
for any distribution over integers (0,1,2,...) that you want.
convolve3.py is the same and also plots the distribution on a log scale.
randomwalk1.py creates random walks from any distribution
you want. The distribution is specified by a list of pairs
[ ( step size, probability ), ( step size, probability ), ... ]
The probabilities must sum to 1.0.
Here are 7 random walks of duration 1000, 7 of duration 100,000, and 7 of duration
1,000,000:
The pictures all look rather similar, which is interesting;
if you pay attention
to the vertical scales, you may notice how the typical distance travelled
scales with time.
David MacKay / Python pages