Zeros between 1 and 222 MillionDate: 10/31/2001 at 16:23:51 From: A. Buhrs Subject: How many zeros are there between 1 and 222 million Hello Dr. Math, I have a difficult question from my math teacher: How many zeros do I use if I write down all the numbers from 1 to 222.222.222 (222 million)? Thank you very much indeed. Gerrit van Buren Amsterdam Date: 10/31/2001 at 17:07:57 From: Doctor Floor Subject: Re: How many zeros are there between 1 and 222 million Dear Gerrit, Thanks for your nice question. The trick here is to count how many zeroes have to be used at each digit position. The digit in the 100,000,000 position is never zero, because we don't use leading zeroes. There are two numbers where the digit in the 10,000,000 position and all the digits following it are zeroes, namely 100,000,000 and 200,000,000. That gives two sets of zeroes for this digit. Of course there are not only two numbers for which the digit in the 10,000,000 position is zero, but there are two sets: 100,000,000 200,000,000 100,000,001 200,000,001 100,000,002 200,000,002 ... ... ... ... 109,999,998 209,999,998 109,999,999 209,999,999 So we should count 20,000,000 zeroes in the 10,000,000 position. There are 22 numbers where the digit in the 1,000,000 position and the digits following it are zeroes, namely 10,000,000 - 20,000,000 - 30,000,000 - ... - 210,000,000 and 220,000,000. (We again encounter the numbers 100,000,000 and 200,000,000: we haven't forgotten that these numbers have more zeroes than only the second digit that we counted first.) That gives 22 sets of numbers with zeroes, to count for 22,000,000 zeroes as a total for this digit. Now I guess you know how to proceed. The total number of zeroes used to write this enormous number of numbers is 20,000,000 + 22,000,000 + ... If you need more help, just write back. Best regards, - Doctor Floor, The Math Forum (thanking Doctor Tom for assistence) http://mathforum.org/dr.math/ Date: 11/17/2001 at 10:17:59 From: A. Buhrs Subject: How many zeros are there between 1 and 222 million Dear Dr. Floor, After a lot of trial and error I'm still having trouble with the correct answer. Is it 20.000 + 7 * 22.000 ? If you could provide me with the complete answer I would be very grateful indeed. My other problem is generalizing this. If I want to know how many zeroes there, say, between 1 and n (n = positive integer), how do I write the previous solution in a more generalised term? I thank you very much indeed for helping me out, Kindest regards, Gerrit van Buren Amsterdam The Netherlands Date: 11/18/2001 at 14:47:40 From: Doctor Floor Subject: Re: How many zeros are there between 1 and 222 million Dear Gerrit, Thanks for your reaction. Let me get back to your problem, and explain more extensively: When we go from 1 to 222,222,222 then the first digit is never zero. The second digit is zero when the number starts 10.... and 20.... After this second digit we still have seven digits that can have all possible values. There are 10^7 = 10,000,000 possibilities. So we conclude that the second digit is zero in 2*10,000,000 = 20,000,000 numbers. Now for the third digit. The third digit is zero when the number begins (allowing leading zeroes) 010, 020, 030, 040, 050, 060, 070, 080, 090, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220. This is definitely the last time I will write this out. Clearly there are 22 possibilities, and those reflect exactly the first two digits of 222,222,222. After each third digit there are still 6 digits that can have all possible values, and that means per set of 3 initial digits there are 1,000,000 possibilities. So we find 22*1,000,000 = 22,000,000 numbers with a third digit of zero. For the fourth digit, in the same way, there are 222 possible initial parts of four digits ending with 0, and there are 5 digits following them, so that there are 222*100,000 = 22,200,000 numbers with a fourth digit of zero Going on like this: 2nd digit is zero: 20,000,000 possiblities 3rd digit is zero: 22,000,000 possiblities 4th digit is zero: 22,200,000 possiblities 5th digit is zero: 22,220,000 possiblities 6th digit is zero: 22,222,000 possiblities 7th digit is zero: 22,222,200 possiblities 8th digit is zero: 22,222,220 possiblities 9th digit is zero: 22,222,222 possiblities All there is left to do is to add these. Can we generalize this? Certainly! Take a number A with n digits (represented by a(x) for the xth digit: a(1) a(2) a(3) a(4) a(5) ... a(n-2) a(n-1) a(n) Then the number of zeroes among all numbers from 1 to this number A is a(1) a(2) a(3) a(4) a(5) ... a(n-2) a(n-1) + a(1) a(2) a(3) a(4) a(5) ... a(n-2) 0 + ... ... ... a(1) a(2) a(3) a(4) a(5) ... 0 0 + a(1) a(2) a(3) a(4) 0 ... 0 0 + a(1) a(2) a(3) 0 0 ... 0 0 + a(1) a(2) 0 0 0 ... 0 0 + a(1) 0 0 0 0 ... 0 0 Do you see that this reflects exactly what we have done above? If you need more help, just write back Best regards, - Doctor Floor, The Math Forum http://mathforum.org/dr.math/ |
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]
Ask Dr. Math^{TM}
© 1994-2013 The Math Forum
http://mathforum.org/dr.math/