using System; using System.Collections.Generic; using S = Science.Statistics.BasicStatistics; namespace ScienceTest.StatisticsTest.BasicStatisticsTest { public class ProbabilityTest { public ProbabilityTest() { } private string result; public string Result { get{return result;} } public void Compute() { S.Event fR = new S.Event(); fR.TotalNumberOfOutcomes = 10; fR.NumberOfOutcomes = 6; S.Event sRgf = new S.Event(); sRgf.TotalNumberOfOutcomes = 9; sRgf.NumberOfOutcomes = 5; S.Event B = new S.Event(); B.GivenEvent = sRgf; S.Event fG = new S.Event(); fG.TotalNumberOfOutcomes = 10; fG.NumberOfOutcomes = 4; S.Event sGgf = new S.Event(); sGgf.TotalNumberOfOutcomes = 9; sGgf.NumberOfOutcomes = 3; S.Event C = new S.Event(); C.GivenEvent = sGgf; S.Probability p = S.Probability.And(fR,B); S.Probability q = S.Probability.And(fG,C); result += (p.Value+q.Value).ToString()+"\r\n"; result += (7.0 / 15.0).ToString(); } } } // 0.466666666666667 // 0.466666666666667