# Two independent Poisson processes (no successive arrivals etc)

Requests for orange juices and lemonades are according to two independent Poisson processes of rates $\lambda,~\mu$ (per minute), accordingly.

(1) What is the probability in the next one minute there are requests only for lemonades?

(2) Given that two requests were made in the last minute, what is the probability the times of request among them were done in less than 1/2 minute?

(3) What is the probability in the next minute no successive requests for the same type of drink are made?

Attempt Let $\{O_t\}, ~\{L_t\}$ the relative PP for oranges and lemonades, respectively.

(1) we get some ($\geq0$) lemonades and no orange juices in the next minute, so:

$$\sum_{k=0}^{\infty}P(L_1=k,~0_1=0)~P(L_1=k,~O_1=0/L_1+O_1=k)= \sum_{k=0}^{\infty}e^{-(\lambda+\mu)}\frac{(\lambda+\mu)^k}{k!}\bigg(\frac{\mu}{\lambda+\mu}\bigg)^k=e^{-\lambda}.$$

(2) Let $S_1,~S_2$ be the (total) times of the first, second arrival of $\{L_t+O_t\}$, respectively, so under our hypothesis they are uniformly distributed on $[0,1]$ and $$P(|S_2-S_1|<1/2)=1-2\times 1/8=3/4.$$

(3) This one i don't know how to approach.

Edit. An approach to (3). No successive arrivals for $O_1,~L_1$ means that we have $k$ total arrivals for some $k=0,1,2,\ldots$, with probability $e^{-(\lambda+\mu)}\frac{(\lambda+\mu)^k}{k!}$ and given the $k$ total arrivals,

$\bullet$ for $k=2m$ even we have a sequence of arrivals $OLOL...OL$, with probability $\bigg(\frac{\lambda}{\lambda+\mu}\bigg)^m\bigg(\frac{\mu}{\lambda+\mu}\bigg)^m$ or a sequence of arrivals $LOLO...LO$, with the same probability,

$\bullet$ for $k=2m+1$ odd we have a sequence of arrivals $OLOL...OLO$, with probability $\bigg(\frac{\lambda}{\lambda+\mu}\bigg)^m\bigg(\frac{\mu}{\lambda+\mu}\bigg)^m\bigg(\frac{\lambda}{\lambda+\mu}\bigg)$ or a sequence of arrivals $LOLO...LOL$, with probability $\bigg(\frac{\lambda}{\lambda+\mu}\bigg)^m\bigg(\frac{\mu}{\lambda+\mu}\bigg)^m\bigg(\frac{\mu}{\lambda+\mu}\bigg)$.

Working the sums, the desired probability is:

$$e^{-(\lambda+\mu)}\bigg(2\cosh(\sqrt{\lambda \mu})+\frac{1}{\sqrt{\lambda \mu}}\sinh(\sqrt{\lambda \mu})\bigg).$$

• 1 should definitely depend on $\mu$. In fact by the independence it seems to me that it is just $P(O_1=0)P(L_1>0)$.
– Ian
Commented Aug 30, 2017 at 19:12
• Also, arrival times for Poisson processes are exponentially distributed.
– Ian
Commented Aug 30, 2017 at 19:14
• 3 can be treated by taking a CTMC on four states. One is "no request has yet been made", one is "the last request was lemonade", one is "the last request was OJ", the last is "there were two successive identical requests at some point so far". The question is, if you start at the first state, what is the probability to be at the fourth state after one time unit.
– Ian
Commented Aug 30, 2017 at 19:17
• I'm actually not sure #3 has a simple answer at all. I ask Matlab to do it symbolically and I get something quite complicated. (As a result of my comment from earlier, the answer is the (1,4) entry of expm([-(a+b) a b 0; 0 -(a+b) b a; 0 a -(a+b) b; 0 0 0 0]))
– Ian
Commented Aug 30, 2017 at 20:30
• If the rates are equal then 3 becomes much simpler, because you can just rescale time so that the rates don't enter into the matrix at all. Then it just comes down to diagonalizing $\begin{bmatrix} -2 & 1 & 1 & 0 \\ 0 & -2 & 1 & 1 \\ 0 & 1 & -2 & 1 \\ 0 & 0 & 0 & 0 \end{bmatrix}$ which is much easier than symbolically diagonalizing. You get the very simple solution $(1-e^{-t})^2$ where $t=\frac{1}{\lambda}=\frac{1}{\mu}$.
– Ian
Commented Aug 31, 2017 at 15:30

