21

Is it possible to solve this problem:

A prince wish to marry a princess. There are 3 princesses, one is young, one is a little older and one is old. The prince is able to tell the princesses apart. One of the princesses always tells the truth, one never tells the truth and one sometimes tells the truth and sometimes not.

The prince only wish to marry a princess whom he can trust. Therefore it must be the princess that always tells the truth or the princess that never tells the truth (he can just negate her answers for the rest of their marriage).

Before he chooses the princess he wish to marry, he can ask one and only one princess a single question. She must only answer the question by yes or no.

Which question must he ask to be sure he marries one of the right princesses?

Edit: I was not expecting the question "who is more truthful", so consider this change of rules. Suppose we remove the "random princess", and instead insert an "evil princess". The evil princess can choose her strategy for answering, after she has seen which princess we are asking. So asking "Who is more truthful", does not make sense anymore, since the evil princess could choose to answer correct to every question.

Gerry Myerson
  • 179,216
utdiscant
  • 3,201
  • Yes it is possible (certainly if he does not mind not knowing whether the princess he chooses is the always truthful or never truthful). It has to be a question which they cannot all answer the same way. What have you tried? – Henry Mar 27 '11 at 21:41
  • 13
    Hehe, "he can just negate her answers for the rest of their marriage". – George Lowther Mar 27 '11 at 21:44
  • 1
    But, I'd say, ask the oldest one if the youngest is more truthful than the middle one. If the answer is no, marry the middle one, otherwise marry the youngest. – George Lowther Mar 27 '11 at 21:55
  • @Lowther: Nice work, it seems you are correct. Thanks! – utdiscant Mar 27 '11 at 22:10
  • Now suppose we remove the "random princess", and instead insert an "evil princess". The evil princess can choose her strategy for answering, after she has seen which princess we are asking. So asking "Who is more truthful", does not make sense anymore, since the evil princess could choose to answer correct to every question. – utdiscant Mar 27 '11 at 22:15
  • 1
    @George, @utdiscant: I don't think that works. What if the oldest one is the liar and the youngest is the truthful one? Won't you get no as an answer and thus end up marrying the one you don't want to marry? – t.b. Mar 27 '11 at 22:16
  • 1
    @Theo: Yes, I got that the wrong way round. The correct statement should have been "If the answer is no, marry the youngest, otherwise marry the middle one". – George Lowther Mar 27 '11 at 22:25
  • @Theo: Nice spotted, it seems I overlooked that. It is hard to get your head around this! – utdiscant Mar 27 '11 at 22:26
  • It looks to me like your edit can easily be reverted by just asking "if the evil princess would not be evil (but random), then..." + the original answer. – Attila O. Jan 27 '12 at 14:11
  • 3
    There are now two solutions that seem to rely on "No answer" being a possible answer to a yes or no question. Perhaps you should clarify whether this is permitted. –  Feb 02 '15 at 14:34
  • @pew: Why do you think that it mayn't be permitted? –  Feb 02 '15 at 14:37
  • 4
    Because in every logic puzzle I've ever heard, a "yes or no" question can only be answered with "yes" or "no" (tertium non datur), not with "I can't answer". –  Feb 02 '15 at 14:39
  • @pew: But it's all that I have found. –  Feb 02 '15 at 14:40
  • 1
    Hint: You can assume that you will always receive an answer of "Yes" or "No". You have no way of knowing whether the princess that you ask is the middle princess or not, so you will always choose one of the other two. – TonyK Feb 02 '15 at 14:45
  • @TonyK I ask a question to the liar/truther and that leaves me to have a 50/50 chance of picking the middle sister. – Axoren Feb 02 '15 at 14:47
  • Not an answer, but if you ask something along the lines of "Are you the oldest sister", the oldest and youngest must answer yes, so a no answer would guarantee the middle sister - but obviously if you ask the middle sister it's not ensured if she answers yes. But your chances are good at least! – Mike Miller Feb 02 '15 at 14:49
  • If "no answer" is not acceptable, how do you deal with Russell's paradox (ie one cannot always lie AND answer the question "do you always lie?") – Alexandre Halm Feb 03 '15 at 04:14
  • @Alex H.: If you always lie, your answer to "Do you always lie?" is "No". If you say "Yes" then you sometimes lie. – Henry Feb 03 '15 at 07:04
  • @Henry: true, i had some weird misconception about this being equivalent to the liar's paradox , thanks – Alexandre Halm Feb 03 '15 at 10:02
  • 10
    @GregMartin, I reversed the genders to address your concern. Given the lack of historical commoditization of male progeny, this should address it, and doesn't harm the problem in any way. – Jaydles Feb 03 '15 at 18:30
  • 8
    Users wishing to constructively discuss the original wording of this question and @Jaydles's edit are welcome to use this meta thread. Further discussion on this matter will be off-topic here. – user642796 Feb 04 '15 at 09:01
  • 4
    @user 170039: please remember that this site is not intended for simply posting mathematical puzzles - it is not a place for "sharing" as the first sentence of the post says. – Carl Mummert Feb 04 '15 at 17:59
  • 2
    @Joffan: That is incorrect. The answer, aside from irrelevant details in the presentation of the puzzle, is identical there. – Jonas Meyer Feb 06 '15 at 13:14
  • @CarlMummert: Then this question should also be closed. –  Feb 07 '15 at 13:43
  • 1
    @user 170039: yes, exactly. – Carl Mummert Feb 07 '15 at 16:19
  • @Henry: It is not possible to always lie because it would be impossible to answer the question "Will you lie in answering this question?". So it is indeed Russel's paradox as Alex H. thought. – user21820 Feb 15 '15 at 02:28
  • @user21820: That would only be a problem if you were an always liar and you were to be asked "Will you lie in answering this question?". The question I was commenting on was "Do you always lie?", which is much easier to answer. – Henry Feb 15 '15 at 08:52
  • @Henry: Yup I know. I'm just saying in case you thought the liar paradox had nothing to do with it. – user21820 Feb 15 '15 at 09:21
  • Please note that this question is also discussed here : https://puzzling.stackexchange.com/questions/12204/the-three-seers – Hemant Agarwal May 29 '21 at 05:32

