How many people in a room?
Archive - Originally posted on "The Horse's Mouth" - 2004-08-12 21:45:18 - Graham EllisHow many people do you need to gather in a room for there to be an even chance that two of them have the same birthday? Would you believe that it's as few as 23? This is something I've heard said over the years but I wasn't sure if I believed it. Well - here you go:
Day 18, chance is 35.5%
Day 19, chance is 38.9%
Day 20, chance is 42.2%
Day 21, chance is 45.6%
Day 22, chance is 48.9%
Day 23, chance is 52.1%
Day 24, chance is 55.4%
Day 25, chance is 58.5%
Sure ... I used Perl ;-)
#!/usr/bin/perl
$chance = 0;
for ($k=1; $k<25; $k++) {
$chance += ($k/(366 - $k)) * (1 - $chance);
printf "Day %2d, chance is %5.1f%%\n",$k+1,$chance*100;
}
Yes - I DID do a test / sanity check. Ran it up to 365 people and ended up at 100%