A and B are exponentially distributed with parameter $\alpha$ and $\beta$.
A and B race with each other continuously. $N_b$ denotes the number of times B wins before A wins single time. Find $P (N_b = n )$ for $n \geq 0$.
Any hint or help is highly appreciated.
Suppose:
Then the desired probability is $$\Pr[N_B(A_1) = n] = \Pr\left[\sum_{i=1}^n B_i \le A_1 < \sum_{i=1}^{n+1} B_i\right].$$
However, it is easier to regard the above as a Poisson process. Interarrival times are exponentially distributed and have independent increments. The random variable $N_B(t)$ is Poisson with rate parameter $\lambda = \beta t$; i.e., $$\Pr[N_B(t) = n] = e^{-\beta t} \frac{(\beta t)^n}{n!}, \quad n = 0, 1, 2, \ldots,$$ hence $$\Pr[N_B(A_1) = n] = \int_{a = 0}^\infty \Pr[N_B(a) = n] f_{A_1}(a) \, da.$$ We then easily find $$\Pr[N_B(t) = n] = \int_{a=0}^\infty e^{-\beta a} \frac{(\beta a)^n}{n!} \alpha e^{-a \alpha} \, da = \frac{\alpha \beta^n}{(\alpha+\beta)^{n+1}} \int_{a=0}^\infty \frac{(\alpha+\beta)^{n+1} a^n e^{-(\alpha+\beta)a}}{\Gamma(n+1)} \, da$$ and since the last integral is that of a gamma density with shape $n+1$ and rate $\alpha + \beta$, we have $$\Pr[N_B(A_1) = n] = \frac{\alpha \beta^n}{(\alpha+\beta)^{n+1}} = (1-p)^n p,$$ where $p = \alpha/(\alpha+\beta)$ is the probability that A wins the first race before B. Note that we also could have used the memorylessness property of the exponential distribution: if $B$ completes a race, then the time that it takes for $B$ to complete the next one is equivalent to the time that it would have taken had $B$ not completed the previous race--i.e., each time $B$ completes and $A$ has not, the situation reverts to that when both had just started the race. This is why we can intuitively reason that the desired probability distribution is a geometric random variable: the probability that B completes exactly $n$ races is equal to the probability that we observe $n$ "failures" followed by one "success" in a series of independent Bernoulli trials with probability of success $p = \beta/(\alpha + \beta)$.