# Are there eighteen or twenty bars in my castle?

Two friends, Mark and Rose, are very famous logicians; they are so clever that they can deduce any logic connection possible in a matter of minutes even from the most vague situation.

Unfortunately, one day, the two friends are abducted by the Evil Logician, who is envious of their fame, and believes they don't deserve it. He imprisons them in his castle and decides to test their cleverness. They are kept in two different cells, which are located on opposite sides of the castle, so that they cannot communicate in any way. Mark's cell's window has twelve steel bars, while Rose's cell's window has eight.

The first day of their imprisonment, the Evil Logician tells first Mark and then Rose that he has decided to give them a riddle to solve. The rules are simple, and solving the riddle is the only hope the two friends have for their salvation:

• In the castle there are no bars on any window, door or passage, except for the windows in the two logicians' cells, which are the only barred ones (this implies that each cell has at least one bar on its window).
• The Evil Logician will ask the same question to Mark every morning: "are there eighteen or twenty bars in my castle?"
• If Mark doesn't answer, the same question will then be asked to Rose the night of the same day.
• If either of them answers correctly, and is able to explain the logical reasoning behind their answer, the Evil Logician will immediately free both of them and never bother them again.
• If either of them answers wrong, the Evil Logician will throw away the keys of the cells and hold Mark and Rose prisoners for the rest of their lives.
• Both Mark and Rose know these rules.

Can the two logicians redeem themselves? If so, what will the reasoning behind the correct answer be, and what's the minimum number of days it will take either of them to answer correctly?

• Is the question "are there (18 bars in the castle) or (20 bars in the castle)", or "are there (18 or 20 bars in the castle) or (some other number of bars in the castle"? If the former, is it guaranteed that one of the options is correct (i.e. is it a rule that there are either 18 bars in the castle or 20 bars in the castle)? – 2012rcampion Nov 15 '16 at 5:27
• Hello Marco, very nice puzzle. Did you come up with it or it is a famous one? – Puzzle Prime Nov 15 '16 at 7:09
• I'm sorry but, are you copying your puzzles from a youtube channel ? The second time I see one of your puzzle it's coincidently also one that has been talked about by the same youtube channel. – Teleporting Goat Nov 15 '16 at 16:17
• Ok, I challenge everyone who thinks that he understood the solution to try it out in chat or at home. Two players, one arbiter (Evil Logician). Each player tells only the arbiter how many bars are on the window and the arbiter tells both players only the right sum and a wrong one. We go now step for step through the puzzle and if this really works, it could be demonstrated, right ? – Thorsten S. Nov 15 '16 at 20:32
• @FlorianF well, for starters, maybe they would like to think about those together. – Marco Bonelli Mar 12 '20 at 12:33

## 18 Answers

I think I have a faster solution than Rubio. (Or I did, when Rubio's solution took one day longer than mine; he's since incorporated my solution into his answer).

The answer:

They can escape, and will do so in four days.

The explanation:

Let's start on the time of release and follow the thought process.

Mark learns that Rose has 8 bars on the morning of the 4th day. To avoid long lists of "he knows she knows" let's use some shorthand. "M12: R=6,8" means "In the case that Mark has 12 bars, Mark knows that Rose has 6 or 8 bars". On the next indent level, "R6" and "R8" describes both possible cases. Here's the thought process of Mark on the morning of the 4th day, just before he announces that there are 20 bars in total. The logic starts like this: Mark knows Rose has 6 or 8 bars. If Rose had 6 bars, she would think Mark had 12 or 14 bars. If Rose had 6 bars and assumed Mark had 12, Mark would think... etc.
M12: R=6,8
- R6: M=12,14
- - M14: R=4,6
- - - R4: M=14,16
- - - - M16: R=2,4
- - - - - R2: M=16,18
- - - - - - M18: If M had 18 bars, he would have answered "20" on the first morning
- - - - - - M16: Since M didn't answer day 1, R would answer "18" on the first evening.
- - - - - R4: That didn't happen, so M would answer "20" on second morning
- - - - M14: That didn't happen, so R would answer "18" on second evening
- - - R6: That didn't happen, so M would answer "20" on the third morning
- - M12: That didn't happen, so R would answer "18" on the third evening
- R8: None of the above happened, so this is the only remaining choice
Mark announces that 20 is the answer on the fourth morning.

• Wrong. You cannot draw any conclusions from "if Mark had 18 bars..." since it was impossible for him to have 18 bars and Rose knew it. – Sejanus Nov 15 '16 at 18:44
• @Sejanus Sure you can. In the hypothetical situation that Rose had 2 bars, Mark having 18 would be perfectly possible. – Joe Nov 15 '16 at 18:59
• @Sejanus this kind of "perfect logician" problem has been discussed to death online, so I don't want to reiterate all of the arguments for why this type of reasoning is valid. It may help to think about the simpler cases: what if Mark had 2 bars, Rose had 1, and the question was 3 or 4 total? What about M=3 R=2 and question is 4/5? If you look up the "forehead spot puzzle" or the "blue eyes" puzzle they follow a similar chain of reasoning and may be helpful. – Joe Nov 15 '16 at 19:12
• This type of reasoning may be valid in a sense that it works if both persons agreed to use this type of reasoning beforehand. But it is not logical. There's nothing logical in making conclusions that do not follow from premises. It's like saying the sky is clear today therefore 20 bars. This may be valid in a context of some secret code agreed upon beforehand, but it has nothing to do with logic. – Sejanus Nov 15 '16 at 19:29
• Mark couldnt have 18. Theres no way he could have 18. Rose knows it. Since Mark didnt answer Rose knows Mark had no 18 which she already knew. Rose knows Mark has either 10 or 12 and no other number. She always knew it from the beginning. Marks silence didnt tell her anything new. She cant draw any conclusions she couldnt before. Rose didnt have 2. Mark knows it. Mark always knew it. Rose can have only 8 or 6 from Marks perspecrive. It seems to me you are trying to apply the solution that probably worked in a superficially similar but ultimatelly different puzzle before. It does not work here. – Sejanus Nov 15 '16 at 21:10

### The answer

They can escape, and will do so in FOUR days.
Joe's answer shows that Mark will answer "20" on the morning of the fourth day.
All credit to Joe for finding the shortcut; go upvote him, please!

I'm updating here to flesh out the logic in the vein of my original answer.

### Assumptions

We assume both have at least one bar on their window (or the window couldn't be said to be barred, and they're told their windows are the only barred ones).

We further assume that they must determine which total, 18 or 20, is correct.
If they are being asked to determine if it is either (18 or 20) or (not(18 or 20)), that's a whole different puzzle, but the plain meaning of the riddle suggests the first interpretation is the correct one (OP confirms this in comments).

### Explanation

With those assumptions:

Mark knows he has 12 bars. So Rose must have 6 or 8. If 6, he knows Rose knows he has 12 or 14; if 8, he knows Rose knows he has 10 or 12. For each of those possibilities, he knows Rose knows he knows Rose knows blah blah blah; shortcutting all the explanations, it is easy to see that regardless, each for SURE knows the other has to have an EVEN number of bars on their window.

We know neither has zero; thus neither can have 20, so each has at least 2 and at most 18.
Borrowing Jonathan Allan's notation, we have —

If (person) has [N] bars they will say "total" and be correct:
Day     Mark knows Rose...      Morning (Mark)  Rose knows Mark...      Evening (Rose)
1       has 2..18               "20"        has 2..16               "18"; "20"
2       has 4..16               "20"        has 4..14               "18"; "20"
3       has 6..14               "20"        has 6..16               "18"; "20"
4       has 8..12.              "20" → which is exactly what happens.

My original answer below - this is no longer optimal

On day one:
Mark would say 20 if he had 18 or 19 bars; Rose has at least one, so 18 could not be the answer; he doesn't answer. Rose gets asked, and knows Mark has 1..17 bars.
Rose would say 20 if she had 18 or 19 bars; she doesn't.
Rose would say 18 if she had 1 bar, as she knows Mark has at most 17; she doesn't.

