Spider web walk

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?


The answer is 9.

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.

2 solutions

Chris Lewis
May 28, 2019

Label the hexagon as below:

The spider starts at S S ; the fly is finished off at F F . Note that there's essentially no difference between the two points labelled A A .

Let E x E_x denote the expected number of steps to reach the fly starting from a vertex labelled x x . Note that E F = 0 E_F=0 . We want to find E S E_S .

From point S S , the spider must travel in one step to a point A A . So E S = 1 + E A E_S=1+E_A .

From a point A A , the spider goes to either S S or B B with probability 1 2 \frac12 in each case. So E A = 1 + E S 2 + E B 2 E_A=1+\frac{E_S}{2}+\frac{E_B}{2} .

Similarly, E B = 1 + E A 2 + E F 2 = E B = 1 + E A 2 E_B=1+\frac{E_A}{2}+\frac{E_F}{2} = E_B=1+\frac{E_A}{2} , since E F = 0 E_F=0 .

We have three linear equations in three unknowns; solving we find E B = 5 E_B=5 , E A = 8 E_A=8 , and E S = 9 E_S=\boxed9 .

K T
May 31, 2019

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 ) \vec{p_t}=(p1,p2,p3,p4) 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 \vec{p_{t+1}}=M\vec{p_t} where M = [ 0 1 2 0 0 1 0 1 2 0 0 1 2 0 0 0 0 1 2 0 ] M = \begin{bmatrix} 0 & \frac{1}{2} & 0 & 0 \\ 1 & 0 & \frac{1}{2} & 0 \\ 0 & \frac{1}{2} & 0 & 0 \\ 0 & 0 & \frac{1}{2} & 0 \end{bmatrix}

position: 1 2 3 4
t=0 1 0 0 0
t=1 0 1 0 0
t=2 1 2 \frac{1}{2} 0 1 2 \frac{1}{2} 0
t=3 0 3 4 \frac{3}{4} 0 1 4 \frac{1}{4}
t=4 3 8 \frac{3}{8} 0 3 8 \frac{3}{8} 0
t=5 0 9 16 \frac{9}{16} 0 3 16 \frac{3}{16}
t=6 9 32 \frac{9}{32} 0 9 32 \frac{9}{32} 0
t=7 0 27 64 \frac{27}{64} 0 9 64 \frac{9}{64}

A pattern emerges, and the probability to find it at position 4 can be summarized as P ( t ) = 0 P(t)=0 when t is even and P ( t ) = 1 4 ( 3 4 ) ( t 3 2 ) P(t)=\frac{1}{4}(\frac{3}{4})^{(\frac{t-3}{2})} when t is odd and at least 3.

Substituting k = t 3 2 k=\frac{t-3}{2} and multiplying each probability by the time taken we get < t > = k = 0 ( 3 + 2 k ) × 1 4 ( 3 4 ) k <t> = \sum_{k=0}^{\infty} (3+2k) × \frac{1}{4}(\frac{3}{4})^k

To calculate this, we splitt it into two separate sums k = 0 ( 3 4 ) k + 1 + k = 0 2 k 4 ( 3 4 ) k \sum_{k=0}^{\infty} (\frac{3}{4})^{k+1} + \sum_{k=0}^{\infty} \frac{2k}{4}(\frac{3}{4})^k = 3 4 1 3 4 + 1 2 3 4 ( 1 3 4 ) 2 = 3 + 6 = 9 = \frac{\frac{3}{4}}{1-\frac{3}{4}} + \frac{1}{2} \frac{\frac{3}{4}}{(1-\frac{3}{4})^2} = 3+6 = \boxed{9}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...