The probability of choosing a 4-digit number that starts with 1 or 2, and has at least 3 of the same digit

combinationscombinatoricsinclusion-exclusion

This is a question that I haven’t been able to solve!

Some more information:

  • The four digit number must start with either 1 or 2.
  • I’ve assumed that combinations is required, as the order of the final three digits chosen doesn’t matter. For example, the number 2322 has three 2s, and so does 2223. Hence they are the same combination of 4 digits, (three 2s, one 3).
  • The digits can repeat as many times as needed. The only obvious restriction is that the 4-digit number must start with 1 or 2.
  • To find the probably, all the favourable outcomes (the number of 4-digit number combinations that start with 1 or 2, that have at least 3 of the same digit), must be divided by the total amount of 4-digit number combinations.
  • The range of 4-digit numbers is between 1000 and 9999, as a 4-digit number cannot start with 0. (0999 cannot occur, 0023 cannot either…)
  • To be considered a favourable outcome, the digit must repeat 3 or 4 times in the 4-digit number combination.

I’ve had a go:

By hand, I wrote every different 4-digit number combination that starts with 1 or 2, that has at least 3 of the same digit. There were 36 different combinations, although this may be incorrect due to technique used.

I assumed the answer would be 36 divided by the total number of different 4-digit number combinations.

I don’t know how to find these values, though.

How would you solve this?

Best Answer

The way I interpret the question: We pick one of the integers from $1000,1001,1002,1003,\dots,9999$ uniformly at random. There are $9\times 10^3 = 9000$ of these numbers (seen by basic application of rule of product, nine options for the first digit, ten options for the second digit and so on... or by common knowledge of numbers). We ask what the probability is that the number we picked happens to have a starting digit of $1$ or $2$ and happens to have exactly three identical digits or exactly four identical digits.

Since we are dealing with uniform probability here, we may simply find the count of desired outcomes and divide by 9000 which is the total number of possible outcomes. (N.B. this approach of dividing good outcomes over total outcomes is only valid in such scenarios where we deal with a uniform distribution and is in general not going to give the correct answer).

Counting the desired outcomes, break into cases based on whether there are exactly three identical or exactly four identical numbers.

  • (3 identical numbers) Pick the first digit. It is either a $1$ or a $2$ for a total of two options. Given such a selection, pick an additional digit to appear different from the first for a total of nine options. Now, decide which of the four positions in the number is the "odd one out", being the digit that is not repeated for a total of four options.

Note, if the first digit was the odd one out that means that the alternate digit is the one that is repeated such as in the example of $2888$. Alternatively if the first digit was not selected to be the odd one out that means that the first digit was among those repeated such as the example of $2822$

  • (4 identical numbers). Pick the first digit, there are two options. All digits are the same.

$$2\cdot 9\cdot 4 + 2=74$$

The final probability then is $$\frac{74}{9000}$$