Showing posts with label linear random walk. Show all posts
Showing posts with label linear random walk. Show all posts

Wednesday, May 18, 2016

More About Random Walks

   I've written two additional random walk projects. The first of the two is essentially a Monte Carlo experiment that shows that the average square displacement of a random walker from zero, its starting point on the integer number line, is n, the number of steps in the walk. In equation form, let D equal the average square displacement. Then D^2 = n (or D = √(n)). 
   The Nobel physicist Richard Feynman provides a simple algebraic proof that D^2 = n.
   A copy of Feynman's proof is available upon request. Email
   This Scratch project can be viewed by clicking on the following link.
Average Square Displacement

   The second project is another Monte Carlo simulation.
   Consider a random walker starting at position 100 on a number line that has no barriers. Instead of flipping a coin to randomize left or right movement the walker has a pack of ten playing cards, 5 black and 5 red. 

The cards are shuffled and held face down in the walker’s hand. The walker selects, without peeking, the top card from the pack. The walker then looks at the card. If red, the walker moves to the right half the distance the walker is from 0. If black, the walker moves to the left half the distance the walker is from 0. The card is then discarded.

   The walker continues selecting a card and moving to the left or to the right as determined by the color of the card and the distance-halving rule until the tenth card has been looked at and the walker’s position changed according to the color of the last card. 

   You can explore the problem with paper/pencil or a calculator but a simple Scratch program is the easiest way to reach a surprising conjecture about the problem. The problem originated with Enn Norak, a Canadian mathematician and appeared in May 1969 issue of Scientific American magazine.
   This Scratch project can be viewed by clicking on the following link.
A Random Walk Paradox

Monday, March 9, 2015

Random Walk with Barriers

   A student is performing a random walk on the integer number line. Starting at any integer position > -20 and < 20, the student flips a coin. If it's heads, the student takes one step to the right, if tails, one step to the left, and flips again and again until one of the barriers is hit.
   Given any integer starting point between the two barriers, what is the probability of hitting the yellow barrier? Click on the video to see a sample run of the Scratch project where the walker starts at +15. The answer is P(yellow) = 7/8.

   The Scratch project can be viewed and downloaded by clicking on the following link.    
   I know of two simple proofs for the theoretical probability of the walker arriving at either barrier given the integer starting position of the walker. One uses an 'area' analysis and the other a tree diagram. You can obtain a free copy (PDF format) of either or both proofs by sending an e-mail request to
   A related Scratch project is my project Feynman's Random Walk
 I coded Dr. Feynman's amazing result that if a random walker starts at zero and performs an n-step random walk, with equal probabilities for moving one step to the right or left, and with no barriers left or right, then the ‘average displacement’ from 0 of the walker is √(n).