If you write down all the numbers from 1 to 1000 (inclusive) which digit occurs most frequently? Which digit appears least frequently in the same range? Click below for the answers.
You could write all the numbers down or write a program to count the digit frequencies, but this problem is much easier if you look for a pattern. The digits 0 through 9 all appear the same number of times in the ones place, but 1 through 9 appear a lot more often in the tens and hundreds place (because of numbers like 22, 222, etc., and the fact that we don't write leading 0s). This means that 0 is the least frequent digit. It only appears 192 times in the specified range. What about the most frequent? The digits 1 through 9 appear with exactly the same frequency in the range 1 to 999 (300 times each), so that extra occurrence (in the number 1000) makes 1 the most frequent digit from 1 to 1000.
No comments:
Post a Comment