Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • Compute Services
  • System Modeler
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

Wolfram Consulting

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Notebook Assistant + LLM Kit
    • Compute Services
    • System Modeler
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
HypergeometricDistribution
  • See Also
    • BinomialDistribution
    • MultivariateHypergeometricDistribution
    • FisherHypergeometricDistribution
    • WalleniusHypergeometricDistribution
    • HypergeometricPFQ
  • Related Guides
    • Urn Model Distributions
    • Discrete Univariate Distributions
    • Bounded Domain Distributions
    • Functions Used in Statistics
  • Tech Notes
    • Discrete Distributions
    • See Also
      • BinomialDistribution
      • MultivariateHypergeometricDistribution
      • FisherHypergeometricDistribution
      • WalleniusHypergeometricDistribution
      • HypergeometricPFQ
    • Related Guides
      • Urn Model Distributions
      • Discrete Univariate Distributions
      • Bounded Domain Distributions
      • Functions Used in Statistics
    • Tech Notes
      • Discrete Distributions

HypergeometricDistribution[n,nsucc,ntot]

represents a hypergeometric distribution.

Details
Details and Options Details and Options
Background & Context
Examples  
Basic Examples  
Scope  
Applications  
Properties & Relations  
Possible Issues  
See Also
Tech Notes
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • BinomialDistribution
    • MultivariateHypergeometricDistribution
    • FisherHypergeometricDistribution
    • WalleniusHypergeometricDistribution
    • HypergeometricPFQ
  • Related Guides
    • Urn Model Distributions
    • Discrete Univariate Distributions
    • Bounded Domain Distributions
    • Functions Used in Statistics
  • Tech Notes
    • Discrete Distributions
    • See Also
      • BinomialDistribution
      • MultivariateHypergeometricDistribution
      • FisherHypergeometricDistribution
      • WalleniusHypergeometricDistribution
      • HypergeometricPFQ
    • Related Guides
      • Urn Model Distributions
      • Discrete Univariate Distributions
      • Bounded Domain Distributions
      • Functions Used in Statistics
    • Tech Notes
      • Discrete Distributions

HypergeometricDistribution

HypergeometricDistribution[n,nsucc,ntot]

represents a hypergeometric distribution.

Details

  • A hypergeometric distribution gives the distribution of the number of successes in n draws from a population of size ntot containing nsucc successes.
  • HypergeometricDistribution allows n, nsucc, and ntot to be any integers such that 0<n≤ntot and 0≤nsucc≤ntot.
  • HypergeometricDistribution can be used with such functions as Mean, CDF, and RandomVariate. »

Background & Context

  • HypergeometricDistribution[n,nsucc,ntot] represents a discrete statistical distribution defined for integer values contained in and determined by the integer parameters n, nsucc, and ntot that satisfy 0<n≤ntot and 0≤nsucc≤ntot and that represent the number of draws of the experiment, the number of successes within that population, and the size of the population drawn from, respectively. The hypergeometric distribution has a probability density function (PDF) that is discrete and unimodal. The distribution is sometimes also referred to as the central or classic hypergeometric distribution to differentiate it from the related and qualitatively-similar distributions of Wallenius (WalleniusHypergeometricDistribution) and Fisher (FisherHypergeometricDistribution).
  • The hypergeometric distribution gives the distribution of the number of successes in n draws (without replacement) from a population of size ntot containing nsucc successes and can be visualized as an urn model whereby n balls are drawn without replacement from an urn containing nsucc blue balls and ntot-nsucc green balls. The hypergeometric distribution dates back to the 1710s work of de Moivre, who obtained it as a solution to an urn problem proposed even earlier by Huygens and related to the urn problem described above. The name of the hypergeometric distribution derives from the fact that its PDF can be expressed in terms of the generalized hypergeometric function (Hypergeometric2F1), and the distribution itself is used to model a number of quantities across various fields. In particular, the hypergeometric distribution has been used as a tool in the study of queueing models, manufacturing systems, population dynamics, contingency table analysis, and quantum cryptography.
  • RandomVariate can be used to give one or more machine- or arbitrary-precision (the latter via the WorkingPrecision option) pseudorandom variates from a hypergeometric distribution. Distributed[x,HypergeometricDistribution[n,nsucc,ntot]], written more concisely as xHypergeometricDistribution[n,nsucc,ntot], can be used to assert that a random variable x is distributed according to a hypergeometric distribution. Such an assertion can then be used in functions such as Probability, NProbability, Expectation, and NExpectation.
  • The probability density and cumulative distribution functions may be given using PDF[HypergeometricDistribution[n,nsucc,ntot],x] and CDF[HypergeometricDistribution[n,nsucc,ntot],x], though one should note that there is no closed-form expression for its PDF. The mean, median, variance, raw moments, and central moments may be computed using Mean, Median, Variance, Moment, and CentralMoment, respectively. These quantities can be visualized using DiscretePlot.
  • DistributionFitTest can be used to test if a given dataset is consistent with a hypergeometric distribution, EstimatedDistribution to estimate a hypergeometric parametric distribution from given data, and FindDistributionParameters to fit data to a hypergeometric distribution. ProbabilityPlot can be used to generate a plot of the CDF of given data against the CDF of a symbolic hypergeometric distribution and QuantilePlot to generate a plot of the quantiles of given data against the quantiles of a symbolic hypergeometric distribution.
  • TransformedDistribution can be used to represent a transformed hypergeometric distribution, CensoredDistribution to represent the distribution of values censored between upper and lower values, and TruncatedDistribution to represent the distribution of values truncated between upper and lower values. CopulaDistribution can be used to build higher-dimensional distributions that contain a hypergeometric distribution, and ProductDistribution can be used to compute a joint distribution with independent component distributions involving hypergeometric distributions.
  • HypergeometricDistribution is related to a number of other statistical distributions. For example, HypergeometricDistribution is generalized by both FisherHypergeometricDistribution and WalleniusHypergeometricDistribution in the sense that HypergeometricDistribution[n,nsucc,ntot] has the same PDF as both FisherHypergeometricDistribution[n,nsucc,ntot,1] and WalleniusHypergeometricDistribution[n,nsucc,ntot,1]. As , HypergeometricDistribution limits to BinomialDistribution, and MultivariateHypergeometricDistribution is an obvious higher-dimensional generalization of HypergeometricDistribution. HypergeometricDistribution is also related to GeometricDistribution, NormalDistribution, PoissonDistribution, PearsonDistribution, and BetaBinomialDistribution.

