返回题库

最后剩下的球

Last Ball

专题
Brainteaser / 脑筋急转弯
难度
L4

题目详情

袋子里有 20 个蓝球、14 个红球。每次随机取出 2 个球:

  • 若两球同色,则放回 1 个蓝球;
  • 若两球异色,则放回 1 个红球。

重复直到只剩 1 个球。问最后剩下球的颜色是什么?

如果初始是 20 蓝 13 红呢?

A bag has 20 blue balls and 14 red balls. You randomly take out 2 balls at a time. If both are the same color, you put back 1 blue ball; if they are different colors, you put back 1 red ball. Repeat until only 1 ball remains. What is the color of the last ball? What if initially there are 20 blue and 13 red?

解析

答案:

  • 初始 20 蓝 14 红(红球数为偶数)→ 最后剩 蓝球
  • 初始 20 蓝 13 红(红球数为奇数)→ 最后剩 红球

关键不变量:红球数量的奇偶性在操作下保持不变,因此最终剩球颜色由红球奇偶决定。


Original Explanation

  • With 20 blue and 14 red (an even number of reds), the last ball is blue.
  • With 20 blue and 13 red (an odd number of reds), the last ball is red.

Each same-color pair removes 2 of that color but adds 1 blue, effectively changing the count of blue by ±1 and red by ±0 or ±2. One can show that the parity of red balls controls the outcome.