Skip to content
Related Articles
Open in App
Not now

Related Articles

Puzzle | Find the last ball to remain after the entire process

Improve Article
Save Article
  • Difficulty Level : Medium
  • Last Updated : 08 Feb, 2023
Improve Article
Save Article

Problem Statement: You have 20 Red and 16 Blue balls in a bag. You pull out 2 balls one after another. If the balls are of the same color, then you replace them with a Blue ball – but if they are of different color, you replace them with a Red ball. Once you take out the balls, you do not put them back in the bag – so the balls keep reducing. What would be the color of the last ball remaining in the bag?

Answer: Red Balls

Observations:
Blue balls can only be reduced by two and that too if the 1st condition is satisfied, i.e., if you choose both blue balls, then they are replaced by a single red ball. In no other ways you can reduce blue balls. Red balls can be reduced by one on the basis of 2nd condition if you choose both different balls and on the basis of 1st condition if you choose both red balls.
Now, because there are an even number of blue balls and blue balls can only be reduced by two, you will end up with either 0 or 2 or 4…(even number) blue balls in the bag at any point during the replacement process. There will never be a situation in which the bag contains an odd number of blue balls. As a result, the last ball in the bag will be a red ball in any combination of replacements.

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!