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?
Both your answers are right. You can evaluate the integral using the gamma function: https://en.wikipedia.org/wiki/Gamma_function
The gamma function will cancel the factorial, and you'll get precisely what your other method says. Or if you're lazy like me just evaluate this in Mathematica:
Integrate[((l1 t)^k)/(Factorial[k]) Exp[-l1 t]*l2*Exp[-l2 t], {t, 0, Infinity}, Assumptions -> {l1 > 0, l2 > 0, k > 0}]Actually that intuitive methad is quite clever, haven't seen that before!