Let's call the two variables $X$ and $Y$, to avoid confusions when using the $O$ letter.

The number of events, obeying to a Poisson distribution, over a generic period of time equal to $t$ time units is $$\bbox[lightyellow] { P\left( {X = k;\;t} \right) = {{\left( {\lambda \,t} \right)^{\,k} e^{\, - \lambda \,t} } \over {k!}} } \tag {a}$$ where $\lambda$ is the (average/expected) rate of occurrence in the unit period.

For two independent variables, with rates $\lambda$ and $\mu$ $$\bbox[lightyellow] { P\left( {X = k,Y = j;\;t} \right) = {{\left( {\lambda \,t} \right)^{\,k} e^{\, - \lambda \,t} } \over {k!}}{{\left( {\mu \,t} \right)^{\,j} e^{\, - \mu \,t} } \over {j!}} } \tag {b}$$

So we will have

1) What is the probability that in the next unit time there are only $X$ events ?

a) including no $X$ event $$\bbox[lightyellow] { P\left( {0 \le X,Y = 0;\;t = 1} \right) = 1{{1\,e^{\, - \mu \,1} } \over {0!}} = e^{\, - \mu \,} } \tag {1.a}$$ b) at least one $X$ event $$\bbox[lightyellow] { P\left( {1 \le X,Y = 0;\; t=1} \right) = \left( {1 - e^{\, - \lambda } } \right)e^{\, - \mu \,} } \tag {1.b}$$

2) Given that two events occurred in the last unit time, what is the probability that they occured with a time difference of less than 1/2 unit time ?

• the rate of occurrence of events of any kind ($X$ or $Y$) is of course $\lambda + \mu$;
• the probability that any two events occur in the unit time is $$\bbox[lightyellow] { P\left( {X + Y = 2;\;t=1} \right) = {{\left( {\left( {\lambda + \mu } \right)\,1} \right)^{\,2} e^{\, - \left( {\lambda + \mu } \right)1} } \over {2!}} = {{\left( {\lambda + \mu } \right)^{\,2} e^{\, - \left( {\lambda + \mu } \right)} } \over 2} } \tag {2.a}$$ and in fact \bbox[lightyellow] { \eqalign{ & P\left( {X + Y = 2;\;t=1} \right) = P\left( {0 = X,Y = 2;\;1} \right) + P\left( {1 = X,Y = 1;\;1} \right) + P\left( {2 = X,Y = 0;\;1} \right) = \cr & = {{\lambda ^{\,0} e^{\, - \lambda \,} } \over {0!}}{{\mu ^{\,2} e^{\, - \mu } } \over {2!}} + {{\lambda ^\, e^{\, - \lambda \,} } \over {1!}}{{\mu e^{\, - \mu } } \over {1!}} + {{\lambda ^{\,2} e^{\, - \lambda \,} } \over {2!}}{{\mu ^{\,0} e^{\, - \mu } } \over {1!}} = \cr & = {{\left( {\lambda + \mu } \right)^{\,2} e^{\, - \left( {\lambda + \mu } \right)} } \over 2} \cr} } \tag {2.b}
• the probability that there are no events till time $t$ and that one (the first) event occurs in the interval $t, \, t+dt$ is $$\bbox[lightyellow] { p(\lambda ,\;t)\,dt = P\left( {X = 0;\;t} \right)\lambda \,dt = e^{\, - \lambda \,t} \lambda \,dt } \tag {2.c}$$ and in fact, we have that the probability of having just one event in time $t$ is $$\bbox[lightyellow] { P\left( {X = 1;\;t} \right) = \int_{\tau \, = \,0}^{\;t} {p(\lambda ,\;\tau )\,d\tau \;P\left( {X = 0;\;t - \tau } \right)} = \lambda \,t\,e^{\, - \lambda \,t} } \tag {2.d}$$
• the probability that there is just one event in the period $t$ and that it occurs in the interval $\tau, \, \tau+d\tau$ is $$\bbox[lightyellow] { p_{\,e} (\lambda ,\;\tau ,t)\,d\tau = P\left( {X = 0;\;\tau } \right)\lambda \,d\tau P\left( {X = 0;\;t - \tau } \right) = e^{\, - \lambda \,t} \lambda \,d\tau } \tag {2.e}$$
• the probability that there are only two events $X$, separated by more than $1/2$ unit time will be \bbox[lightyellow] { \eqalign{ & P\left( {X = 2;\;t = 1,\;1/2 < \Delta t \le 1} \right) = \int_{\,\tau \, = \,0}^{\;1/2} {p_{\,e} (\lambda ,\;\tau ,\tau + 1/2)P\left( {X = 1;\;t = 1 - \left( {\tau + 1/2} \right)} \right)\,d\tau } = \cr & = \int_{\,\tau \, = \,0}^{\;1/2} {e^{\, - \lambda \,\left( {\tau + 1/2} \right)} \lambda \;\lambda \,\left( {1/2 - \tau } \right)e^{\, - \lambda \left( {1/2 - \tau } \right)} \,d\tau } = \cr & = \lambda ^{\,2} e^{\, - \lambda } \int_{\,\tau \, = \,0}^{\;1/2} {\,\left( {1/2 - \tau } \right)\,d\tau } = {1 \over 8}\lambda ^{\,2} e^{\, - \lambda } \cr} } \tag {2.f}

