Author |
Topic: One evil king, two prisoners, 20 trees (Read 21429 times) |
|
Zaz
Newbie
Posts: 3
|
|
One evil king, two prisoners, 20 trees
« on: Jan 7th, 2010, 4:49am » |
Quote Modify
|
I have only heard the following riddle in swedish, and this is my attempt of a translation. Code: An evil king imprisons two people, A and B. They are placed in the king's evil castle in separate towers. Each tower has a window, and through the windows A and B can see separate parts of the castle's garden. In the garden there grows 20 trees. The prisoners can't communicate in any way with each other. A can see 12 trees through the window in A-tower. B can see 8 trees through the window in B-tower. Both are told that the garden has either 18 or 20 trees, and that they together see all the trees, and that no tree is seen by both of them. Every day, starting with the day they are imprisoned, a guard asks them a question. The guard first asks A, and if no answer is given, goes on to ask B. The question asked is: "Is there 18 or 20 trees in the garden?" If the asked prisoner answers correctly, both prisoners are released immediately. If the asked prisoner answers erroneously, both prisoners are executed immediately. The prisoner can opt to not answer, in which case the guard will continue to ask the next prisoner as mentioned above. (The prisoner will opt this if it is not sure, since we assume both prisoners to be completely logical entities.) Will the prisoners ever be released? After how many days? |
| I looked through the archives here, and couldn't find this or anything similar. If anyone knows where this riddle comes from, or its actual name and original text, please tell me. I've looked all over and haven't found it.
|
|
IP Logged |
|
|
|
SMQ
wu::riddles Moderator Uberpuzzler
Gender:
Posts: 2084
|
|
Re: One evil king, two prisoners, 20 trees
« Reply #1 on: Jan 7th, 2010, 5:56am » |
Quote Modify
|
The prisoners will be released on the fifth day. hidden: | A sees 12 trees, knows B sees either 6 or 8 trees, reasons that: If B sees 6 trees then B knows A' sees either 14 or 12 trees, reasons that: If A' sees 14 trees then A' knows B' sees either 4 or 6 trees, reasons that: If B' sees 4 trees then B' knows A'' sees either 16 or 14 trees, reasons that: If A'' sees 16 trees then A'' knows B'' sees either 2 or 4 trees, reasons that: If B'' sees 2 trees then B'' knows A(3) sees either 18 or 16 trees, reasons that: If A(3) sees 18 trees then A(3) knows B(3) sees either 0 or 2 trees, reasons that: If B(3) sees 0 trees then B(3) knows A(4) sees either 20 or 18 trees, reasons that: If A(4) sees 20 trees then he would announce an answer! Otherwise if A(4) sees 18 trees then A(4) knows B(4) sees either 0 or 2 trees, reasons that: ... Otherwise if B(3) sees 2 trees then B(3) knows A(4) sees either 18 or 16 trees, reasons that: ... Otherwise if A(3) sees 16 trees than A(3) knows B(3) sees either 2 or 4 trees, reasons that: ... Otherwise if B'' sees 4 trees then B'' knows A(3) sees either 16 or 14 trees, reasons that: ... Otherwise if A'' sees 14 trees then A'' knows B'' sees either 4 or 6 trees, reasons that: ... Otherwise if B' sees 6 trees then B' knows A'' sees either 14 or 12 trees, reasons that: ... Otherwise if A' sees 12 trees then A' knows B' sees either 6 or 8 trees, reasons that: ... Otherwise if B sees 8 trees then B knows A' sees either 12 or 10 trees, reasons that: If A' sees 12 trees then A' knows B' sees either 6 or 8 trees, reasons that: ... Otherwise if A' sees 10 trees then A' knows B' sees either 8 or 10 trees, reasons that: ...and so on where A', A'', A(3), etc. represent more deeply nested mental hypothetical prisoners. After the first half of the first day, when A doesn't answer, the tree of possibilities is pruned since eight-times-hypothetical A(4) would have answered if he saw 20 trees. After the second half of the first day, when B doesn't answer, the tree of possibilities is pruned again since seven-times-hypothetical B(3) wound have known A(4) saw only 18 trees and answered. And so on, pruning one possibility each half day, until, on the morning of the fifth day, only-once-hypothetical B can only see 8 trees, allowing A to declare that there are 20 trees in the garden. | See this thread (dicussing this riddle) for several other approaches to problems of this type. Edit: And welcome to the forum, Zaz! --SMQ
|
« Last Edit: Jan 7th, 2010, 5:57am by SMQ » |
IP Logged |
--SMQ
|
|
|
rmsgrey
Uberpuzzler
Gender:
Posts: 2873
|
|
Re: One evil king, two prisoners, 20 trees
« Reply #2 on: Jan 7th, 2010, 6:23am » |
Quote Modify
|
I don't recognise the "story" of the puzzle, but the mechanics of it - two or more people successively declaring their ignorance to enable one or more of them to deduce something - are used in a number of puzzles around here. One of the archetypical ones involves five hats - three black and two white - and three people, each of whom can see the hat each of the others wears but not their own. No matter which three hats are chosen, or how they're arranged, by the time you've asked each of them once, one of them will have correctly identified their hat.
|
|
IP Logged |
|
|
|
Zaz
Newbie
Posts: 3
|
|
Re: One evil king, two prisoners, 20 trees
« Reply #4 on: Jan 7th, 2010, 8:15am » |
Quote Modify
|
Thanks for the info. One thing I wondered though... As you say, they will be hidden: | released at day five if one iterates reasoning from the fact that A would answer the first day if he saw 20 trees.... however, you get a different answer if you iterate from B? If B sees 20 and A 0, B will answer the first day. If B sees 18 and A sees 0, A will answer the second day. If B sees 18 and A sees 2, B will answer the second day [...] If B sees 8 and A sees 12, B will answer on the seventh day. | I had a blog post about this, but it is in swedish... I'll translate it when I'm not at work. ^^
|
|
IP Logged |
|
|
|
JohanC
Senior Riddler
Posts: 460
|
|
Re: One evil king, two prisoners, 20 trees
« Reply #5 on: Jan 7th, 2010, 8:22am » |
Quote Modify
|
This problem certainly looks like an interesting variation to the hidden-information theme. Especially that you need so many rounds to answer a question with only two possible options. I'm wondering whether the solution could be written simpler, I mean without all those levels of indirection. But I see it dificult. The only thing I see (like with a lot of riddles), is first restating it with lower numbers to "get the trick".
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: One evil king, two prisoners, 20 trees
« Reply #6 on: Jan 7th, 2010, 8:23am » |
Quote Modify
|
You start the iteration with whichever prisoner is asked first by the guard. If you reverse the order, it doesn't change much it would still be the fifth day, but it would be the second prisoner that gives the answer (which, however, would still be A, since we reversed their order). If instead of reversing the order you skip A on the first day, then you get basically the same as when you reverse the order and in addition shift the process "half a day". Which means it runs over to the sixth day. It is, however, important the prisoners know exactly in what order and how often they're asked.
|
« Last Edit: Jan 7th, 2010, 8:30am by towr » |
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
Zaz
Newbie
Posts: 3
|
|
Re: One evil king, two prisoners, 20 trees
« Reply #7 on: Jan 7th, 2010, 12:13pm » |
Quote Modify
|
Nono, that is not what I meant. I meant that if you try to solve it by hidden: | imagining different distributions of visible trees for A and B, depending on which one you imagine starts with 20 trees, you will get a different result. I tried to translate my blog post into english, but I can't post it here because I can't figure out the bb-code for managing tables. I instead put the file here, take a look and tell me if/where my reasoning is faulty. |
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: One evil king, two prisoners, 20 trees
« Reply #8 on: Jan 7th, 2010, 12:36pm » |
Quote Modify
|
They both imagine that alternates of them can start with 20 trees. You need to start with all possible worlds. And you eliminate possible worlds according to the order in which prisoners are questioned and how they respond. If you don't approach the problem from "both ends" (where and alternate A sees 20, and where an alternate B sees 20), then you do indeed get the problem there seem to be two answers, depending on where you start. However, if you look at the pdf I posted, you can see that it works out fine if you consider the whole picture.
|
« Last Edit: Jan 7th, 2010, 12:58pm by towr » |
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
Hippo
Uberpuzzler
Gender:
Posts: 919
|
|
Re: One evil king, two prisoners, 20 trees
« Reply #9 on: Jan 7th, 2010, 1:16pm » |
Quote Modify
|
on Jan 7th, 2010, 8:03am, towr wrote:Here's a graphical way to solve the problem (attached as pdf). |
| Just two things ... typo least / leaTS and I would not color the left bottom node at the first half of the first day. The graphical solution is very nice.
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: One evil king, two prisoners, 20 trees
« Reply #10 on: Jan 7th, 2010, 2:05pm » |
Quote Modify
|
on Jan 7th, 2010, 1:16pm, Hippo wrote:Just two things ... typo least / leaTS |
| Yeah, I noticed that after I uploaded it here. If I had caught it before, I would have fixed it, but unfortunately I missed it, and I didn't want to go through the trouble of reuploading it. Quote:and I would not color the left bottom node at the first half of the first day. |
| Well, as it is, the colouring accurately reflects their knowledge. At the start A would know whether he's in world 20,0 and B would also know whether he's in 0,20. But on the other hand, to reflect the process/order in which possible worlds are eliminated, it might have been better not to have coloured the bottom left node. So I can see your point. Quote:The graphical solution is very nice. |
| Thanks.
|
« Last Edit: Jan 7th, 2010, 2:06pm by towr » |
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
rmsgrey
Uberpuzzler
Gender:
Posts: 2873
|
|
Re: One evil king, two prisoners, 20 trees
« Reply #11 on: Jan 8th, 2010, 7:04am » |
Quote Modify
|
One trivial simplification for this particular version would be to count pairs of trees rather than individual trees - A sees 6 pairs, B sees 4, and there are known to be 9 or 10 pairs in total.
|
|
IP Logged |
|
|
|
ekaprits
Newbie
Posts: 1
|
|
Re: One evil king, two prisoners, 20 trees
« Reply #12 on: Sep 2nd, 2013, 6:30am » |
Quote Modify
|
I used to think that the above solution was the correct one for this riddle. A friend of mine disagrees, and I'm not so sure any more. I post his solution here. Can someone spot any problems with it? My (somewhat informal) reaction to it is that it assumes that certain facts are common knowledge, when they are not. Here is the solution: hidden: | At the initial state, A knows that B sees 6 or 8 trees. He also knows that B knows that A sees 10,12, or 14 trees. Similarly, B knows that A sees 10 or 12 trees, and he knows that A knows that B sees 6, 8, or 10 trees. Therefore, the common knowledge is A:10,12,14, B:6,8,10. By not answering on the first day, A informs B that A knows that B knows that A sees either 10 or 12 trees (if he saw 14, he would have answered "20", since they both know that B has 6-10 trees). So the common knowledge is down to A:10,12, B:6,8,10. By not answering on his turn on the first day, B informs A that he doesn't see 6 trees (otherwise he would be certain that there are 18 trees), and that he doesn't see 10 trees (otherwise he would be certain that there are 20 trees). Therefore A will answer "20" on the 2nd day, since he now knows that B has 8 trees. | What do you guys think?
|
|
IP Logged |
|
|
|
rmsgrey
Uberpuzzler
Gender:
Posts: 2873
|
|
Re: One evil king, two prisoners, 20 trees
« Reply #13 on: Sep 2nd, 2013, 9:25am » |
Quote Modify
|
on Sep 2nd, 2013, 6:30am, ekaprits wrote:I used to think that the above solution was the correct one for this riddle. A friend of mine disagrees, and I'm not so sure any more. I post his solution here. Can someone spot any problems with it? My (somewhat informal) reaction to it is that it assumes that certain facts are common knowledge, when they are not. Here is the solution: hidden: | At the initial state, A knows that B sees 6 or 8 trees. He also knows that B knows that A sees 10,12, or 14 trees. Similarly, B knows that A sees 10 or 12 trees, and he knows that A knows that B sees 6, 8, or 10 trees. Therefore, the common knowledge is A:10,12,14, B:6,8,10. By not answering on the first day, A informs B that A knows that B knows that A sees either 10 or 12 trees (if he saw 14, he would have answered "20", since they both know that B has 6-10 trees). So the common knowledge is down to A:10,12, B:6,8,10. By not answering on his turn on the first day, B informs A that he doesn't see 6 trees (otherwise he would be certain that there are 18 trees), and that he doesn't see 10 trees (otherwise he would be certain that there are 20 trees). Therefore A will answer "20" on the 2nd day, since he now knows that B has 8 trees. | What do you guys think? |
| The problem is here: (if he saw 14, he would have answered "20", since they both know that B has 6-10 trees) The only reason they both know that B has 6-10 trees is because A has 12. If A had 14 trees, he'd know that B has 4 or 6, so if he saw 14 trees he wouldn't be able to answer "20" because his being able to answer "20" when he sees 14 trees relies on his deductions from seeing 12 trees. If A sees 2 trees added to his view, and is told that the total is still either 18 or 20, that B's view is unchanged, and that they still see every tree exactly once between them, then, yes, he can conclude that there are now 20 trees (and there were 18 before)... If A sees both 14 and 12 trees for some other reason, then it's hard to make any deductions...
|
|
IP Logged |
|
|
|
|