# Simultaneous Poisson processes

The arrival of taxis at a taxi stand is Poisson at rate $$\lambda$$ per hour. The arrival of people to the stand is also Poisson but at rate $$\mu$$ per hour.

Taxis do not stop (they leave empty) if another taxi is waiting at the stand, and customers do not stop if another customer is waiting at the stand. This means that the stand is either empty or occupied by a taxi or a customer at any given time.

(a) What's the distribution of time until the stand is occupied?

(b) What's the expected amount of time for the first customer to leave in a taxi?

(c) In the long run, how many customers leave per hour in a taxi?

(d) In the long run, how many taxis leave per hour empty?

This question is really challenging for me because there is so much going on. I know the interarrival for taxi and people is $$\text{Exp}(\lambda)$$ and $$\text{Exp}(\mu)$$. I also know the merged processes is Poisson process with parameter $$\mu + \lambda$$.

(a) I think here you just find the distribution of $$\min(T_1, T_2))$$ where $$T_1$$ and $$T_2$$ are the interarrival times of taxi and person. Is that right?

(b) Would this just be $$E(\max(T_1, T_2))$$? Again, I'm not sure.

I'm truly unsure how to do (b), (c), and (d). I guess that (c) and (d) are limits of some sort but I am really looking for help on these.

Let $$S=\{(0,0),(1,0),(0,1)\}$$ where $$(i,j)$$ denotes the number of people (resp. taxis) waiting. Define $$\{X(t):t\geqslant 0\}$$ by the transition rates $$q_{(i,j),(i',j'))} = \begin{cases} \lambda,& (i,j)=(0,0), (i',j')=(0,1)\\ \mu,& (i,j)=(0,0), (i',j')=(1,0)\\ \lambda,& (i,j) = (i,j)=(1,0), (i',j') = (0,0)\\ \mu,& (i,j) = (i,j)=(0,1), (i',j')=(0,0). \end{cases}$$
For (a) the distribution of time until the stand is occupied is the minimum of a $$\mathrm{Exp}(\lambda)$$ and a $$\mathrm{Exp}(\mu)$$ random variable, which has $$\mathrm{Exp}(\lambda+\mu)$$ distribution.
For (b), the distribution of time until the first customer to leave in a taxi is the maximum of a $$\mathrm{Exp}(\lambda)$$ and a $$\mathrm{Exp}(\mu)$$ random variable, which has distribution function $$F(t) = (1-e^{-\lambda t})(1-e^{-\mu t})$$. Hence the expected time until the first customer to leave in a taxi is \begin{align} \int_0^\infty (1-F(t))\ \mathsf dt &=\int_0^\infty (1 - (1-e^{-\lambda t})(1-e^{-\mu t}))\ \mathsf dt\\ &= \frac{\lambda ^2+\lambda \mu +\mu ^2}{\lambda \mu (\lambda +\mu )}. \end{align}
For (c) and (d) we must compute the stationary distribution of $$X(t)$$. We have the balance equations \begin{align} \mu\pi_{(0,0)} &= \lambda\pi_{(1,0)}\\ \lambda\pi_{(0,0)} &= \mu\pi_{(0,1)} \end{align} from which $$\pi_{(1,0)} = \frac\mu\lambda \pi_{(0,0)}$$ and $$\pi_{(1,0)}=\frac\lambda\mu\pi_{(0,0)}$$. From $$\sum_{(i,j)}\pi_{(i,j)}=1$$ we have $$1 = \pi_{(0,0)}\left(1 + \frac\mu\lambda + \frac\lambda\mu\right) \implies \pi_{(0,0)} = \frac1{1 + \frac\mu\lambda + \frac\lambda\mu} = \frac{\lambda\mu}{\lambda\mu +\lambda+\mu}$$ and hence \begin{align} \pi_{(1,0)} &= \frac\mu\lambda\cdot \frac{\lambda\mu}{\lambda\mu +\lambda+\mu} = \frac{\mu^2}{\lambda\mu +\lambda+\mu}\\ \pi_{(0,1)} &= \frac\lambda\mu\cdot \frac{\lambda\mu}{\lambda\mu +\lambda+\mu} = \frac{\lambda^2}{\lambda\mu +\lambda+\mu}. \end{align}
(c) is the rate at which customers arrive multiplied by the long-run fraction of time that a taxi is waiting, i.e. $$\mu\pi_{(0,1)}$$. (d) is the rate at which taxis arrive multiplied by the long-run fraction of time that a taxi is waiting, i.e. $$\lambda\pi_{(0,1)}$$.