On day two:
Mark gets asked, so he knows Rose has 2..17 bars.
If he had 1 or 2 bars, he would now say 18 (as (1..2) + (2..17) < 20); he doesn't. If he had 17 bars, he would now say 20 (as 17 + (2..17) > 18); he doesn't.
Rose gets asked, so she knows Mark has 3..16 bars.
Rose would say 18 if she had 2 to 3 bars (as (2..3) + (3..16) < 20); she doesn't.
Rose would say 20 if she had 16 or 17 bars (as (16..17) + (3..16) > 18); she doesn't.

On day three:
Mark gets asked, so he knows Rose has 4..15 bars.
If he had 15 or 16 bars, he would now say 20 (as (15..16) + (4..15) > 18); he doesn't. If he had 3 or 4 bars, he would now say 18 (as (3+4) + (4..15) < 20); he doesn't.
Rose gets asked, so she knows Mark has 5..14 bars.
Rose would say 20 if she had 14 or 15 bars (as (14..15) + (5..14) > 18); she doesn't.
Rose would say 18 if she had 4 or 5 bars (as (4..5) + (5..14) < 20); she doesn't.

On day four:
Mark gets asked, so he knows Rose has 6..13 bars.
If he had 5 or 6 bars, he would now say 18 (as (5..6) + (6..13)<20); he doesn't.
If he had 13 or 14 bars, he would now say 20 (as (13..14) + (6..13) > 18); he doesn't. Rose get asked, so she knows Mark has 7..12 bars.
Rose would say 18 if she had 6 or 7 bars (as (6..7) + (7..12) < 20); she doesn't.
Rose would say 20 if she had 12 or 13 bars (as (12..13) + (7..12) > 18); she doesn't.

On day five:
Mark gets asked, so he knows Rose has 8..11 bars.
He has 12, so knows their total cannot be 18.
He now says 20, and is correct.

