This is the final riddle exercise in my probability class. It feels like I'm almost at the solution but something is still not correct. Similar questions seem to utilize Markov Chains or Wiener Processes. We did not cover advanced stochastics so far. I'm sorry if this question is too specific.
With probability $p$, jump to $i+1$ and with $1-p$ jump to $i-1$. Starting at $i=0$, when are you expecting to leave $[-1,1]$ for the first time. Let $X$ be the number of jumps till leaving the interval.
My Work so far: First, you can't exit [-1,1] on uneven jumps for the first time.
For $n: n \text{ mod }2 = 0$ jumps: Jump inside [-1,1] for n-2 jumps and then leave the interval with either $p^2$ (2 jumps +1) or $(1-p)^2$ (2 jumps -1).
For n jumps there are $2^{({n-2})/2}$ possible sequences for jumps inside the interval.
This leaves me with the following probability function:
$$f_X(x) = p^{n-2/2}\cdot(1-p)^{n-2/2}\cdot(p^2+(1-p)^2)\cdot2^{n-2/2}$$
Where $p^{n-2/2}\cdot(1-p)^{n-2/2}$ are the n-2 jumps. $(p^2+(1-p)^2)$ is leaving the interval with 2 jumps in either direction. $2^{n-2/2}$ is the number of jump-sequences before leaving the interval.
When I now try to compute $$E[X] = \Sigma_{x=0}^\infty x*f_X(x)$$ the sum converges, therefore there is no expected value.
Can someone please provide a hint. Thank you!
Your observation that every second jump you will be at an even position simplifies the problem a lot, because the only even position where you haven't already won is $0$.
So when you are at position $0$, the probability that you will win in two steps is $(1-p)^2+p^2$ because you need to make two jumps in the same direction. If you don't win, then after two steps you're back at position $0$, and your expectation of the remaining time is the same as before.
Therefore the expectation $E$ satisfies $$ E = q\cdot 2 + (1-q)\cdot(2+E) \qquad\text{where }q=(1-p)^2+p^2 $$