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.
[Math] Ant walking in hexagon
graph theoryprobabilityrandom walk
Related Solutions
Extending to $d$-dimensions
So I had enough time to procrastinate today and I extended this problem to $d$ dimensions. I would appreciate if someone could read through the answer and suggest any simplification to final answer if possible. Do the final numbers $u_n$ constitute a nice well known sequence? Further, what other interesting problems arise out this ant and the cube problem. I think another nice problem is the expected cover time. Thanks
Working out explicitly for $d=3$ gave some nice hints and a good picture of what is going on. We use these to extend to any d-dimension.
The first thing is to define a cube in $d$-dimensions. A $\mathbf{d}$-dimensional cube is a set of vertices of the form $(i_1,i_2,\ldots,i_d)$ where $i_k \in \{0,1\}$. There is an edge between vertex $(i_1,i_2,\ldots,i_d)$ and vertex $(j_1,j_2,\ldots,j_d)$ if $\exists l$ such that $\left | i_l - j_l \right| = 1$ and $i_k = j_k$, $\forall k \neq l$.
Two vertices are said to be adjacent if they share an edge. It is easy to note that every vertex shares an edge with $d$ vertices. (Consider a vertex $(i_1,i_2,\ldots,i_d)$. Choose any $i_k$ and replace $i_k$ by $1-i_k$. This gives an adjacent vertex and hence there are $d$ adjacent vertices as $k$ can be any number from $1$ to $d$). Hence, the probability that an ant at a vertex will choose an edge is $\frac1{d}$.
For every vertex, $(i_1,i_2,\ldots,i_d)$ let $s((i_1,i_2,\ldots,i_d)) = \displaystyle \sum_{k=1}^d i_k$. Note that $s$ can take values from $0$ to $d$. There are $\binom{d}{r}$ vertices such that $s((i_1,i_2,\ldots,i_d)) = r$.
Let $v_{(i_1,i_2,\ldots,i_d)}$ denote the expected number of steps taken from $(i_1,i_2,\ldots,i_d)$ to reach $(1,1,\ldots,1)$
Let $S_r = \{ (i_1,i_2,\ldots,i_d) \in \{0,1\}^d: s((i_1,i_2,\ldots,i_d)) = r\}$
Claim: Consider two vertices say $a,b \in S_r$. Then $v_a = v_b$. The argument follows easily from symmetry. It can also be seen from writing down the equations and noting that the equations for $a$ and $b$ are symmetrical.
Further note that if $a \in S_r$, with $0 < r < d$, then any adjacent vertex of $a$ must be in $S_{r-1}$ or $S_{r+1}$. Any adjacent vertex of $(0,0,\ldots,0)$ belongs to $S_1$ and any adjacent vertex of $(1,1,\ldots,1)$ belongs to $S_{d-1}$. In fact, for any $a \in S_r$, $r$ adjacent vertices $\in S_{r-1}$ and $d-r$ adjacent vertices $\in S_{r+1}$.
Let $u_r$ denote the expected number of steps from any vertex $\in S_r$ to reach $(1,1,\ldots,1)$. For $r \in \{1,2,\ldots,d-1\}$, we have \begin{align} u_r & = 1 + \frac{r}{d} u_{r-1} + \frac{d-r}{d} u_{r+1} & r \in \{1,2,\ldots,d-1\}\\\ u_0 & = 1 + u_1 & r = 0\\\ u_d & = 0 & r = d \end{align} Setting up a matrix gives us a tai-diagonal system to be solved. Instead, we go about solving this as follows.
Let $p_r = \frac{r}{d}$, $\forall r \in \{1,2,\ldots,d-1\}$. Then the equations become \begin{align} u_r & = 1 + p_r u_{r-1} + (1-p_r) u_{r+1} & r \in \{1,2,\ldots,d-1\}\\\ u_0 & = 1 + (1-p_0) u_1 & r = 0\\\ u_d & = 0 & r = d \end{align} Let $a_{r} = u_{r+1} - u_r$. Then we get \begin{align} p_r a_{r-1} & = 1 + (1-p_r)a_r & r \in \{1,2,\ldots,d-1\}\\\ a_0 & = -1 & r = 0 \end{align} Note that $u_m = - \displaystyle \sum_{k=m}^{d-1} a_k$ and $u_d = 0$ \begin{align} a_0 & = -1 & r = 0\\\ a_{r} & = \frac{p_r}{1-p_r} a_{r-1} - \frac1{1-p_r} & r \in \{1,2,\ldots,d-1\} \end{align} Let $l_r = \frac{p_r}{1-p_r} = \frac{r}{d-r}$ \begin{align} a_0 & = -1 & r = 0\\\ a_{r} & = l_r a_{r-1} - (1+l_r) & r \in \{1,2,\ldots,d-1\} \end{align} \begin{align} a_1 &= l_1 a_0 - (1+l_1)\\\ a_2 & = l_2 l_1 a_0 - l_2(1+l_1) - (1+l_2)\\\ a_3 & = l_3 l_2 l_1 a_0 - l_3 l_2 (1+l_1) - l_3 (1+l_2) - (1+l_3)\\\ a_m & = \left( \prod_{k=1}^{m} l_k \right) a_0 - \displaystyle \sum_{k=1}^{m} \left((1+l_k) \left( \prod_{j=k+1}^m l_j \right) \right) \end{align} Since $a_0 = -1$ and $l_0 = 0$, we get \begin{align} a_m & = - \displaystyle \sum_{k=0}^{m} \left((1+l_k) \left( \prod_{j=k+1}^m l_j \right) \right) \end{align} Hence, \begin{align} u_n & = - \displaystyle \sum_{m=n}^{d-1} a_m\\\ u_n & = \displaystyle \sum_{m=n}^{d-1} \left( \displaystyle \sum_{k=0}^{m} \left((1+l_k) \left( \prod_{j=k+1}^m l_j \right) \right) \right)\\\ u_n & = \displaystyle \sum_{m=n}^{d-1} \left( \displaystyle \sum_{k=0}^{m} \left(\frac{d}{d-k} \left( \prod_{j=k+1}^m \frac{j}{d-j} \right) \right) \right)\\\ u_n & = \displaystyle \sum_{m=n}^{d-1} \frac{\displaystyle \sum_{k=0}^{m} \binom{d}{k}}{\binom{d-1}{m}} \end{align} Note that \begin{align} u_n & = \frac{\displaystyle \sum_{k=0}^{n} \binom{d}{k}}{\binom{d-1}{n}} + u_{n+1} & \forall n \in \{0,1,2,\ldots,d-2 \} \end{align} The expected number of steps from one vertex away is when $n = d-1$ and hence $u_{d-1} = 2^d-1$
The expected number of steps from two vertices away is when $n = d-2$ and hence $u_{d-2} = \frac{2d(2^{d-1} - 1)}{d-1}$
The answers for the expected number of steps from a vertex and two vertices away coincide with Douglas Zhare's comment
Initial Solution
Problems such as these fall in the category of Markov chains and one way to solve this is through first step analysis.
We shall denote the vertices of the cube by numbers from $1$ to $8$ with $1$ and $8$ being the opposite ends of the body diagonal.
Let $v_i$ denote the expected number of steps to reach the vertex numbered $8$ starting at vertex numbered $i$.
$v_1 = 1 + \frac{1}{3}(v_2 + v_4 + v_6)$; $v_2 = 1 + \frac{1}{3}(v_1 + v_3 + v_7)$; $v_3 = 1 + \frac{1}{3}(v_2 + v_4 + v_8)$; $v_4 = 1 + \frac{1}{3}(v_1 + v_3 + v_5)$; $v_5 = 1 + \frac{1}{3}(v_4 + v_6 + v_8)$; $v_6 = 1 + \frac{1}{3}(v_1 + v_5 + v_7)$; $v_7 = 1 + \frac{1}{3}(v_6 + v_2 + v_8)$; $v_8 = 0$;
Note that by symmetry you have $v_2 = v_4 = v_6$ and $v_3 = v_5 = v_7$.
Hence, $v_1 = 1 + v_2$ and $v_2 = 1 + \frac{1}{3}(v_1 + 2v_3)$ and $v_3 = 1 + \frac{2}{3} v_2$.
Solving we get $$\begin{align} v_1 & = 10\\ v_2 = v_4 = v_6 & = 9\\ v_3 = v_5 = v_7 & = 7 \end{align}$$
Hence, the expected number of steps to reach the diagonally opposite vertex is $10$.
Conditioning the ant to never pass by vertex $5$ is equivalent to cancelling edges $\{4,5\}$, $\{6,5\}$ and $\{8,6\}$. This leaves $7$ vertices and $9$ edges. The symmetry with respect to the plane containing $1$, $2$, $5$ and $8$ shows that $3$ and $7$ play the same role for a path starting from $1$ and ending at $8$. Likewise, $4$ and $6$ play the same role. So one can consider $3$ and $7$ as a single vertex, and $4$ and $6$ as a single vertex, only with more edges leading to them and leaving them than the others.
Thus the setting is equivalent to a random walk on a weighted graph with $5$ vertices and $5$ edges, drawn like a square plus an additional edge added to a vertex of the square. The square has vertices $1$, $2$, $3$ (which represents $3$ and $7$) and $4$ (which represents $4$ and $6$), the fifth vertex is $8$, and the edges are those of the square $\{1,2\}$, $\{2,3\}$, $\{3,4\}$, $\{4,1\}$, plus the additional edge $\{3,8\}$. Every edge has weight $2$ except the edge $\{1,2\}$ which has weight $1$. Weights on edges mean for instance that starting from $1$, one has $1/(1+2)$ chances to go to $2$ and $2/(1+2)$ chances to go to $4$.
Writing $t_i$ for the mean hitting time of $8$ starting from $i$ on the reduced graph, one looks for $t_1$. The vector $(t_1,t_2,t_3,t_4)$ solves the system $t_1=1+(t_2+2t_4)/3$, $t_2=1+(t_1+2t_3)/3$, $t_3=1+(t_1+t_2+0)/3$ and $t_4=1+(t_1+t_3)/2$. Hence $t_1=62/5$ or something like that.
Alternatively, one can solve an analogous system on the original graph with $7$ vertices and $9$ edges. This system has size $6$ since $t_8=0$ and if one solves it one will note that some coordinates of the solution are equal, namely $t_3=t_7$ and $t_4=t_6$. The reduction explained above uses this fact to lower a priori the size of the linear system down to $4$ but it is not essential.
All this, and much more, in the must-read short book Random walks and electric networks by Peter G. Doyle and J. Laurie Snell.
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.