Sample Probability Calculations
We can calculate probabilities for the Hypergeometric( G, B, n ) distribution using either the probability
distribution function (PDF) or the cumulative distribution function (CDF). We will denote
the PDF by f and the CDF by F . We will consider these functions for a variable X having
the Geometric(30, 10, 10) distribution.
> G:=30; B:=10; n:=10;
> f:=t->HypergeometricPDF(G,B,n,t);
At the present time, there is no HypergeometricCDF command. We can create our own by summing the HypergeometricPDF.
F:=x->sum(f(t),t=0..x);
Below you will find three different ways to calculate P( ) .
> evalf(f(1)+f(2)+f(3));
> evalf(sum(f(x),x=1..3));
> evalf(F(3)-F(0));