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.
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
2. Use the pbinom function to calculate the cumulative probability distribution for value k.
Click to copy this expression
3. Use the qbinom function to calculate the inverse cumulative probability distribution for probability p.
Click to copy this expression
Click to copy this expression
4. Use the rbinom function to create a vector of m random numbers having the binomial distribution.
Click to copy this expression
Click to copy this expression
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.
Click to copy this expression
2. Use the pnbinom function to calculate the cumulative probability distribution for value k.
Click to copy this expression
3. Use the qnbinom function to calculate the inverse cumulative probability distribution for probability p.
Click to copy this expression
Click to copy this expression
4. Use the rnbinom function to create a vector of m random numbers having the binomial distribution.
Click to copy this expression
Click to copy this expression
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.
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
The two functions are not the negative of each other.