|
|
|
|
||
|
|
|
|
|
Factorials and Trailing Zeroes This "trailing zeroes in a factorial" problem keeps coming up, and it's pretty easy to answer once you think about it the right way. But I couldn't find anything much useful on the Internet, so here's a little lesson on how to handle it.
If I try to plug this into my calculator, I'll get something in scientific notation, because the answer is too big for the calculator to display. In practical terms, the calculator will show me the beginning of the number, where I'm only caring about the end of the number. So the calculator won't help. I'll try expanding the factorial: 1×2×3×4×5×6×7×8×9×10×11×12×13×14×15×16×17×18×19×20×21×22×23 I know that a number gets a zero at the end of it if the number has 10 as a factor. For instance, 10 is a factor of 50, 120, and 1234567890. So I need to find out how many times 10 is a factor in the expansion of 23!. But since 5×2 = 10, I need to account for all the products of 5 and 2. Looking at the factors in the above expansion, there are many more numbers that are multiples of 2 (2, 4, 6, 8, 10, 12, 14,...) than are multiples of 5 (5, 10, 15,...). That is, if I take all the numbers with 5 as a factor, I'll have way more than enough even numbers to pair with them to get factors of 10 (and another trailing zero on my factorial). So to find the number of times 10 is a factor, all I really need to worry about is how many times 5 is a factor in all of the numbers between 1 and 23. How many multiples of 5 are between 1 and 23? There is 5, 10, 15, and 20, for four multiples of 5. Paired with 2's from the even factors, this makes for four factors of 10, so: 23! has four trailing zeroes Copyright © Elizabeth Stapel 2006-2008 All Rights Reserved
Okay, how many multiples of 5 are there in the numbers from 1 to 101? There's 5, 10, 15, 20, 25,... Oh, heck; let's do this the short way: 100 is the closest multiple of 5 below 101, and 100 ÷ 5 = 20, so there are twenty multiples of 5 between 1 and 101. But wait: 25 is 5×5, so 25 has an extra factor of 5 that I need to account for. How many multiples of 25 are between 1 and 101? Since 100 ÷ 25 = 4, there are four multiples of 25 between 1 and 101. Adding these, I get 20 + 4 = 24 trailing zeroes in 101! This reasoning continues with larger numbers. For instance:
Okay, there are 1000 ÷ 5 = 200 multiples of 5 between 1 and 1000. The next power of 5, 25, has 1000 ÷ 25 = 40 multiples between 1 and 1000. The next power of 5, 125, will also fit in the expansion, and has 1000 ÷ 125 = 8 multiples between 1 and 1000. The next power of 5, 625, also fits in the expansion, and has 1000 ÷ 625 = 1.6... um, okay, 625 has 1 multiple between 1 and 1000. (I don't care about the 0.6 "multiples", only the one full multiple, so I truncate to a whole number.) Then, in total, I have 200 + 40 + 8 + 1 = 249 trailing zeroes in the expansion of 1000! The previous example highlights the general method for answering this question, no matter what factorial they give you.
Here's how the process works:
I'll apply the procedure from above: Then 4617! has 923 + 184 + 36 + 7 + 1 = 1151 trailing zeroes. Note: Software like Excel won't help with this sort of computation, any more than your calculator would. Software customarily only stores fifteen or so digits of "accuracy", which is why, after a number gets sufficiently large, the display switches automatically to scientific notation. Since the software is only storing the first few leading digits, the remaining trailing digits have to be filled in with zeroes. If you attempt the first expansion above, "23!", in Excel, you'll get something with way more zeroes than is actually true. In other words, the computer will give you the wrong answer. So learn the concepts; don't try to cheat with software.
|
|
|
|
Copyright © 2006-2008 Elizabeth Stapel | About | Terms of Use |
|
|
|
|
|
|