This Riddler puzzle is about randomly generating convex quadrilaterals.

You’re the most eligible bachelorette in the kingdom, and you’ve decided to marry a prince. The king has invited you to his castle so that you may choose from among his three sons. The eldest prince is honest and always tells the truth. The youngest prince is dishonest and always lies. The middle prince is mischievous and tells the truth sometimes and lies the rest of the time. Because you will be forever married to one of the princes, you want to marry the eldest (truth-teller) or the youngest (liar) because at least you know where you stand with each. But there’s a problem: You can’t tell the princes apart just by looking, and the king will grant you only one yes-or-no question that you may address to only one of the brothers.

What yes-or-no question can you ask that will ensure that you do not marry the middle prince?

Here is my solution:

[Show Solution]

**One possible solution**

Let’s label the princes A, B, and C. Ask Prince A the question:

“Is this prince (pointing to B) older than that prince (pointing to C)”.

If the answer is “Yes”, then marry Prince C.

If the answer is “No”, then marry Prince B.

This strategy is guaranteed to never choose the mischievous prince!

**Why it works**

There are 6 possible ways of assigning the three princes to the three labels. The following table illustrates what happens in all six cases.

A |
B |
C |
Is B older than C? |
What A repsonds |
Chosen prince |

Honest |
Dishonest |
Mischief |
No |
No |
Dishonest |

Honest |
Mischief |
Dishonest |
Yes |
Yes |
Dishonest |

Dishonest |
Honest |
Mischief |
Yes |
No |
Honest |

Dishonest |
Mischief |
Honest |
No |
Yes |
Honest |

Mischief |
Honest |
Dishonest |
Yes |
Yes or No |
Honest or Dishonest |

Mischief |
Dishonest |
Honest |
No |
Yes or No |
Honest or Dishonest |

When Prince A is honest, you’re trying to avoid the older of the two remaining princes since that one is mischievous. So you want to choose the younger one. When Prince A is dishonest, you’re trying to avoid the younger of the two remaining princes since that one is mischievous. So you want to choose the older one. But the dishonest prince always lies! So in both cases, if you go with the one that is claimed to be the youngest, you’ll always avoid the mischievous prince. Finally, when Prince A is mischievous, it doesn’t matter what they answer because you’re always picking one of the two remaining princes anyway!

**Rationale**

A single yes-no question must allow us to separate the three princes into two groups. Since we don’t need to discriminate between the honest and dishonest princes, we might expect the solution to be a question for which the honest and dishonest princes give the same answer. For example, we could ask: “Are you the oldest prince?”. Both the honest and dishonest princes would answer “Yes”. The problem, however, is that the mischievous prince could also answer “Yes”. In fact, no matter what we ask, the mischievous prince can always respond with whatever he likes!

The key is to realize that because we have no way of controlling what the mischievous prince says, we need a strategy that never selects the person asking the question. That way, if we happen to be talking to the mischievous prince, we can’t make a wrong decision. This chain of reasoning leads to the solution above (and it’s not the only one!).

Nice solution! Another solution is to ask “Would you say ‘yes’ if I asked you if this prince (pointing to B) is the middle prince?”. If the answer is “No”, choose prince B; otherwise, choose prince C. My solution is pretty similar to the “heaven and hell” riddle. I think your solution is easier to understand, just thought I would share another approach.