Last active
January 26, 2018 09:31
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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