# Treasure Hunt Riddle

John and Peter participate in a treasure hunting competition. The organizer places a gold medal in one of the lockers. The locker rack contains 49 lockers, each of which has a name indicating its row and column. The organizer gives both of them a list of 10 possible treasure locker locations (cells highlighted in yellow below). The organizer will tell John the treasure locker row (A to G) and tell Peter the treasure locker column (1 to 7).

John: "I have no idea where the treasure locker is, and I do not think Peter will know.".
Peter: "I have no idea just now, but I know the treasure locker location."
John: "I also know where the treasure locker location is".

• Do they both have the same list of 10 possible lockers ? – Rémi Henry Feb 26 at 15:18
• @RémiHenry From my understanding the possible lockers are the ones marked with yellow in the table. Anyway I'm sure they both get the same list of possible lockers. – npkllr Feb 26 at 15:22
• @npkllr, yes that's what i thought afterward – Rémi Henry Feb 26 at 15:23
• @RémiHenry yes,they both have same list and marked with yellow are the possible lockers. – Hugo Feb 26 at 15:24
• rot13(Fbzr bs vg pbzrf qbja gb ynathntr. "V qb abg guvax Crgre jvyy xabj" pna vasre gung Crgre zvtug xabj. Naq gur fragrapr "V unir ab vqrn whfg abj, ohg V xabj gur gernfher ybpxre ybpngvba" vf n ovg pbagenqvpgbel gbb. V srry yvxr Wbua'f svefg nafjre zrnaf gung gur Gernfher pbhyq or va Ebj N be O.) Which makes me feel that Pravin's answer is correct. – davewasthere Feb 27 at 4:43

If John

Doesn’t think Peter will know, he must be sure that the gold medal isn’t in A5 or B3. He therefore mustn’t have been told A or B.

Eliminated lockers:

A2, A5, B3, B6, B7.

The medal is therefore in

rows D or F.

Now, If Peter

was told 1, he still wouldn’t be able to find out the locker after John’s statement, because D1 and F1 are both possible lockers. So the gold medal isn’t there.

More eliminated lockers:

D1, F1

Peter must’ve been told

2, 6, or 7, because he would be able to uniquely determine the locker after John’s statement. There are three possible lockers: F2, D6, and F7.

If John was told

F, then by Peter’s statement, F1 would be eliminated in John’s mind. However, John would not be able to discern between F2 and F7. If John was told D, he would know the locker was D6. This is the only locker where both would know the location given their deductions.

Therefore the gold medal is in

Locker D6.

Edit:

@Elpharya raises a good point, that I might not have been super clear why

John wasn't told that the medal was in row B (or for that matter, in row A).

The reason is,

Let's assume that John was told that the medal was in row B. So the medal would be in either B3, B6, or B7. Since there's a chance that the medal was in locker B3, there's a chance that Peter was told the number 3. If Peter was told the number 3, then John could not be sure that Peter wouldn't know where the medal was hidden. Another way to phrase this is that John knows that Peter wasn't told the numbers 3 or 5, because he knows that Peter can't guess the right locker. How does he know that Peter wasn't told the number 3? Because John wasn't told the letter B, and that's the only row where the number 3 shows up. How does John know that Peter wasn't told the number 5? Because John wasn't told the letter A, and that's the only row where the number 5 shows up.

I hope this clears things up!

• Would you mind clarifying why rot13(wbua jnfa'g gbyq vg jnf O)? – Elpharya Feb 27 at 3:08
• @Elpharya -- please see my edited answer. Hope this clears everything up! – El-Guest Feb 27 at 4:16
• @El-Guest Thanks for your clarification but I think the OP is a bit misleading. It says John says "I have no idea where the treasure locker is, and I do not think Peter will know.". I thought it meant that John thinks there is a possibility for Peter to know. It may have been clearer if it said "Peter can't know either". – Telokis Feb 27 at 14:22

A2

Now since

A5 and B3 rows are removed because in this row there is only one option for John but in the first statement he says he has no idea so there is for sure more than one yellow locker to guess for.

Now John says

Peter will not get it because he knows that whichever column he gets he will have to face at least two yellow blocks.

Now Peter says

that he knows the treasure location and same by John. This is only possible if both have only one yellow block in their row/column. Now as this is only possible for A2 as for the column Peter has only one remaining option and John knows it's A2 because he knows the locker is in A2 or F2 but then Peter's statement says he knows it which is only possible if Peter would have remained with two or less yellow blocks which case is violated by F2.

• Welcome to Puzzling Stack Exchange! Please hide your answer in a spoiler tag - you can do this by putting ">! " at the start of the line :) – Elpharya Feb 26 at 20:12
• I'm sorry, I can't follow your solution at all. You seem to be confusing rows with columns and Peter with John. Peter is the one that was given the column number, and John is the one that was given the row letter. Also you seem to be taking the statements out of order. Peter can't base his decision on the knowledge that John knows where the locker is, because John only said that after Peter already said he know where the locker is. – Amorydai Feb 27 at 16:05

I have a different answer. It might be a little lateral-thinking, but word choice matters! The treasure is in locker:

F2

The first thing to really pay attention to is when John says:

"I do not think Peter will know".
Why didn't he say I know for a fact Peter does not know? Because he does not know for a fact that Peter does not know. It's like when I go with my friend to play roulette and he puts all his money on 32. I try to talk him out of it by saying "take your money back, I do not think 32 will come up". Why did I say that? Do I know for sure 32 will not come up? Of course not, it's just that it's so unlikely that I do not think it will this time. Same with John, he does not know that Peter for sure does not know where the treasure is, it is just that it is unlikely that he does.

Having determined this, the next step is:

So we cannot eliminate row B, because if John was given row B then Peter could have been given columns 3, 6 or 7. Only if he was given column 3 would he know where the treasure is - that's a 33% probability and unlikely to happen in a sense that an even that occurs 66% of the time is more likely to happen than one that occurs only 33% of the time. Right? That is why John says he does not think Peter will know.
The only row we can eliminate is row A. If John was given row A then Peter would have a 50% chance to either know or not know where the treasure is, so John would be unable to say that he doesn't think Peter will know, because with a 50% chance he cannot take a position of what is more likely to happen - Peter knowing or not knowing.

It's a breeze now:

Now Peter says he didn't know where the treasure was, but now he knows. So Peter was not given columns 3 or 5 because then he would know right away. The only way for him to know where the treasure is after only eliminating row A is if the treasure is in F2. Now for John to know where the treasure is after hearing Peter would have to mean that he was given row F and he also deduced that the treasure is in F2.

And that's that.

EDIT: You may have noticed that

John did know for sure that Peter does not know the location of the locker. Why didn't he just say that then? The problem is, if John was given row F and he said Peter cannot know the location of the treasure, thus eliminating both rows A and B, then if Peter next said he knows where the treasure is, John would be stuck, because the treasure can be in F2 or F7. Since John knows this, he chose his words carefully to only eliminate row A, because he is smarter than your average Joe.
Now if Peter says he knows where the treasure is, like in the problem, then it's in F2. If Peter says he still doesn't know then John can eliminate row B by saying something like "I actually knew you didn't know even before you said anything". Now if Peter knows, then it's in F7 and if he still doesn't know then it's in F1. John was just trying to make sure he can figure out the location.

Also notice that

John cannot have been given row A. I already mentioned why, but there is another reason - because his statement would be inconsistent with itself. If John was given row A, and he says that he does not think Peter will know, then that means that he thinks Peter will not know. This is just how logic works. If he thinks Peter will not know, then he thinks Peter was given column 2, because that's the only column where Peter will not know. If John thinks Peter was given column 2 then the treasure will be in A2. So if John was given row A and he does not think Peter will know, then he thinks treasure is in A2. How can he then say that he has no idea where the treasure is? He has some idea - he thinks it's in A2! This is logically inconsistent so he cannot have been given row A and make the statements that he makes.