回复:红蓝帽子问题的真正答案

本帖于 2011-12-12 02:34:33 时间, 由版主 笑比哭好 编辑
回答: 红蓝帽子问题的真正答案a7a82011-12-11 14:48:38

If we suppose that everyone can hear what other people have reported, then all people can survive.


Suppose that we have x red hats and y blue hats, where x,y are between 1 and 99, and x+y=100.


Case one ------ x=y=50:


                The queue is: red, blue, red, blue, …, red, blue.


The first one is red and the last one is blue. The last person knows that he is blue and report blue. Then each other people know the hat of his color from the pattern of the queue he see or hear.


 


Case two ------ x is less than y, such as x=10, y=90:


                The queue is: 10 blue, 10 red, 80 blue.


                The last 80 people with blue hats and last 9 people with red hats are easy to know that there 10 red hats when they see 10 blue hats at the beginning of the queue. So they can guess the colors of hats they have by counting their locations in the queue. The first 10 people with blue hats and the first people with red hat can guess the colors of their hats by counting how many people report red hats and their locations in the queue.


 


Case three ----- y is less than x.


                The queue is: y red, y blue, x-y red.


                Reason is similar to the case two.

所有跟帖: 

你不能假设帽子,那是国王的权力。此题是囚犯自救。 -a7a8- 给 a7a8 发送悄悄话 (0 bytes) () 12/11/2011 postreply 18:42:33

请您先登陆,再发跟帖!