I have forgotten

• https://me.yahoo.com
COST (GBP)
2.81
0.00
0

# PDF

viewed 2264 times and licensed 45 times
Evaluates the binomial distribution probability density function.
Controller: CodeCogs
Contents

C++
Excel

## PDF

 doublePDF( double p int s int n )
The binomial distribution gives the discrete probability distribution

of obtaining exactly s successes out of n Bernoulli trials (where the result of each Bernoulli trial is true with probability p and false with probability <em>1-p</em>). The binomial distribution is therefore given by:


## References:

MathWorld, http://mathworld.wolfram.com/BinomialDistribution.html

### Example 1

#include<iostream>
#include<codecogs/stats/dists/discrete/binomial/pdf.h>
int main()
{
std::cout << "binomial PDF: " << Stats::Dists::Discrete::Binomial::PDF(0.3,5,2) << std::endl;
return 0;
}
Output:
binomial PDF: 0.00708455

### Parameters

 p is the probability of success on any one trial s is the number of successes n is the number of events

### Authors

Anca Filibiu (September 2005)
##### Source Code

Source code is available when you agree to a GP Licence or buy a Commercial Licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.