Join free to take this lesson
Anyone can look around, but taking a lesson needs a free account. With one, your answers are checked step by step and your progress is saved, so you can stop and pick up where you left off on any device.
12 steps ยท about 25 min
By the end you can
- Say what a random walk is
- Take one random step with rng.choice([-1, 1]), and many in a loop
- Make all the steps at once with size=N, and find where the walker ends with np.sum
- Find the whole path with np.cumsum, a running total
Who it is for: Anyone who has done lesson 9.2 (random numbers with a seed) and unit 17 (Monte Carlo).
The steps
- The drunkard's walk
- A coin toss in Python
- Ten steps
- Where can he be?
- Steps of a metre
- Many nights
- All the steps at once
- Where he ends
- The whole path: np.cumsum
- A running total
- The farthest he strayed
- One walk
Discussion 0 comments
Log in to join the discussion.