Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
If you have two bags each containing 100 numbered balls and pick 1 ball at random from each bag, what are the odds that you will pick two similarly numbered balls?
I believe this is equivalent to the Birthday paradox equation:
T! 1 - ----------------- T^n . ( T - n )!
Which for T=100, n=2 comes out to:
use strict; use bignum; sub fact{ my($r,$n) = (1,shift); $r *= $n-- while $n; return $r; } print 1-((fact(100)/fact(98))/100**2);
gives 0.01 or 1% chance.
My question is, if I have 2 pairs of 2 bags and pick one ball from each, what are the odds of the first pair being identical to the second pair?
For my purposes, order does matter. So, the question is really what are the odds that ball 1 from each of pair1/bag1 & pair2/bag1 will be identical; and ball 2 from each of pair1/bag2 & pair2/bag2 will also be identical?
Is this a simple combination of odds? Eg. 0.01 * 0.01 == 0.0001?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Math help
by Melly (Chaplain) on Nov 27, 2006 at 11:03 UTC | |
by Anonymous Monk on Nov 27, 2006 at 11:14 UTC | |
by themage (Friar) on Nov 27, 2006 at 11:30 UTC | |
|
Re: Math help
by Not_a_Number (Prior) on Nov 27, 2006 at 17:49 UTC |