NuGenSciMath

NuGenBinomialProbability Methods

The methods of the NuGenBinomialProbability class are listed below. For a complete list of NuGenBinomialProbability class members, see the NuGenBinomialProbability Members topic.

Public Instance Methods

Equals (inherited from Object) Determines whether the specified Object is equal to the current Object.
GetExpectedValue The Expected Value or population mean is defined by E(V) = N*p
GetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetResult (inherited from NuGenProbability) This is the public function that is callable to compute a probability or a cumulative probability. For cumulative probabilities it is assumed that the Random Variables range is at least computable from zero to Y. Optimizations could be made to compute cumulative probabilities faster for events that have a very large number of FINITE trials by taking the shorter of the computable ranges and possibly subtracting from one if necessary. If the probability is set in the constructor then the value won't be undefined and will be immediately returned.
GetType (inherited from Object) Gets the Type of the current instance.
GetVariance the Variance is defined by o^2 = N*p*q
ToString (inherited from Object) Returns a String that represents the current Object.

Protected Instance Methods

ComputeResult Computing the Result. At first the distinction is made that the factorial part of the equation is going to be a large number, possibly outside of the range of an int type and causing overflow. The second part of the equation involves taking the power of two numbers below 1.0 which will yield a very small number and here significant digits may be truncated. We know a probability MUST be between zero and one so the general algorithm is to interleave the computing of the factorial side and the fractional power side of the equation so that the running result never strays far from being between zero and one. There are a couple optimizations for when the number of successes is zero or equal to the number of trials. Also of note is an optimization on the division of the factorial by factorial. All of the digits in either N-Y or Y are reproduced in the numerator. The greatest number of cancellations is made depending on which is bigger, N-Y or Y, thus reducing significantly the number of multiplications.
Finalize (inherited from Object) Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.
SetRV When the base class function, GetResult(), is called, if the probability is cumulative then GetResult will call to set the Random variable then compute the probability and add it to the cumulative total.

See Also

NuGenBinomialProbability Class | Genetibase.MathX Namespace