TITLE: Logic question: Ant walking a cube
QUESTION [34 upvotes]: There is a cube and an ant is performing a random walk on the edges where it can select any of the 3 adjoining vertices with equal probability. What is the expected number of steps it needs till it reaches the diagonally opposite vertex?

REPLY [4 votes]: Here is what I thought. It is a Markov Chain Problem.
Mark the start point as $E_3$, here we define $E_n$ which means that it takes $n$ sides to reach the final point.
we have such relationship:
take one side, it will definitely go to point as $E_2$:
$$E_3 = E_2 + 1$$
the probability is 2/3 to $E_1$ and 1/3 back to $E_3$:
$$E_2 = 2/3 (E_1 + 1) + 1/3 (E_3 + 1)$$
similar to $E_1$:
$$E_1 = 1/3 + 2/3 (1 + E_2)$$
solve these equations, you will get $E_3$ = 10.