• You got it fast, nice job, good explanation for every day and number range, it helps understanding the problem a lot. I would have formatted it a bit better though. – Marco Bonelli Nov 15 '16 at 8:08
• Nice. Thanks for the downvote, whoever. – Rubio Nov 15 '16 at 8:55
• There are two things limiting how many bars each knows the other can have: one is their knowledge of how many their own window has—which is static—and the other is their knowledge of what the other's (lack of) answers tells them. Rose knows both that Mark has 10 or 12, and also that because Mark didn't give an answer that he cannot have more than 17 or fewer than 2. This second bit of knowledge continues to be refined as time passes with no answer given, until it finally decides between the two possibilities each knows the other can have from the first bit. – Rubio Nov 15 '16 at 9:02
• (It's actually even more complicated than that—Mark has 12 bars so he knows Rose has to have 6 or 8; he also knows if Rose has 6, Rose knows he has 12 or 14, and if Rose has 8, she knows he has 10 or 12. So they each know what they know, and what the other knows, and what the other knows THEY know. But in this case the numbers just happen to be such that this extra knowledge doesn't actually help them at all. So it's not included in my analysis.) – Rubio Nov 15 '16 at 9:06
• I have trouble with these sorts of problems. Here's where I get hung up: Mark not answering on day one tells Rose nothing she doesn't already know: Mark must have either 10, 12 or 14 bars. She can not possibly think that Mark has 1.. 17. Likewise, Rose not answering on day two does not tell Mark anything he doesn't already know. He knows that Rose has either 8 or 6 blocks, and further, knows that Rose obtained no new information by him not answering on day 1. Mark has no new information on day 3. The cycle repeats. I understand this is probably wrong - but what am I missing? – jkhan Nov 15 '16 at 17:25

Along the lines of Glen O's answer, this answer attempts to explain the solvability of the problem, rather than provide the answer, which has already been given. Instead of using the meta-knowledge approach, which, as Glen stated, can get hard to follow, I use the range-base approach used in Rubio's answer, and specifically address some of the objections being raised.

The argument has been put forward that when Mark fails to answer on the first morning, he gives Rose no new information. This is actually true (sort of— see the last spoiler section of this answer). Rose could have predicted beforehand with certainty that Mark would fail to answer on the first day, so his failure to answer doesn't tell her anything she didn't know. However, that doesn't make the problem unsolvable. To see why, you must understand the following logical axiom: Additional information never invalidates a valid deduction. In other words, if I know that all of the statements $P_1,\dots P_n$ and $Q$ are true, and that $R$ is definitely true if $P_1, \dots P_n$ are true, I can conclude that $R$ is true. My additional knowledge that $Q$ is true, though unnecessary to deduce $R$, doesn't hamper my ability to deduce $R$ from $P_1,\dots P_n$. I will call this rule LUI for "Law of Unnecessary Information." (It may have some other name, but I don't know it, so I'm giving it a new one.)

The line of reasoning goes as follows:

Let $R,\;M$ be the number of bars on Rose's and Mark's windows, respectively. Before the first question is asked, both Mark and Rose know the following:

$P_1$: Mark knows the value of $M$

$P_2$: Rose knows the value of $R$

$P_3$: $M+R=20 \;\vee \;M+R=18\;$ ($\vee$ means "or", in case you're unfamiliar with the notation)

$P_4$: $M\ge 2\;\wedge\;R \ge2\;$ ($\wedge$ means "and")

$P_5$: Both of them know every statement on this list, and every statement that can be deduced from statements they both know.

To help keep track of $P_5$ I will say that I will call a statement $P$ (with some subscript) only if it is known to both prisoners (or neither); thus, $P_5$ becomes "the other prisoner knows every $P$ that I know."

Additionally, Mark knows that $M=12$ and Rose knows that $R=8$. Call this knowledge $Q_M$ and $Q_R$, respectively. Finally, as soon as one of them is asked the question for $k^\text{th}$ time, they both know (and know that one another know, etc.) $P_{\leftarrow k}$:

$P_{\leftarrow k}$: The other prisoner could not deduce the value of $M+R$ given the information they already had.

After Mark doesn't answer on the morning of day one, both prisoners can deduce from $P_1, P_3, P_4, P_5,$ and $P_{\leftarrow 2}$ that $M\le 16$ (call this $P_6$). It is true that both prisoners have more information than this about the value of $M$, but LUI tells us that that doesn't invalidate the deduction. It basically just means that Rose won't be surprised when she gets asked the question. She already knows she will be.

By the following morning, both prisoners can deduce from $P_1\dots P_6$ and $P_{\leftarrow 3}$ that $4\le R \le 16$ ($P_7$), and that evening, they can deduce from $P1,\dots P_7$ and $P_{\leftarrow 4}$ that $4 \le M \le 14$ ($P_8$). Again, both prisoners know all of this already. (But the conclusions are still valid by LUI.)

On the next day, in a similar manner, they can deduce in the morning that $6 \le R \le 14$ ($P_9$), and in the evening that $6 \le M \le 12$ ($P_{10}$). Here's where things get interesting. Mark can deduce from $P_3$ and $Q_M$ that $R$ is either $6$ or $8$, but $R=6\wedge P_{10} \wedge P_3\implies M+R=18$ and $R=6\wedge P_{10} \wedge P_3\wedge\left[R=6\wedge P_{10} \wedge P_3\implies M+R=18\right]\implies \neg P_{\leftarrow 7}$. When he gets asked the question again on the following morning, he learns that $P_{\leftarrow 7}$ is true, and can thus deduce that $R \neq 6$ and therefore $R=8$ and $M+R=20$. This is actually the first time in the sequence that a $P_{\leftarrow k}$ provides any more information about the value of $M+R$ than the prisoner already has, but the sequence of irrelevant questions is necessary to establish the deep metaknowledge Glen talks about. In this formulation, all this metaknowledge is encapsulated in $P_5$. When a prisoner is asked a question, $P_5$ says that they can deduce not only $P_{\leftarrow k}$ but also that both of them know $P_{\leftarrow k}$ and, by repeatedly applying $P_5$, that both of them know that both of them know $P_{\leftarrow k}$ and so on. For any $P_{\leftarrow k}$, there is some level of "we both know that we both know" that can't be deduced from $P_1\dots P_5$ and $Q_M$ or $Q_R$ alone. This is the "new information" being "learned" at each stage. Really nothing new is learned until Rose fails to answer on the $3^\text{rd}$ evening, but the sequence of non-answers $P_{\leftarrow k}$ is necessary to provide the deductive path to $P_{\leftarrow 7}$.

In fact, viewing it another way, the fact that not answering provides "no new information" (and in fact doesn't provide any new direct information about the number of bars) is exactly why the puzzle is solvable, because

It says that the previous answer provided no new information. Because they both know that the number of bars is either $18$ or $20$ (only two possibilities), any new information about the number of bars (eliminating a possibility) will allow them to give the answer; thus, not answering sends the message "I have not yet received any new information," which, eventually, is new information for the other prisoner.

The "conversation" the prisoners have amounts to this:

Mark: I don't know how many bars there are.

Rose: I already knew that (that you wouldn't know).

Mark: I already knew that (that you'd know I wouldn't know).

Rose: I already knew THAT (etc.)

Mark: I already knew THAT.

Rose: I already knew $\mathbf {THAT}$.

Mark (To the Evil Logician): There are $20$ bars.

But how, you may ask, can a series of messages that provide their recipient with no new information lead to one that does? Simple!

The non-answers provide no new information to the recipient, but they do provide information to the sender. If I tell you that I'm secretly a ninja, you might already know that, but even if you do, knowledge is gained, because by telling you, I give myself the knowledge that you know I'm a ninja, and that you know I know you know I'm a ninja, etc. Thus, each message sent, even if the recipient already knows it, provides the sender with information. After several such questions, this is enough information that a message recipient can draw conclusions based on the sender's inability to draw any conclusions from the information they know the sender has.

Ok, fine, you might say, but what, exactly, is learned when Mark fails to answer on the first morning, and how can you prove this was not already known? Great question, thanks for asking. You see...

At this point, we have to resort to metaknowledge (I know she knows I know...) even though it can get confusing, However, I'll break it down in such a way as to hopefully satisfy anyone who still objects that there is (meta)knowledge available after Mark fails to answer the first question was not available before he did so. Specifically, After failing to answer the first question, Mark gains the information that Rose knows that Mark knows that Rose knows that Mark knows that Rose knows that Mark's window has less than $18$ bars. Now, that's a mouthful, so let's break it down into parts:

$R_0$:Mark's window doesn't have $18$ bars

$M_1$:Rose knows $R_0$

$R_2$:Mark knows $M_1$

$M_3$:Rose knows $R_2$

$R_4$:Mark knows $M_3$

$M_5$:Rose knows $R_4$

My claim is that A) Before he fails to answer on the first morning, Mark does not know $M_5$, and B) Afterwards, he does. Let's examine A) first:

To show that Mark doesn't know $M_5$ beforehand, we work backwards from $R_0$. In order for Rose to know that Mark's window doesn't have $18$ bars, her window would have to have more than $2$ bars. Since the rules (and numbers of bars) imply that they both have an even number of bars, in order for Mark to know $M_1$, he would have to know that Rose's window has at least $4$ bars. The only way for him to know that is if his window has less than $16$ bars. Thus, for rose to know $R_2$, she must know that Mark has no more than $14$ bars, which requires that she have at least $6$ bars. For Mark to know $M_3$, then, he must have no more than $12$ bars, so for Rose to know $R_4$ she must have at least $8$ bars, and for Mark to know $M_5$ he must have no more than $10$ bars. But he does have more than $10$ bars, so he doesn't know $M_5$ beforehand.

To see why Mark must know $M_5$ after he fails to answer the question, we must realize that they both know the rules of the game and one of the rules of the game is that they both know the rules of the game. This creates an infinite loop of meta-knowledge, meaning that they both know that they both know that they both know... the rules, no matter how many times you repeat "they both know". This infinite-depth meta-knowledge extends to anything that can be deduced from the rules. If Mark's window had $18$ bars, he could deduce from the rules that Rose must have $2$, and the tower must have $20$ in total. Because he doesn't answer, rose will be asked, and when she is, she will know that he couldn't deduce the answer, and therefore has less than $18$ bars. Because this is all deduced directly from the rules, rather than the private knowledge that either prisoner has, it inherits the infinite meta-knowledge of the rules, and Mark knows $M_5$.

So, Mark learns $M_5$. Does Rose learn anything? It's tempting to think that she doesn't, because she can predict in advance that Mark won't answer and therefore, one might think, she can draw in advance any conclusions that could be drawn from his not answering. However, as was shown above, by not answering, Mark learns $M_5$. Not answering changes the state of Mark's knowledge. This means that Rose's ability to predict Mark's behavior doesn't prevent her from gaining new information. She can predict in advance both what he will do (not answer) and what he will learn when he does it ($M_5$), but since he doesn't learn $M_5$ until he actually declines to answer, his failure to answer provides her with the information that he now knows $M_5$. Since he didn't know $M_5$ beforehand, the knowledge that he does is by definition new information for Rose. Rose already knew that she would know this, but until Mark doesn't answer, she doesn't actually know it (because it isn't true). By following this prediction logic out, it's possible to show that Rose knows (at the start) that Mark will be unable to answer until the $4^\text{th}$ morning, but not whether or not he'll be able to answer then. Mark, meanwhile, knows that Rose will be unable to answer until the $3^\text{rd}$ evening, but not whether or not she'll be able to answer then. As soon as one of the prisoners observes an event that they were unable to predict at the beginning, they can deduce from it something they didn't know about the state of the other's knowledge. Since the only hidden information is how many bars are in the other prisoners window, and they know that it must be one of two values, learning new information about that allows them to eliminate one of the values and find the correct result.

• Sorry, spoiler tag isn't working for some reason. – Gabriel Burns Nov 16 '16 at 20:10
• got it, through annoying workaround. – Gabriel Burns Nov 16 '16 at 21:02
• I edited your answer to do the spoilers in a more conventional way.  Please check that I didn’t change any content/meaning.  Notes: (1) In a spoiler block, every line has to begin with >!; even the blank ones.  Yes, it gets tedious.  (2) Put two spaces at the end of a line to get a line break.  (3) Lists within spoiler blocks are a real pain. – Peregrine Rook Nov 16 '16 at 21:33
• THIS. times a million. If anyone can't understand how the non-answers provide information to limit how many bars each knows the other might have, this explanation should explain it entirely. At this point, anyone continuing to argue for unsolvability falls under the umbrella of "There is none so blind as he who will not see." – Rubio Nov 17 '16 at 19:42
• Thanks, skimming the last part of your answer gave me the intuition I needed. I imagined a simpler problem: Mark has 1 bar; Rose has 1 bar. The evil logician asks: 2 or 3? The evil logician first visits Mark: Mark knows that he has 1 bar, and that the total number of bars is 2 or 3. So he knows that Rose has 1 or 2 bars. Mark says nothing. The evil logician then visits Rose: Rose knows Mark would have said 3 if he had 2 bars. As Rose has 1, and the total is 2 or 3, Rose now knows that Mark has 1 bar; and that total number of bars is 2. She says "2". – user2023370 Nov 18 '16 at 10:30

Here is another mathematical / graphical solution :

Rose can answer after 4 days. Let's enumerate all the possible pairs of number of bars : left is Mark and right is Rose.
There are 2 ways to create this list :
- by recursively thinking "If Rose has 6 bars she can think that Mark has 12 or 14 bars, so she thinks that mark thinks that she has 8,6 or 4 bars...".
- By listing all the pairs and remove all the odd numbers (they both know they have an even number of bars, and they know that this is shared knowledge).

I have graphically rearranged it so on a line we can see the different possibilities given Mark number of bars and in a column the different possibilities given Rose Number of bar :

DAY 1 morning, before Mark talks
(2,18) (2,16)
(4,16) (4,14)
(6,14) (6,12)
(8,12) (8,10)
(10,10) (10,8)
(12,8) (12,6)
(14,6) (14,4)
(16,4) (16,2)
(18,2)

If the true number of someone only appears one time then he can safely talk. If not, he remains silent and then we can rule out this answer. For example at first step if Mark had 18 bars : he could have talked but he didn't so we remove the (18,2) possibility.
 DAY 1 evening, before Rose talks
(2,18) (2,16)
(4,16) (4,14)
(6,14) (6,12)
(8,12) (8,10)
(10,10) (10,8)
(12,8) (12,6)
(14,6) (14,4)
(16,4) (16,2)

Then Rose can safely speak if she has 18 or 2 bars, but she didn't so we remove it.
 DAY 2 morning, before Mark talks
(2,16)
(4,16) (4,14)
(6,14) (6,12)
(8,12) (8,10)
(10,10) (10,8)
(12,8) (12,6)
(14,6) (14,4)
(16,4)


Then Mark can safely speak if he has 2 or 16 bars, but he didn't so we remove it :
 DAY 2 evening, before Rose talks
(4,16) (4,14)
(6,14) (6,12)
(8,12) (8,10)
(10,10) (10,8)
(12,8) (12,6)
(14,6) (14,4)

Then Rose can safely speak if she has 4 or 14 bars, but she didn't so we remove it.
 DAY 3 morning, before Mark talks
(4,14)
(6,14) (6,12)
(8,12) (8,10)
(10,10) (10,8)
(12,8) (12,6)
(14,6)

Then Mark can safely speak if he has 4 or 14 bars, but he didn't so we remove it.
 DAY 3 evening, before Rose talks
(6,14) (6,12)
(8,12) (8,10)
(10,10) (10,8)
(12,8) (12,6)

Then Rose can safely speak if she has 14 or 6 bars, but she didn't so we remove it.
 DAY 4 morning, before Mark talks
(6,12)
(8,12) (8,10)
(10,10) (10,8)
(12,8)

Mark has 12 bars and sees there is only one possibility so he can safely say that there is 20 bars.

• Same idea... but 4 minutes too late :-) – mountrix Nov 16 '16 at 1:04
• I've made a mistake thinking there could be 0 bars, I hope it's correct now – Fabich Nov 16 '16 at 1:13
• Thanks for all the effort put into this and the well formatted explanation! Very good answer. – Marco Bonelli Nov 16 '16 at 3:14

