A spider and a fly are diametrically opposite vertices of a web in the shape of a regular hexagon. The fly is stuck and cannot move. On the other hand, the spider can walk freely along the edges of the hexagon. Each time the spider reaches a vertex, it randomly chooses between two adjacent edges with equal probability and proceeds to walk along that edge. On average, how many edge lengths will the spider walk before getting to the fly?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
There are 4 essentially different positions for the spider. We label its starting point as position 1 counting upward as it approaches the fly. We make a chart of the probabilities to find it at each position as a function of time.
As soon as it reaches the fly (at position 4) we will remove it the next step.
For those who like linear algebra and matrix notation, we could make a vector p t = ( p 1 , p 2 , p 3 , p 4 ) denoting the probability for the spider to be at positions 1 through 4 at a given point t in time. A matrix then could be used to calculate the probabilities in the next step using p t + 1 = M p t where M = ⎣ ⎢ ⎢ ⎡ 0 1 0 0 2 1 0 2 1 0 0 2 1 0 2 1 0 0 0 0 ⎦ ⎥ ⎥ ⎤
position: | 1 | 2 | 3 | 4 |
t=0 | 1 | 0 | 0 | 0 |
t=1 | 0 | 1 | 0 | 0 |
t=2 | 2 1 | 0 | 2 1 | 0 |
t=3 | 0 | 4 3 | 0 | 4 1 |
t=4 | 8 3 | 0 | 8 3 | 0 |
t=5 | 0 | 1 6 9 | 0 | 1 6 3 |
t=6 | 3 2 9 | 0 | 3 2 9 | 0 |
t=7 | 0 | 6 4 2 7 | 0 | 6 4 9 |
A pattern emerges, and the probability to find it at position 4 can be summarized as P ( t ) = 0 when t is even and P ( t ) = 4 1 ( 4 3 ) ( 2 t − 3 ) when t is odd and at least 3.
Substituting k = 2 t − 3 and multiplying each probability by the time taken we get < t > = k = 0 ∑ ∞ ( 3 + 2 k ) × 4 1 ( 4 3 ) k
To calculate this, we splitt it into two separate sums ∑ k = 0 ∞ ( 4 3 ) k + 1 + ∑ k = 0 ∞ 4 2 k ( 4 3 ) k = 1 − 4 3 4 3 + 2 1 ( 1 − 4 3 ) 2 4 3 = 3 + 6 = 9
Problem Loading...
Note Loading...
Set Loading...
Label the hexagon as below:
The spider starts at S ; the fly is finished off at F . Note that there's essentially no difference between the two points labelled A .
Let E x denote the expected number of steps to reach the fly starting from a vertex labelled x . Note that E F = 0 . We want to find E S .
From point S , the spider must travel in one step to a point A . So E S = 1 + E A .
From a point A , the spider goes to either S or B with probability 2 1 in each case. So E A = 1 + 2 E S + 2 E B .
Similarly, E B = 1 + 2 E A + 2 E F = E B = 1 + 2 E A , since E F = 0 .
We have three linear equations in three unknowns; solving we find E B = 5 , E A = 8 , and E S = 9 .