If you wrote down all whole numbers from 1 to 1000...
1 , 2 , 3 , 4 , . . . , 9 9 9 , 1 0 0 0
...which digit would appear the least?
There's a clever way to think of the numbers from 1 to 1000 that will make this problem easier.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Ya ,simple approach.
Amazing write up.
Concise! Nice!
Simple but interesting
If we write the numbers 0 0 0 , 0 0 1 , 0 0 2 , ..., 9 9 9 , then we have wrote 3 0 0 0 digits in total. Due to symmetry 3 0 0 of every digit. Now, we have to remove some of 0 's. There are 1 0 8 extra of digit 0 in 0 0 1 , 0 0 2 , ..., 0 9 9 . Also put a 1 before 0 0 0 because we count digits of 1 0 0 0 also. Thus in 1 , 2 , 3 , ..., 1 0 0 0 we got in total
3 0 0 − 1 0 8 = 1 9 2 of digit 0
3 0 0 + 1 = 3 0 1 of digit 1
3 0 0 of each of other digits
192 + 3 = 195 of digit 0. You forgot to count the three 0s of 1000. But this doesn't change the conclusion
Here, we can permute the digits 1,2,3,...,9,0- to make 3 digit numbers
we get also
1 digit numbers(001,002,...,009)
2 digit numbers(011,012,...,098,099)
0 digit number(000)
we do not count these `0's which are in front of an actual number.
So, there is a lack of '0's from 1,2,3,...,998,999. It can't be filled up by 3 '0's of 1000
- So, the answer is 0
Actually, only "1" appears once more, the others appear the same number of times. From 1 to 10, the digits in the first position completes a loop, as well as every other time it changes the second position. In the second position, the same happens every change in the third position, which also completes a cycle when reaching "1000". Long story short, the units, tens and hundreds positions loop through all digits, equally. In the thousands position, it only appears "1", once.
0 never comes at the beginning of a number. and all the other numbers do. qed
If we start by looking at the numbers: 0 0 0 − 9 9 9 , in other words, every possible combination of 3 digits, we will find that every digit occurs equally (since there’s no reason for any one digit to occur any more than any other - technically, 1000 numbers * 3 digits each = 3000 digits used, 10 different digits → 300 occurrences per digit).
Now subtract off all the instances of 0’s, from 0 0 1 , 0 0 2 , 0 0 3 , all the way up to 099, and you will have removed quite a few 0’s (108 to be exact). Also, remove the 0 0 0 , because we’re only considering 1 - 1 0 0 0 . This brings the total to 1 1 1 . Now add on a 1,000. This brings the total # of 1’s up by one, and the total # of 0’s up by 3 , so we’re left with one extra 1, and 108 missing 0’s.
Final totals:
1 9 2 − 0 ’ s
3 0 1 − 1 ’ s
3 0 0 of every other digit
from 1-99 each number 1-9 appears 10 times while 0 only appears 9 times.
Thinking inductively, there's a 111, a 222, a 333, and so on, but not a 000. There's an 11, a 22, a 33, but no 00, and no leading 0 in the rest. Zero thus becomes the rarest digit simply because leading zeroes aren't a thing.
def countingDigits(end_point = 1000):
digitCounts = [0,0,0,0,0,0,0,0,0,0]
for idx in range(1,end_point+1):
strOfDigits = str(idx)
for aDigit in strOfDigits:
digitCounts[int(aDigit)] += 1
for idx, count in enumerate( digitCounts ):
print idx, " = ", count
0 = 192 1 = 301 2 = 300 3 = 300 4 = 300 5 = 300 6 = 300 7 = 300 8 = 300 9 = 300
If instead of a 1000, there was 0, and if all the numbers were written with enough leading zeroes to make them three digit numbers, we would cycle through all the possible digits in the ones place, then switch in the tens place and do it again, until all the digits were cycled in the tens, and so on with the hundreds. All the digits would appear exactly the same number of times.
But since the leading zeroes are not listed, there is a smaller number of zeroes.
(There is the extra 1 and some zeroes to make that 1000, but that does not begin to change the balance.)
0 being least and 1 being most frequently occurring one.
Simply because you write1,2,3... and 100, 101, 102. etc but you don't write 001, 002... or 010, 011, 012... so the 0s will not be used as much. If you wrote it as 001, 002, 003... then all the numbers would have been used the same amount of times.
Each of the place values cycle 1 through 9 and then 0. So, in the set of single digit numbers that presents one less zero than the other numbers. Zero occurs the least.
Because zero is kind of once in a 10 and only 11 in a hundred so it is kind of the least especially in a 1000
Let us start with the digit 1 , which appears:
2 0 times between 1 − 9 9 .
1 2 0 times between 1 0 0 − 1 9 9 .
1 6 0 times total for 2 0 times each between 2 0 0 − 2 9 9 , 3 0 0 − 3 9 9 , 4 0 0 − 4 9 9 , 5 0 0 − 5 9 9 , 6 0 0 − 6 9 9 , 7 0 0 − 7 9 9 , 8 0 0 − 8 9 9 , and 9 0 0 − 9 9 9 .
1 time for 1 0 0 0 .
Adding this up, we have 1 6 0 + 1 2 0 + 2 0 + 1 = 3 0 1 .
We have 3 0 0 times for each of the eight other digits between 2 and 9 inclusive because 1 0 0 0 only satisfies the case with 1 .
However, the digit 0 appears:
9 times between 1 − 9 9 .
1 8 0 times total for 20 times each between 1 0 0 − 1 9 9 , 2 0 0 − 2 9 9 , 3 0 0 − 3 9 9 , 4 0 0 − 4 9 9 , 5 0 0 − 5 9 9 , 6 0 0 − 6 9 9 , 7 0 0 − 7 9 9 , 8 0 0 − 8 9 9 , and 9 0 0 − 9 9 9 .
3 times for 1 0 0 0 .
Adding this up, we have 1 8 0 + 9 + 3 = 1 9 2 .
1 9 2 < 3 0 0 and 1 9 2 < 3 0 1 , so 0 is our answer.
As you go through the numbers from 1 to 1000, every number is represented over 100 times, just because each number is the first digit of a three-digit number 100 times - apart from 0.
Because the 1 and 2-digit numbers are not shown to begin with 0, 0 is represented nowhere near as many times.
Since we start with the Digit 1 hence except for 0 ...all numbers are repeated equally ... Hence the least appearing digit in Natural Numbers Is zero
But , considering Whole Numbers...all digits from 0-1000 appear equally..
We can simulate this sequence more efficiently by using a different base, such as base 3: 1 , 2 , 1 0 , 1 1 , 1 2 , 2 0 , 2 1 , 2 2 , 1 0 0 , 1 0 1 … 1 0 0 0 , which yields the following counts:
Digit | Count |
0 : | 1 7 |
1 : | 2 8 |
2 : | 2 7 |
From this we can infer that 0 is the least common digit.
When counting from 1 to ......,9, we rarely count 0 as part of the decimal system -0 to........9
Each digit has a whole hundred's digit to itself, adding 100 to its count, however zero does not. We can immediately see that 0 is the answer.
Problem Loading...
Note Loading...
Set Loading...
If we write 0 0 0 , 0 0 1 , 0 0 2 , … , 9 9 9 , every digits appears the same number of times.
So, if we wirte 1 , 2 , 3 , … , 1 0 0 0 , the digit 0 would appears the least.