Imprisoned Logicians

Two friends, logicians – Ein and Stein, get imprisoned in two distant cells in a castle. Both cells have just one door, and a window with 8 bars in the first cell, and 12 bars in the second cell. The first day both logicians get the same letter from the prison master:

“The total number of bars in the two prison cells in this castle is either 18 or 20. Starting tomorrow, every morning I will go first to Ein and then to Stein, and will ask how many bars the other logician has. If one of you answers correctly, I will immediately let both of you leave the castle. If one of you answers incorrectly, I will execute both of you. Of course, you can always decide not to answer and just stay imprisoned.
I have sent a copy of this letter to you and your friend. There is no point in trying to communicate with him – your cells are far away from each other and he won’t hear you.”

Will the logicians manage to escape the castle eventually? When will they do it?

On the second day, Ein will know that Stein has realized that the number of bars in Ein’s cell is at most 18 (assuming the windows can have 0 bars on them), because otherwise, Ein would have guessed correctly 20. On the third day, Stein will know that Ein has realized that the number of bars in Stein’s cell is between 2 and 18, because otherwise, Stein would have guessed the exact number the previous day. Later, Ein will know that Stein has realized that the number of bars in Ein’s cell is between 2 and 16, because otherwise, Ein would have guessed the exact number. On the fourth day, Stein will know that Ein has realized that the number of bars in Stein’s cell is between 4 and 16. After that, Ein will know that Stein has realized that the number of bars in Ein’s cell is between 4 and 14. On the fifth day, Stein will know that Ein has realized that the number of bars in Stein’s cell is between 6 and 14, and Ein will know that Stein has realized that the number of bars in Ein’s cell is between 6 and 12. On the sixth day, Stein will know that Ein has realized that the number of bars in Stein’s cell is between 8 and 12, and Ein will know that Stein has realized that the number of bars in Ein’s cell is between 8 and 10. Finally, Stein will conclude that the number of bars in Ein’s cell must be 8, and that the total number of bars in the castle is 20.

+ latest posts

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

Puzzle Newsletter

Subscribe to our newsletter and get our selected puzzles directly in your mailbox.


Responses

Your email address will not be published. Required fields are marked *

  1. Apportioning cascading reasoning to particular days is absurd, as are the conclusions supplied. If Ein is in the 8 bar cell and Stein in the 12 bar cell, Ein will have realised immediately that the other cell has 10 or 12 bars and Stein that the other has 6 or 8 bars. Not even logic is required to reach this, nor will either logician consider any other numbers at all. Instead we are told: “Stein will realize that the number of bars in Ein’s cell is at most 18”. Only if he’s lost his mind! It is at most 8. Are these “logicians” or mathematical illiterates? Day in, day out, the position is unchanged and they can either guess or not guess with a 50-50 chance of being right. There is no “solution” beyond this.

    1. Thank you for noticing the inaccuracy in the solution; it is fixed now. The friends can figure out the number of bars with 100% certainty, no need to guess.