public Result(Measurement[] measurements) { Name = measurements[0].Name; Unit = measurements[0].Unit; double total = measurements.Sum(m=>m.Result); Average = total / measurements.Length; double variance = measurements.Sum(m => { double dist = m.Result - Average; return dist * dist; }); variance /= (measurements.Length - 1); StandardDeviation = Math.Sqrt(variance); }