Consider a Poisson process with rate $\lambda$. Each time this process triggers, we flip a coin. Let X be the time at which the second head is flipped. Describe the random variable X, by giving its density function and cumulative distribution function.
If we flip this coin n times, and p be the probability when head will come. $P(X=2)= \sum P(X=2|N=n)$.I am not sure how to do this question. Can anyone suggest me how to solve this question?
Let $\{N(t):t\geqslant0\}$ be the Poisson process and define $T_0 = 0$, $$ T_{n+1} = \inf\{t>T_n : N(t) = N(T_n)+1\}. $$ (The sequence $\{T_n\}$ are the "jumps" of the Poisson process.) One may show by induction that the density of $T_n$ is $$ f_n(t) = \frac{\lambda(\lambda t)^n}{(n-1)!} e^{-\lambda t}, \ t>0. $$ (This is known as the Erlang distribution.) Now, let $\{X_n:n=1,2,\ldots\}$ be an i.i.d. sequence of Bernoulli random variables with parameter $p$, and $\tau=\inf\{n>0:X_n=1\}$. Then the density of $T_\tau$ may be computed by conditioning on $\tau$: \begin{align} f_\tau(t) &= \sum_{n=1}^\infty f_{n\mid\tau = n}(t\mid \tau)\mathbb P(\tau = n)\\ &= \sum_{n=1}^\infty \frac{\lambda(\lambda t)^{n-1}}{(n-1)!} e^{-\lambda t} (1-p)^{n-1} p\\ &= \lambda p e^{-\lambda pt}, \end{align} in other words, $T_\tau$ is exponentially distributed with parameter $\lambda p$. Now, $X$ is simply the sum of two independent copies of $T_\tau$, and so has Erlang distribution with parameters $n$ and $\lambda p$, that is, $$ f_X(t) = \lambda p(\lambda p t)e^{-\lambda p t},\ t>0. $$