# Probability distribution of Poisson process

Let $X_t$ and $Y_t$ be two independent Poisson process with rate parameter $\lambda_1$ and $\lambda_2$, respectively, measuring the number of customers arriving in stores $1$ and $2$, respectively.

Let $T$ denote the time of arrival of the first customer at store $2$. Then $X_T$ is the number of customers in store $1$ at the time of the first customer arrival at store $2$. Find the probability distribution of $X_T$.

I realized that the problem can be handled by looking at $X_t+Y_t$ whose jump is given to $X_t$ with probability ${\lambda_1\over \lambda_1+\lambda_2}$ and $Y_t$ with probability ${\lambda_2\over\lambda_1+\lambda_2}$.

So I guess the answer is $P(X_T=k)={\lambda_1^k \lambda_2\over (\lambda_1+\lambda_2)^{k+1}}$.

However, I have difficulty formalizing the idea.

$P(X_T=k)=\int_0^\infty P(X_T=k|T=t) P(T=t) \,\mathrm{d} t=\int_0^\infty {(\lambda_1 t)^k\over k!}e^{-\lambda_1t}\lambda_2 e^{-\lambda_2t}\,\mathrm{d} t\neq {\lambda_1^k \lambda_2\over (\lambda_1+\lambda_2)^{k+1}}$.

Now I'm wondering which one is correct, or neither?

-
I don't understand the logic behind your guess. I think the answer derived through integration is right. I'll recommend evaluating the integral and then coming up with an intuition for the answer. –  elexhobby Mar 24 '14 at 5:26
@elexhobby His intuitive method is to first construct a "both stores" poisson process; and from a realization of that construct the $X_t$ and $Y_t$ processes by assigning customers to each in proportionality to their relative rate parameters. Using this construction it's pretty easy to evaluate the probability that $k$ customers went to store 1 before one went to store 2. His intuition is right. –  Kai Sikorski Mar 24 '14 at 21:01
Oh, that is cool. Thanks Kai. And sorry OP if I misguided you. –  elexhobby Mar 24 '14 at 21:04

Integrate[((l1 t)^k)/(Factorial[k]) Exp[-l1 t]*l2*Exp[-l2 t], {t, 0, Infinity}, Assumptions -> {l1 > 0, l2 > 0, k > 0}]