Ant on vertex of pyramid expected number of seconds to return to original vertex

expected valueprobability

An ant is walking on a square pyramid. It starts at a random vertex, and from there, it can only go to an adjacent vertex. It takes the ant one second to go to an adjacent vertex. What is the expected number of seconds the ant takes to return to its original vertex.

I only know how to do this for if the ant is on the apex, and I'm not sure how to proceed if it was an arbitrary vertex.

If it was the apex, the ant must take $1$ second to one of the other four adjacent vertices. From the new vertex it is on, it can go to any of the three other adjacent vertices, and it has a $\frac{1}{3}$ chance of going back to the original vertex. However, if it doesn't go to the original vertex, the new vertex it is on still has a $\frac{1}{3}$ chance of going back to the original vertex. We could treat this as a "three sided die" with probability $\frac{1}{3}$ of getting a desired result. With states, we can find that the expected number of seconds to get a desired result will be $3.$ Adding this to the first second the ant moved to another adjacent vertex, we get an answer of $4$ seconds if it was the apex.

However, I have to consider what happens if it was the other vertices? May I have some help? Thanks in advance.

Best Answer

Sorry I had misread the question, so I am giving a revised answer.

As you have already found out, if you start from the apex, the expected time to return is $4s$

Let us call the apex a, and the $4$ base vertices as b,c,d,e (clockwise,say)

To find the expected time to start from and return from any base vertex, say b, we apply first step analysis

One step from b, eg will land us at a,c,e with $Pr = \frac13$ each

Similarly, one step from a will land us at c,d,e with $Pr = \frac14$ each, or we are back home at b Framing equations in this manner, we get

$\displaylines{b = 1+ (a+c+e)/3 \\a = 1+ (c+d+e)/4 \\c = 1+(a+d)/3\\d=1+(a+c+e)/3\\e=1+(a+d)/3}$

Solving this gives the answer $b = \frac{16}3$

and the expected time from a random vertex $= \frac{4(1+16/3)}{5} = \frac{76}{15}s $

This tallies with the results of @bof, who has used graph theory