Functions > Statistics > Probability Distributions > Example: Binomial and Negative Binomial Distributions
Example: Binomial and Negative Binomial Distributions
Binomial Distributions
1. Use the dbinom function to calculate the probability density for value k.
2. Use the pbinom function to calculate the cumulative probability distribution for value k.
3. Use the qbinom function to calculate the inverse cumulative probability distribution for probability p.
4. Use the rbinom function to create a vector of m random numbers having the binomial distribution.
Recalculating the worksheet causes function rbinom to return a new set of random numbers.
Negative Binomial Distributions
1. Use the dnbinom function to calculate the probability density for value k.
2. Use the pnbinom function to calculate the cumulative probability distribution for value k.
3. Use the qnbinom function to calculate the inverse cumulative probability distribution for probability p.
4. Use the rnbinom function to create a vector of m random numbers having the binomial distribution.
Recalculating the worksheet causes function rnbinom to return a new set of random numbers.
5. Plot and compare the rbinom function with the rnbinom function using the same parameters.
The two functions are not the negative of each other.