98. The first guy tell the number of hat, which color is different from the second guys's hat, is odd or even. The second guy tell the number of another color hat is or or even. |
Actually, I think it can be 99: The possible colors compostions of the first 99 hats can be divided into 4 groups: (odd,odd,odd), (even,even,odd) (even,odd,even) (odd,even,even). The second guy, based on the colors of the first 98 hats can exclude one situation, so the first guy only have to code the remaining 3 cases with the three colours. |
How can the second guy, based on the colors of the first 98 hats can exclude one situation? Suppose r=(odd,odd,odd), y=(even,even,odd), b=(even,odd,even). If the first guy can say "Don't know", I know how to do it. Otherwise, how to handle (odd,even,even)? |
I guss my notation is misleading. By (odd,even,even) I mean there are odd # of red, even # of yellow and even # of blue. If the sencond guy, with 98 hats in front of him, counts (odd,odd,even), he knows that the first guy, with 99 hats in front of hime, will not count (even,even,odd). So the first guy don't have to worry about this situation when he try to encode his observation. |
如果有四种颜色的帽子呢?100种呢?无穷多种呢? |
I understand you point. What about the situation when #99 count (even,even,even)? |
good question. |
I still can not prove or disprove whether 99 is right, are you sure this is only a ++ question? |
Yes. It is not difficult. You should be able to get it except your thinking is limited by the original, two-colored version of the problem, which called for a binary solution. |
Thanks for the hint. So the first guy can just encode the information of mod(#red,3), and others will be able to deduce the his color. |
欢迎光临 珍珠湾ART (http://zzwav.com/) | Powered by Discuz! X3 |