Functions > Statistics > Probability Distributions > Example: Geometric and Hypergeometric Distribution Functions
  
Example: Geometric and Hypergeometric Distribution Functions
Geometric Distribution
1. Use the dgeom function to calculate the probability density for value k:
Click to copy this expression
Click to copy this expression
Click to copy this expression
2. Use the pgeom function to calculate the cumulative probability distribution for value k:
Click to copy this expression
3. Use the pgeom function to calculate the inverse cumulative probability distribution for probability p:
Click to copy this expression
Click to copy this expression
4. Use the rgeom function to create a vector of m random numbers having the geometric distribution:
Click to copy this expression
Click to copy this expression
Recalculating the worksheet causes function rgeom to return a new set of random numbers.
Hypergeometric Distribution
1. Define the input parameters a, b, m and n. The parameters are integers satisfying the relationship:
max{0, n − b} ≤ m ≤ min{n, a}, and 0 for m elsewhere.
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
2. Use the dhypergeom function to calculate the probability density for the hypergeometric distribution:
Click to copy this expression
3. Use the phypergeom function to calculate the cumulative probability distribution:
Click to copy this expression
4. Use the qhypergeom function to calculate the inverse cumulative probability distribution for probability p:
Click to copy this expression
Click to copy this expression
5. Use the rhypergeom function to create a vector of m random numbers having the hypergeometric distribution:
Click to copy this expression
Recalculating the worksheet causes the rhypergeom function to return a new set of random numbers.