In a set of $n$ numbers, one of the numbers is 0, and another is 1.

a) What is the smallest possible variance of such a set?

b) What should the set be for this to happen?
Let the numbers be $a_{k}$, where $k=1, \ldots, n$, and the arithmetic mean of all numbers $a$.

The variance $D$ of the set is $1 / n\left((0-a)^{2}+\left(a_{2}-a\right)^{2}+\ldots+\left(a_{n-1}-a\right)^{2}+(1-a)^{2}\right)$. We will split the sum in the numerator into two groups - the first term will be combined with the last, and the second group will include the remaining terms (if any): $\left(a^{2}+(1-a)^{2}\right)+\left(\left(a^{2}-a\right)^{2}+\ldots+\left(a_{n-1}-a\right)^{2}\right)$.

If $n=2$, then the second group is absent. If $n>2$, then, to make this sum as small as possible, we set $a_{2}=a_{3}=\ldots=a_{n-1}=a$. Then

$D=1 / n\left(a^{2}+(1-a)^{2}\right)$

The minimum of the quadratic function $a^{2}+(1-a)^{2}=2 a^{2}-2 a+1=2(a-1 / 2)^{2}+1 / 2$ is $1 / 2$. Under these conditions, the variance is $1 / 2 n$.

## Answer

a) $1 / 2 n ;$ b) all numbers, except the first and last, are equal to $1 / 2$.