protected void Compute(int positive, int total, OneSampleHypothesis alternate)
{
this.Hypothesis = alternate;
// The underlying test is to check whether the probability
// value from the samples are higher than or lesser than 0.5,
// thus the actual Binomial test hypothesis is inverted:
OneSampleHypothesis binomialHypothesis;
switch (alternate)
{
case OneSampleHypothesis.ValueIsDifferentFromHypothesis:
binomialHypothesis = OneSampleHypothesis.ValueIsDifferentFromHypothesis; break;
case OneSampleHypothesis.ValueIsGreaterThanHypothesis:
binomialHypothesis = OneSampleHypothesis.ValueIsSmallerThanHypothesis; break;
case OneSampleHypothesis.ValueIsSmallerThanHypothesis:
binomialHypothesis = OneSampleHypothesis.ValueIsGreaterThanHypothesis; break;
default: throw new InvalidOperationException();
}
base.Compute(positive, total, 0.5, binomialHypothesis);
}