.
what fraction of the integers between 0 and 1000 include exactly two 6s?
~~~~~~~~~~~~~~~~~~
This problem has a brilliant, elegant and unexpectedly simple solution.
Consider all integer numbers from 0 to 999, inclusive.
In all, there are exactly 1000 such numbers.
Will consider one-digit numbers, like 3, 7 as three digit numbers with leading zeroes 003, 007.
Will consider two digit numbers, like 37 as three digit numbers with leading zero 037.
It will change NOTHING in the solution.
All such three-digit numbers, that have only two digits "6", are in the following three disjoint categories:
- having "6" in the first and the second positions, only;
- having "6" in the first and the third positions, only;
- having "6" in the second and the third positions, only.
Now, let's consider all three-digit numbers with the digits 6 in "hundreds" and "tens" position.
The amount of such numbers is 9, obviously, because there are 9 such thre-digit numbers that have 9 possible digits
(all excepting 6) in the "ones" position.
Next, consider all three-digit numbers with the digits 6 in "hundreds" and "ones" position.
The amount of such numbers is 9, obviously, because there are 9 such thre-digit numbers that have 9 possible digits
(all excepting 6) in the "tens" position.
Finally, consider all three-digit numbers with the digits 6 in "tens" and "ones" position.
The amount of such numbers is 9, obviously, because there are 9 such thre-digit numbers that have 9 possible digits
(all excepting 6) in the "ones" position.
ANSWER. In all, there are 9+9+9 = 27 numbers from 0 to 1000, having only two digits "6" in their records.
Solved.