using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Science.Statistics.BasicStatistics { public class SimpleRandomSample { public SimpleRandomSample(BoxModel model) { ss = model.NumberOfDraws; int sum = 0; for(int i = 0 ; i < model.NumberOfTickets.Count; i++) sum += model.NumberOfTickets[i]; ps = sum; cf = Math.Sqrt((double)(ps - ss) / (double)(ps - 1)); StandardErrorAndExpectedValue sewr = new StandardErrorAndExpectedValue(model); se = sewr.StandardErrorForSum * cf; sp = sewr.StandardErrorForPercentage * cf; } private int ss; public int SampleSize { get { return ss; } set { ss = value; } } private int ps; public int PopulationSize { get { return ps; } set { ps = value; } } private double cf; public double CorrectionFactor { get { return cf; } set { cf = value; } } private double se; public double StandardErrorForSumWithoutReplacement { get { return se; } set { se = value; } } private double sp; public double StandardErrorForPercentageWithoutReplacement { get { return sp; } set { sp = value; } } } }