7.

Define L1 as being a hop away from the origin, L2 as being 2 hops away
from origin, L3 as being 3 hops away.
Thus we are looking for E[X|L1] since originally the ant is only a hop
away.
So, E[X|L1]=1/3(1)+2/3(E[X|L2]+1) since it may return to the origin
with chance 1/3 or go away another level with chance 2/3
Then, E[X|L2]=2/3(E[X|L1]+1)+1/3(E[X|L3]+1) since it may get closer
with chance 2/3, or further.
Finally, E[X|L3]=E[X|L2]+1 since it has no choice but to get closer.
Hence, E[X|L2]=2/3(E[X|L1]+1)+1/3(E[X|L2]+2) => 2/3(E[X|L2])=2/3(E[X|
L1]+1)+2/3=>E[X|L2]=E[X|L1]+2
Thus, E[X|L1]=1/3(1)+2/3(E[X|L1]+3)=> E[X|L1]=7

On Nov 2, 11:14 pm, ankur aggarwal <ankur.mast....@gmail.com> wrote:
>  An ant stays at one corner of a cube. It can go only along the side with
> equal probability, and taking one minute to get to another corner. What is
> the expect minutes for the ant coming back to the original position?

--

You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.


Reply via email to