The Wayback Machine - https://web.archive.org/web/20240930174821/https://www.geeksforgeeks.org/puzzle-47-red-hat-vs-blue-hat/
Open In App

Puzzle 47 | Red Hat vs Blue Hat

Last Updated : 18 Jan, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

A team of three people decide on a strategy for playing the following game. Each player walks into a room. On the way in, a fair coin is tossed for each player, deciding that player’s hat color, either red or blue. Each player can see the hat colors of the other two players, but cannot see her own hat color. After inspecting each other’s hat colors, each player decides on a response which are one of the following :

             “I have a red hat”, or “I had a blue hat”, or “I pass”

The player’s responses are recorded, but the responses are not shared until every player has recorded her response. The team wins if at least one player responds with a color and every color response correctly describes the hat color of the player making the response. In other words, the team loses if either everyone responds with “I pass” or someone responds with a color that is different from her hat color. What strategy should one use to maximize the team’s expected chance of winning?

For example, one possible strategy is to single out one of the three players. This player will respond “I have a red hat” and the others will respond “I pass”. The expected chance of winning with this strategy is 50%. Can you do better?

Answer : A better solution exists for 75% chance of winning.

Solution : With three players and two hat colors, there are a total of eight equally likely outcomes :

One special feature about the distribution is that most outcomes–six of them–include at least one hat of both colors. Only two extreme outcomes don’t–the ones with all red hats or all blue hats. We can analyze further. Among outcomes with both hat colors, there logically has to be two hats of one color (the “majority” color) and one hat of another color (the “minority” color). See pic below

Now, by looking at the other hats, players can identify whether they are wearing a majority color or a minority color. For instance, if a player sees both a red and blue hat, then the player must be wearing the majority color (which could be red or blue). If a player sees two blue or two red hats, then the player must be wearing the minority color, which will be the opposite color of what the player sees. Here is what players can reason among the six choices:

Now the idea is to get the player with the minority hat color to guess and force the other people to pass.
So here is the strategy :
If you see both a red and a blue hat, then “pass”
If you see two red hats, then guess “blue”
If you see two blue hats, then guess “red”

This strategy wins in all six cases with at least one hat of each color. It only loses in the two cases of all-red or all-blue, in which all players guess incorrectly. Here is how players would guess:

So the group wins in six of eight possible outcomes– a whopping 75 percent chance.

 

This puzzle is contributed by Feroz Baig.

 


Previous Article
Next Article

Similar Reads

