[Math] Ant walking in hexagon

graph theoryprobabilityrandom walk

There is a hexagon and an ant is performing a random walk on the edges and lines joining center and vertex with equal probability to choose next edge/line. What is the expected number of steps (one edge/line is equal to one step) it needs till it reaches the center again?

There is similar question here but we have a center in this case.

Best Answer

2 approaches:

1) Markov Chains. Your problem can be modelled by a Markov chain where each vertex is a state. Your Transition Matrix looks like (assuming the center is an absorbing state):

$$ TM=\begin{pmatrix} 0& 0& 0& 0& 0& 0& 0\\ 1/3& 0 & 1/3& 0& 0& 0& 1/3\\ 1/3& 1/3& 0& 1/3& 0& 0& 0\\ 1/3& 0 & 1/3& 0& 1/3& 0& 0\\ 1/3& 0 & 0& 1/3& 0& 1/3& 0\\ 1/3& 0 & 0& 0& 1/3& 0& 1/3\\ 1/3& 1/3 & 0& 0& 0& 1/3& 0\\ \end{pmatrix} $$

where i'm labeling the first row/column as the center and the other rows/colums as the rest of the vertices clockwise from the top.

Then to compute the average steps to go back to center from each vertex you can compute:

$$(Id-TM)^{-1}\begin{pmatrix} 0\\ 1\\ 1\\ 1\\ 1\\ 1\\ 1\\ \end{pmatrix}=\begin{pmatrix} 0\\ 3\\ 3\\ 3\\ 3\\ 3\\ 3\\ \end{pmatrix}$$

So you need 3 steps to get from any vertex back to the center plus the step to get out from the center so finaly you need 4 steps total.

2) Series. As commented above and observing the simetry in the problem, Markov chains look like overkill.

You can compute $$1+\sum_{i=1}^{\infty}iP(i)$$ where $$P(i)=\frac{1}{3}\left(\frac{2}{3}\right)^{i-1}$$ since you have 1 out of three possibilities to return at step $i$ after you have to travelled along the exterior vertices for $i-1$ steps.

Using that $$\sum_{i=1}^{\infty}ik^{i-1}=\left(\sum_{i=0}^{\infty}k^{i}\right)'=\frac{1}{(1-k)^2} $$ you get $$1+\sum_{i=1}^{\infty}iP(i)=4$$ as above.