• the probability that there will be only one $X$, followed by one $Y$ and separated by more than $1/2$ unit time will be \bbox[lightyellow] { \eqalign{ & P\left( {X = 1,Y = 1;\;t = 1,\;1/2 < \Delta t \le 1} \right) = \cr & = \int_{\,\tau \, = \,0}^{\;1/2} {p_{\,e} (\lambda ,\;\tau ,1)P\left( {Y = 0;\;t = \tau + 1/2} \right)P\left( {Y = 1;\;t = 1 - \left( {\tau + 1/2} \right)} \right)\,d\tau } = \cr & = \int_{\,\tau \, = \,0}^{\;1/2} {e^{\, - \lambda \,} \lambda \;e^{\, - \mu \,\left( {\tau + 1/2} \right)} \mu \,\left( {1/2 - \tau } \right)e^{\, - \mu \left( {1/2 - \tau } \right)} \,d\tau } = \cr & = \lambda \,\mu \,e^{\, - \,\left( {\lambda + \mu } \right)\,} \int_{\,\tau \, = \,0}^{\;1/2} {\;\,\left( {1/2 - \tau } \right)\,d\tau } = {1 \over 8}\lambda \,\mu \,e^{\, - \,\left( {\lambda + \mu } \right)\,} \cr} } \tag {2.g}

Therefore the probability , given that there are two events, that they be separated by more than $1/2$ unit time will be \bbox[lightyellow] { \eqalign{ & P\left( {\left( {X + Y = 2;\;1/2 < \Delta t \le 1} \right)\;|\;\left( {X + Y = 2;\;t = 1} \right)} \right) = \cr & = \sum\limits_{0\, \le \,k\, \le \,2} {{{P\left( {X = k,Y = 2 - k;\;t = 1,\;1/2 < \Delta t \le 1} \right)} \over {P\left( {X + Y = 2;\;t = 1} \right)}}} = \cr & = {1 \over {{{\left( {\lambda + \mu } \right)^{\,2} e^{\, - \left( {\lambda + \mu } \right)} } \over 2}}}\left( \matrix{ P\left( {X = 0;\;t = 1} \right)P\left( {Y = 2;\;t = 1,\;1/2 < \Delta t \le 1} \right) + \hfill \cr + 2P\left( {X = 1,Y = 1;\;t = 1,\;1/2 < \Delta t \le 1} \right) + \hfill \cr + P\left( {Y = 0;\;t = 1} \right)P\left( {X = 2;\;t = 1,\;1/2 < \Delta t \le 1} \right) \hfill \cr} \right) = \cr & = {1 \over {{{\left( {\lambda + \mu } \right)^{\,2} e^{\, - \left( {\lambda + \mu } \right)} } \over 2}}}\left( {e^{\, - \;\lambda } {1 \over 8}\mu ^{\,2} e^{\, - \;\mu } + 2{1 \over 8}\lambda \,\mu \,e^{\, - \;\left( {\lambda + \mu } \right)} + e^{\, - \;\mu } {1 \over 8}\lambda ^{\,2} e^{\, - \;\lambda } } \right) = \cr & = {1 \over 4} \cr} } \tag {2.h}

While the requested probability will therefore be $3/4$,
which is what you already found and eq. (2.e) confirms that times are uniformly distributed.

3) Given that two events occurred in the last unit time, what is the probability in the next unit time no successive event of the same type occur ?

