Salesmen in a supermarket Poisson We have a supermarket in which customer enter at Poisson rate 2. There are two salesmen near the door who offer passing customers samples of a new product. Each customer takes an exponential time time of parameter 1 to think about the new product and during this time occupies the full attention of the salesmen. Having tried the product customers proceed into the door and leave by another door. When bozh salesmen are occupied, customers walk straight in. Assuminh that both salesmen are free at time 0, whats the prob. that  both are busy at time t.
I do not know how to start here, a friend told me I should take a look at the transition matrix $
\begin{pmatrix}
-2 & 2 & 0 \\
-1 & -3 & 2 \\
0 & 2 & -2 \\
\end{pmatrix}
$ 
but where does this come from?
 A: One already knows that the Q-matrix $
\begin{pmatrix}
-2 & 2 & 0 \\
\color{red}{\bf +}1 & -3 & 2 \\
0 & 2 & -2 \\
\end{pmatrix}
$ 
summarizes the transition rates between the states [$0$ salesman occupied], [$1$ salesman occupied] and [$2$ salesmen occupied]. Let $p_i(t)$ denote the probability that $i$ salesmen are occupied at time $t$. Then $p_0(0)=1$, $p_1(0)=p_2(0)=0$, and
$$
p'_0=-2p_0+p_1,\quad p'_1=2p_0-3p_1+2p_2,\quad p'_2=-2p_2+2p_1.
$$
Thus, $(2p_0-p_2)'=-2(2p_0-p_2)$, that is, using the initial condition $(2p_0-p_2)(0)=2$, $p_2=2p_0-2e_2$ where $e_2(t)=\mathrm e^{-2t}$ for every $t$. On the other hand, $p_1=1-p_0-p_2=1-3p_0+2e_2$ hence the formula for $p'_0$ above reads
$$
p'_0+5p_0=1+2e_2.
$$
Integrating this and using the initial condition $p_0(0)=1$, one sees that
$$
p_0(t)=\tfrac15+\tfrac23\mathrm e^{-2t}+\tfrac2{15}\mathrm e^{-5t}.
$$
and finally the desired probability $p_2=2p_0-2e_2$ is
$$
p_2(t)=\tfrac25-\tfrac23\mathrm e^{-2t}+\tfrac4{15}\mathrm e^{-5t}.
$$
One recovers the limits $p_0(t)\to\tfrac15$ and $p_2(t)\to\tfrac25$ when $t\to\infty$ hence $p_1(t)=1-p_0(t)-p_2(t)\to\frac25$.
At the other end of the time span, when $t\to0$,
$$
p_2(t)\sim2t^2.
$$
A: Think of the system as a Markov chain with three states -- $S_0$ (no customers), $S_1$ (one customer), and $S_2$ (two customers). Think of splitting up time into very small chunks, of size $\delta$ (because $\delta$ is very small we can safely ignore $\delta^2$ terms in this analysis).
If we are in state $S_0$, then the probability some customer arrives this time period is $2\delta$. Therefore we transition to $S_1$ with probability $2\delta$ and stay in $S_0$ with probability $1-2\delta$. 
If we are in state $S_1$, then the probability our customer leaves is $\delta$, and the probability a new customer arrives is $2\delta$. As a result, we transition to $S_0$ with probability $\delta$, transition to $S_2$ with probability $2\delta$, and stay in $S_1$ with probability $1-3\delta$.
If we are in state $S_2$, then the probability one of our two customers leaves is $2\delta$, and we will ignore all arriving customers. Therefore, we transition to $S_1$ with probability $2\delta$ and stay in $S_2$ with probability $1-2\delta$.
At time $t$, we have taken $t/\delta$ time steps, each time applying our transition matrix
$T = \left( \begin{array}{ccc}
1-2\delta & \delta & 0 \\
2\delta & 1-3\delta & 2\delta \\
0 & 2\delta & 1-2\delta \end{array} \right)$.
Since we started with no customers, the probability distribution of the number of customers at time $t$ is $T^{t/\delta} \left(\begin{array}{c} 1\\0\\0\end{array}\right)$.
For small $t$ (in queuing terminology this is called the "transient" stage of the queue), the only way I know to compute the state distribution is to actually evaluate this expression with a small $\delta$. For instance, for $t=1$ we have state distribution $(0.827, 0.157, 0.016)$; at $t=2$ we have distribution $(0.696, 0.253, 0.051)$; at $t=10$ we have distribution $(0.291, 0.397, 0.312)$; at $t=25$ we have distribution $(0.204, 0.400, 0.396)$; and at $t=100$ we have distribution $(0.2, 0.4, 0.4)$. 
Here's a plot of the probability of both being occupied:

For large $t$, we have entered a regime of steady state -- we have overcome the effect of the initial state (having 0 customers), and the state distribution for any large $t$ value will be roughly $(0.2, 0.4, 0.4)$. We can analytically analyze this steady state distribution, which we will define to be distribution $p$, by requiring $p = Tp$, aka the state distribution after applying our transition matrix is equal to the state distribution before.
Solving this system, we get equations 
$p_1 = (1-2\delta) p_1 + \delta p_2 \\
p_2 = 2\delta p_1 + (1-3\delta)p_2 + 2\delta p_3 \\
p_3 = 2\delta p_2 + (1-2\delta)p_3 \\
p_1 + p_2 + p_3 = 1$
Solving, we obtain $p = (\frac{1}{5}, \frac{2}{5}, \frac{2}{5})$ to be the steady-state distribution.
