Occurrences of two independent Poisson processes I am trying to prove the result that exactly k occurrences of a Poisson process before the first occurrence of another independent Poisson process is a geometric random variable.
$$P(k\text{ events of type }\lambda_1 \text{before first event of type }\lambda_2)P(\text{the next event is of type }\lambda_2)$$ 
$$=\left( \int_0^\infty e^{-\lambda_1t}\frac{(\lambda_1t)^k}{k!}e^{-\lambda_2t}dt\right) (\frac{\lambda_2}{\lambda_1+\lambda_2})$$
$$= \frac{\lambda_1^{k}\lambda_2}{k!(\lambda_1+\lambda_2)} \int_0^\infty t^ke^{-(\lambda_1+\lambda_2)t}dt$$
$$=\frac{\lambda_1^{k}\lambda_2}{k!(\lambda_1+\lambda_2)} . \frac{\Gamma(k+1)}{(\lambda_1+\lambda_2)^{k+1}}$$
$$= \frac{\lambda_1^{k}\lambda_2}{(\lambda_1+\lambda_2)^{k+2}}$$
I cannot figure out why I am having an extra $(\lambda_1+\lambda_2)$ term in the denominator. Can someone please point out where I am going wrong?
Thanks!
 A: You are getting an extra $\lambda_1+\lambda_2$ in the denominator because the integrand in your first expression is incorrect and you are including an extra
$(\lambda_1+\lambda_2)^{-1}$ (outside the integral) in your formula.
Let $Y$ denote the number of arrivals of type 1 that occur before the first
arrival of type 2.  Thus $Y$ is a discrete random variable taking on values
$0,1,2,,\ldots$. 
Let $Z$ denote the time of the first arrival of type 2. Thus,
$Z$ is an exponential random variable with parameter $\lambda_2$.
Now, consider the (conditional) probability that there are exactly $k$ arrivals of type 1 during $(0,t)$ given that the first arrival of type 2 
occurred at $t$. In other words, we are asking for $P\{Y=k\mid Z = t\}$
This is the the same as the unconditional probability of exactly $k$ arrivals of type 1 during $(0,t)$, which is, as you correctly point out in your comment, just 
$e^{-\lambda_1 t}\frac{(\lambda_1t)^k}{k!}$. Thus, we have found that
$$P\{Y=k\mid Z = t\} = e^{-\lambda_1 t}\frac{(\lambda_1t)^k}{k!}.$$
To find $P\{Y = k\}$, the unconditional probability that exactly $k$ arrivals of type 1 occurred before the first arrival of type 2, we multiply
$e^{-\lambda_1 t}\frac{\lambda_1^k}{k!}$ by the density of $Z$ and integrate.
This gives
$$P\{Y = k\} = \int_0^\infty e^{-\lambda_1 t}\frac{(\lambda_1t)^k}{k!}\cdot
\lambda_2 e^{-\lambda_2 t}\,\mathrm dt\tag{1}$$
which evaluates to 
$\displaystyle \left(\frac{\lambda_1}{\lambda_1+\lambda_2}\right)^k
\cdot \frac{\lambda_2}{\lambda_1+\lambda_2} 
= \frac{\lambda_1^k\lambda_2}{\left(\lambda_1+\lambda_2\right)^{k+1}}$
showing that $Y$ is a geometric random variable with parameter
$\displaystyle \frac{\lambda_2}{\lambda_1+\lambda_2}.$
If you compare $(1)$ with your 
$\displaystyle \left( \int_0^\infty e^{-\lambda_1t}\frac{(\lambda_1t)^k}{k!}e^{-\lambda_2t}dt\right) \left(\frac{\lambda_2}{\lambda_1+\lambda_2}\right)$, you
will see that you are missing a $\lambda_2$ in the integrand but have an
extraneous $\displaystyle \frac{\lambda_2}{\lambda_1+\lambda_2}$,
the net result of which is that you are getting an extra 
$(\lambda_1+\lambda_2)^{-1}$ in your answer.
A: The probabilty that an event of type 1 occurs before a type 2 event is simply $\frac{\lambda_1}{\lambda_1+\lambda_2}$ and similarly probability that a type 2 event occurs before a type 1 event is $\frac{\lambda_2}{\lambda_1+\lambda_2}$. since they both have interarrival times $X_1$ and $X_2$ exponentially distributed with rates $\lambda_1$ and $\lambda_2$ it is not hard to come up with that probabilties($P(X_1<X_2)$).
We want exactly k type 1 occurences and 1 type 2 afterwards
That is $(\frac{\lambda_1}{\lambda_1+\lambda_2})^k*\frac{\lambda_2}{\lambda_1+\lambda_2}$
