Expected number of times return to the origin If I go right with probability p and left with probability 1-p and I start at the origin, what is the expected (E) number of returns to the origin after infinity steps? I know that E is infinity with p=1/2 but what hapoens if p is very close to 1? Intuitively if p is something like 0.99999 the number of times I return to the origin has to be finite, or not?
Maybe E always diverges no matter how close p is to 1? (Applying borel canteli lemmas maybe). But I find that counterintuitive 
 A: Without loss of generality, assume $p\gt\frac12$. The expected number of returns $a_n$ starting at $n\gt0$ satisfies the recurrence
$$
a_n=pa_{n+1}+(1-p)a_{n-1}\;.
$$
To find the boundary condition at the origin, note that the walk is certain to return to the origin if it goes left from the origin. Thus, if the walk reaches the origin from the right, the resulting number of returns is the number of attempts needed for going right, where each attempt has probability $p$; this is $\frac1p$. Thus, the boundary condition is $a_0=\frac1p+a_1$.
The characteristic equation $p\lambda^2-\lambda+1-p=0$ has the solutions $\lambda=1$ and $\lambda=\frac{1-p}p$. There is no constant component, since the expected number of returns to the origin goes to $0$ at infinity. Thus we have $a_n=c\left(\frac{1-p}p\right)^n$. The boundary condition yields $c=\frac1p+c\cdot\frac{1-p}p$, and thus $c=\frac 1{2p-1}$ and $a_n=\frac 1{2p-1}\left(\frac{1-p}p\right)^n$. If you start at the origin, the expected number $x$ of returns to the origin satisfies
$$
x=pa_1+(1-p)(1+x)\;.
$$
The solution is
$$
x=\frac{1-p}p+a_1=\frac{1-p}p\left(1+\frac1{2p-1}\right)=\frac{2(1-p)}{2p-1}\;,
$$
which goes to infinity as $p\to\frac12$, as it must. For $p=1-\epsilon$ we have $x=\frac{2\epsilon}{1-2\epsilon}=2\epsilon+O\left(\epsilon^2\right)$, which makes sense, since there are two chances to return to the origin with a single step to the left (at $0$ and at $1$), and all other ways of returning to the origin require at least two steps to the left.
