# Confused about how to show independent random variable $Y$ has the Poisson distribution with parameter $t\lambda$

Assume there are N independent exponential random variable $$(X_1, X_2,..., X_N)$$ with parameter $$\lambda$$. Fix a real number $$t > 0$$. Let Y be the largest $$N$$ so that $$X_1 + X_2 + \ldots + X_N \leqslant t$$ ($$Y = 0$$ if $$X_1 > t$$). How to show independent random variable $$Y$$ has the Poisson distribution with parameter $$t\lambda$$?

Approach: I want to prove that $$P(Y \geqslant k) = 1 - \sum_{j=1}^{k-1}\frac{e^{-\lambda t}(\lambda t)^k}{k!}$$, in order to do this, I wanted to use $$P(Y\geqslant k) = P(X_1 + X_2 + ... + X_k \leqslant t) = \int_{x_1 =0}^{t} P(X_2 + X_3 + \ldots + X_k \leqslant t - x_1)f_{X_1}(x_1)dx$$. Then I don't know how to keep going from here. please help me...

Let $$S_k:=\sum_{i=1}^k X_i$$ (note that $$S_k\sim \Gamma(k,\lambda^{-1})$$). Then
\begin{align} \mathsf{P}(Y=k)&=\mathsf{P}(S_k\le t, S_k+X_{k+1}>t)=\mathsf{E}[1\{S_k\le t\}\mathsf{P}(X_{k+1}>t-S_k\mid S_k)] \\ &=\mathsf{E}[1\{S_k\le t\}e^{-\lambda(t-S_k)}]=\int_0^t\frac{\lambda^k}{(k-1)!}x^{k-1}e^{-\lambda t}\,dx \\ &=\frac{(\lambda t)^ke^{-\lambda t}}{k!}. \end{align}
• Could you elaborate please? What is $S_k$ or S? What is equality of the first line based on? I don't really follow the step. – Chameleon_7 Mar 21 at 4:58
• This one: $P(Y = k) = P(S_k \le t, S_k + X_(k+1) > t) = E[....]$. Also, I haven't learned gamma function yet... Sorry – Chameleon_7 Mar 21 at 5:37
• The first equality is self-evident: $Y=k$ iff $S_k\le t$ and $S_{k+1}>t$. The second one is the law of iterated expectations: for random variables $X$ and $Y$, $\mathsf{E}[f(X)g(Y)]=\mathsf{E}[f(X)\mathsf{E}[g(Y)\mid X]]$. – d.k.o. Mar 21 at 5:40
• $\Gamma(k,\lambda^{-1})$ is the gamma distribution. – d.k.o. Mar 21 at 5:43