Skip to main content
2 of 2
added 33 characters in body
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=z_k)=\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\}$), $z_0=n-x_0$, $z_{k+1}=2\alpha_k-z_k$ for $k\in\Bbb Z$, $\alpha_k:=N-x_0+k(N-1)$, $y_{t,k}:=(t+z_k)/2$, $\binom tb=0$ if $b\notin\{0,\dots,t\}$. Explicitly, $z_{2m}=2m(N-1)+n-x_0$ and $z_{2m+1}=2m(N-1)+2N-n-x_0$ for $m\in\Bbb Z$.

Iosif Pinelis
  • 127.7k
  • 8
  • 107
  • 229