## This answer does not attempt to directly answer the question, but to help understand why it's solvable.

There is some confusion occurring due to the language used in some other answers – they imply that the logicians are able to directly deduce things like "Rose doesn't have 2" from failure to respond. This isn't quite right.

Instead, it's about depth of knowledge – think of the initial knowledge like this:

Depth 0: Mark has 12 (and he knows it); Rose has 8 (and she knows it).  They both know that the total is either 18 or 20.

Depth 1: Mark knows that Rose has either 6 or 8, and Rose knows that Mark has either 10 or 12.

Depth 2: Mark knows that Rose knows that Mark has either (10 or 12) or (12 or 14), and Rose knows that Mark knows that Rose has either (6 or 8) or (8 or 10).

And so on down.

When Mark initially is asked on Day 1, it's his Depth 1 knowledge being tested – he has 12, so he can't know whether Rose has 6 or 8, and thus cannot answer.

When Rose is asked on Night 1, it's her Depth 2 knowledge being tested. Why? Because if she could rule out which pair Mark considers possibilities because he couldn't answer, then that tells her which ones are possible.

To see this, let's consider a different case: Mark has 16, Rose has 2.

In this case, Rose knows that Mark knows that Rose has either (0 or 2) or (2 or 4).

But if he knew the options for Rose were 0 or 2, he'd know the answer was 2. Therefore, she can rule out the idea that Mark thinks that Rose has either 0 or 2. Thus Rose knows that Mark knows that Rose has "either 2 or 4". The only way he'd see that is if Mark had 16. Therefore, Rose knows Mark has 16, and she answers 18.

On Day 2, Mark is now being tested on his Depth 3 knowledge.

Again, let's see it in action with an example: Mark has 16, Rose has 4. Now Mark knows that Rose knows that Mark knows that Rose has either [(0 or 2) or (2 or 4)] or [(2 or 4) or (4 or 6)]. If Rose knew that Mark knew that Rose had either (0 or 2) or (2 or 4), as discussed earlier, she would have answered. But she didn't answer, so Mark now knows that Rose knows that Mark knows that Rose has "either (2 or 4) or (4 or 6)".

Yes, I know it's getting hard to follow.

This allows Mark to determine the answer in this example. Mark knows Rose's Depth 2 knowledge, now. For Rose to know that Mark knows that Rose has either (2 or 4) or (4 or 6), it is necessary for Rose to think that Mark has either 14 or 16. And for that to be true, Rose must have 4. Thus, Mark can answer 20.

To get to the final answer, Mark is going to have to determine the truth from Depth 7.

In other words...

