Black Hat white hat

Source: Internet
Author: User

A group of people have a dance party with a hat on their heads. There are only black and white hats, and at least one black hat. Everyone can see the colors of others' hats, but not their own. The host will show you what hats others wear on their heads and turn off the lights. If someone thinks they are wearing black hats, clap their hands. Turn off the light for the first time and there is no sound. Then we turned on the light and watched it again. When the light was turned off, it was still silent. It was not until the third time that the light was switched off that the sound of a clap of hands sounded. How many people are wearing black hats?


Analysis

The minimum number of black hats is determined.


0, not valid;

1 top, 1 ring; first enlightened when you see 0.

2, 2 rings; a black sees B black, bet B sees 0. The first time I did not ring, the second time I proved I was wrong, I was blackening myself, two times 

3 things:C black to see the AB black, will bet AB to see a black, think AB will ring for the second time, otherwise he will be black. Three calls. 

4 things, 4 things: d Things are black. If you see ABC three blacks, you will bet on ABC one by one. If it is correct, it will ring for 3rd Times. Otherwise, you will ring for the fourth time.

5 top, 5 calls; eIf you see the four blacklisted items on the top of the black list, the four blacklisted items will be played four times, or even 5th times.

.......

According to this logic, it can be true. There are K black hats and K rings. The launch of the top 3.

How dull a group of people ....



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.