# Students with Hats

Professor Vivek decided to test three of his students, Frank, Gary and Henry. The teacher took three hats, wrote on each hat a positive integer, and put the hats on the heads of the students. Each student could see the numbers written on the hats of the other two students but not the number written on his own hat.

The teacher said that one of the numbers is sum of the other two and started asking the students:

— Frank, do you know the number on your hat?

— No, I don’t.

— Gary, do you know the number on your hat?

— No, I don’t.

— Henry, do you know the number on your hat?

— Yes, my number is 5.

What were the numbers which the teacher wrote on the hats?

**SOLUTION**

The numbers are 2, 3, and 5. First, we check that these numbers work.

Indeed, Frank would not be able to figure out whether his number is 2 or 8. Then, Gary would not be able to figure out whether his number is 3 or 7, since with numbers 2, 7, 5, Frank still would not have been able to figure his number out. Finally, Henry can conclude that his number is 5, because if it was 1, then Gary would have been able to conclude that his number is 3, due to Frank’s inability to figure his number out.

Next, we we check that there are no other solutions. We note that if the numbers are 1, 4, 3, or 3, 2, 1, or 4, 1, 3, neither Frank nor Gary would have been able to figure their number out. Therefore, if the numbers were 1, 4, 5, or 3, 2, 5, or 4, 1, 5, Henry would not have been able to figure his number out. Thus, 5 is not the largest number.

Similarly, if the numbers are X, X + 5, X + 10, or X + 5, X, X + 10, once again, neither Frank nor Gary would have been able to figure their number out. Therefore, if the numbers were X, X + 5, 5, or X + 5, X, 5, Henry would not have been able to figure his number out.

We do not know where this puzzle originated from. If you have any information, please let us know via **email**.

The students knew BEFORE the first round of questioning that the numbers were different, because the teacher had told them this (of course the teacher might have been a seven-legged octopus, which would have prevented any solution being reached at all). The solution as presented displays runaway intuition at work – the sort of pattern finding exercise that might indicate the likelihood of a correct answer in a multiple choice IQ test if one was unable to find it in any other way, but it does not suffice here. Henry merely quessed. True he guessed correctly, but the number of options was severely limited and his success means nothing. Henry had no information whatever to show that his number was not 72, i.e., that the two numbers he could see (36 and 108) were not part of a sum (36) and a total (108), the latter being reached by adding his possible 72 to 108. Henry possessed enough information to know that but two options existed as to his number: either 72 or 144. That he guessed correctly is a chance result by very definition of the word.

Hi Element. The teacher did not tell the students that their numbers are different. They concluded this themselves, because if there were 2 hats with the same number, than the third student would have figured out that his number is equal to their sum. The rest of the reasoning also did not evolve any guessing.