Mark knows that Rose knows that Mark knows that Rose knows that Mark knows that Rose knows that Mark has either [([([(0 or 2) or (2 or 4)] or [(2 or 4) or (4 or 6)]) or ([(2 or 4) or (4 or 6)] or [(4 or 6) or (6 or 8)])] or [([(2 or 4) or (4 or 6)] or...

... and it keeps on going like that. The "0 or 2" at the start is what allows Mark to get the answer.

• 16 and 2 isn't a very good example, because it just so happens that Rose having 2 means that Mark, if he did have 18, knows that the answer is 20 - So this is a boundary case leading to the possibility that Mark can answer correctly immediately, otherwise he doesn't answer, indicating to Rose that he has 16. If you drop to 15 - 3 you are then away from the boundary condition, and you don't get the solution - unless both participants follow an inductive process that doesn't logically follow in reality. – Cato Sep 11 '17 at 13:09
• @Cato - I don't think you've actually understood the logic as described, because what you just said about the 16+2 case is exactly the point of the example - Rose can work out that the answer is 18 because if it were 20, Mark would have figured it out. Now in the 16+4 case, Rose isn't able to figure it out - which tells Mark that the answer is 20, because if it were 18, Rose would have been able to figure it out. And so it propagates. The case of 15+3 works similarly, but the expressed numbers at each depth change - if Mark had 17, he would've answered 20, but he didn't, so Rose answers 18 – Glen O Sep 11 '17 at 17:31
• my point is that 15 and 3 does not then work without the artificial construct of the 'countdown' sequence, that they would have to agree on before hand. You realise the person with 3 bars knows the other has 15 or 17 bars, there is then no longer any concept of 18,19 or 20 bars being 'excluded' by a non answer, unless a completely notional concept of them doing this is artificially introduced. – Cato Sep 12 '17 at 9:58
• @Cato - they know that there is either 18 or 20 bars - it's established in the question. And the exclusion process still works - it's just that, rather than being caught when "0" is a possibility at that level, it's caught when "-1" is a possibility. Think about it - if it were 17 and 1, then Mark wouldn't be able to answer, and then Rose would (because Rose knows Mark would answer if he had 19). With 15 and 3, it takes a little longer - Mark doesn't answer, then Rose doesn't answer, then Mark doesn't answer, then Rose answers 18. – Glen O Sep 20 '17 at 17:20
• Think it through - Mark can't answer because Rose could have 3 or 5. Rose can't answer because she doesn't know whether Mark thinks she has [1 or 3] or [3 or 5]. Mark then can't answer because he doesn't know if Rose thinks he thinks she has ([1 or 3] or [3 or 5]) or ([3 or 5] or [5 or 7]). But then Rose can answer because if Mark had 17, he'd have been able to answer (because if he had 17, then ([3 or 5] or [5 or 7]) would mean the total was at least 20). – Glen O Sep 20 '17 at 17:26

Nice problem! This is an attempt to illustrate the solution graphically. This is also how I found it, I then could confirm with the previous answers it was the correct one :)

Let's start by a simpler problem. Mark has 12 bars, Rose 4, and Evil Logician is asking : do I have 14 or 16 bars in my castle?

We first note that if, at any point in the reasoning of Rose, Mark is suspected to have 14 bars, he would be a jerk not telling immediately having a total count of 14 is impossible (Rose cannot have 0 bars), and correct answer is 16. If Rose is still living at that point, she would know Mark cannot have 14 bars and have only 12, and should tell at that moment the correct answer.

This reasoning is illustrated below, the black numbers being the order of the days/nights, and the count in parenthesis being respectively the number of bars of Mark and Rose. An arrow between two nodes M=12 and R=2 means "if I am Mark and I have 12 bars, I think Rose could have 2". Now the real problem. Mark has 12 bars, Rose 8, and Evil Logician is asking : do I have 18 or 20 bars in my castle? Here is the illustrated graph: We can note that the values of the nodes in the tree can be computed from the previous values, and Mark and Rose have fixed answers (Mark is always telling about 20 for instance). The depth of the tree indicates the number of half days to wait until they are made free (here, a depth of 7 corresponds to 7 half days, thus the freedom is for the morning of the 4th day). The depth also equals the length of the alternative path between Mark and Rose, which can be computed from the two possible answers of the Evil Logician (18 and 20): starting with M=12, and given 18-12=6, we jump to R=6, given 20-6=14, we have M=14, given 18-14=4, we have R=4, given 20-4=16, we have M=16, given 18-16=2, we have R=2, and given 20-2=18, we have M=18, which is 7 nodes. This could be used to compute the number of days in the general case :-)

I have an alternative answer which, if correct, would allow Mark to give an answer on the morning of the second day.

Breakdown of knowledge prior to any exchange of information:

Mark’s knowledge, prior to any exchange of information

• There are either 18 or 20 bars in total.
• I will be asked for an answer every morning, Rose will be asked every evening.
• I can see 12 bars.
• R must have 6 / 8 bars.
• If R had 6 bars, she’d think I had 12 / 14. If she had 8, she’d think I had 10 / 12. She can therefore ascertain that I have 10 / 12 / 14 bars. She can narrow it down to two numbers but I don’t know which two.
• I have more bars than Rose.
• R has at least 6 bars.
• If R had 6 bars and therefore thought that I had 12 / 14, she would reason that I would think she had 6 / 8 or 4 / 6. If she had 8 and therefore thought that I had 10 / 12, she would reason that I would think she had 8 / 10 or 6 / 8.
• She is therefore aware that I know she has at least 4.
• I must give an answer first.

• Rose’s knowledge, prior to any exchange of information

• There are either 18 or 20 bars in total.
• Mark will be asked for an answer every morning, I will be asked every evening.
• I can see 8 bars.
• M must have 10 / 12 bars.
• If M had 10 bars, he’d think I had 8 / 10. If M had 12, he’d think I had 6 / 8. He can therefore ascertain that I have 6 / 8 / 10 bars. He can narrow it down to two numbers but I don’t know which two.
• If M had 10 bars and therefore thought that I had 8 / 10, he would reason that I would think he had 10 / 12 or 8 /10. If he had 12 and therefore thought that I had 6 / 8, he would reason that I would think he had 12 / 14 or 10 / 12.
• Mark has more bars than me.
• M has at most 12 bars.
• He is aware that I know he has at most 14.
• Mark must give an answer first.
• Breakdown of Events:

Morning of Day 1: Mark is asked whether there are 18 or 20 bars?

• The common knowledge is that Mark sees at most 14 bars. Mark needs to tell Rose that he doesn’t see 14 bars so he passes.
• Rose already knows this but also knows that Mark needed to tell her. Now they both know she knows this.
• The common knowledge is now that Mark has at most 12 bars.

• Evening of Day 1: Rose is asked.
• As Mark can have at most 12 bars, the lowest number of bars that Rose can have is now 6. She needs to tell Mark that she doesn’t see 6 bars so she passes.
• Mark did not know this. Had Rose seen 6, she would have known there were 18 bars and given the answer. Mark now knows that Rose has 8 bars and has the answer.

• Morning of Day 2: Mark is asked.
• Mark gives the answer 20 and both are freed.
• This is what I found as well, and it should be the accepted answer. @marco-bonelli – user453441 May 5 at 4:17
• This answer is not correct. If you apply this logic to the scenario where Rose instead has 6 bars, you'll find that she does not give an answer on the first evening in that case either. So Mark cannot tell on day 2 whether she has 6 or 8 bars in her window. The problem is that it is not common knowledge that Mark sees at most 14 bars - they both know it, they both know the other knows it, but they don't know if the other knows the other knows it. – Rob Watts May 12 at 8:44

Here is my solution

Here is the info they can gather after each day
day 1 both <= 18(If anyone had over 18, they would know it's 20)
day 2 neither have 0(If anyone had 0, they would know the answer)
day 3 neither have 1(If anyone had 1, they would know the answer)
day 4 neither have 2(If anyone had 2, they would know the answer)
day 5 neither have 3 or 18
day 6 neither have 4 or 17
day 7 neither have 5 or 16
day 8 neither have 6 or 15
day 9 neither have 7 or 14
day 10 Mark knows she have a 8 and the total is 20

EDIT(new answer)

- The first day, when Rose gets the question, she knows that Mark didn't know. Which could only mean that he doesn't have 19 or 20
- The morning of the second day, when Mark gets the question, he knows Rose didn't know. Which means she didn't have 19-20 but also didn't have 0 or 1(or else she would have known it was 18)
- The night of the second day, Rose will now know that Mark doesn't have 0-1 but also doesn't have 17-18.(or else he would have known it was 20)
- The morning of the third day, he will know she doesn't have 17-18 and 2-3
- The night of the third day, she will know he doesn't have 2-3 and 15-16
- The morning of the fourth day, he will know she doesn't have 15-16 and 4-5
- The night of the fourth day, she will know he doesn't have 4-5 and 13-14
- The morning of the fifth day, he will know that she doesn't have 6 and since he knows she must have 6 or 8, he will know the result is 20.

• @Marco Bonelli How about my new answer? – stack reader Nov 15 '16 at 7:41
• Your limits are off by one, I believe. You get to the right day but by slightly incorrect limiting. – Rubio Nov 15 '16 at 7:54
• @Rubio it all depends on if you accept 0 or not. Since the result is the same, I went ahead and included it so that my solution is good for any cases. – stack reader Nov 15 '16 at 8:03
• I was just reading the old one when I saw the edit: the first one looks good, a bit slow because it requires ten days, maybe the kind of answer a computer running a procedural algorithm would give I think. The second one is indeed better, it involves more thinking, and also the Evil Logician says that "the windows in the two logicians' cells are the only barred ones": a barred window must have at least one bar to be considered such, so yeah, the solution is more general than the actual solution to this problem. – Marco Bonelli Nov 15 '16 at 8:05

My answer was originally wrong as I had switched who was who half way though by mistake.
I believe:
Rubio had the correct answer given zero bars on the other cell window is a theoretical possibility (although it turns out that there was a mistake going with the not possible case); and that
Joe has the correct answer given zero bars on the other cell window is not a theoretical possibility.

So, instead, here are tables of who would say what and when - up to the point at which they free themselves in the current scenario given those two situations:

Zero bars is a possible situation:
If (person) has [a, or b] bars they will say "total" and be correct

Day   Morning (Mark)            Evening (Rose)
1     [19,20]"20"               [0,1]"18"; [19,20]"20"

2     [17,18]"20"; [0,1]"18"    [2,3]"18"; [17,18]"20"

3     [15,16]"20"; [2,3]"18"    [4,5]"18"; [15,16]"20"

4     [13,14]"20"; [4,5]"18"    [6,7]"18"; [13,14]"20"

5     [11,12]"20" ...
Zero bars is not a possible situation:
If (person) has [a, or b] bars they will say "total" and be correct

Day   Morning (Mark)            Evening (Rose)
1     [18,19]"20"               [1,2]"18"; [18,19]"20"

2     [16,17]"20"; [1,2]"18"    [3,4]"18"; [16,17]"20"

3     [14,15]"20"; [3,4]"18"    [5,6]"18"; [14,15]"20"

4     [12,13]"20" ...

Note that

For the "zero is possible" case:
On the first evening if Rose has 0 bars and is not free, she knows that Mark does not have 20 bars and hence may deduce there are 18 in total. Similarly if she has 1 bar and is not free she knows that Mark does not have 19 and again may deduce there are 18 in total. If she has 19 or 20 she can say 20, just as Mark could in the morning.

On the second morning if Mark has 18 bars and is not free, he knows that Rose does not have 0 bars and hence may deduce there are 20 in total. (Similarly if he has 17...) If he has 0 bars and is not free he knows Rose does not have 20 and hence may deduce there are 18 in total. (Similarly if he has 1).

and so on...

For the "zero is not possible" case, the sets of values get shifted away from 20 and 0 by one, because they have the knowledge that the other window does not have zero bars.

• I'm not sure I understand your logic... could you elaborate a bit more explaining each day morning/night (specially the third and fourth one)? – Marco Bonelli Nov 15 '16 at 8:14
• I switched the "he knows she knows" with the "she knows he knows" at some point. So this answer is wrong actually. – Jonathan Allan Nov 15 '16 at 8:31
• Oh snap, I thought you came up with the most clever answer for a minute... – Marco Bonelli Nov 15 '16 at 8:32
• You can confine this a little more. You know (and OP confirmed in a comment) that "a barred window must have at least one bar to be considered such", so on the first evening Rose knows Mark does not have 18 bars either, as his 18 + her minimum 1 would preclude 18 as an total and he would say 20. That makes things more narrowly confined throughout. In this specific case it ends up not mattering, but for different numbers it would have been the difference of a day. – Rubio Nov 15 '16 at 9:47
• I added the 1 bar implication in the question as well since that it didn't look so obvious. Nice well organized table by the way, +1. – Marco Bonelli Nov 15 '16 at 10:06

Without 0 bars excluded:

Mark will answer 20 on the fifourth day

Here's why, working from the known to the unknown:

If Mark had 20: M=20 (M would say 20 the first time asked)
If Mark had 18: M=20 (Rose has 2)
If Rose had 0: M=?,R=18 (Rose knows Mark has 18 because he didn't answer)
If Rose had 2: M=?,R=?,M=20 (Mark knows Rose has 2 because she didn't answer)

If Mark had 16:
If Rose had 2: M,R,M,R=18 (R knows M has 16)
If Rose had 4: M,R,M,R,M=20 (M knows R has 4)
If M had 14:
If R had 4: M,R,M,R,M,R=18 (R knows M has 14)
If R had 6: M,R,M,R,M,R,M=20 (M knows R has 6)
If M had 12:
If R had 6: M,R,M,R,M,R,M,R=18 (R knows M has 12)
If R had 8: M,R,M,R,M,R,M,R,M=20 (M knows R has 8)

• They both have more than 0 (given in the problem). So actually the answer comes sooner than you said. – Gabriel Burns Nov 16 '16 at 19:49

# Another way of looking at it...

As some people still have trouble understanding how they can logically figure it out by induction, I'm going to introduce two more people, so that Mark and Rose don't actually know how many bars are on the windows. Mark will be asking Mary a question, while Rose will be asking Rove. Each one can only ask a single yes-or-no question, and it has to be answerable by Mary/Rove with only the information visible to them.

### Day 1

Mark is asked whether there are 18 or 20 bars in total, and he turns to Mary. "Do we have 18 bars on our window?" Mary says no, and Mark cannot answer the question, as the only way he could be confident of the number of bars on the windows in total is if there were 18 on his.

Rose is now asked, and, knowing that Mark could have answered if there were 18 bars on his window, concludes that there can't be 18 on his window. Therefore, there's one way she could be confident of the total - "Are there 2 bars on our window?" she asks Rove. He says no, and Mary cannot answer the question.

### Day 2

Mark knows that Mary will have asked if there are two bars on her window, and as she couldn't answer, he also knows she doesn't have 2 bars. This means there's just one way he could know the answer, and he asks if there are 16 bars on his window. Mary says no, and Mark cannot answer.

Now Rose knows there aren't 16 bars on Mark's window, asks if there are four on hers, Rove says no, and Rose can't answer.

### Day 3

This continues - Mark knows Rose doesn't have four, asks Mary if their window has 14, she says no, and he cannot answer.

Rose knows Mark doesn't have 14, asks Rove if their window has 6, he says no, and she cannot answer.

### Day 4

Mark now knows that Rose doesn't have six, and asks Mary "Do we have 12 bars on our window?" - Mary smiles and says yes. Mark now knows the answer: there must be 20 bars between the two cells, as Rose has at least 8 and Mark has 12.

But here's the thing - even if Mark and Rose know the real numbers, rather than needing Mary and Rove to check for them, the logic is still the same. Having the information about the number of bars on their own window doesn't restrict their ability to draw the same conclusions.

At each step, there's only one relevant piece of information outside of the known restrictions (at least two bars on each, total is either 18 or 20, etc): "is the number of bars on my window the number necessary for me to be able to determine the answer right now?" All further information is extraneous.

The introduction of Mary and Rove allows us to see this in action more easily, but is unnecessary for the logic itself.

There seems to be a way that Mark and Rose can solve this problem in just 2 days. Please replace trees with bars. I originally saw this problem where trees were used, instead.

Rose knows that Mark knows she has at least 6 trees. She knows he has 10 or 12 so she knows that he knows she has either 8 or 10 if he has 10 -- and 6 or 8 if he has 12. Regardless, it's at least 6.

Mark knows that Rose knows he has at most 14 trees. He knows she has 6 or 8 so he knows that she knows he either has 12 or 14 if she has 6 -- and 10 or 12 if she has 8. Regardless, it's at most 14.

Thus, we begin communication between the two of them on the same idea that Mark has at most 14 and Rose has at least 6.

### Day One

Mark knows Rose has at least 6 and she knows he has at most 14. If he has 13 or 14 trees he can conclude they add past 18 and there must be 20. Since he has 12, he passes.

Rose knows Mark knows she has at least 6, so Mark passing meant that he had at most 12. If she had 6 or 7 trees then she can conclude they can't add to 20 and there must be 18. Since she has 8, she passes.

### Day Two

At this point, Mark knows he conveyed to Rose he had at most 12 since they eliminated 13 or 14 since the beginning. So Rose passing meant that she could not have had 6 or 7 trees. Since Mark, to start with, knew Rose actually had either 6 or 8, 6 is eliminated and she has 8 trees. Adding, Mark can conclude that there are 20 trees.

Just a thought I had; please correct me if I'm wrong.

• I checked and rechecked and believe it is correct. Why did you post it as a "comment" and not as "solution"? The words "please correct me if I'm wrong" seem to be very unfortunate. Someone else considers this solution correct? – kaksi Dec 16 '20 at 23:50

# Answer:

Yes they can and be free in 2 days.

There are 3 phases of logical reasoning involved in the Main Line of Logic, each building upon the previous: An 8 Day Method which leads to a 5 Day Method which finally leads to the 2 Day Solution.

You can not prove the logical steps involved in the 2 Day Solution without working out the other 2 methods first, and then using logic to eliminate them. They are both part of this 2 Day Solution.

[Note: I suspect the original logic problem included a caveat of there being no food and water in the cells and a reminder that people die in 3 days without water.]

# Main Line of Logical Reasoning:

[This all occurs before any passing or answer.]

1) Both want to be free as quick as possible without taking chances & both will work out the fastest way to be free (reason: survival instinct).

2) Each knows the other can only see a certain number of bars and what those numbers must be and that the other knows this: Rose sees 6 or 8 bars & Mark see 10 or 12 bars (this is common knowledge between them).

* Mark Knows Conclusively:
> I see 12 bars.
> That Rose can only see either 6 or 8 bars because I see 12, and the only correct answers are 18 or 20.
> That Rose can come to a similar conclusion from her point of view.
> That Rose knows I can only see 10 or 12 bars because Rose can only see 6 or 8 bars.

* Rose Knows Conclusively:
> I see 8 bars.
> That Mark can only see either 10 or 12 bars because I see 8, and the only correct answers are 18 or 20.
> That Mark can come to a similar conclusion from his point of view.
> That Mark knows I can only see 6 or 8 bars because Mark can only see 10 or 12 bars.

3) 'Passing' is the only way to communicate, and can only be used to count. Count what? Bars.
> Reason: The only thing that needs to be communicated to solve the problems is the answer to this question: How many bars do you see?

4) Both know that Rose has the least number of bars required to be counted -- 6 or 8 -- thus, they are going to be counting Roses' bars to escape the quickest.

5) There are only 2 ways to communicate an increase in the 'Count' with 'passing': a) Counting each day both of them passes, or; b) counting each pass. Can both methods lead to success?