9 Answers9

107

Pick a random prince, then ask him:

Is he [pointing to one of his brothers] older than him [pointing to the second one]?

If you receive "Yes" as an answer, choose the second brother, otherwise choose the first. This ensures you will not marry the middle one.


Explanation:

If the prince you asked is the eldest, he will answer truthfully, and you will pick the youngest.

If the prince you asked is the youngest, he will lie, and you will pick the eldest.

If the prince you asked is the middle one, he will answer randomly, and you will pick one of the two others, as desired.


Edit:

More information about the many variations of this puzzle can be found by searching for the term "Knights and Knaves", which is the name logician and author Raymond Smullyan used to describe these problems.

Of particular interest is a problem known as The Hardest Logic Puzzle Ever, which has the same basic setup as the "princes(ses)" puzzle – lier, truther and random answerer – but with more information needing to be extracted and the additional complication that instead of "Yes" and "No", equivalent words in some esoteric language are used and it is unknown which word means which.

24

Ask the middle one if the youngest is more truthful than the eldest. If the answer is "no" then marry the youngest, otherwise marry the eldest.

That way, if the middle one is the liar, he is guaranteed to marry the most truthful of the remaining two, which is the 100% truthful princess. If the middle one is the truthful one, then he is guaranteed to marry the least truthful of the remaining two, who is the habitual liar. If the middle one sometimes tells the truth and sometimes lies then it doesn't matter which of the other two he marries (for the purposes of this riddle...).

