Func
<
List
<
double
>
,
double
>
variance
=
numbers
=>
(from n in numbers select Math.Pow((n - numbers.Sum() / numbers.Count), 2)).Sum() / numbers.Count;
Console.Write(variance(new List<double> { 1, 2, 5, 6 }));