Waiting for Stoplights

Requires a Wolfram Notebook System
Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.
A walker in a city is at the green point in the upper-right corner of the plot. Her goal is the red point at the origin. Thus, at each intersection of streets, she goes either to the west or to the south. She has to go
intersections to the west and
intersections to the south. Suppose that at each intersection, there is always a green light in one of the two possible directions and a red light in the other direction; the walker always chooses the direction where she sees the green light. Also suppose that the walker faces the lights randomly, that is, there is a probability of 1/2 that the green light is to the west and also a probability of 1/2 that the green light is to the south.
Contributed by: Heikki Ruskeepää (February 2013)
Open content licensed under CC BY-NC-SA
Snapshots
Details
Snapshots 1, 2, 3: these plots show the results when the starting point is ,
, or
When the starting point is for
, the expected number of red lights is 1.76, 2.51, 3.98, 5.63, 7.97, 12.6, and 17.84, respectively. Thus, the expected number of red lights grows slowly, approximately as
.
The expected number of red lights is easy to calculate with Mathematica by using recurrence relations. Let be the expected number of red lights when starting from
. The recurrence relations are:
for
and
,
for
,
for
,
.
The Demonstration is based on problem 18 in [1]. See also [2].
References
[1] P. J. Nahin, Digital Dice: Computational Solutions to Practical Probability Problems, Princeton: Princeton University Press, 2008.
[2] H. Sagan, "On Pedestrians, City Blocks, and Traffic Lights," Journal of Recreational Mathematics, 21(2), 1989 pp. 116–119.
Permanent Citation