TITLE: Random walk over a cube:Probability of returning back
QUESTION [10 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 probability that ant is in the vertex it started with after N steps?
What I tried->
Breaking problem to simpler one where we see distance from start vertex. So out of 8 vertices, we have 1 with distance 0(our start), 3 with distance 1, 3 with distance 2 and 1 with distance 3.
Also, ant can only return back if N is even. So probability is 0 when N is odd.

REPLY [16 votes]: The probability is zero if $N$ is odd.
After two steps, starting at the original vertex, the probability
of returning there is $1/3$. Otherwise the walk moves to
a vertex at distance $2$ from the original vertex.
Starting at a vertex at distance $2$ from the original vertex,
after two steps the probability it returns to the original vertex
is $2/9$. Otherwise it moves to a vertex at distance $2$ from the original vertex.
So the probability of return after $2n$ steps is the top left
entry of the matrix
$$\pmatrix{1/3&2/3\\2/9&7/9}^n.$$
You can compute this by any standard method (diagonalisation, generating 
functions, etc.).