This is just the answer I gave in the comment above, removing the mistake pointed out by Theo Buehler (and the implicit ageism in assuming the prince would rather marry one of the younger two).

Ross Millikan
  • 374,822
15

Label the brothers arbitrarily as $A$, $B$, and $C$ (as mathematical parents would). We can describe any strategy we might adopt as three pieces of information:

  • A question to be addressed to $A$. (Since the labeling were arbitrary, we assume $A$)
  • The brother we will marry if we receive "Yes" as an answer
  • The brother we will marry if we receive "No" as an answer.

You cannot marry the brother you ask the question to.

To show this, suppose that we marry $A$ if he responds "yes". It is possible that $A$ is the middle brother. Similarly if we marry $A$ for a response of "no" - it is, in fact, impossible for us to determine whether the person we ask the question to is the middle brother, since if it were, we could receive any answer - and in particular, we could receive the same answer as if he were not

Thus, we can assume, without loss of generality, that we will marry brother $B$ if we get a "yes" and brother $C$ if we get a "no" (since we should obviously not have chosen the brother we marry before hearing an answer!). Moreover, this means that we can assume that $A$ is not the middle brother, since if he is, the strategy works regardless of the question.

There are a number of questions that will let us determine, assuming $A$ is the youngest or the oldest, whether $C$ is the middle brother. For instance

Is $C$ older than $B$?

functions, since if we get the youngest and a "yes", we know $C$ is the middle brother and we should marry $B$ - and we can work out the other cases similarly. In particular, any question with the following truth table functions: $$\begin{array}[ccc]. &&\text{$B$ is the middle brother}&&\text{$C$ is the middle brother}\\\text{$A$ is the youngest}&&\text{true} &&\text{false}\\\text{$A$ is the oldest}&&\text{false}&&\text{true}\end{array}$$ To be very blunt we could ask $A$:

Are you the youngest exclusive or is $C$ the middle brother?

Another question, along a different line, would be:

If I asked you if $C$ was the middle brother, what would you say?

Since we essentially force the brother to tell the truth - but this is perhaps further from the spirit of the question.

Milo Brandt
  • 60,888
  • 3
    This post is inspired by @pew's prior post, which gives the same answer. – Milo Brandt Feb 02 '15 at 21:53
  • 5
    @Jaydles Everyone knows that $A$, $B$ and $C$ are girl's names! If you ask me, it's downright silly to label brothers that way, as is the case in your edit (as opposed to, say, the more common $\alpha$, $\beta$, and $\gamma$ labeling of boys or $\mathscr a$, $\mathscr b$, and $\mathscr c$ for siblings of arbitrary gender) – Milo Brandt Feb 04 '15 at 00:11
  • I agree with Meelo. We should enforce a strict policy of choosing names from the set ${'\emptyset','\emptyset \emptyset', ... }$. – copper.hat Feb 04 '15 at 07:06
  • This is actually the better answer, because instead of pulling a rabbit out of a hat, it explains how to tackle these problems (there are many variations such as The Hardest Logic Puzzle Ever) in general. I love the question "Are you the youngest XOR is C the middle one?" –  Feb 04 '15 at 07:32
  • @pew: Nice link. –  Feb 04 '15 at 13:09
4

Ask one of the siblings:

Are you someone who both has a younger sibling and is currently being as dishonest as you ever are?

The truth-teller has a younger sibling and is never dishonest, and so will honestly answer "yes."

The liar has no younger sibling, and so will lie and answer "yes."

The mischievous one either a) is telling the truth, and thus is more honest than sometimes, and so will truthfully answer "no," or b) is lying, therefore currently maximally dishonest, and so will falsely answer "no."

Note however that this answer relies on the mischievous one being logically mischievous (that is, arbitrarily choosing to be truthful or not, and then answering based on that choice), rather than being mischievous in the sense of answering with the intent to confuse you. In that sense the other answer (which works however the mischievous one decides what to answer) is superior.

