Riddles

I like puzzles and riddles. Not the “it is yellow and […]” kind of riddles, but what I would call logical or mathematical riddles. I collected some interesting ones; hope you like them.

Some of the riddles are not my own, in that the idea behind the riddle is not mine. It is hard to come up with a good riddle! However, exposition (story, details) of the riddles given here are mine. Further context about the riddles or mathematics behind it are given in these note blocks.

Vampires

In Transylvania, there live vampires and humans. Humans always tell the truth, while vampires always lie. Every person is either a vampire or a human, but not both. Disjunctive statements, like “or” and “either […] or […]”, are always meant as inclusive disjunction/inclusive or.

You come across four wise elderly persons: A, B, C, and D. They tell you the following:

Who are human, and who are vampire?

This is a knights and knaves type of riddle. They were first introduced by Raymond Smullyan in his book “What is the name of this book?”. This instance is my own, and I hope it is a bit more tricky than most knights and knaves riddles you find around.

Next, you run into a group of mathematics students: E, F, G, and H. Unlike the elderly persons, the students don’t have full knowledge over who is vampire and who is human. However, everyone knows about themselves whether they are vampire or not, and since they are mathematics students, they reason completely logically. In particular, if from the knowledge of a student some fact φ logically follows, then this student also knows φ . Moreover, no one has flawed knowledge, i.e. if someone knows something then it must be true. Finally, everyone knows what they know. For example, if I (don’t) know φ , then I know that I (don’t) know φ .

Initial knowledge can be composite, e.g. I can know “if X is human then so is Y” without knowing whether X is human or whether Y is human. However, knowledge always describes whether people are human or not, or whether they know something regarding whether people are human or not, etc. For example, no one knows something like “if X says something before Y does then …”.

Humans only ever make statements for which they know that they are true (and thus, in particular, are true). Conversely, vampires only ever make statements for which they know that they are false (and thus, in particular, are false).

They students tell you the following:

Note that everyone overheard the entire conversation, and at any point base their knowledge on everything said before that point. Who are human, and who are vampire?

This second part of the riddle combines the knights and knaves type of riddle with epistemic knowledge. While riddles of the form “A: I don’t know X.”, “B: Neither do I”, “A: Now I know!”, “B: Now I do so too!” are quite mainstream, I had never seen it combined in a knights and knaves riddle, so I came up with this example. I think this makes the riddle much more interesting than a standard knights-and-knaves one.

The mathematics behind this riddle, the study of reasoning about knowledge, is called epistemic logic, which is a particular instance of one of my areas of study: modal logic.

Coloured hats

A group of 42 logic students are playing the following game. The students stand in a circle so they can see all the other students. The professor gives each of the students a coloured hat. Every student can see the colours of all the hats except for their own.

The game is played in turns. At the start of every turn, all students that have derived their hat colour head to the professor to tell what colour their hat is, hand it in and then leave the game. All students reason fully rationally (they are logic students), know all others reason fully rationally, and so on. The professor hands out the hats in a way that everyone can deduce their hat colour, and tells this to the students. The students are not allowed to communicate in any manner.

The first turn at most one hat is handed in. The second turn a non-zero number of hats, all the same colour, are handed in. The third turn no hats are handed in, and the fourth turn hats of 2 different colours are handed in. The fifth turn a non-zero number of hats are handed in, and the sixth turn a non-zero even number of hats are handed in.

How many different hat colours were handed out by the professor? How many hats were handed in during the fifth turn? And the sixth turn? What turn were the last hats handed in?

This riddle is based on an animated riddle by TED-Ed. I changed the setting and details though.

Fortuna

As mathematicians developed the theory of probability, they incurred upon them the rage of Fortuna, the goddess of luck and fate.1 She now seized a (countably) infinite number of mathematicians, 0, 1, 2, etc. To teach you the existence of actual luck, she came up with the following cruel “game”.

You will be put on a line such that any mathematician n sees precisely all mathematicians m for m > n . Every mathematician is given either a black or a white hat (and not both). Each mathematician n can see the colours of all the hats in front of them ( m > n ) but not their own hat colour or the colours of the hats behind them ( m n ). No communication is allowed at all.

Afterwards, each mathematician has to guess their hat colour. If the guess is wrong, the mathematician is executed, when it is correct the mathematician is released and awarded fortunes from the cornucopia (horn of plenty). All of this happens in private, so none of the other mathematicians observe the guess or whether it was correct.

Before the “game” starts you have the opportunity to agree on a strategy together. However, note that as your opponent is Fortuna, luck is always in her favour, so never in yours.2 For example, if your strategy is that everyone guesses purely at random, Fortuna will (by luck) have assigned each mathematician a hat with colour opposite to what this mathematician is going to guess, resulting in all mathematicians being executed.

It is your job to come up with a strategy that saves as many mathematicians as possible, while minimizing the number of executions. Beat Fortuna!

For non-mathematicians: the optimal strategy requires some formal (for example academic) training in mathematics. In particular, it requires familiarity with at least some set theory. However, don’t fear: even without any mathematical background there is a decently good strategy, although it would be better described as a draw than beating Fortuna.

  1. If you are not worried yet, maybe Carmina Burana: O Fortuna can get you into the mood…

  2. Alternatively, you can think of Fortuna knowing your strategy and being able to predict any “random” guesses any of the mathematicians are going to make.