using System; using System.Collections.Generic; using System.Linq; using System.Text; using S = Science.Statistics.BasicStatistics; namespace Statistics4Ed.Chapter27.SetA { public class Exercise03 { public Exercise03() { } private string result; public string Result { get{return result;} } public void Compute() { S.BoxModel model = new S.BoxModel(); model.AddTicket(0.0); // tail model.AddTicket(1.0); // head model.NumberOfDraws = 400; S.StandardErrorAndExpectedValue s = new S.StandardErrorAndExpectedValue(model); result += s.ExpectedValueForPercentage.ToString() + " "; result += s.StandardErrorForPercentage.ToString() + "\r\n"; S.BoxModel model2 = new S.BoxModel(); model2.AddTicket(0.0); // tail model2.AddTicket(1.0); // head model2.NumberOfDraws = 100; S.StandardErrorAndExpectedValue s2 = new S.StandardErrorAndExpectedValue(model2); result += s2.ExpectedValueForPercentage.ToString() + " "; result += s2.StandardErrorForPercentage.ToString() + "\r\n"; S.StandardErrorForDifference sed = new S.StandardErrorForDifference(s, s2); result += sed.ExpectedValueForPercentageDifference.ToString() + " "; result += sed.StandardErrorForPercentageDifference.ToString() + "\r\n"; } } } /* 50 2.5 50 5 0 5.59016994374947 */