Putting $P$ as the probability of two events occurring in the unit time AND no same type of events in a successive unit time, will give \bbox[lightyellow] { \eqalign{ & P = \cr & P\left( {X = 0,Y = 2;\;t = 1} \right)P\left( {Y = 0;\;t = 1} \right) + \cr & + P\left( {X = 1,Y = 1;\;t = 1} \right)P\left( {X = 0,Y = 0;\;t = 1} \right) + \cr & + P\left( {Y = 0,X = 2;\;t = 1} \right)P\left( {X = 0;\;t = 1} \right) = \cr & = {{\mu ^{\,2} } \over 2}e^{\, - \left( {\lambda + \mu } \right)} e^{\, - \mu } + \lambda \,\mu \,e^{\, - \left( {\lambda + \mu } \right)} e^{\, - \left( {\lambda + \mu } \right)} + {{\lambda ^{\,2} } \over 2}e^{\, - \left( {\lambda + \mu } \right)} e^{\, - \lambda } = \cr & = {1 \over 2}e^{\, - \left( {\lambda + \mu } \right)} \left( {\mu ^{\,2} e^{\, - \mu } + 2\lambda \,\mu \,e^{\, - \left( {\lambda + \mu } \right)} + \lambda ^{\,2} e^{\, - \lambda } } \right) \cr} } \tag {3.a}

So the requested probability is \bbox[lightyellow] { \eqalign{ & {P \over {P\left( {X + Y = 2;\;t = 1} \right)}} = \cr & = {{{1 \over 2}e^{\, - \left( {\lambda + \mu } \right)} \left( {\mu ^{\,2} e^{\, - \mu } + 2\lambda \,\mu \,e^{\, - \left( {\lambda + \mu } \right)} + \lambda ^{\,2} e^{\, - \lambda } } \right)} \over {{1 \over 2}\left( {\lambda + \mu } \right)^{\,2} e^{\, - \left( {\lambda + \mu } \right)} }} = \cr & = {{\mu ^{\,2} e^{\, - \mu } + 2\lambda \,\mu \,e^{\, - \left( {\lambda + \mu } \right)} + \lambda ^{\,2} e^{\, - \lambda } } \over {\left( {\lambda + \mu } \right)^{\,2} }} \cr} } \tag {3.b}

• G Cab, thank you for your post. I agree with (2). Regarding (3), we seek the probability in the next time unit (here, minute) no successive arrivals from X, or Y, exist (no hypothesis on the number of events occurring in the previous unit time, as you posted at the beginning of 3). For example, we don't want something like (X,Y,X,Y,Y,X,Y,..). Commented Sep 9, 2017 at 18:47

Here is a solution to part (1) that exploits the relationship between Poisson and exponential disributions. Some of the rest might also benefit from this point of view.

Let $L$ be the waiting time for the first lemonade order. Then $L \sim \mathsf{EXP}(rate = \mu = 2).$ That is, $F_L(t) = 1 - e^{-\mu t},$ for $t > 0.$ Similarly, let $J$ be the wait for the first orange juice order with $F_J(t) = 1 - e^{-\lambda t},$ for $t > 0.$ Then $$P(L \le 1, J > 1) = P(L \le 1)P(J > 1) = F_L(1)(1-F_J(1)) \\= (1-e^{-\mu t})(e^{-\lambda t}) = e^{-\lambda t} - e^{-(\mu - \lambda)t}.$$

If $\mu = 2$ and $\lambda = 3$, then $P(L \le 1, J > 1) = 0.043.$

In the simulation below of a million realizations, rexp generates random exponential observations, pexp is the exponential CDF, exp is $e$ to a power, and the mean of a logical vector (with T and F values) is its proportion of T's. The simulated answer is accurate to three places.

m = 10^6; a = rexp(m, 2);  j = rexp(m, 3)
mean(a < 1 & j > 1);  exp(-3)-exp(-5);  pexp(1,2)*(1-pexp(1,3))
## 0.042865     # aprx (1) by simulation
## 0.04304912   # exact (1)
## 0.04304912   # exact (1)


Note: If I understand what (2) is asking--and I'm not at all sure of that--then a rough simulated answer is about 0.82 (for my choice of parameters).

• Correctly, just a minor correction: the result is $e^{-\lambda}-e^{-(\lambda+\mu)}$ (we have $t=1$). Commented Aug 31, 2017 at 11:23