Puzzle | 50 red marbles and 50 blue marbles
Give two boxes B1 and B2 one have 50 red marbles and other have 50 blue marbles. A ball is selected randomly from any of the box and the task is to maximize the probability of selecting a red ball, by reshuffling marbles in both the boxes. Solution: Let P(R) be the probability of picking a red marble. P(R) = P(B1) * P(B1 | J1) + P(B2) * P(B2 | J2)
2 min read
Puzzle 41 | (Guess Color of Hat)
There are 20 people standing in a line, one behind the other. Each is made to wear a hat, which can either be white or black. There can be any number of white or black hats between 0 and 20. Each person can see the hat of all the persons ahead of him in the line, but not those of the people standing behind. Each person is required to guess (loudly)
2 min read
Puzzle 75 | Prisoner's Hat
A Police officer caught four criminals. He plays a game with these four men. He lines up three of the prisoners (A, B, C) in one room and the fourth prisoner(D) is placed in a separate room. Each prisoner is given a hat to wear. The officer tells them that there are in total two blue hats and two red hats. If any of them can guess the color of the
2 min read
Puzzle | Cut Blue Painted Cube
A solid, n-inch cube of wood is coated with blue paint on all six sides. Then the cube is cut into smaller one-inch cubes. These new one-inch cubes will have either Three blue sides, Two blue sides, One blue side, or No blue sides. How many of each type 1 - inch cube will there be? Solution: This puzzle can be solved logically or mathematically. Af
2 min read
The Blue – eyed Island puzzle
Question : A bunch of people are living on an island, when a visitor comes with a strange order : all the blue-eyed people must leave the island as soon as possible. There will be a flight out at 8 PM every evening.Each person can see everyone else's eye color, but they do not their own(nor is anyone allowed to tell them). Additionally they do not
2 min read
Puzzle | 9 Students and Red Black Hats
Puzzle: There are 9 IITians in a classroom. A professor enters the room with a bag. He says to them that there are 9 hats inside the bag. The hats are either of red colour or black colour. Further instruction was provided that there is at least one red hat and the number of black hats is greater than that of the red ones. The professor puts the hat
3 min read
Puzzle 13 | (100 Prisoners with Red/Black Hats)
100 prisoners in jail are standing in a queue facing in one direction. Each prisoner is wearing a hat of color either black or red. A prisoner can see hats of all prisoners in front of him in the queue, but cannot see his hat and hats of prisoners standing behind him. The jailer is going to ask color of each prisoner's hat starting from the last pr
3 min read
Puzzle | Man fell in well Puzzle
A man fell in a 50m deep well. He climbs 4 meters up and slips 3 meters down in one day. How many days would it take for him to come out of the well? Answer: 47days Explanation: On the first day, the man climbs 4 meters up and slips 3 meters down, therefore he only climbs 1 meter up totally.On the second day, again he climbs 1 meter up, so the tota
1 min read
Puzzle - A LITTLE TRAIN PUZZLE
A nonstop express going sixty miles an hour starts from Bustletown for Ironchester, and another nonstop express going forty miles an hour starts at the same time from Ironchester for Bustletown. How far apart are they exactly an hour before they meet?Because the two stations cannot be found on any map or gazetteer, we cannot state the distance betw
1 min read
Puzzle | The Einstein's Puzzle
Einstein's puzzle is a famous logic puzzle that was supposedly created by Albert Einstein as a boy. The puzzle goes as follows:There are five houses in a row, each with a different color. In each house lives a person of a different nationality. The five owners drink a certain type of beverage, smoke a certain brand of cigar, and keep a certain pet.
4 min read
Puzzle 15 | (Camel and Banana Puzzle)
A person has 3000 bananas and a camel. The person wants to transport the maximum number of bananas to a destination which is 1000 KMs away, using only the camel as a mode of transportation. The camel cannot carry more than 1000 bananas at a time and eats a banana every km it travels. What is the maximum number of bananas that can be transferred to
4 min read
Puzzle 24 | (10 Coins Puzzle)
You are blindfolded and 10 coins are placed in front of you on the table. You are allowed to touch the coins but can’t tell which way up they are by feel. You are told that there are 5 coins head up, and 5 coins tails up but not which ones are which. Can you make two piles of coins each with the same number of heads up? You can flip the coins any n
1 min read
Puzzle 27 | (Hourglasses Puzzle)
Puzzle: Given two hourglass of 4 minutes and 7 minutes, the task is to measure 9 minutes. Solution: At 0 minutes: Start both hourglasses at the same time. At 4 minutes: 4 minutes hourglass runs out and flip it. 7 minutes hourglass is left with 3 minutes. At 7 minutes: 4 minutes hourglass is left with 1 minute. 7 minutes hourglass runs out and flip
1 min read
Puzzle 28 | (Newspaper Puzzle)
Question: A newspaper made of 16 large sheets of paper folded in half. The newspaper has 64 pages altogether. The first sheet contains pages 1, 2, 63, 64. If we pick up a sheet containing page number 45. What are the other pages that this sheet contains? Answer: On the back of 45, it is 46. The pages are such that for each page p, 65-p will be also
1 min read
Puzzle 31 | (Minimum cut Puzzle)
Puzzle: You have got someone working for you for five days and a gold bar to pay him. You must give them a piece of gold at the end of every day. What are the fewest number of cuts to the bar of gold that will allow you to pay him 1/5th each day? Answer: 2 cuts. Solution: Explanation 1: After two cut there are three pieces of [1 unit and two 2 unit
2 min read
Puzzle 33 | ( Rs 500 Note Puzzle )
A Lady (L) bought an item of Rs 100 from the Shopkeeper (C). She paid him through a 500 Rs Note. Realizing that he did not have change, the shopkeeper C got change for that note from another shopkeeper (S) and paid Rs 400 to the Lady. After a few days, S realized that the note is fake, And this railed at C and took 500 Rs back from him. So in this
1 min read
Puzzle 36 | (Matchstick Puzzle)
Question: How to make 4 equilateral triangles with 6 identical match sticks? Method - I: Make a tetrahedron. Method-II: Method - III: Make one equilateral triangle by three sticks . then put each remaining stick on straight line passing through middle points of each two arms of triangle. Method IV: https://youtu.be/DqLOC85SVHQ
1 min read
Puzzle 38 | (Tic Tac Toe Puzzle)
Statement: The game of Tic-Tac-Toe is being played between two players and it is in below state after six moves. Can you answer following questions? Who will win the game, O or X? Which was the sixth mark and at which position? Assume that both the players are intelligent enough. Solution: O will win the game. The sixth mark was X in square 9. Expl
1 min read
Puzzle 39 | (100 coins puzzle)
This puzzle is similar to 10 Coins Puzzle. Question: 100 coins are lying flat on a table. 10 of them are heads up and 90 are tails up.You can't see which one is which.How can we split the coins into two piles such that there are same number of heads up in each pile? Note: It is allowed to flip the coins of one pile once. Answer: Make 2 piles with 1
1 min read
Puzzle 51| Cheryl’s Birthday Puzzle and Solution
(Wiki) Cheryl's Birthday is the unofficial name given to a mathematics brain teaser that was asked in the Singapore and Asian Schools Math Olympiad, and was posted online on 10 April 2015 by Singapore TV presenter. It is an interesting problem and might be asked in the interviews. It is based on logical deduction. It doesn’t require any prior mathe
3 min read
Puzzle 85 | Chain Link Puzzle
You have five pieces of chain, each consisting of three links. You want to make one long chain of these five pieces. Breaking open a link costs 1 Rs, and welding an open link costs 3 Rs. Is it possible to make one long chain of the five pieces, if you have just 15 Rs? Solution: Let us name the chains as 1, 2, 3, 4, 5 each having three links. Take c
1 min read
Puzzle | 3 Priests and 3 devils Puzzle
There are 3 devils and 3 Priests.They all have to cross a river in a boat.Boat can only carry two people at a time.As long as there are equal number of devils and priests,then devils will not eat Priest.If the number of devils are greater than the number of priests on the same side of the river then devils will eat the priests.So how can we make al
2 min read
Puzzle - "Rocky and Sam's Avian Puzzle: A Feathery Conundrum"
In a little town called Puzzleville, where puzzles and brain teasers made every day exciting, two friends, Rocky and Sam, got caught up in a tricky puzzle about flying birds. Sam, being curious, asked Rocky a question that led them on an adventure to solve the mystery of the birds in the sky. The Puzzle"Rocky," Sam began, his eyes sparkling with ex
2 min read
Puzzle 29 | (Car Wheel Puzzle)
Puzzle: A car has 4 tyres and 1 spare tyre. Each tyre can travel a maximum distance of 20000 km before wearing off. What is the maximum distance the car can travel before you are forced to buy a new tyre? You are allowed to change tyres (using the spare tyre) an unlimited number of times.   Answer: 25000 kmsSolution: Divide the lifetime of the spar
6 min read
Puzzle 81 | 100 people in a circle with gun puzzle
100 people standing in a circle in an order 1 to 100. No. 1 has a sword. He kills the next person (i.e. No. 2) and gives the sword to the next (i.e. No. 3). All people do the same until only 1 survives. Which number survives at the last? There are 100 people starting from 1 to 100. Solution: 73rd person will survive at last Explanation 1 (intuitive
8 min read
Puzzle 34 | (Prisoner and Policeman Puzzle)
Policeman decided to punish the Prisoner and asked him to make a statement. The Prisoner should make such a statement so that he would be alive. If the statement is held true by Policeman, the Prisoner will be hanged to death and if the statement is held false, the Prisoner will be shot dead. Answer: The Prisoner said, 'I will be shot dead'. If the
1 min read
Puzzle | Elevator Puzzle
A man works on the 10-th floor and takes the elevator down to ground level at the end of the day. Yet every morning, he only takes the elevator to the 7th floor, even when in a hurry. But he goes all the way to the 10-th floor when others are in the elevator with him or it is a rainy day. Why? Solution: He is too short to reach the "10" button on t
1 min read
Minimum number of Apples to be collected from trees to guarantee M red apples
There are different kinds of apple trees in the four directions (East, West, North, South), which may grow both red and green apples such that each tree grows exactly K apples, in the following manner: N - number of trees to the north does not have red apples.S - number of trees to the south does not have green apples.W - number of trees in the wes
7 min read
Puzzle 2 | (Find the ages of daughters)
Alok has three daughters. His friend Shyam wants to know the ages of his daughters. Alok gives him a first hint. 1. The product of their age is 72. Shyam says this is not enough information Alok gives him a second hint. 2. The sum of their ages is equal to my house number. Shyam goes out and looks at the house number and tells “I still do not have
2 min read
Puzzle 11 | ( 1000 Coins and 10 Bags )
A dealer has 1000 coins and 10 bags. He has to divide the coins over the ten bags so that he can make any number of coins simply by handing over a few bags. How must divide his money into the ten bags? Solution: The idea of filling coins in the powers of 2 can be get from the condition that was given the question that each bag can be given or not g
2 min read
Article Tags :
Practice Tags :