100 men are in a room, each wearing either a white or black hat. Nobody knows the color of his own hat, although everyone can see everyone else's hat. The men are not allowed to communicate with each other at all (and thus nobody will ever be able to figure out the color of his own hat).
The men need to line up against the wall such that all the men with black hats are next to each other, and all the men with white hats are next to each other. How can they do this without communicating? You can assume they came up with a shared strategy before coming into the room.
The men go to stand agains the wall one at a time. If a man goes to stand against the wall and all of the men already against the wall have the same color hat, then he just goes and stands at either end of the line. However, if a man goes to stand against the wall and there are men with both black and white hats already against the wall, he goes and stands between the two men with different colored hats. This will maintain the state that the line contains men with one colored hats on one side, and men with the other colored hats on the other side, and when the last man goes and stands against the wall, we'll still have the desired outcome.
You are a prisoner sentenced to death. The Emperor offers you a chance to live by playing a simple game. He gives you 50 black marbles, 50 white marbles and 2 empty bowls. He then says, "Divide these 100 marbles into these 2 bowls. You can divide them any way you like as long as you use all the marbles. Then I will blindfold you and mix the bowls around. You then can choose one bowl and remove ONE marble. If the marble is WHITE you will live, but if the marble is BLACK... you will die." How do you divide the marbles up so that you have the greatest probability of choosing a WHITE marble?
HINT: The answer does not guarantee 100% you will chose a white marble, but you have a much better chance.
Place 1 white marble in the bowl, and place the rest of the marbles in the other bowl (49 whites, and 50 blacks). This way you begin a 50/50 chance of choosing the bowl with just one white marble, therefore life! BUT even if you choose the other bowl, you still have almost a 50/50 chance at picking one of the 49 white marbles.
It was a grandeur party. In order to filter the uninvited guests, the security guard was assigned a task to check the secret password. The guests invited by the royal family also were shared with the secret password.
John wasn't an invited guest. He learned that the password is needed to make an entry. He hides himself and started watching the guests and the security.
The first guest comes. Security told him, TWELVE and the guest replied SIX. He wished him and allowed him to enter.
The second guest comes. Security told him SIX and the guest replied THREE! He was too allowed.
John made an entry as third guest. Security told him EIGHT and John replied FOUR. He was thrown out of the party!
The answer should be five. The password is not half of the digit, but the number that represents the number of digits told by security.