Slope and intercept of linear equation of uniformly distributed variables Consider the random variable $y_M$ which equals the sum of $M$ independently uniformly distributed random variables; i.e., $y_M = x_1 + x_2 +\ldots + x_M$, with the assumption that each of the $x_i$ are independently and uniformly distributed. The variance of the sum equals the sum of the variances of each of the $x_i$. That is, $Var[x_1 + x_2 + \ldots + x_M]$ $= Var[x_1] + Var[x_2] + \ldots + Var[x_M]$. Likewise, $Mean[x_1 + x_2 + \ldots + x_M]$  $= Mean[x_1] + Mean[x_2] + \ldots + Mean[x_M]$.
Given this I need to do the following:


*

*Construct $Y(x_1, x_2 , \ldots, x_M) = a(x_1 + x_2 + \ldots + x_M) + b$.

*Find $a$ (slope) and $b$ (intercept) such that $Y$ has zero mean and unit variance.


This seems to be a transformation technique (of which I'm unaware). Any thoughts on how to approach this problem?
 A: Hint: since $a$ and $b$ are constants, you can compute the mean and variance of $Y$ in terms of $a$, $b$, and what you have already established. That gives two easily-solved equations in two unknowns.
Edit
Now that the answer has been sketched in comments, I will sketch it here for completeness.  The general setting in which this works is one in which $(x_1, x_2, \ldots, x_M)$ has an $M$-variate distribution with finite first and second moments (namely, its expectation $(\mu_i)$ and covariance matrix $\Sigma_{ij}$).  (That is, they do not have to be uniform--indeed they do not have to have a common distribution--and they can be dependent.)  Using the most basic properties of expectation and variance, we compute
$$Var(Y) = Var(a(x_1 + \ldots + x_M) + b) = a^2\sum_{i=1}^M\sum_{j=1}^M \text{Covar}(x_i,x_j) = a^2\sum_{i,j}\Sigma_{ij}$$
and
$$\mathbb{E}[Y] = a(\mu_1 + \mu_2 + \ldots + \mu_M) + b = a\mu + b.$$
We can therefore make the variance equal to unity by setting $a = \left(\sum_{i,j=1}^M\Sigma_{ij}\right)^{-1/2}$ and zero out the mean by setting $b = -a\mu$.  This can always be done provided $Y$ isn't degenerate (that is, constantly equal to a single value, in which case $\sum_{i,j}\Sigma_{ij}=0$).
A special case is when the $x_i$ have a common uniform distribution supported on $[0,1]$ and are independent.  Here, $\mu_i = 1/2$ implies $\mu=M/2$ and $\Sigma_{ij} = (1/{12})\delta_{ij}$ implies $\sum_{i,j}\Sigma_{ij} = M/{12}$, whence $a = \sqrt{12/M}$ and $b = -a\mu$ $=-\sqrt{M/12}$.
