Skip to content

Instantly share code, notes, and snippets.

@Razzo78
Last active January 26, 2018 09:31
Show Gist options
  • Save Razzo78/54752a4afe5890803e30b4b687103b7c to your computer and use it in GitHub Desktop.
Save Razzo78/54752a4afe5890803e30b4b687103b7c to your computer and use it in GitHub Desktop.
Python - A random walk is a mathematical object, known as a stochastic or random process, that describes a path that consists of a succession of random steps on some mathematical space such as the integers. (Wikipedia)
import numpy as np
np.random.seed(123)
tails = [0]
for x in range(10) :
coin = np.random.randint(0,2)
tails.append(tails[x] + coin)
print(tails)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment