\documentclass[a4paper,12pt]{article}

\begin{document}

\parindent=0pt

QUESTION

\begin{description}

\item[(a)]
Describe the inverse transform method of generating random
variates from a distribution with given cumulative distribution
function (cdf), $F(x)$. A certain distribution has density
function $$ f(x)=\sigma ^{-1}\exp \Bigl[ -{{x-\mu }\over{\sigma
}}-\exp \Bigl( -{{x-\mu }\over{\sigma }}\Bigr) \Bigr],\qquad
-\infty<x<\infty. $$ By using the substitution $z=\exp( -{{x-\mu
}\over{\sigma }})$ or otherwise, find the cdf of the distribution,
and hence show how to generate random variates from this
distribution.

\item[(b)]
Explain what is meant by an {\it activity cycle} as used in
simulation modelling.

Container lorries (each carrying one container) arrive at a dock
and form a queue to wait to be unloaded by the one crane at the
dock. The operation of unloading, which requires the presence of
both the lorry being unloaded and the crane, takes a fixed time.
Once its container is lifted off, a lorry can leave immediately.
The crane has to spend some time taking the container to the
quayside before it can return to get the next container.

Show that the above system can be simulated using activity cycles
by drawing an activity cycle diagram for the system. Two variables
are to be used to follow and control the progress of activities:
(i) $C,$ an indicator variable showing when the crane is available
to unload lorries, and (ii) $Q,$ the number of lorries waiting to
be unloaded. Indicate carefully in your diagram where the values
of these variable are changed and tested.

\end{description}

ANSWER


\begin{description}

\item[(a)]
Inverse transform method: If $F(x)$ is the cdf of the distribution
then $X=F^{-1}(U)$ where $U\sim U(0,1)$ has distribution with cdf
$F(x)$.

For
$f(x)=\sigma^{-1}\exp\left(-\frac{x-\mu}{\sigma}-\exp\left(-\frac{x-\mu}{\sigma}\right)\right)$
let $z=\exp\left(-\frac{x-\mu}{\sigma}\right)$. Then
$dz=-\frac{1}{\sigma}\exp\left(-\frac{x-\mu}{\sigma}\right)dx$.

Then

\begin{eqnarray*}
\int_{-\infty}^\infty
f(x)\,dx&=&\int_{e^{-\frac{x-\mu}{\sigma}}}^\infty\exp(-z)\,dz\\
&=&-\exp(-z)\Big|_{e^{-\frac{x-\mu}{\sigma}}}^\infty\\
&=&\exp\left(-\exp\left(-\frac{x-\mu}{\sigma}\right)\right)
\end{eqnarray*}

So set
$\exp\left(-\exp\left(-\frac{X-\mu}{\sigma}\right)\right)=U$.
Therefore

$$-\exp\left(-\frac{X-\mu}{\sigma}\right)=\log
U\Rightarrow\frac{X-\mu}{\sigma}=-\log(-\log U)$$

Therefore $X=\mu-\sigma\log[-\log U]$ is the required generator.

\item[(b)]
Activity cycle: The sequence of states that an entity of the
system passes through.

\begin{tabular}{ll}
Active states:&When something is happening od being done to the
entity\\ Dead states:&When an entity is waiting
\end{tabular}

Often, active states are interactive.

DIAGRAM

\end{description}




\end{document}
