Simple Random Walk
Two equally matched opponents are competing in a game in which changes in score occur often and in one point increments. (Imagine a basketball game in which every basket counts only one point.) We’ll use simulation to investigate the following questions.
- Which is more likely: that one team leads for most of the game, or that the lead tends to change frequently over the course of the game?
- When would you expect the largest lead (or deficit) to occur — near the beginning, the end, or in the middle of the game? (If the largest lead (or deficit) is attained at several points in the game, when you do expect it to first occur?)
- When would you expect the last tie to occur — near the beginning, the end, or in the middle of the game?
Pause to think about these questions before proceeding.
Let
Consider the first
We are interested in the following random variables, each of which has been scaled to take values between 0 and 1.
, where is the time, between 0 and , at which the walk is last in state 0. For example, if and the walk takes 100 steps, and it is last at 0 at step 84, then (the last tie occurs with 16% of the game remaining.) , the fraction of time the walk stays above 0, where the number of time steps for which the walk is above 0; is the proportion of the game team A is in the lead. , where is the first time, between 0 and , at which the maximum value, over time 0 to , of the walk is attained; is the first time (measured as a proportion of the full game) at which team A’s largest lead is attained.
Write your own code to conduct and run a simulation to approximate the distribution of each of
Optional: experiment with different values of