# Estimate the probability that at least two students in a class of 100 share the same ID number

Seeking help with a probability problem.

Assume grades on an exam are posted according to an ID number corresponding to the last 4-digits of a persons social security number ranging from 0000 to 9999.

Assume that each sequence of 4-digits has the same probability.

Q1: Estimate the probability that at least two students in a class of 100 share the same ID number?

So far...

• Class of 100 people
• Each person has an ID number concluding in a sequence of 4-digits.
• There are 10 possibilities {0,1,...,9} for each digit - 1st, 2nd, 3rd, and 4th.
• There are 10^4 total possible outcomes?
• Solution will involve the complement

Any ideas on how to approach this?

• Search our site for the Birthday Problem. A general formula is given at stats.stackexchange.com/questions/57347. – whuber Sep 3 '18 at 17:42
• thanks @whuber we have not begun working with the binomial coefficient formula yet but I can see how it is useful for this problems and other variants of the birthday problem. – dpoak Sep 3 '18 at 22:22

## 1 Answer

This sounds like a homework problem, so I want to give you a hint without giving you the answer.

The best way to solve this type of problem is to figure out the probability that there are NO matches. Work through as if you are assigning the IDs in order. Start with the first student. This is trivial, as there are no other IDs to match, so the probability of not matching is 1. For the second student, out of the 10^4 IDs there is only one that you must not choose. So the probability of NOT matching is 1 * (10^4-1)/(10^4). For the third student, there are now 2 IDs to avoid, so the probability of not matching among the first three is 1*(10^4-1)/(10^4)*(10^4-2)/(10^4).

Hope that helps get you started!

• thanks for the hint @daniel-ludwinski this definitely helped point me in the right direction. I will add another comment once I have worked a solution. – dpoak Sep 3 '18 at 22:23
• Hey @daniel-ludwinski for the 1st student P(Not Matching) = 1, for the 2nd student to not match you need 1 of the 4 possible digits to be different than the other 3 so P(Not Matching) = 10^(4-1) / 10^4, for the 3rd student you recognize that two students have been assigned ID's and you need to avoid matching them, P(Not Matching) = 10^(4-1) / 10^4 * 106(4-2) / 10^4, for the 4th student you have 10^(4-3) / 10^4. Is this correct? – dpoak Sep 3 '18 at 22:59
• No quite. I should have included more parentheses in my original answer. For the second student you could have 1 digit not match... 2 digits... 3 digits or four! Probability is all about counting. You want to count all the possible ways to not match (and in the simplest way possible). For the second student, you can use any of the 10,000 numbers - except for the one already used for the first student. You have (10^4) -1 = 9,999 options. So the probability is [(10^4) -1] / (10^4) = 9,999/10,000 – Daniel Ludwinski Sep 5 '18 at 15:47
• Thanks for clearing that up. To follow...Does this then mean that the probability for all four students not matching is [(9,999/10,000)]^4 ? – dpoak Sep 7 '18 at 2:01