How many trailing zeros are in 100! (100 factorial)?
First, let's make sure we understand what we mean by factorial and by trailing zeros.
Factorial means taking a number and multiplying it by one less than that number, then two less than that number, etc. until you get to 1. For example:
What we mean by trailing zeros is the number of consecutive zeros at the end of a number. For example:
So one way to solve this problem is to simply calculate 100!, which would be 100 x 99 x 98 x 97 x ... x 3 x 2 x 1. And this will give you the right solution, as long as you don't make any multiplication mistakes while multiplying 100 numbers. But let's try to figure this out more intelligently.
Let's start with the question of, what would add a trailing zero? Or another way of saying this is, since we're talking about multiplying a bunch of numbers together, what would you need to multiply with to add a trailing number? When asked this way, most people will quickly realize that multiplying any number by 10 adds a trailing zero to that number (e.g., 4 x 10 = 40).
So with that information, that each 10 adds a trailing zero, how do you figure out how many trailing zeros there are in 100! ? It's relatively easy to see that every number that's a factor of 10 (e.g., 10, 20, 30, 40, etc.) adds a trailing zero, and since there are 10 of these numbers, that's 10 trailing zeros. Or, if you realize that 10 is actually two factors of 10 (i.e., 100 = 10 x 10), then that's 11 trailing zeros.
But there are more than 11 trailing zeros in 100!. Look at 5! :
5! = 5 x 4 x 3 x 2 x 1 = 120
Do you see why? Can you solve it from here?
Continue to solution