Suppose there are 23 people in a room. What is the probability that at least two have the same birthday?
SOLUTION
The probability that no two have the same birthday is (note that the product stops at , not ). Subtracting from 1 gives the probability that at least two have the same birthday:
>> 1-prod( 1 - (1:22)/365)
ans =
0.5073
Suppose a lazy phone company employee assigns telephone numbers by choosing random seven-digit numbers. In a town with 10,000 phones, what is the probability that two people receive the same number?
>> 1-prod( 1 - (1:9999)/10^7)
ans =
0.9933
Note that the number of phones is about three times the square root of the number of possibilities. This means that we expect the probability to be high, which it is. From Section 12.1, we have the estimate that if there are around phones, there should be a 50% chance of a match. Let’s see how accurate this is:
>> 1-prod( 1 - (1:3722)/10^7)
ans =
0.4999