\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\pl}{\partial}
\parindent=0pt
\begin{document}


{\bf Question}

Describe briefly the behaviour of a particle moving in a simple
random walk between two reflecting barriers.

Find the expected number of steps until the particle, initially at
position $j,$ reaches the upper barrier for the first time for the
case $p \not= q,$ $p$ and $q$ nonzero.

Calculate the expected number of consecutive steps for which the
particle remains on the upper barrier during a visit.



\vspace{.25in}

{\bf Answer}

Let $E_j$ be the expected number of steps until the particle
reaches the upper barrier for the first time, starting at $j.$
(Barriers at $a$ and $-b$)

$\ds E_j = p(1 + E_{j+1}) + q(1 + E_{j-1}) + (1-p-q)(1 + E_j)$

which rearranges to give

$\ds pE_{j+1} - (p+q)E_j + qE_{j-1} = -1 \hspace{.2in} -b<j<a$

The auxiliary equation is $ \ds p \lambda^2 - (p+q)\lambda + q =
0$ $${\rm i.e.\ \ }(\lambda +1)(p\lambda -q) = 0 \Rightarrow
\lambda = 1, \frac{q}{p}$$ A particular solution is $E_j = cj$
where

$p c(j+1) - (p+q)c j + q c(j-1) = -1$

$\Rightarrow c(p-q) = -1$ so $\ds c = \frac{1}{(q-p)}$

Thus the general solution is $$E_j = A + B \left( \frac{q}{p}
\right)^j + \frac{j}{q-p}$$

The boundary conditions give

$\ds E_a = 0 \hspace{.2in} {\rm so} \hspace{.2in} A + B\left(
\frac{q}{p} \right)^a + \frac{a}{q-p} = 0,$

$\ds E_{-b} = p(1 + E_{-b+1}) + (1 -p) (1+E_{-b}) \Rightarrow
pE_{-b+1} - pE_{-b} + 1 = 0$

Substituting from the general solution gives $$B =
-\left(\frac{q}{p} \right)^b \frac{q}{(q-p)^2} \hspace{.2in} A =
-\frac{a}{q-p} + \left( \frac{q}{p} \right)^{a+b}
\frac{q}{(q-p)^2}$$

$$ E_j = -\frac{a}{q-p} + \left(\frac{q}{p} \right)^{a+b}
\frac{q}{(q-p)^2} - \left( \frac{q}{p} \right)^{b+j}
\frac{q}{(q-p)^2} + \frac{j}{q-p}$$

Let $N$ = number of steps on the upper barrier during a visit.

\begin{eqnarray*}
P(N=n) &=& (1-q)^n \cdot q \\ E(N) &=& \sum_{n=0}^{\infty} n (1 -
q)^n \cdot q = \frac{1-q}{q}\end{eqnarray*}
 (Summing the
arithmetic-geometric series.)



\end{document}
