Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Does hygepdf(X,M,N,K)=hygepdf(X,M,K,N)?

Subject: Does hygepdf(X,M,N,K)=hygepdf(X,M,K,N)?

From: Eugene Gallagher

Date: 11 Oct, 2013 17:32:10

Message: 1 of 2

Here's an interesting feature of the hypergeometric probability distribution discovered by one of my students in a Matlab homework. It is probably well known, but I didn't know it until today. I proved the result with the symbolic math toolbox.

Does the probability of drawing exactly X of a possible K items in N drawings without replacement from a group of M objects equal the probability of drawing exactly X of a possible N items in K drawings without replacement from a group of M objects?
 
A proof using Matlab’s symbolic math toolbox:
% Written by Eugene.Gallagher@umb.edu
syms N X K M y z
% Equation for expanded hypergeometric pdf from p 111 of
% Larsen and Marx 2012 Introduction to Mathematical Statistics, 5th edition
y=factorial(N)/(factorial(X)*factorial(N-X))*factorial(K)/factorial(K-X)*factorial(M-K)/factorial((M-K)-N+X)/(factorial(M)/factorial(M-N))
% swap N and K, save as z
z=factorial(K)/(factorial(X)*factorial(K-X))*factorial(N)/factorial(N-X)*factorial(M-N)/factorial((M-N)-K+X)/(factorial(M)/factorial(M-K))
fprintf('y/z:\n')
y/z
fprintf('Switching N and K will always produce identical hypergeometric probabilities.\nQ.E.D.\n')
fprintf('An example based on problem 3.2.26 on p 117 in Larsen & Marx (2012):\n')
X=6;M=80;K=20;N=10;
hygepdf(X,M,K,N)
hygepdf(X,M,N,K)
eval(y)
X=6;M=80;K=10;N=20;
eval(y)

Subject: Does hygepdf(X,M,N,K)=hygepdf(X,M,K,N)?

From: Tom Lane

Date: 16 Oct, 2013 22:12:28

Message: 2 of 2

> Does the probability of drawing exactly X of a possible K items in N
> drawings without replacement from a group of M objects equal the
> probability of drawing exactly X of a possible N items in K drawings
> without replacement from a group of M objects?

Hi, Gene.

This makes sense to me. There seems to be a sort of symmetry between the
dichotomy defined by the item type and the dichotomy defined by the ones I
select. You could imagine someone else drawing the items in order to specify
their types, and sometimes drawing the ones that you selected.

-- Tom

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us