\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\pl}{\partial}
\parindent=0pt
\begin{document}


{\bf Question}

Repairs carried out in a workshop often involve the replacement of
a particular component.  In the interests of efficiency a small
stock of components is kept in the workshop.  The probability that
$k$ components are used in the workshop during a working day is
$a_k$ where $$ \begin{array}{ll} a_k > 0 & k = 0, 1, 2, ..., 12,
\\ a_k = 0 & {\rm otherwise.}\end{array}$$
and the numbers of components used on different days are
independent, identically distributed random variables.

At the end of each working day the number of components in stock
is counted.  If there are fewer than 12 components, then the
minimum number of boxes, each containing 5 components, are brought
from the central stores to make the stock in the workshop at least
12 components.

Show that the number of components if necessary, form a Markov
chain.  Show that the Markov chain is ergodic and find the
equilibrium distribution.



\vspace{.25in}

{\bf Answer}

Let $X_n =$ number of customers in the workshop at the end of day
$n$ - after re stocking.

Let $Z_n =$ the number of components used during day $n.$

$X_n$ depends only on $X_{n-1}$ and $Z_n$, so the history of the
process before the end of day $(n-1)$ is irrelevant.

The possible values of $X_n$ are $12, 13, 14, 15, 16$ and in terms
of $N_{n-1}$ and $Z_n$ are given by the table below, with
transition probabilities as shown.

$$ \begin{tabular}{r|ccccccccccccc}  $Z_n$ & 0 & 1 & 2 & 3 & 4 & 5
& 6 & 7 & 8 & 9 & 10 & 11 & 12  \\ $X_{n-1}$  \\ \hline 12 & 12 &
16 & 15 & 14 & 13 & 12 & 16 & 15 & 14 & 13 & 12 & 16 & 15 \\ 13 &
13 & 12 & 16 & 15 & 14 & 13 & 12 & 16 & 15 & 14 & 13 & 12 & 16 \\
14 & 14 & 13 & 12 & 16 & 15 & 14 & 13 & 12 & 16 & 15 & 14 & 13 &
12 \\ 15  & 15 & 14 & 13 & 12 & 16 & 15 & 14 & 13 & 12 & 16 & 15 &
14 & 13 \\ 16 & 16 & 15 & 14 & 13 & 12 & 16 & 15 & 14 & 13 & 12 &
16 & 15 & 14 \end{tabular} $$


$\begin{array}{rcll}P_{xx} &=& P(Z_n=0) + P(Z_n = 5) & + P(Z_n =
10)\\ P_{xx} & = & a_0 + a_5 + a_{10} &  x  =  12,\ldots, 16
\\ P_{x,x+1} & = & a_4 + a_9  &  x  =  12,\ldots, 15 \\ P_{x,x-1} &
= & a_1 + a_6 + a_{11} &  x  =  13,\ldots, 16
\\ P_{x,x+2} & = & a_3 + a_8  &  x  =  12,13, 14 \\ P_{x,x-2}
& = & a_2 + a_7 + a_{12} &  x  =  14,15, 16 \\ P_{x,x+3} & = & a_2
+ a_7 + a_{12} &  x  =  12, 13 \\ P_{x,x-3} & = & a_3 + a_8 &
 x  =  15, 16 \\ P_{x,x+4} & = & a_1 + a_6 + a_{11} &  x  =
12 \\ P_{x,x-4} & = & a_4 + a_9  &  x  =  16\\ \\ {\rm Let\ \ }
p_0 & = & a_0 + a_5 + a _{10} \\ p_1 & = & a_4 + a_9 \\ p_2 & = &
a_3 + a_8 \\ p_3 & = & a_2 + a_7 + a_{12}
\\ p_4 & = & a_1 + a_6 + a_{11}
\end{array}$

\bigskip

The transition matrix is $$p = \begin{array}{c} 12 \\ 13 \\ 14 \\
15 \\ 16 \end{array} \left( \begin{array}{ccccc} p_0 & p_1 & p_2 &
p_3 & p_4 \\ p_4 & p_0 & p_1 & p_2 & p_3 \\ p_3 & p_4 & p_0 & p_1
& p_2 \\ p_2 & p_3 & p_4 & p_0 & p_1  \\ p_1 & p_2 & p_3 & p_4 &
p_0 \end{array} \right)$$



All the $p_i$ are positive (non zero) and so the Markov chain is
aperiodic irreducible and finite, and therefore ergodic.  Hence
the equilibrium distribution is also the stationary distribution,
satisfying: $\pi P = \pi$

Now $\pi=(1,1,1,1,1)$ satisfies this, since the column sums for
$P$ are all 1 (as well as the row sums), so the required
probability distribution is $$\pi = \left(\frac{1}{5},
\frac{1}{5}, \frac{1}{5}, \frac{1}{5}, \frac{1}{5} \right)$$


\end{document}
