# Geometric sum of exponential random variables

Here’s an interesting result: Let ${N\sim\mathrm{Geo}(p)}$, i.e. ${\mathbb P(N=n) = p(1-p)^{n-1}, n=1,2,3,\ldots}$ and assume that ${X}$ is a continuous random variable such that ${X\mid N}$ follows ${\mathrm{Erlang}(N,\lambda)}$ distribution. What is the distribution of ${X}$?

For ${x>0}$ we have

\displaystyle \begin{aligned} f_X(x) &= \sum_{n=1}^\infty f_{X\mid N=n}(x)\\ &= \sum_{n=1}^\infty p(1-p)^{n-1}\frac{(\lambda x)^{n-1}}{(n-1)!}\lambda e^{-\lambda x}\\ &= \lambda p e^{-\lambda x} \sum_{n=1}^\infty \frac{((1-p)\lambda x)^{n-1}}{(n-1)!}\\ &= \lambda p e^{-\lambda x}e^{(1-p)\lambda x}\\ &= \lambda p e^{-\lambda p x}, \end{aligned}

so that ${X\sim\mathrm{Exp}(\lambda p)}$.

Note that if ${\{N(t):t\geqslant 0\}}$ is a Poisson process with intensity ${\lambda}$ and ${\{X_n : n=1,2,3,\ldots \}}$ is a Bernoulli process with parameter ${p}$, then we can consider the split processes ${\{N_p(t):t\geqslant0\}}$, ${\{N_{1-p}(t):t\geqslant 0 \}}$, where ${\{T_n\}}$ are the arrival times of the original process, and ${N_p(t)}$ is the number of arrivals in ${(0,t]}$ with ${B_n=1}$, ${N_{1-p}(t)}$ the number of arrivals in ${(0,t]}$ with ${B_n=0}$. It is well-known that ${N_p(t)}$ and ${N_{1-p}(t)}$ are independent Poisson processes with intensity ${\lambda p}$ and ${\lambda(1-p)}$, respectively. So ${X}$ is the interarrival distribution of ${N_p(t)}$.