Here is a self‐contained answer in two parts. In the first part we write down a closed‐form (spectral) expansion for the (n)–step probabilities
[P_k(n)=\Pr{\xi_n= k\mid\xi_0=i},\qquad k=1,\dots,a-1,]
and in the second part we let (n\to\infty) to recover the familiar “gambler’s‐ruin’’ absorption probabilities at (0) and (a).
1. Spectral expansion for (P_k(n))
Label the nonabsorbing states by (1,2,\dots,a-1). The subchain on these states is a symmetric (if (p=q=\tfrac12)) or asymmetric birth–and–death chain. It has the well‐known orthogonal–polynomial (or trigonometric) eigenbasis:
-
Eigenvalues. For (r=1,2,\dots,a-1) define
[
\lambda_r ;=; 2\sqrt{p,q},\cos!\frac{\pi r}{a},.
]
One checks (!-!1<\lambda_{a-1}<\cdots<\lambda_1<1).
-
Eigenvectors. For each (r) an eigenvector (\varphi^{(r)}=(\varphi^{(r)}j){j=1}^{a-1}) may be chosen as
[
\varphi^{(r)}_j
;=;
\sin!\Bigl(\tfrac{\pi r j}{a}\Bigr),
\qquad j=1,\dots,a-1.
]
(One checks that under the birth–death transition kernel this is indeed an eigenvector with eigenvalue (\lambda_r).)
-
Orthogonality and normalization. The vectors (\varphi^{(r)}) are orthogonal in the weighted inner product
(\sum_{j=1}^{a-1}w_j,\varphi^{(r)}j,\varphi^{(s)}j)
with weights
[
w_j=\frac{1}{p_j,q{j}}
\quad\bigl(p_j!=!q_j!=\tfrac12\text{ in the symmetric case, or more general}\bigr).
]
One can choose a normalization constant (N_r) so that
[
\sum{j=1}^{a-1}w_j,[\varphi^{(r)}_j]^2
=1.
]
For simplicity we absorb that into the definition of (\varphi).
With these ingredients the usual spectral expansion of the (n)–step transition probabilities is
[
P_k(n);=; \Pr{\xi_n=k\mid\xi_0=i}
;=;
\sum_{r=1}^{a-1}
\bigl\langle \delta_i,\varphi^{(r)}\bigr\rangle,
\lambda_r^{,n},
\varphi^{(r)}k
;=;
\sum{r=1}^{a-1}
\varphi^{(r)}_i;\lambda_r^{,n};\varphi^{(r)}_k,
]
where (\delta_i) is the unit‐mass initial vector supported at (i).
In fully explicit form (choosing the normalization so that
(\sum_{j=1}^{a-1}\varphi^{(r)}_j,\varphi^{(s)}j
=\frac{a}{2},\delta{rs})) one gets
[
P_k(n)
;=;
\frac{2}{a}
\sum_{r=1}^{a-1}
\sin!\Bigl(\tfrac{\pi r i}{a}\Bigr),
\sin!\Bigl(\tfrac{\pi r k}{a}\Bigr),
\Bigl(2\sqrt{p,q},\cos\tfrac{\pi r}{a}\Bigr)^{!n}!.
]
–––
2. Absorption probabilities as (n\to\infty)
Because (|\lambda_r|<1) for every (r), all interior probabilities (P_k(n)) die off as (n\to\infty), and the mass is absorbed at (0) or (a). One shows by the standard martingale (or difference‐equation) argument (often called Gambler’s Ruin) that
-
If (p\neq q), then
[
\Pr{\text{absorb at }0\mid \xi_0=j}
=\pi_j^*
=\frac{(q/p)^j ;-;(q/p)^a}{1 ;-;(q/p)^a},
\quad
j=1,2,\dots,a-1,
]
and of course (\Pr{\text{absorb at }a}=1-\pi_j^*).
-
In the fair case (p=q=\tfrac12),
[
\pi_j^*
=\Pr{\text{absorb at }0\mid j}
=\frac{a-j}{a},
\qquad
\Pr{\text{absorb at }a\mid j}
=\frac{j}{a}.
]
Summary
-
Finite-(n) law
[
P_k(n)
=\frac{2}{a}
\sum_{r=1}^{a-1}
\sin!\Bigl(\tfrac{\pi r i}{a}\Bigr),
\sin!\Bigl(\tfrac{\pi r k}{a}\Bigr),
\Bigl(2\sqrt{p,q},\cos\tfrac{\pi r}{a}\Bigr)^{!n}.
]
-
Long‐run absorption at 0
[
\pi_j^*
=\lim_{n\to\infty}\Pr{\xi_n=0\mid\xi_0=j}
=\begin{cases}
\displaystyle
\tfrac{(q/p)^j - (q/p)^a}{1-(q/p)^a}, & p\neq q,\[1ex]
\displaystyle
\tfrac{a-j}{a}, & p=q=\tfrac12.
\end{cases}
]