The probability that an event with exponential distribution will happen before an event with a Poisson distribution I have two variables depicting arrival. One (lets call it $A$) has a Poisson distribution, so the probability of $n$ elements arriving in time period $\tau$ is: $P_n(\tau)=\frac{\left(\lambda t\right)^ne^{-\lambda t}}{n!}$.
One (lets call it $B$) has an exponential distribution, so the probability of an element arriving in under time $\tau$ is $P(t)=1-e^{-\mu t}$.
$A$ and $B$ are unrelated/independent.
I'm asked what is the probability that an element from group $B$ will arrive before an element before group $A$.
The correct answer is given as $\frac{\mu}{\mu+\lambda}$
What I did is:
$$\int_0^{\infty}P\left( T_B<t\right)\cdot P^A_0(t)dt=\int_0^{\infty}\left( 1-e^{-\mu t}\right)\cdot e^{-\lambda t}dt=\int_0^{\infty}e^{-\lambda t}-e^{-(\lambda +\mu) t}dt=\frac{1}{\lambda}-\frac{1}{\mu + \lambda}=\frac{\mu}{\lambda (\mu + \lambda)}$$
Explanation: I tried to calculate the probability that $B$ arrives before time $t$ and that during that time 0 elements of $A$ arrive.
Where is my mistake?
 A: Perhaps this is more intuitive:
Consider time epochs of $\delta$ seconds each, for small $\delta$. 
Let the probability of an "A" event occurring in an epoch to be $p_A$; 
similarly for a "B" event. 
In your situation, $p_A = \lambda \delta \exp(-\lambda \delta)$ 
and $p_B = 1- \exp(- \mu \delta)$. 
Let $q_A$ and $q_B$ be the complementary probabilities that an event does not occur in an epoch.
Then the probability that a "B" event occurs before an "A" event is
$$q_A p_B + (q_A q_B) q_A p_B + (q_A q_B)^2 q_A p_B + \cdots 
= \frac{q_A p_B}{1 - q_A q_B} = \frac{q_A p_B}{p_A + p_B - p_A p_B}.$$
Now $p_A = \lambda \delta + O(\delta^2)$ and $p_B = \mu \delta + O(\delta^2)$, so the desired probability is 
$$\frac{\mu \delta + O(\delta^2)}{\lambda \delta + \mu \delta + O(\delta^2)} = \frac{\mu}{\lambda  + \mu} + O(\delta).$$
A: In fact, both $A$ and $B$ correspond to a homogeneous Poisson point process with rates $\lambda$ and $\mu$, respectively. For $A$ you were given the distribution of time between consecutive events (exponential distribution), while for $B$ you were given the distribution of number of events in a given time interval (Poisson distribution).
The expected number of $B$ events occurring within any time interval $t$ is $t\mu$, and the expected total (from $A$ and $B$) is $t(\mu + \lambda)$. Since these events are uniformly distributed over time, the probability that the first event is from $B$ is simply $\mu/(\mu + \lambda)$, the expected proportion of $B$ events.
A: My mistake was that I took the cumulative distribution function for $B$ instead of the probability density function ($f(t)=\mu e^{-\mu t}$). Which as @Shreevatsar explains causes to over count. With the correct function the result is:
$$\int_0^{\infty}f_B\left(t\right)\cdot P^A_0(t)dt=\int_0^{\infty}\mu e^{-\mu t}\cdot e^{-\lambda t}dt=\int_0^{\infty}\mu e^{-(\mu +\lambda)t}=\frac{\mu}{\mu + \lambda}$$
