A Counting Problem
The Problem
Choose an integer from 0 to 999 randomly. Say the probability of the digits of containing 2 but no 3 is . What is .
The Generalized Problem
We consider a generalized problem. Choose an integer from 0 to randomly. Say the probability of the digits of containing 2 but no 3 is . What is .
A Subtraction Solution
Let be the number of numbers whose digits don’t contain 3, be the number of numbers whose digits don’t contain 2 or 3. Then we know that
And we can see choosing a number randomly as choosing digits randomly. Therefore
Thus
When , .
A Summation Solution
The previous solution is concise and the expression of is elegant and scalable. However, even when is small, and are two large numbers that are hard to compute without the help of a calculator. Therefore we propose another solution that only involves the addition operation. Although the expression may be more complicated, the involved computations may be simpler when is small.
Let be the number of numbers whose digits contain 2s but no 3. Then we have
Then
E.g., when , the computation is
A MUCH SIMPLER Solution 1
We use an array to denote three digits of a number without order. Then there are three cases:
So there are numbers satisfying the condition. Thus .
A Simple Solution
First we count the numbers whose digits contain 2. We use an array to denote three digits without order. There are three cases:
So there are total numbers whose digits contain 2.
Then we count the numbers whose digits contain both 2 and 3. There are still three cases
So there are total numbers whose digits contain both 2 and 3.
Therefore, there are numbers satisfying the condition. Thus .
Note that for illustration the solution is a little long. But the idea and all the operations are very simple that you don’t even need to write them down.
Footnotes
-
Compared to A Simple Solution ↩