Extreme Optimization™: Complexity made simple.

Numerical Components
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
    • 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
    • Contact us
Introduction
Deployment Guide
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 Statistics Library User's GuideStatistics Library User's Guide
Expand ReferenceReference
  • Home
    • Features
    • Solutions
    • Documentation
    • QuickStart Samples
    • Sample Applications
    • Downloads
    • Technical Support
    • Download trial
    • How to buy
    • Blog
    • Company
    • Resources
  • Documentation
    • Introduction
    • Deployment Guide
    • Using Parallelism
    • Mathematics Library User's Guide
    • Vector and Matrix Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • Statistics Library User's Guide
    • Statistical Variables
    • Continuous Variables
    • Categorical Variables
    • Variable Collections
    • General Linear Models
    • Regression Analysis
    • Analysis of Variance
    • Time Series Analysis
    • Multivariate Analysis
    • Continuous Distributions
    • Discrete Distributions
    • Multivariate Distributions
    • Hypothesis Tests
    • Histograms
    • Random Numbers
    • Appendices
  • Discrete Distributions
    • Discrete Probability Distributions
    • The Bernoulli Distribution
    • The Binomial Distribution
    • The Geometric Distribution
    • The Hypergeometric Distributions
    • The Negative NegativeBinomial Distribution
    • The Poisson Distribution
    • The Uniform Distribution
  • The Hypergeometric Distributions
Collapse image Expand Image Copy image CopyHover image
         




The Hypergeometric Distributions

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 with three parameters. The first parameter is an integer that specifies the number of items in the untagged population. The second parameter specifies the number of items in the tagged population. The thirs 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#  Copy imageCopy
HypergeometricDistribution hyper = new HypergeometricDistribution(20, 10, 15);
Visual Basic  Copy imageCopy
Dim hyper As HypergeometricDistribution = New 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 variate using a user-supplied uniform random number generator. The first parameter is the random number generator. The remaining 3 parameters correspond to the parameters of the constructor.

C#  Copy imageCopy
MersenneTwister random = new MersenneTwister();
double variate = HypergeometricDistribution.GetRandomVariate(random, 20, 10, 15);
Visual Basic  Copy imageCopy
Dim random As MersenneTwister = New MersenneTwister()
Dim variate As Double = HypergeometricDistribution.GetRandomVariate(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 class.

Send comments on this topic to support@extremeoptimization.com

Copyright (c) 2004-2011 ExoAnalytics Inc.

Copyright © 2003-2013, 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.