Sum of $N$ uniform random variables where $N$ has geometric distribution

Solution 1:

Assuming that $N,Z_1,Z_2, \ldots$ are independent, the distribution of $X$ is a mixture of Irwin-Hall distributions. Specifically, its CDF is given by $$ \mathsf{P}(X\le x)=\sum_{k\ge 1}\frac{\lambda}{k!}\sum_{i=0}^{\lfloor x\rfloor \wedge k}(-1)^i\binom{k}{i}(x-i)^k (1-\lambda)^{k-1}. $$ Using Wald equations we can compute its mean and variance as follows: $$ \mathsf{E}X=\mathsf{E}Z_1\mathsf{E}N=\frac{1}{2\lambda}, $$ and $$ \mathsf{E}[X-N\mathsf{E}Z_1]^2=\operatorname{Var}(Z_1)\mathsf{E}N=\frac{1}{12\lambda} \Rightarrow \operatorname{Var}(X)=\frac{3-2\lambda}{12\lambda^2}. $$