What is the possibility that at least one digit will not show up in a 20-digit "code"?

1.9k Views Asked by At

A "code" is composed of 20 digits (numbers from 0 to 9), and we want to choose a number randomly. What is the possibility that at least one digit will not show up in the code?

What I did:
We have $10^{20}$ possibilities. Now, I want to choose 9 numbers out of the ten, and choose them randomly, so the possibility is:

$\frac{10\cdot9^{20}}{10^{20}} = \frac{9^{20}}{10^{19}}$

But when I put this in the calculator, I get $1.25\dots$ I thought maybe I need a more precise calculator, but even calculators I found in google returns the same answer.

The possibility isn't supposed to be above 1. What is the problem here?

1

There are 1 best solutions below

7
On BEST ANSWER

For any given digit, the probability the "code" does not contain that digit is indeed $(9/10)^{20}$. But computing the probability that any one of the ten digits is missing requires the inclusion/exclusion principle.

  • Add $10×(9/10)^{20}$, like you did, for the probability that one digit is missing.
  • Subtract $45×(8/10)^{20}$ for the probability that two digits are missing. 45 is the number of ways to choose two digits to omit.
  • Add $120×(7/10)^{20}$ for the probability that three digits are missing. Again, 120 is the number of ways to omit three digits.
  • Continue until adding $10×(1/10)^{20}$ for the probability that nine digits are missing.

The final, correct answer is $0.785262\dots$