Question series (6): Hat tricks

Source: Internet
Author: User

Question: ten people are caught by a devil. The devil is not interested in directly killing people. So he thought of a new way of killing people. That's right. One night, the devil announced the game rules to these 10 people, that is, he would arrange 10 of them in a row tomorrow morning, then, I randomly picked a hat from a pile of white hats with infinite numbers of black hats and gave them hats for 10 of them. Because 10 people are in a row, 10th people can see the color of the first 9 hats, and 9th people can see the color of the first 8 hats ,... and so on. Then, the devil will start from 10th people and ask him whether the color of the hat on your head is white or black. If correct, let him go. If wrong, is killed. Then, I also asked 9th people, and then asked 8th people, and so on. Only 10 of them can answer white or black questions when asked by the devil. No action beyond this scope. Otherwise, the devil will kill all 10 of them. Now, the devil gives them 10 people a night to discuss a countermeasure, so that the more people they can survive, the better. Excuse me, what kind of countermeasures do you have? How many of them can survive 100% in the worst case of your countermeasures? What is the expected number of people to survive?

 

Answer:

The answer can only be white or black, that is, only 2 can choose 1, which Lenovo binary and parity. Binary didn't come up with any good methods at once, and there were some tips for Parity, so we started with parity. 10th people answered with the odd number of white hats he saw. For example, we agreed that white represents an even, and black represents an odd, then the answer from 10th People is the parity of the number of white hats in the first nine hats. He has a 50% chance on his own. After hearing his answer, 9th people can know the color of their hats Based on the white hats' parity. 8th people know the parity of the white hat among the 9 hats, and hear the color of the 9th hats, they can know the parity of the white hat among the first 8 hats (if 9th people answer the white question, then, the white hats on the top of the first 8 are the opposite of those on the top of the first 8 hats. If the white hats on the top of the first 8 are blacklisted, the white hats on the top are displayed, you can also introduce your own hat color and answer it truthfully. So far, the first nine people can survive, and 10th People have half a chance.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.