Suppose that particle does a random walk on the following graph:
It starts from $A$ and at every moment of time goes to any adjacent vertex with the same probability. Find
- expected time returning to $A$
- how many times it visits $D$ before returning to $A$
- how many times it visits $C$ before returning to $A$
My attempts on solving first part of the problem:
Denote by $a$ expected time to return to $A$ starting from $A$, $b$ -- expected time to return to $A$ starting from $B$ and so on for $c$, $d$, $e$.
They are linked as
$\begin{cases} a = \frac{1}{2}(c+1) + \frac{1}{2}(b+1)\\ b = \frac{1}{2} + \frac{1}{2}(c+1)\\ c = \frac{1}{2} + \frac{1}{2}(b+1)\\ d = \frac{1}{2}(c+1) + \frac{1}{2}(e+2)\\ e = \frac{1}{2}(d+2) + \frac{1}{2}(c+1) \end{cases}$
and the solution of this system is $a=3, b=2, c=2, d=5, e=5$, so the answer is that expected time returning to $A$ is $3$.
But one of the comments to this question says that for connected undirected graph the expected returning time is given by $\frac{2n}{d}$, where $n$ is the number of edges and $d$ is the degree of the starting vertex. For this graph it gives us $a=\frac{2\cdot6}{2}=6$.
Where is my mistake? It seems that I wrote wrong system of equations. Can anyone fix it and also explain how second and third parts should be done?
