Suppose that the expected number of accidents per week at an industrial plant is four. Suppose also that the numbers of workers injured in each accident are independent random variables with a common mean of 2. Assume also that the number of workers injured in each accident is independent of the number of accidents that occur. What is the expected number of injuries during a week?
Letting N denote the number of accidents and X_{i} the number injured in the ith accident, i = 1, 2, … , then the total number of injuries can be expressed as \textstyle\sum_{i=1}^{N}X_{i}. Now,
E\left[\sum_{1}^{N}\ X_{i}\right]=E\left[E\!\left[\sum_{1}^{N}\ X_{i}|N\right]\right]But
E\left[\sum_{1}^{N}\ X_{i}|N=n\right]=E\left[\sum_{1}^{n}\ X_{i}|N=n\right]
=E{\left[\sum_{1}^{n}\;X_{i}\right]} by the independence of X_{i} and N
= nE[X]
which yields
E\biggl[\sum_{i=1}^{N}\ X_{i}|N\biggr]=N E[X]and thus
E{\Biggl[}\sum_{i=1}^{N}\;X_{i}{\Biggr]}=E[N E[X]]=E[N]E[X]Therefore, in our example, the expected number of injuries during a week equals 4 × 2 = 8.