Answer: because that those who don’t recognize what factorial is, 100! = 100 * 99 * 98 * … * 2 * 1

Ok, let’s look at how trailing zeros are formed in the first place. A rolling zero is developed when a lot of of 5 is multiplied v a multiple of 2. Now all we need to do is count the variety of 5’s and 2’s in the multiplication.

You are watching: How many zeros in 100!

Let’s counting the 5’s first. 5, 10, 15, 20, 25 and also so on do a complete of 20. But there is an ext to this. Due to the fact that 25, 50, 75 and 100 have two 5’s in each of castle (25 = 5 * 5, 50 = 2 * 5 * 5, …), you have to count lock twice. This makes the grand total 24. For world who like to look in ~ it native a formula suggest of view

Number of 5’s = 100/5 + 100/25 + 100/125 + … = 24 (Integer values only)


Moving on to count the variety of 2’s. 2, 4, 6, 8, 10 and so on. Full of 50 multiples the 2’s, 25 multiples the 4’s (count these once more), 12 multiples the 8’s (count these once more) and so on… The grand total comes the end to

Number of 2’s = 100/2 + 100/4 + 100/8 + 100/16 + 100/32 + 100/64 + 100/128 + … = 97 (Integer worths only)

Each pair that 2 and 5 will cause a trailing zero. Because we have only 24 5’s, we can only make 24 bag of 2’s and 5’s thus the variety of trailing zeros in 100 factorial is 24.

If girlfriend have any type of questions, please feel totally free to send me an e-mail at . If friend have any kind of interview concerns which you feel would benefit others, I would love to hear around it.


Continue reading Below

If you like this post, please Digg that or provide it a thumbs up on StumbleUpon.

See more: Is It Ok To Eat Ramen Noodles While Pregnant Women To Eat Instant Noodles?

If you're trying to find some severe preparation for your interviews, I'd introduce this publication written by a lead Google interviewer. It has actually 189 programming questions and also solutions:
\"*\"

Related posts:


6 Comments
Filed in Puzzles
posted by john Sonmez
Tagged easy, mathematics, numbers, puzzle

6 Responses


Leave a Reply


Click right here to cancel reply.


Using Gravatars in the comments - gain your own and also be recognized!

XHTML: this are some of the tags you can use:


My tech Interviews is powered by WordPress using design template Tribune
report this ad

Search Interview Questions


Random

report this ad

Categories

report this ad

Archives


report this ad
x
x