Skip to main content
1 of 2
Iosif Pinelis
  • 127.7k
  • 8
  • 107
  • 229

Your boundary conditions do not correspond to reflective boundaries. Your $P(n,t)$ is the probability that, starting at time $0$ at some point $x_0$ in the set $I:=\{2,\dots,N-1\}$, the random walker stays in this set at all times $1,\dots,t$ and is at point $n\in I$ at time $t$.

According to Proposition 4, $$P(n,t)=\sum_{k\in\Bbb Z}(-1)^k P(S_t=x_k-x_0)=\frac1{2^t}\sum_{k\in\Bbb Z}(-1)^k \binom t{y_{t,k}},$$ where $S_t$ is the sum of $t$ independent Rademacher random variables (each of them uniformly distributed over the set $\{-1,1\}$), $x_{k+1}=2\alpha_k-x_k$ for $k\in\Bbb Z$, $\alpha_k:=N-x_0+k(N-1)$, $y_{t,k}:=(t+x_k-x_0)/2$.

Iosif Pinelis
  • 127.7k
  • 8
  • 107
  • 229