Micah
  • 38,108
  • 15
  • 85
  • 133
  • 2
    This approach makes sure you marry the eligible princess you find more attractive, so +1 from me. – Dennis Feb 03 '15 at 01:48
  • 2
    Technically speaking, it is partially cheating by asking two conditions..sort of two questions. But still +1 for creativity :-) – Michal Feb 03 '15 at 14:28
  • 3
    @Michal I think it is valid to ask a conjunction in these sorts of questions, since you still only get one bit of information back. It would be cheating if you managed to get an answer and follow it up with something else, or somehow otherwise forced the answerer to give more than just "yes" or "no" - one's own question is allowed to be as complicated as desired. – Mario Carneiro Feb 04 '15 at 01:58
  • 1
    @Michal The answer can be summed up as a single yes or no, so it's one question. The answerer doesn't have to say "yes to the second but no to the first". – Jack M Feb 04 '15 at 21:00
  • @MarioCarneiro Of course you're both right about the fact, that the question is valid in the sense that only one output is produced. I only wanted to say that I see two separate questions creatively tied together - both of them could be asked separately, but no dispute about the fact that it is correct - it's the && that makes the question work. Really, it was just a comment, not critique :-) – Michal Feb 05 '15 at 09:29
2

"Will I marry the middle brother?"

Because the liar and the truther don't know the answer, they can't answer without having a chance of betraying their nature.

The middle brother will be the only one able to answer.

Marry either brother that doesn't answer the question.

Edit: Due to the recent edit, this answer is no longer valid to the question. It depends on the fact that you can force the princesses to be unable to answer.

Jaydles
  • 201
