天平找异重豆 II
Balanced Beans II
题目详情
有 12 颗豆子,其中恰好 1 颗与其他不同,它可能略重也可能略轻。使用天平左右称重。
问:最少需要称几次,才能保证确定哪一颗是异常豆子并判断它是偏重还是偏轻?
There are beans; one weighs slightly heavier or lighter than the others. What is the minimum number of times a balance scale must be used to guarantee the determination of the abnormal bean?
解析
最少需要 次称重。
理由(信息论下界):
- 每次称重有 3 种结果(左重/右重/平衡),3 次最多区分 种情况。
- 12 颗豆子,每颗可能“偏重/偏轻”两种,共 种可能,需要至少 3 次。
并且经典 12-coin 方案可在 3 次内完成,因此最小次数为 3。