I have a question about the answer to this question:
A symmetric random walk, i.e. with equal probability one makes a unit step left and right, respectively. Given positive integers x,yx,y we position walker at place x.x. What is the probability to reach x+yx+y before we reach 0?
The answer used a martingale argument, but I didn't understand the following line:
Let $p$ be the probability of reaching $x+y$ (rather than reaching 0). So the probability of reaching $0$ is $1−p$ (note that the probability of never reaching either end is $0$). Let $Z$ be the position at the end of the walk.
We have $\mathbb E[Z]=p⋅(x+y)+ (1−p)⋅0.$
Why is this true?