" You are given 5 bags containing 100 coins each. The bags can contain
c
oins of 3 different types that look identical. The first type weighs 9 g
rams, the second type 10 and the third type 11 grams. Each bag contains
coins of equal weight but you do not know how many of the 5 bags are of
the different types. (i.e. all 5 bags might well contain 9 gram coins as
far as you are concerned). You are given a huge digital balance. How ma
ny times do you need to use the balance to clearly determine the type of
coin contained in each bag?
1 coin from bag 1
3 coins from bag 2
9 coins from bag 3
27 coins from bag 4
81 coins from bag 5
You are done.
是不是需要把结果分解成
a0+a1*3+a2*9+a3*27+a4*81
来判断每个盒子装的是哪种coin?
把和mod 3 得到 a0
然后 mod 9 结合 a0 得到 a1,依次类推
Edit:
For n different types of coin in m bags, we choose
n^0 from the first bag
n^1 from the second bag
n^2 from the third
...
...
n^(m-1) from the m-th
阅读(724) | 评论(0) | 转发(0) |