You have a jar with 20 black balls and 16 white balls. At each step,
1. You remove two balls.
2. If the two balls are of the same color, you add a black ball. Otherwise you add a white ball.
You repeat these steps until there is only 1 ball remaining in the jar. What is the color of the remaining ball?
As a follow-up question, suppose you start with 100 black balls and 93 white balls. What is the color of the remaining ball?
- via Algorithmic puzzles