Standard deviation of the sum of a discrete uniform If I randomly generate a number between 1 and 10.... 10 times, and then total all the numbers, what will the standard deviation of that total be?
I'm pretty sure the mean of the total will be 55.5, but what about the average distance from that mean? 
 A: You're right about the average.
Using the expectation operator $E$, this is a consequence of the linearity of expectation.  If we write $X$ for a random integer between one and ten drawn inclusively and uniformly (this is what the function call random.randint is modeling), then
$$ E(X) = 1 \times 0.1 + 2 \times 0.1 + \cdots + 10 * 0.1 = 5.5 $$
You're asking about the sum of ten draws from $X$, so using the linearity of expectation
$$ E \left( \sum_{i = 1}^{10} X \right) = \sum_{i = 1}^{10} E(X) = 10 E(X) = 5.5 $$
The variance calculation is a little more tricky, but goes through with a standard trick.  For clarity, let's assign each of your ten draws to a different symbol, $X_1, X_2, \ldots, X_{10}$ are the ten draws from $X$.  Now recall that for any two random variables $A$ and $B$
$$ Var(A + B) = Var(A) + Var(B) + 2Cov(A, B) $$
The variance is not linear, its failure to be linear is summarized in the $Cov(A, B)$ term that appears.
In your case, you need to know that when you call random.randint multiple times, the draws you get are independent.  This is really important, the random number generator would be useless if this was not true.  For $A$ and $B$ independent random variables
$$ Cov(A, B) = 0 $$
Again, super important, must be independent or this step probably fails.
Given all this, you can break down the variance
$$ Var \left( \sum_{i = 1}^{10} X_i \right) = \sum_{i=1}^n Var(X_i) + 2 \sum_{i = 1}^n \sum_{j = 1}^n Cov(X_i, X_j) $$
You should play around with that until you convince yourself it's true.  The index manipulation is a little weird until you get used to it.  Anyway, in our situation, the covariance terms are zero, so this reduces to
$$ Var \left( \sum_{i = 1}^{10} X_i \right) = \sum_{i=1}^{10} Var(X_i) $$
But each $X_i$ has the same distribution, so this is really just
$$ Var \left( \sum_{i = 1}^{10} X_i \right) = \sum_{i=1}^n Var(X) = 10 Var(X) $$
And my guess is you can finish it off from here.
