# Why probability value get constant before 1 in a Merged Poisson Process

A Machine receives two kinds of jobs following two Independent Poisson Processes $1$ and $2$ with arrival rates $\lambda_{1}$ and $\lambda_{2}$, respectively. The machine process the jobs in the following way:

1. If the $1^{st}$ job is coming from process $1$, it will have $0$ wait, and process repeats.
2. If the $1^{st}$ job is coming from process $2$, it will either wait for time $T$, OR another job from process $1$ before $T$ expires. Process repeats.

Focusing on Point $2$: What is the probability that $1^{st}$ job of process $2$ is served due to a job coming from process $1$ before $T$ expiry?

My answer is: $$P\ (1\ or \ more \ arrivals \ from\ Process\ 1 \ in [0-T]\ )=1-e^{-\lambda_{1}T}$$

I developed a simulator to check this probability value.

1. When $\lambda_{1} >= \lambda_{2}$, both simulator and above expression results matches, and probability gets $1$ for higher rates.

2. When $\lambda_{1} <$ $\lambda_{2}$, both simulator and the above expression results do not match for higher rates. Surprisingly, simulation results get constant to a value lower than 1, as $\lambda$ increases.

What would be the right expression for calculating this probability in case if $\lambda_{1} <$ $\lambda_{2}$?

• So by point $2$ do you mean the time to serve a job from stream $2$ is $\min\{T, \tau\}$ where $\tau$ is the time until the next job from stream $1$? – Nap D. Lover Nov 2 '17 at 11:53
• Can you show us what your simulation does? – Raskolnikov Nov 2 '17 at 12:21
• Ah, but your comment to LoveTooNap29 changes everything. Of course the probability is not $1-exp{-\lambda_1 T}$ when you add a third condition. On top of that, when you increase the rate of the second process, you augment the chance that 2 will be processed because there are k jobs in wait. – Raskolnikov Nov 3 '17 at 4:36

What you need is $$\mathbb{P}(\tau<\mu)$$

that is, the probability that a job from process 1 arrives before $k$ jobs from process 2 arrive.

The time of arrival for process 1 is indeed exponentially distributed with parameter $\lambda_1$. However the time of arrival of $k$ processes is Erlang distributed, i.e. its density is

$$f_{\lambda_2,k}(t)=\frac{\lambda_2^k t^{k-1}e^{-\lambda_2 t}}{(k-1)!}$$

I worked out the end result, it is:

$$\frac{\Gamma(k;(\lambda_2) T)}{(k-1)!}-\left(\frac{\lambda_2}{\lambda_1+\lambda_2}\right)^k\frac{\Gamma(k;(\lambda_1+\lambda_2) T)}{(k-1)!}$$

in which $\Gamma(\alpha,x)$ is the incomplete Gamma function with parameter $\alpha$.

• Thanks a lot, let me go through it to get the curves. – Hallian1990 Nov 5 '17 at 10:47
• Now that I have been rethinking about the problem: do you need $\mathbb{P}(\tau<\mu)$ or $\mathbb{P}(\tau<\mu|\min(\tau,\mu)<T)$? This makes an important difference. I also think I inadvertantly computed $\mathbb{P}(\tau<\mu \text{ and } \min(\tau,\mu)<T)$ which is still something else. It would help if you showed me the code of your simulation. – Raskolnikov Nov 5 '17 at 10:56
• You asked good point. Since we have three conditions for serving Stream $2$ i.e., due to $T$, $k$ stream 2 arrivals, or one stream $1$ arrival, the probability that, the Stream $2$ get service due to an incoming Stream $1$ arrival means the rest of the two conditions are not fulfilled. This is exactly how simulator conditions work. Therefore, this probability would be $Pr \ (to \ get \ stream \ 1 \ arrival \ before \ 'k' \ stream \ 2 \ arrivals, \ within \ time \ T )$. So, it will be the first expression of your comment, $p(\tau< \mu | min(\tau,\mu)<T)$ – Hallian1990 Nov 5 '17 at 11:15