In [3]:
import walk2Dv as wlk
import numpy as np
import matplotlib.pyplot as plt
import flip_coin_vec as fcv
In [5]:
for i in range(0,10):
print(fcv.flipCoin(10))
Simulate the random walk problem in 2 dimensions, using vectorized code where possible. Then create a Gif of the random walk for 1000 particles taking 400 steps.
The code I implemented was a cleaned-up version of the code in the book. I also went a little nuts with ImageMagick and subsequently FFMpeg. Without further ado, here is a gif of 1000 particles taking 400 steps each: