\documentclass[a4paper,12pt]{article}

\begin{document}

\parindent=0pt

QUESTION

Assume that admissions to an Intensive Care Unit (ICU) are either
``emergencies'' or ``planned''. Both the emergency and the planned
patients arrive independently at the hospital, according to a
Poisson process with rates 1.23 and 0.37 per day, respectively.
Their length of stay in the ICU follows a negative exponential
distribution with mean 4.17 days. The ICU has 6 beds, and planned
patients are only admitted if there are two or more beds
available. Emergency patients are only turned away if no beds are
available. Patients, planned or emergencies, who are not admitted
to the unit are transferred out of the system to another hospital.


\begin{description}

\item[(i)] Draw the rate diagram for this queuing system.

\item[(ii)]
 Find the average number of beds occupied.

\item[(iii)]
 Find the proportion of emergency patients that
have to be transferred out.

\item[(iv)]
 Find the proportion of planned patients
that have to be transferred out.

\end{description}


ANSWER


Queues

\begin{description}

\item[(i)]\

\setlength{\unitlength}{1cm}
\begin{picture}(14,4)
\multiput(0,2)(2,0){7}{\circle{.5}} \put(0,2){\makebox(0,0){0}}
\put(2,2){\makebox(0,0){1}} \put(4,2){\makebox(0,0){2}}
\put(6,2){\makebox(0,0){3}} \put(8,2){\makebox(0,0){4}}
\put(10,2){\makebox(0,0){5}} \put(12,2){\makebox(0,0){6}}

\put(1,2.3){\oval(2,.3)[t]} \put(1,1.7){\oval(2,.3)[b]}
\put(3,2.3){\oval(2,.3)[t]} \put(3,1.7){\oval(2,.3)[b]}
\put(5,2.3){\oval(2,.3)[t]} \put(5,1.7){\oval(2,.3)[b]}
\put(7,2.3){\oval(2,.3)[t]} \put(7,1.7){\oval(2,.3)[b]}
\put(9,2.3){\oval(2,.3)[t]} \put(9,1.7){\oval(2,.3)[b]}
\put(11,2.3){\oval(2,.3)[t]} \put(11,1.7){\oval(2,.3)[b]}

\multiput(1,2.45)(2,0){6}{\vector(1,0){.3}}
\multiput(1,1.55)(2,0){6}{\vector(-1,0){.3}}

\begin{small}

\put(.1,2.6){$(\lambda_e+\lambda_p)\pi_0$}
\put(2.2,2.6){$(\lambda_e+\lambda_p)\pi_1$}
\put(4.3,2.6){$(\lambda_e+\lambda_p)\pi_2$}
\put(6.4,2.6){$(\lambda_e+\lambda_p)\pi_3$}
\put(8.5,2.6){$(\lambda_e+\lambda_p)\pi_4$}
\put(10.6,2.6){$\lambda_e\pi_5$}

\put(.5,1.2){$\mu\pi_1$} \put(2.5,1){$2\mu\pi_2$}
\put(4.5,1.2){$3\mu\pi_3$} \put(6.5,1){$4\mu\pi_4$}
\put(8.5,1.2){$5\mu\pi_5$} \put(10.5,1){$6\mu\pi_6$}

\end{small}

\end{picture}

[including explanation for variables]

\item[(ii)]
\begin{eqnarray*}
(\lambda_e+\lambda_p)\pi_0&=&\mu\pi_1\\
(\lambda_e+\lambda_p)\pi_1+\mu\pi_1&=&(\lambda_e+\lambda_p)\pi_0+2\mu\pi_2\\
(\lambda_e+\lambda_p)\pi_2+2\mu\pi_2&=&(\lambda_e+\lambda_p)\pi_1+3\mu\pi_3\\
(\lambda_e+\lambda_p)\pi_3+3\mu\pi_3&=&(\lambda_e+\lambda_p)\pi_2+4\mu\pi_4\\
(\lambda_e+\lambda_p)\pi_4+4\mu\pi_4&=&(\lambda_e+\lambda_p)\pi_3+5\mu\pi_5\\
\lambda_e\pi_5+5\mu\pi_5&=&(\lambda_e+\lambda_p)\pi_4+6\mu\pi_6
\end{eqnarray*}

$$\sum_{i=0}^6\pi_i=1$$

Hence
\begin{eqnarray*}
(\lambda_e+\lambda_p)\pi_0&=&\mu\pi_1\\
(\lambda_e+\lambda_p)\pi_1&=&2\mu\pi_2\\
(\lambda_e+\lambda_p)\pi_2&=&3\mu\pi_3\\
(\lambda_e+\lambda_p)\pi_3&=&4\mu\pi_4\\
(\lambda_e+\lambda_p)\pi_4&=&5\mu\pi_5\\
\lambda_e\pi_5&=&6\mu\pi_6\\
\end{eqnarray*}

and therefore,
\begin{eqnarray*}
\pi_1&=&\frac{(\lambda_e+\lambda_p)}{\mu}\pi_0\\
\pi_2&=&\frac{(\lambda_e+\lambda_p)}{2\mu}\pi_1\\
\pi_3&=&\frac{(\lambda_e+\lambda_p)}{3\mu}\pi_2\\
\pi_4&=&\frac{(\lambda_e+\lambda_p)}{4\mu}\pi_3\\
\pi_5&=&\frac{(\lambda_e+\lambda_p)}{5\mu}\pi_4\\
\pi_6&=&\frac{\lambda_e}{6\mu}\pi_5\\
\end{eqnarray*}

As $\lambda_e=1.23$/day, $\lambda_p=0.37/$day and
$\mu=\frac{1}{4.17}=0.24$/day we have

$$\pi_i=\frac{1.6^i}{i!0.24^i}\pi_0=\left(\frac{1.6}{2.4}\right)^i\frac{\pi_0}{i!};\
i=1\ldots5$$

$$\pi_6=\frac{1.23\times1.6^5}{6!0.24^6}\pi_0$$

Using $\sum_{0}^6\pi_i=1$ we have
\begin{eqnarray*}
\pi_0&=&0.00274\\ \pi_1&=&0.018\\ \pi_2&=&0.061\\ \pi_3&=&0.135\\
\pi_4&=&0.225\\ \pi_5&=&0.301\\ \pi)6&=&0.257
\end{eqnarray*}

The average number of beds occupied is
$$0.\pi_0+1.\pi_1+2.\pi_2+3.\pi_3+\ldots+6.\pi_6=4.49$$

\item[(iii)]
$\pi_6=25.7\%$

\item[(iv)]
$\pi_5+\pi_6=55.7\%$

\end{description}




\end{document}