Axoren
  • 2,303
  • Why the -1? It works. – Axoren Feb 02 '15 at 14:33
  • I have no idea too I got the same – The Artist Feb 02 '15 at 14:33
  • If the princess who "always" lies can choose not to answer this question, what forces the princess who lies "the rest of the time" to answer it? – David K Feb 02 '15 at 14:37
  • By that logic, every princess can refuse to answer when they're able to, regardless of the question. – Axoren Feb 02 '15 at 14:38
  • @DavidK And it's not that she can choose not to answer, it's that she "can't" answer. – Axoren Feb 02 '15 at 14:39
  • You only get one question, not one question per sister. – Joffan Feb 02 '15 at 14:47
  • 1
    @Joffan, If the sister I asked can't answer: marry her. If she can: marry any other sister. – Axoren Feb 02 '15 at 14:48
  • It doesn't matter which sister I asked and it doesn't matter how many sisters I asked. – Axoren Feb 02 '15 at 14:49
  • 2
    Well I like your answer then :-) – Joffan Feb 02 '15 at 14:49
  • The point is that you must choose who you marry. They cannot possibly know who you will marry. – Pedro Feb 02 '15 at 14:51
  • @PedroTamaroff And that's exactly why the middle sister is the only one who can answer. She is the only one able to both lie and tell the truth, so she can answer with either Yes or No without care. – Axoren Feb 02 '15 at 14:56
  • 3
    Do you mean "If I married you, will I be marrying the middle aged sister?" Currently your question doesn't appear to be directed at someone, and is a question of an outcome based on a decision that is not within their ability, rather than on an outcome for a known choice. –  Feb 02 '15 at 14:58
  • @Axoren The point is, "always" no longer means "always" once you admit the occurrence of cases where she "can't". Once you contradict one condition of the puzzle statement--or if you will, "creatively interpret" it--you open the door for creative interpretations of other conditions. – David K Feb 02 '15 at 15:21
  • 5
    Note that the question doesn't say the middle sister will choose between saying "yes" or "no". It says she will choose between telling the truth and lying. So if she cannot tell the truth (for the same reason the eldest sister cannot tell the truth -- she doesn't know the answer) and she cannot lie (for the same reason the youngest sister cannot lie -- she doesn't know the answer) then I don't see how the problem as stated permits her to answer. – Steve Jessop Feb 02 '15 at 18:46
  • @SteveJessop You are holding a banana. I've stated something that is either a lie or a truth. I do not know which it is, but I have either told a lie or told the truth. – Axoren Feb 02 '15 at 21:41
  • By most definitions a lie is not "a false statement" it's "a false statement which you know or believe to be false". – Steve Jessop Feb 02 '15 at 22:09
  • This answer can be seen as the "exploding heads" approach outlined in the same literature describing the original knights and knaves riddle. – Axoren Feb 10 '15 at 01:09
1

There are often brute force solutions to these kinds of questions that can be constructed by simply throwing enough logical disjunctions and conjunctions at the problem.

Let $M$ denote the proposition "You are the middle brother", and $L$ denote the proposition "You are lying". Then ask any brother:

$(M\wedge\neg L)\vee(\neg M\wedge L)$ ?

Assume $M$ is true. Then the above simplifies to $\neg L$ - "Are you telling the truth?" - to which the answer is always Yes.

Assume $M$ is false. Then the above simplifies to $L$ - "Are you lying?" - to which the answer is always No.

Thus the answer will be Yes iff you asked the middle brother (Note that the middle brother doesn't randomly say yes or no, he randomly answers truthfully or falsely, otherwise this wouldn't work).

Jack M
  • 27,819
  • 7
  • 63
  • 129
1

Ask the youngest princess, "If I were to ask you if the middle princess is the evil one would you say yes?" This formulation causes the false one into a double negative thus if the middle princess is evil both true and false will answer yes, otherwise both true and false will answer no. Thus if the youngest princess answers yes to your question either she is evil and trying to trick you or the middle princess is evil, in any case you can be sure that the oldest princess is not evil and thus marry her. If the youngest princess answers no to your question than whether or not she is evil the middle princess is definitely not evil thus you marry the middle one.

0

You can't pick the one you ask the question to, as there is no yes/no question you can ask that will let you determine that the asker is not random.

From this, there are 3 cases to consider:

  1. If the one you ask is random, it doesn't matter who you pick
  2. If the one you ask is true, you want to pick the false one
  3. If the one you ask is false, you want to pick the true one

We only need to worry about cases 2 and 3, since case 1 solves itself. Thus, the question boils down to these 4 scenarios:

  1. You get a true answer about false
  2. You get a true answer about random
  3. You get a false answer about true
  4. You get a false answer about random

From these cases, let's constrain it so that you'll get a "yes" for 1 and 3, and a "no" for 2 and 4. That way, you can pick the one they say "yes" about, or pick the other if they say "no". There are many possibilities, but here's one such question:

If you are true is that brother false, otherwise is he random?
Briguy37
  • 1,579
0

Let's use the term "consistent" for a person who either always speaks the truth or always lies, and let's assume that the princesses themselves use and recognize this term with the same meaning.

Given that exactly two of the three princesses are consistent, we are to find one of them, using one question.


The simplest question that I've been able to come up with is to ask one princess (call her $\;A\;$)

"Can you say that she [point to another princess, $\;B\;$, here] answers consistently?"

If the answer is "yes" then $\;B\;$ is consistent, otherwise the third princess, $\;C\;$, is.


Why does this work? Well, for any consistent person, if you ask "Can you say that $\;P\;$?", the answer "yes" means that $\;P\;$ is true, and "no" means that $\;P\;$ is false.

So if $\;A\;$ is consistent, then we can choose $\;P\;$ as "$\;B\;$ is consistent", and know whether or not $\;B\;$ is consistent, and if not then $\;C\;$ is (because there are two consistent princesses).

And if $\;A\;$ is not consistent, then both $\;B\;$ and $\;C\;$ are consistent (again, because there are two consistent princesses).

For a more formal argument, see my answer to another math.se question, up until the section "The first question: determinism".