Generating a series with mean=0 and variance=1

130 Views Asked by At

Assume that we want to generate a set of numbers (integer values) having mean=0 and variance=1. Size of this set is even and elements are symmetric which means that half of them are negative values and the other half are positive with the same values (e.g {-2,-1,1,2}). Base on the symmetrical property, the mean of this set is always zero. How can we choose the values such that the variance of this set equals to 1, only by knowing the size of the set? Is there a mathematical way to do this?

1

There are 1 best solutions below

8
On

Let us break this down $$ \mathbb{E}(X) = \frac{1}{N}\sum_{k=0}^Nx_k $$ So the mean is (relatively) easy as we just require $$ \sum_{k=0}^Nx_k = 0 $$ Then the variance is $$ \mathbb{V}(X) = \frac{1}{N}\sum_{k=0}^N\left(x_k-\mathbb{E}(X)\right)^2 $$ or $$ \mathbb{V}(X) = \frac{1}{N}\sum_{k=0}^N x_k^2 -\mathbb{E}^2(X) $$ Then if all things being considered is $$ \mathbb{V}(X) = \frac{1}{N}\sum_{k=0}^N x_k^2 - 0 $$ so the two constraints are $$ \sum_{k=0}^N x_k = 0\\ \sum_{k=0}^N x_k^2 = N $$ This may or may not be easy.