Class BinomialDistribution represents the discrete probability distribution of obtaining exactly n successes in N trials where the probability of success on each trial is p. For example, this code constructs an BinomialDistribution:
int n = 20; double p = 0.25; BinomialDistribution bin = new BinomialDistribution( n, p );
The default constructor creates an BinomialDistribution with
and
:
BinomialDistribution bin = new BinomialDistribution();
The provided N and P properties can be used to get and set the number of trials and the probability of success on each trial after construction:
bin.N = 75; bin.P = 0.02;
Once you have constructed an BinomialDistribution object, you can query it for the PDF, CDF, inverse CDF, and random variable moments, as described in Section 5.1.
TOC | Previous | Next | Index