Extreme Optimization™: Complexity made simple.

Math and Statistics
Libraries for .NET

  • Home
  • Features
    • Math Library
    • Vector and Matrix Library
    • Statistics Library
    • Performance
    • Usability
  • Documentation
    • Introduction
    • Math Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • Resources
    • Downloads
    • QuickStart Samples
    • Sample Applications
    • Frequently Asked Questions
    • Technical Support
  • Blog
  • Order
  • Company
    • About us
    • Testimonials
    • Customers
    • Press Releases
    • Careers
    • Partners
    • Contact us
Introduction
Deployment Guide
Nuget packages
Configuration
Using Parallelism
Expand Mathematics Library User's GuideMathematics Library User's Guide
Expand Vector and Matrix Library User's GuideVector and Matrix Library User's Guide
Expand Data Analysis Library User's GuideData Analysis Library User's Guide
Expand Statistics Library User's GuideStatistics Library User's Guide
Expand Data Access Library User's GuideData Access Library User's Guide
Expand ReferenceReference
  • Extreme Optimization
    • Features
    • Solutions
    • Documentation
    • QuickStart Samples
    • Sample Applications
    • Downloads
    • Technical Support
    • Download trial
    • How to buy
    • Blog
    • Company
    • Resources
  • Documentation
    • Introduction
    • Deployment Guide
    • Nuget packages
    • Configuration
    • Using Parallelism
    • Mathematics Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Data Access Library User's Guide
    • Reference
  • Statistics Library User's Guide
    • Statistical Variables
    • Numerical Variables
    • Statistical Models
    • Regression Analysis
    • Analysis of Variance
    • Time Series Analysis
    • Multivariate Analysis
    • Continuous Distributions
    • Discrete Distributions
    • Multivariate Distributions
    • Kernel Density Estimation
    • Hypothesis Tests
    • Appendices
  • Discrete Distributions
    • Discrete Probability Distributions
    • The Bernoulli Distribution
    • The Binomial Distribution
    • The Geometric Distribution
    • The Hypergeometric Distributions
    • The Negative Binomial Distribution
    • The Poisson Distribution
    • The Uniform Distribution
  • The Hypergeometric Distributions

The Hypergeometric Distributions

Extreme Optimization Numerical Libraries for .NET Professional

The hypergeometric distribution models a picking problem. Given a number of tagged and untagged objects, the number of tagged objects selected out of a fixed number of selections follows a hypergeometric distribution. For example, if a bag contains 8 white and 12 black balls, and 6 balls are taken out of the bag at random, then the number of white balls chosen follows a hypergeometric distribution.

The hypergeometric distribution is related to the The Binomial Distribution. The main difference is that the binomial distribution uses selection with replacement, whereas the hypergeometric distribution uses selection without replacement.

The hypergeometric distribution has three parameters: the number of tagged objects, the number of untagged objects, and the number of selections.

Examples of the hypergeometric distribution are:

  • In quality control, the number of defective products out of a sample of fixed size follows a hypergeometric distribution.

  • In biology, the size of an animal population can be estimated by first tagging a known number of animals, and a short time later recapturing a fixed number of animals. The number of tagged animals in the recaptured samples follows a hypergeometric distribution.

The Hypergeometric distribution is implemented by the HypergeometricDistribution class. It has one constructor that takes three arguments. The first argument is an integer that specifies the number of items in the untagged population. The second argumentspecifies the number of items in the tagged population. The third parameter specifies the number of samples drawn from the total population. The following constructs a hypergeometric distribution for 20 tagged items, 10 untagged items, and 15 samples:

C#
VB
C++
F#
Copy
var hyper = new HypergeometricDistribution(20, 10, 15);
Dim hyper = New HypergeometricDistribution(20, 10, 15)

No code example is currently available or this language may not be supported.

let hyper = HypergeometricDistribution(20, 10, 15)

The HypergeometricDistribution class has three specific properties. TaggedPopulation returns the number of items in the tagged population. UntaggedPopulation returns the number of items in the untagged population. NumberOfSamples returns the number of samples drawn from the entire population.

HypergeometricDistribution has one static (Shared in Visual Basic) method, Sample, which generates a random sample using a user-supplied uniform random number generator. The first argument is the random number generator. The remaining 3 parameters correspond to the parameters of the constructor.

C#
VB
C++
F#
Copy
var random = new MersenneTwister();
int sample = HypergeometricDistribution.Sample(random, 20, 10, 15);
Dim random = New MersenneTwister()
Dim sample = HypergeometricDistribution.Sample(random, 20, 10, 15)

No code example is currently available or this language may not be supported.

let random = MersenneTwister()
let sample = HypergeometricDistribution.Sample(random, 20, 10, 15)

The above example uses the MersenneTwister class to generate uniform random numbers.

For details of the properties and methods common to all discrete probability distribution classes, see the topic on Discrete Distributions.

Copyright (c) 2004-2021 ExoAnalytics Inc.

Send comments on this topic to support@extremeoptimization.com

Copyright © 2004-2021, Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual Studio.NET, and the Optimized for Visual Studio logo
are registered trademarks of Microsoft Corporation.