# Widgets and boxes problem: expectation and variance. Why is this wrong?

I'm taking the MITx: 6.041x Introduction to Probability - The Science of Uncertainty class to sharpen my probability skills. In one of the problems, the solution I came up with diverged from the correct solution, and I'm not sure why my solution isn't valid. I'd appreciate any insights. The problem is:

Widgets and crates. Widgets are stored in boxes, and then all boxes are assembled in a crate. Let $X$ be the number of widgets in any particular box, and $N$ be the number of boxes in a crate. Assume that $X$ and $N$ are independent integer-valued random variables, with expected value equal to 10, and variance equal to 16. Evaluate the expected value and variance of $T$, where $T$ is the total number of widgets in a crate.

The solution can be found here. My (incorrect) solution is below.

### Finding $E[T]$

I started off thinking that the $T$, the total number of widgets, should be $X \cdot N$. Thus:

$E[T] = E[X \cdot N]$

$= E[X] \cdot E[N]$ (independence)

$= 10 \cdot 10 = 100$

### Finding $var(T)$

I use the equation $var(T) = E[(T - E[T])^2] = E[T^2] - E[T]^2$. Thus:

$var(T) = var(X \cdot N) = E[X^2 \cdot N^2] - E[X \cdot N]^2$

We know $E[X \cdot N]^2 = 100^2$ from earlier.

I believe I can do $E[X^2 \cdot N^2] = E[X^2] \cdot E[N^2]$ due to independence.

$X^2 = var(X) + E[X]^2 = 16 + 10^2 = 116$. This came from a rearrangement of the variance equation above. $N^2$ should be the same.

Thus $E[X^2] \cdot E[N^2] = E[116] \cdot E[116] = 116^2$

Finally $var(T) = 116^2 - 100^2$ ... but this is not the case. What am I missing?

Because $X$ is the number of widgets in a particular box, whereas in your calculations you're treating it as the number of widgets in every box. The number of widgets in a crate is actually $\sum_{i=1}^{N} X_i$, where $X_i$ is the number of widgets in box $i$. The expected number should be