http://qs321.pair.com?node_id=588397

willyyam has asked for the wisdom of the Perl Monks concerning the following question:

This is more of a math question than a Perl question, but I know there are monks with far greater math skills than I, and I hope to pick their brains.

Here's the question:

I have the population figures for several entities. What I am looking for is the probability of a given sample of entities occurring at random. Update: As the first response below demonstrates, I have not been sufficiently clear. I'm looking for a the likelyhood of getting a random sample of seven entities (or however many specified) from the total population represented by the population numbers provided. The order of the sample doesn't matter, just that it has those entities in the stipulated proportions. Some pseudocode:

#!/usr/bin/perl use strict; use warnings; # Population numbers my $entity1 = 35000 my $entity2 = 41000 my $entity3 = 16000 my $entity4 = 18000 my $entity5 = 21000 my $entity6 = 45000 my $entity7 = 27000 my $entity8 = 10000 my $entity9 = 16000 # Sample constituents my @sample = ($entity9,$entity9,$entity4,$entity2,$entity6,$entity1,$e +ntity1) sub probability { # Return the probability of @sample occurring at random based on the # populations declared }

I would be perfectly happy if someone could show me how to do the math, and I can do the Perl, although seeing how to do the math in Perl would be great too. Thanks.