Examples

open all close all

Basic Examples  (3)

Probability mass function:

Cumulative distribution function:

Mean and variance:

Scope  (7)

Generate a sample of pseudorandom numbers from a hypergeometric distribution:

Compare its histogram to the PDF:

Distribution parameters estimation:

Estimate the distribution parameters from sample data:

Compare the density histogram of the sample with the PDF of the estimated distribution:

Skewness:

Kurtosis:

Different moments with closed forms as functions of parameters:

Moment:

CentralMoment:

FactorialMoment:

Closed form for symbolic order:

Cumulant:

Hazard function:

Quantile function:

Applications  (6)

CDF of HypergeometricDistribution is an example of a right-continuous function:

Suppose an urn has 100 elements, of which 40 are special:

The probability density function for a draw of 50 elements:

The probability distribution that there are 20 special elements in a draw of 50 elements:

Compute the probability that there are more than 25 special elements in a draw of 50 elements:

Compute the expected number of special elements in a draw of 50 elements:

Suppose there are 5 defective items in a batch of 10 items, and 6 items are selected for testing. Simulate the process of testing when the number of defective items found is counted:

Find the probability that there are 2 defective items in the sample:

Find the distribution of the number of spades in a five-card poker hand:

Find the probability that there are at least 2 spades in the poker hand:

A lottery sells 10 tickets for $1 per ticket. Each time there is only one winning ticket. A gambler has $5 to spend. Find his probability of winning if he buys 5 tickets in 5 different lotteries:

His probability of winning is greater if he buys 5 tickets in the same lottery:

An urn contains white balls and 1 blue ball. Two players draw balls from the urn without replacement until the blue ball is drawn. The player who draws the blue ball wins. Find the chance of winning for the player who draws the first ball. Assuming the first player wins at the draw, the probability that the previous draws were all white follows HypergeometricDistribution:

The conditional probability of drawing a blue ball given that the previous balls were white:

The resulting probability is a sum over :

When the number of white balls is odd, both players have an equal chance of winning:

When the number of white balls is even, the game is unfair:

Properties & Relations  (8)

The probability of getting an irrational number or negative number is zero:

The characteristic function of the hypergeometric distribution is defined in terms of Hypergeometric2F1:

Relationships to other distributions:

The infinite population limit of HypergeometricDistribution is BinomialDistribution:

Hypergeometric distribution is a special case of FisherHypergeometricDistribution:

Hypergeometric distribution is a special case of WalleniusHypergeometricDistribution:

Hypergeometric distribution is equivalent to a bivariate MultivariateHypergeometricDistribution:

HypergeometricDistribution can be obtained from two independent binomial variates conditioning of their total:

Possible Issues  (4)

HypergeometricDistribution is not defined when ntot, nsucc, or n is non-positive:

HypergeometricDistribution is not defined when n>ntot:

HypergeometricDistribution is not defined when nsucc>ntot:

Substitution of invalid parameters into symbolic outputs gives results that are not meaningful:

See Also

BinomialDistribution  MultivariateHypergeometricDistribution  FisherHypergeometricDistribution  WalleniusHypergeometricDistribution  HypergeometricPFQ

Tech Notes

    ▪
  • Discrete Distributions

Related Guides

    ▪
  • Urn Model Distributions
  • ▪
  • Discrete Univariate Distributions
  • ▪
  • Bounded Domain Distributions
  • ▪
  • Functions Used in Statistics

History

Introduced in 2007 (6.0)

Wolfram Research (2007), HypergeometricDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/HypergeometricDistribution.html.

Text

Wolfram Research (2007), HypergeometricDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/HypergeometricDistribution.html.

CMS

Wolfram Language. 2007. "HypergeometricDistribution." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/HypergeometricDistribution.html.

APA

Wolfram Language. (2007). HypergeometricDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HypergeometricDistribution.html

BibTeX

@misc{reference.wolfram_2025_hypergeometricdistribution, author="Wolfram Research", title="{HypergeometricDistribution}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/HypergeometricDistribution.html}", note=[Accessed: 01-March-2026]}

BibLaTeX

@online{reference.wolfram_2025_hypergeometricdistribution, organization={Wolfram Research}, title={HypergeometricDistribution}, year={2007}, url={https://reference.wolfram.com/language/ref/HypergeometricDistribution.html}, note=[Accessed: 01-March-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English