# Hitting time for a random walk where step probabilities linearly depend on the distance to an absorbing wall

Consider the case where I have a discrete random walk on the integers over an interval $[0, M]$, where I start at some position $0 < k < M$, and both endpoints (i.e. $0$ and $M$) are fully absorbing. The caveat, to this otherwise simple random walk problem, is that the probability of taking a step depends on the distance between the walker and the absorbing boundaries. Letting $x_i$ represent the position of the walker, we have $P[+1] = \frac{x_i}{M}$, and $P[-1] = 1 - P[+1]$.

In other words, the probability of the walker taking a $+1$ step is equal to the probability of sampling from the integers over the interval $[1, M]$, with uniform probability, and seleting an integer $j$ such that $j \leq x_i$.

Can we state the probability that the walker reaches the absorbing target $M$?

-

The usual way: write $u(x)$ for the probability to reach $M$ before $0$ for the random walk starting from $x$, and note that $(u(x))_{0\leqslant x\leqslant M}$ is the unique solution of the linear system $u(0)=0$, $u(M)=1$, and, for every $1\leqslant x\leqslant M-1$, $$Mu(x)=xu(x+1)+(M-x)u(x-1).$$ Hence, for every $0\leqslant x\leqslant M$, $$u(x)=\frac1{2^{M-1}}\sum_{k=0}^{x-1}{M-1\choose k}.$$