using System; using System.Collections.Generic; using System.Linq; using System.Text; using S = Science.Statistics.BasicStatistics; namespace Statistics4Ed.Chapter20.SetB { public class Exercise02 { public Exercise02() { } private string result; public string Result { get{return result;} } public void Compute() { S.BoxModel model = new S.BoxModel(); model.AddTicket(0.0, 18000); model.AddTicket(1.0, 12000); // older than 25 model.NumberOfDraws = 1000; S.StandardErrorAndExpectedValue s = new S.StandardErrorAndExpectedValue(model); result += s.ExpectedValueForPercentage.ToString() + " "; result += s.StandardErrorForPercentage.ToString() + "\r\n"; S.NormalCurve nc = new S.NormalCurve(); double su = (39.0 - s.ExpectedValueForPercentage) / s.StandardErrorForPercentage; double area = nc.AreaBetween(su, -su); result += area.ToString(); } } } /* 40 1.54919333848297 48.1394983571466 */