* If counting by the day, they CAN be free in 7 to 8 days. (See 8 Day Method Below.)

* If counting by the pass, they CAN be free in 4 to 5 days. (See 5 Day Method Below.)

6) Since both can work out they can safely be free in 4-5 days, they will eliminate the 8 Day Method, conclusively establishing that 'passing' is going to mean the Count will increase by 1 with each pass.

7) Next, both will examine if it can be done even quicker than 4-5 days.

8) Having worked out the 5 Day Method, both can now see the Count on Day 4 is the key Day/Count to determine if the answer is 18 or 20. They couldn't come to this conclusion before working out the 5 Day Method.

9) Now they can both come to the logical conclusion that they can use the Count for Day 4 on Day 1 -- which is 6 -- and be free in 2 days. So the 2 Day Solution will be the ultimate logical conclusion of how they will escape. (See 2 Day Solution Below)

### 8 Day Method

[Note: We're keeping track of the Count by the Day due to both passing.]

Day 1) pass | pass - Both know the Count is 1

Day 2) pass | pass - Both know the Count is 2

Day 3) pass | pass - Both know the Count is 3

Day 4) pass | pass - Both know the Count is 4

Day 5) pass | pass - Both know the Count is 5

Day 6) pass | pass - Both know the Count is 6

Mark can now reason:

