Given $n$ numbers $a_1<a_2<...<a_n$ how would we find a $m$-element subset ($m \leq n$), with the smallest variance? If I knew what the optimal mean for the smallest variance is I could just greedily choose numbers closest to the mean, but how would I find this mean?
I thought about it this way: each mean has to fall between some element of the sequence so we check if we can find $m$ elements closest to $(a_i+a_{i+1})/2$ for $i \in \{1,...,n-1\}$, if we do this sequentially, then we would find our optimal mean.
But that's obviously wrong, can someone point me in the right direction?