Let $\{X_n\}$ be a Markov chain on $\mathbb{N}_0$ such that $p(x,x+1)=p(x,0)=1/2$ for all $x\in \mathbb{N}_0$. Find $E(T_0~|~X_0=1),$ where $T_0=\inf\{k\geq 0:~ X_k=0\}.$
Attempt. If $g(x)=E(T_0~|~X_0=x),~x\in \mathbb{N}_0$ then, according to one-step analysis:
$g(x)=\frac{1}{2}g(x+1)+\frac{1}{2}g(0)+1,~x\in \mathbb{N}$ and $g(0)=0$, that is $g(x+1)=2g(x)-2,~x\in \mathbb{N}$, with general solution $g(x)=c2^x+2,~x\in \mathbb{N}$. Since $g(0)=0$, we get $c=-2$, so $g(x)=2-2^{x+1},~x\in \mathbb{N}_0$, while $g(x)\geq 0$, a contradiction. Where seems to be the problem in the above solution?
Thank you in advance for the help.