> I see 12 bars, and if Rose sees 6 then the Total is 18 and we now have the right answer, but I can't tell if Rose has 6 or 8 bars conclusively at this point.

> I know Rose will know I can't come to a conclusion about if she sees 6 or 8 bars today, and so I can't answer.

> But, I must say 20 when the Total reaches 20, which will happen on Day 8 if Rose sees 8 bars.

> Rose can come to the conclusion I will say 20 on Day 8 because:

> If Rose sees 8 bars Rose will pass to allow the Count to increase, else Rose will answer 18 to prevent the count from increasing to 8.

Day 7) pass | pass - Before passing, Rose can come to a similar line of reasoning that Mark did:

> I know that Mark sees 10 or 12 bars but Mark couldn't tell if I have 6 or 8 conclusively yesterday, and had to pass.

> The Total will be 20 tomorrow if Mark sees 12 bars.

> Mark will say 20 tomorrow if I pass because the Total will be 20 & because I can confirm that I only see 6 bars today by saying 18 to prevent the Count from increasing to 8.

> Mark expects me to answer 18 today if I only see 6 bars to prevent the Count from increasing to 8.

Day 8) Mark Answers 20 - Freedom.

Mark knows conclusively the Count + the 12 bars he sees = 20

## 5 Day Method

[NOTE: We're keeping track of the Count by each pass.]

Day 1)

Mark pass (Count is 1)
Rose pass (Count is 2)

Day 2) Both know the Count is 2

Mark pass (Count is 3)
Rose pass (Count is 4)

Day 3) Both Know the Count is 4

Mark pass (Count is 5)
Rose pass (Count is 6)

Day 4) Both know the Count is 6

Mark can now reason:

> I see 12 bars, and if Rose sees 6 then the Total is 18 and we now have the right answer, but I can't tell if Rose has 6 or 8 bars conclusively at this point.

> I know Rose will know I can't come to a conclusion about if she sees 6 or 8 bars at this point and so I can't answer.

> But, I must say 20 when the Total reaches 20, which will happen if Rose passes because she sees 8 bars.

> Rose can come to the conclusion I will say 20 if she passes because:

> If Rose sees 8 bars Rose will pass to allow the Count to increase to 8, else Rose will answer 18 to prevent the Count from increasing to 8.

Mark pass (Count is 7)

Rose can come to a similar line of reasoning that Mark just did:

> I know that Mark sees 10 or 12 bars but Mark couldn't tell if I have 6 or 8 conclusively and had to pass.

> The Total will be 20 tomorrow if Mark sees 12 bars.

> Mark will say 20 tomorrow if I pass because the Total will be 20 & because I can confirm that I see 6 bars today by saying 18 to prevent the count from increasing to 8.

> Mark expects me to answer 18 today if I only see 6 bars to prevent the Count from increasing to 8.

Rose pass (count is 8)

Day 5)

Mark answers 20 - Freedom.

Mark knows conclusively the Count + the 12 bars he sees = 20

### 2 Day Solution

[Note: We arrived at this by examining the the 5 Day Method and using the Day 4 Count from it on Day 1. We can not jump to this step in logic without first proving the 5 Day Method.]

Day 1) Both know the Count is 6

Mark can now reason:

> I see 12 bars, and if Rose sees 6 then the Total is 18 and we now have the right answer, but I can't tell if Rose has 6 or 8 bars conclusively at this point.

> I know Rose will know I can't come to a conclusion about if she sees 6 or 8 bars at this point and so I can't answer.

> But, I must say 20 when the Total reaches 20, which will happen if Rose passes because she sees 8 bars.

> Rose can come to the conclusion I will say 20 if she passes because:
> If Rose sees 8 bars Rose will pass to allow the Count to increase, else Rose will answer 18.

Mark pass (count is 7)

Rose can come to a similar line of reasoning that Mark just did:

> I know that Mark sees 10 or 12 bars but Mark couldn't tell if I have 6 or 8 conclusively and had to pass.

> The Total will be 20 tomorrow if Mark has 12 bars.

> Mark will say 20 tomorrow if I pass because the Total will be 20 & because I can confirm that I have 6 today by saying 18 to prevent the Count from increasing to 8.

> Mark expects me to answer 18 today if I only see 6 bars to prevent the Count from increasing to 8.

Rose pass (count is 8)

Day 2)

Mark answers 20 - Freedom.

Mark knows conclusively the Count + the 12 bars he sees = 20

