This is a combination/statistics problem. We let N be the total number of possible passcodes, which N = 100 (for 00 to 99). Now there are Nn possible ways for the n people to choose passcodes (independence). We wish to count the cardinality of the complementary set ∣Ac∣ where A is the event such that all passcodes are different among n tenants. In other words, we want to calculate the probability of some tenants having the same passcode, from which we can find that of A:
P(A)=1−Nn∣Ac∣ (the complementary principle)
Now we focus on counting the cardinality of Ac. For each ordered pair of room i and j, we can determine the number of ways that rooms i and j share the same passcode, which is identical to the total number of passcodes the two can exclusively share, i.e. N, while the remaining n-2 rooms have any of the remaining N-1 passcodes. Obviously, as i and j are ordered, we have (2n)C( = pairs of this type of pair.
On using the second double distribution method, we can find ∣Ac∣ for each pair of room repeating at least one passcode. Iterating from k = 1 to n:
∣Ac∣=∑k=1n
=∑k=1n(
Unraveling the recursion term by term, we have:
=n(N)−
Plugging the result back to our original probability formula, we look for n such that P(A)=0.75:
0.75=
Simplifying, we have:
1−
Noticing the structure of the equation, we can rewrite the left side using an approximate result:
0.25≈41=22
Then, we can define x
x≡100N=100−n+1
Now the equation becomes much more standard:
(
Comparing this to the standard identity:
(
We identify x≡(1−100n)n+1 and approximate using the exponential function as , so:
x≈(e1+1)n
As 1/e1=e−1, x≈(e. Plug the result into the equation for x:
100−n+1100−n≈(e−1)
Now, we can safely plug in a small sequence of real positive integers to find the best approximation (e−1)n. Doing so, we get n = 5;
100−5=95;100−4=96
Indeed, the fractional result obtained from the left side is a really decent approximation to that from the right side (0.9872 vs 1.01)! Therefore our answer to n is 5.