3
<title>The Hypergeometric Distribution - GNU Scientific Library -- Reference Manual</title>
4
<meta http-equiv="Content-Type" content="text/html">
5
<meta name="description" content="GNU Scientific Library -- Reference Manual">
6
<meta name="generator" content="makeinfo 4.8">
7
<link title="Top" rel="start" href="index.html#Top">
8
<link rel="up" href="Random-Number-Distributions.html#Random-Number-Distributions" title="Random Number Distributions">
9
<link rel="prev" href="The-Geometric-Distribution.html#The-Geometric-Distribution" title="The Geometric Distribution">
10
<link rel="next" href="The-Logarithmic-Distribution.html#The-Logarithmic-Distribution" title="The Logarithmic Distribution">
11
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
13
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 The GSL Team.
15
Permission is granted to copy, distribute and/or modify this document
16
under the terms of the GNU Free Documentation License, Version 1.2 or
17
any later version published by the Free Software Foundation; with the
18
Invariant Sections being ``GNU General Public License'' and ``Free Software
19
Needs Free Documentation'', the Front-Cover text being ``A GNU Manual'',
20
and with the Back-Cover Text being (a) (see below). A copy of the
21
license is included in the section entitled ``GNU Free Documentation
24
(a) The Back-Cover Text is: ``You have freedom to copy and modify this
25
GNU Manual, like GNU software.''-->
26
<meta http-equiv="Content-Style-Type" content="text/css">
27
<style type="text/css"><!--
28
pre.display { font-family:inherit }
29
pre.format { font-family:inherit }
30
pre.smalldisplay { font-family:inherit; font-size:smaller }
31
pre.smallformat { font-family:inherit; font-size:smaller }
32
pre.smallexample { font-size:smaller }
33
pre.smalllisp { font-size:smaller }
34
span.sc { font-variant:small-caps }
35
span.roman { font-family:serif; font-weight:normal; }
36
span.sansserif { font-family:sans-serif; font-weight:normal; }
42
<a name="The-Hypergeometric-Distribution"></a>
43
Next: <a rel="next" accesskey="n" href="The-Logarithmic-Distribution.html#The-Logarithmic-Distribution">The Logarithmic Distribution</a>,
44
Previous: <a rel="previous" accesskey="p" href="The-Geometric-Distribution.html#The-Geometric-Distribution">The Geometric Distribution</a>,
45
Up: <a rel="up" accesskey="u" href="Random-Number-Distributions.html#Random-Number-Distributions">Random Number Distributions</a>
49
<h3 class="section">19.36 The Hypergeometric Distribution</h3>
51
<p><a name="index-hypergeometric-random-variates-1690"></a>
54
— Function: unsigned int <b>gsl_ran_hypergeometric</b> (<var>const gsl_rng * r, unsigned int n1, unsigned int n2, unsigned int t</var>)<var><a name="index-gsl_005fran_005fhypergeometric-1691"></a></var><br>
55
<blockquote><p><a name="index-Geometric-random-variates-1692"></a>This function returns a random integer from the hypergeometric
56
distribution. The probability distribution for hypergeometric
58
where C(a,b) = a!/(b!(a-b)!) and
59
<!-- {$t \leq n_1 + n_2$} -->
60
t <= n_1 + n_2. The domain of k is
61
<!-- {$\hbox{max}(0,t-n_2), \ldots, \hbox{min}(t,n_1)$} -->
62
max(0,t-n_2), ..., min(t,n_1).
64
<p>If a population contains n_1 elements of “type 1” and
65
n_2 elements of “type 2” then the hypergeometric
66
distribution gives the probability of obtaining k elements of
67
“type 1” in t samples from the population without
69
</p></blockquote></div>
72
— Function: double <b>gsl_ran_hypergeometric_pdf</b> (<var>unsigned int k, unsigned int n1, unsigned int n2, unsigned int t</var>)<var><a name="index-gsl_005fran_005fhypergeometric_005fpdf-1693"></a></var><br>
73
<blockquote><p>This function computes the probability p(k) of obtaining <var>k</var>
74
from a hypergeometric distribution with parameters <var>n1</var>, <var>n2</var>,
75
<var>t</var>, using the formula given above.
76
</p></blockquote></div>
83
— Function: double <b>gsl_cdf_hypergeometric_P</b> (<var>unsigned int k, unsigned int n1, unsigned int n2, unsigned int t</var>)<var><a name="index-gsl_005fcdf_005fhypergeometric_005fP-1694"></a></var><br>
84
— Function: double <b>gsl_cdf_hypergeometric_Q</b> (<var>unsigned int k, unsigned int n1, unsigned int n2, unsigned int t</var>)<var><a name="index-gsl_005fcdf_005fhypergeometric_005fQ-1695"></a></var><br>
85
<blockquote><p>These functions compute the cumulative distribution functions
86
P(k), Q(k) for the hypergeometric distribution with
87
parameters <var>n1</var>, <var>n2</var> and <var>t</var>.
88
</p></blockquote></div>