• "That Rose knows I can only see 10 or 12 bars because Rose can only see 6 or 8 bars." - this is faulty (as is the equivalent statement around Mark's knowledge). If Mark knows that Rose sees either 6 or 8 bars, then all Mark can be sure of regarding what Rose knows is that Mark sees 10, 12, or 14. This is because, if Rose sees 6, then Mark could have 12 or 14. – Glen O Mar 13 '20 at 2:22
• In short, you are applying external knowledge to the problem - that is, when you decide what Mark thinks Rose is thinking, you are applying the knowledge that Rose sees 8. But Mark doesn't know that. – Glen O Mar 13 '20 at 2:31
• I have to agree with @GlenO here, "That Rose knows I can only see 10 or 12 bars because Rose can only see 6 or 8 bars.". By saying this you are giving Mark the knowledge that Rose has 8 bars. If Mark doesn't know how many bars Rose has, then he can only come to the conclusion that Rose either knows (a) Mark has 10 or 12 (if she has 8) or (b) Mark has 12 or 14 (if she has 6). Therefore, in Mark's mind, Rose could think either 10, 12 or 14. If you exclude the 14, you are implicitly giving Mark the knowledge about Rose's number of bars. – Marco Bonelli Mar 13 '20 at 2:52
• @ChristopherTheodore let me ask you this: we are in the same situation, you can see 10 bars in your cell. The Evil Logician asks you if there are a total of 30 or 35 bars. Now tell me how many bars you think that I think you are seeing. – Marco Bonelli Mar 13 '20 at 11:44
• @ChristopherTheodore well answer my last comment then. – Marco Bonelli Mar 13 '20 at 12:27

# The answer

They escape in 4 days

# The explanation

On day one
Mark (M) does not speak. M knows nothing.

Since M did not speak, Rose (R) deduces that he neither have 19 or 18 bars. R does not speak but knows that M $$\in$$ [1;17].

On day 2
Since R did not speak, M knows that she neither have 19 or 18 bars. Also, since he knows she knew he has at most 17 bars, he deduces that she neither have 1 or 2 bars (since 17 + 2 < 20). He does not speak but he knows that R $$\in$$ [3;17].

Since M did not speak and R knows that M knows that R $$\in$$ [3;17] then R deduces that M has at least 3 bars and less than 16 (because 16 + 3 > 18). She does not speak but she knows M $$\in$$ [3;15].

On day 3
The logic is the same. M knows R $$\in$$ [3;17] and he knows that R knows M $$\in$$ [3;15]. She did not speak so M deduces that R neither have 3 or 4 bars (since 15 + 4 < 20) nor 16 or 17 (since 16+3 > 18). He does not speak but he knows that R $$\in$$ [5;15].

Since M did not speak and R knows that M knows that R $$\in$$ [5;15] then she does not speak but deduces that M $$\in$$ [5;13].

On day 4
From a simillar deduction (R cannot have 5 or 6 or she would have said 18. She cannot have 14 or 15 or she would have said 20) M knows that R $$\in$$ [7;13]. Since he has 12 bars he deduces that R has 8 and answer 20 to the evil logician.

## No, they cannot escape.

Mark sees his window with the 12 bars. He can deduce Rose has either 6 or 8 bars in her window. He does not know which. However, he can deduce that Rose will have deduced he has either 10, 12, or 14 bars.

Rose sees her window with the 8 bars. She can deduce Mark has either 10 or 12 bars in his window. She does not know which. However, she can deduce that Mark will have deduced she must have 6, 8, or 10 bars.

The chain of reasoning never starts at the "if the other had only 1 bar / if the other had 19 bars" stage because they both know that to be untrue.

Most importantly, the knowledge that the other has not answered yields no new information, since they already knew the other wouldn't be able to answer.

## Or can they?

However, they both know of the strategy which has been laid out by other answerers. They also realise that if they were to follow that strategy, they would get out, so they do.

• @Sejanus the truth cannot be repeated often enough. :) – SQB Nov 15 '16 at 21:34
• The crux of all of the solutions above is the idea of "common knowledge", which can be somewhat counter-intuitive. Just because both Rose and Mark know a certain fact "X" does not imply that Rose knows that Mark knows that Rose knows "X". This is why hypotheticals that we as the readers can obviously see are false still hold value in solving the problem. en.wikipedia.org/wiki/Common_knowledge_(logic) – Joe Nov 15 '16 at 21:47
• Rules state they are perfect logicians capable of deducing logical conclusions within minutes. Also that they both know the rules. Rose sees her 8, she knows Mark has 12 or 10, she knows Mark thinks she has 6, 8 or 10. She knows Mark cannot know how many exactly so he's gonna stay silent. Mark stays silent as she knew he would. She learns nothing from it. Its not the blue eyes. – Sejanus Nov 15 '16 at 23:14
• @Sejanus - Continuing your logic Rose sees her 8, she knows Mark has 12 or 10, she knows Mark knows she has 6,8 or 10, she knows Mark knows she knows he has 14,12,10 or 8, she knows Mark knows she knows he knows she has 4,6,8,10 or 12, she knows Mark knows she knows he knows she knows he has 16,14,12,10,8 or 6, she knows Mark knows she knows he knows she knows he knows she knows he has 2,4,6,8,10,12 or 14, she knows Mark knows she knows he knows she knows he knows she knows he has 18,16,14,12,10,8,6 or 4. After each "silence" some of the ends start getting knocked off of those "knows". – YowE3K Nov 16 '16 at 2:42
• Rose knows that Mark knows she knows he knows she knows he knows she knows he knows she has 18,16,14,12,10,8,6,4, or 2 bars. On day 2 she also knows that Mark knows she knows he knows she knows he knows she knows he knows she does not have 18 or 2 bars. Hence on day 2 Rose knows that Mark knows she knows he knows she knows he knows she knows he knows she has 16,14,12,10,8,6, or 4 bars. – Taemyr Nov 16 '16 at 14:11

The "I know you know that I know..." solution does not need to be very long, depending how much detail is requested.

1. Solving for A=18, B=2 Day 1 A: knows the solution, (18+2)=20

2. Solving for A=16, B=2 Day 1 A: cannot decide between (16+2) and (16+4) Day 1 B: a) (18+2) - Ann would know b) (16+2) - solution

3. Solving for A=16, B=4 Day 1 A: cannot decide between (16+2) and (16+4) Day 1 B: cannot decide between (14+4) and (16+4) Day 2 A: a) B has 2 aa) (18+2) B dismissed, knows I would know (case 1) ab) (16+2) B does not cry victory -> B does not have 2 b) B has 4 -> solution (16+4)

4. Solving for A=14, B=4 Day 2 B: a) (14+4): solution (the other case will be excluded) b) (16+4): Ann would know this morning (case 3)

It can be shortened (at least) to:

A=18, B=2: A on 1st day (immediate solution)

A=16, B=2: B on 1st day (because of the previous case)

A=16, B=4: A on 2nd day (because of the previous case)

A=14, B=4: B on 2nd day (because of the previous case)

A=14, B=6: A on 3rd day (because of the previous case)

A=12, B=6: B on 3rd day (because of the previous case)

A=12, B=8: A on 4th day (because of the previous case)

They will never escape. From the info they have and can obtain from each other by knowing that the other hasn't answered, they cannot possibly deduce the number of bars the other one has, hence they cannot possibly deduce the total number either.

Explanation:

Neither Mark nor Rose cannot figure the answer without info from the other one. I hope that much is obvious. Now, the only way for them to send a message to each other is by answering or not answering the question. Mark goes first, he knows Rose has either 8 or 6 bars. He does not know how many, so he does not answer. Rose knows, that Mark didn't answer, and that Mark has either 10 or 12, and that Mark must have guessed Rose has 8||10 or 8||6 and in either case Mark wouldn't have answered. So Rose didn't receive absolutely no new information from Mark non answering, and cannot answer herself. Mark in turn didn't get anything new from Rose not answering. They cannot relay any information to each other than they already had before, hence each of them can only guess with 50 % chance. They cannot escape by using logic, and being genius logicians they do know it. The end.

Now about accepted so called answer. It has nothing to do with logic because Roses conclusions do not logically follow from the info she has. It is a wrong answer. Downvote all you like. That answer would maybe, sort of, make some sense if the two were allowed to agree on some sort of code beforehand, but I still doubt it. Besides the point anyway.

• This puzzle has been solved and the accepted answer proves it is possible – Beastly Gerbil Nov 15 '16 at 17:46
• Accepted answer is wrong and proves only that the author of the question does not know the answer themselves. – Sejanus Nov 15 '16 at 18:04
• @Sejanus You are right. – Thorsten S. Nov 15 '16 at 19:49
• This is incorrect. Have you heard of the Blue Eyes Problem? It may shed some light on the issue for you. – Deusovi Nov 15 '16 at 20:18
• @Deusovi Well, it is not the Blue Eyes Problem. If you are so convinced, lets simulate it in chat. – Thorsten S. Nov 15 '16 at 20:23

After a lot of consideration, I have come to this method: To solve the problem, I had to make two main assumptions. First, it can only be solved from a single point of view, ie. from the evil (logician) because he is the common denominator. He gave both Rose and Mark just two numbers to choose (18 or 20) bars. Second, since he is a logician expecting a logical answer, therefore, his question must be logical. He can not ask if they are seeing less than 12 bars. Although Mark sees 8 , Rose is seeing 12, so that would be an illogical question.

Now, between Rose and the evil, they both know that Mark must be seeing 8 or 6 (from 20 or 18 minus 12)

Between Mark and the evil, Rose must be seeing 12 or 10 (from 20 or 18 minus 8) . Initially Rose don't realize this.

Now its time for Rose to deduce. She knows that Mark has two options- 8 or 6 bars. If she thinks that Mark has 8 bars, then she must be seeing 12 or 10 bars. If she thinks that Mark has 6 bars, then she must be seeing 12 or 14 bars. So Rose will know that all in all Mark actually have three options 10, 12 or 14 bars for her to see. Both Rose and the evil are fully aware that she is not seeing 14. That makes Mark's option to be limited to 10 and 12 bars for Rose, which is exactly the case.

Now here is the catch-: It must be a logical question. If Mark is seeing 6 bars, and both Mark and evil knows that Rose had 10 or 12 bars, the evil's question for Mark must NOT be "are there 18 or 20 bars?" Because the more logical question for 6 bars is "are there 16 or 18 bars?"

Because the evil chose the two numbers (18 and 20), the only option for Mark is to see 8 bars, which is exactly the case.

Rose can safely conclude that Mark sees 8 bars, and the total is 20 bars for both.