Let $S_{n}$ denote the time of the $n$ th event of the Poisson process $[N(t), t \geqslant 0\}$ having rate $\lambda$. Show, for an arbitrary function $g$, that the random variable $\sum_{i=1}^{N(t)} g\left(S_{i}\right)$ has the same distribution as the compound Poisson random variable $\sum_{i=1}^{N(t)} g\left(U_{i}\right)$, where $U_{1}, U_{2}, \ldots$ is a sequence of independent and identically distributed uniform $(0, t)$ random variables that is independent of $N$, a Poisson random variable with mean $\lambda t$. Consequently, conclude that
$$
E\left[\sum_{i=1}^{N(t)} g\left(S_{i}\right)\right]=\lambda \int_{0}^{t} g(x) d x \quad \operatorname{Var}\left(\sum_{i=1}^{N(t)} g\left(S_{i}\right)\right)=\lambda \int_{0}^{t} g^{2}(x) d x
$$