# how to calculate $P(X_{1}+\cdots+X_{k}\leq x_{0}<X_{1}+\cdots+X_{k+1})$

suppose that $X_{1},\cdots, X_{k+1}$ are i.i.d. random variables obeying the exponential distribution. My question is how to calculate $P(X_{1}+\cdots+X_{k}\leq x_{0}<X_{1}+\cdots+X_{k+1})$, where $x_{0}$ is a positive number.

-
I have already found the answer, thank you for all your sincere help – Jim Jun 21 '11 at 6:06
I see you have now accepted an answer to your two other questions. Congratulations for this very good move, showing your appreciation for the time and the effort of the people who answer your questions. – Did Jun 21 '11 at 7:32

Let $a$ denote the parameter of the exponential random variables. The maximal index $k$ such that $X_1+\cdots+X_k\le x_0$ is the value at time $x_0$ of a Poisson process of intensity $a$, see here. Hence the probability of the event you are interested in is also the probability that a Poisson random variable of parameter $ax_0$ is $k$, which is $$\mathrm{e}^{-ax_0}\frac{(ax_0)^k}{k!}.$$

-

The sum of $k$ i.i.d. exponential r.v.'s is an Erlang r.v. of shape $k$, say $Y_k$. Let's consider all possible values of $Y_k$ from 0 to $x_0$:

$\mathrm P ( Y_k \leq x_0 < Y_k + X_{k+1} ) = \mathrm \int_0^{x_0} \mathrm P( x_0 < t+X_{k+1} ) f_{Y_k}(t) \mathrm d t$

-

The sum of $k$ i.i.d exponential random variables is a gamma distribution with cdf $$F(x) = 1-e^{\lambda x} \sum_{k=0}^{r-1} \frac{(\lambda x)^{k}}{k!}$$

-