Answer to Question #28491 in Quantitative Methods for Jack

Question #28491
Problem: You have 100 balls with their numbers written on them. You throw away the first ball, skip the second, throw away the third, skip the fourth, etc. When you get to the end you loop back to the beginning of the remaining balls. So after the first pass through you'll end up with the even numbered balls (2, 4, 6, ... 100). Because on the first pass you kept 100, on the second pass through you'll throw away 2, keep 4, throw away 6, etc. You keep throwing away a ball and skipping one until there's one ball left. Which numbered ball is left?

I know the answer by just going through it manually, but I was wondering if there's a way to do this with a formula/Algorithm/some math way. I'll be translating the answer into computer code.

Thank you.
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS