Gamebook store

Showing posts with label puzzles. Show all posts
Showing posts with label puzzles. Show all posts

Thursday, 22 December 2022

Cats, coins and conundrums


I don’t know how you stand on brain teasers. Jamie has written a whole book of them. I have a friend who likes to get us playing news quizzes on New Year’s Eve, but personally I prefer the kind of thing that stumps people at the dinner table. One of those is the Monty Hall problem. We featured one of Ivan Morris's on the blog a while back. But the one above is slightly less well-known and well worth thinking about.

Maybe you’d start by saying: “Somebody has two cats. The older cat is male. What’s the probability that the other cat is also male?” Everybody can get that. It’s fifty-fifty.

But maybe first we should pause and think about what probability means. Clearly if I have two cats, I already know what sex they are. Probability isn’t about the specific case where the facts are already known (well, duh), it takes a very large number of cases that meet the first condition and then asks how many of them meet the second condition – sight unseen.

Instead of cats, let’s think of it as people tossing coins. You have a room full of people (a thousand, say) and they all toss two coins. I ask everyone who has at least one coin that came up heads to raise their hand. Three-quarters of the room do so. So now I’m just looking at those 750 people and I ask how many have two heads. All but 250 hands go down. So, OK, if the question was: “Somebody has flipped two coins. At least one of them came up heads. What’s the chance their other coin also came up heads?” It’s 1 in 3.

Notice that earlier I mentioned the older cat being male. Making it the older cat defines it as distinct. It’s like asking everybody after tossing the first coin to put their hand up if they get heads. Then you get them to toss again, and keep their hand up if they get heads again. Now half of the hands go down, because each coin toss is random.

Digression: I knew somebody at the French Chamber of Commerce & Industry who believed that you could work out the odds of a coin toss based on how that coin had come up before. So if he tossed three heads in a row, he was convinced tails became more likely on the next toss.

This is of course nonsense, for which Pascal would have berated him soundly. It's nowadays known as the Monte Carlo fallacy. It is true that the chance of getting heads four times in a row is only 1 in 16, but those are the odds in advance. If you toss four coins, cover them up, and then show me that the first two are heads, and ask, “What’s the chance that the next two are heads?” I’ll tell you 1 in 4. You might already know that they both also came up heads, but see above – probability doesn’t apply if you know the facts. What probability can tell us is that in these circumstances, out of every four people who show you the first two heads, only one will be able to reveal two more heads.

So now we’re back to the problem at the top there. Sticking with coins rather than cats: “I have handed out lots of coins marked randomly with the numbers 1-7. Everybody has flipped two coins. If somebody in the room has at least one coin that came up heads with the number 7 marked on it, what’s the chance their other coin also came up heads?”

Think it through. Everybody gets their coins, tosses them, and looks at the result. I ask anyone who has at least one coin showing heads to put their hand up. Obviously nobody who got two tails does, so we ask them to leave.

Next I ask everybody who doesn’t have at least one coin showing a head that’s marked with a 7 to leave too. Two thirds of the people have one head and one tail showing, and only one in seven of those has a head marked with a 7. One third of the original group have thrown two heads. How many of them have at least one marked with a 7? Well, the chance of neither having a 7 is (6/7)squared, ie 36/49. So 13/49 of the two-heads folks have at least one marked with a 7.

Now compare that with the heads-&-tails people. There are 14/49 of them with a head marked with a 7. (One in seven got a head marked 7; count 1/7 times two because half tossed heads then tails, half tossed tails then heads.) Let’s just assume we began with a total of 196 people when the coins were handed out, so the total sample group who can say, “At least one of my coins came up heads and is marked with a 7” is 14+13 = 27 people. Of those, 13 threw two heads.

It applies to cats too (but don’t trying throwing them) and so the answer to “Somebody has two cats. At least one of them is a male born on a Friday. What’s the probability that the other cat is also male?” is 13/27.

Now, notice that this only applies in the general case. If I’d said: “Somebody has two cats, one white and one black. The black one is a male born on a Friday. What’s the probability that the other cat is also male?” Now it’s fifty-fifty, because you collapsed the wave function (so to speak) first. By identifying one specific cat in the pair by a characteristic the other doesn’t share (it could also have been age) you make its birthday irrelevant – the probability of the other one being male is now independent of the other.

By this stage you should have the dining table to yourself, so tuck into more turkey and drink some wine before you start thinking about a cat born on December 25th.

Tuesday, 28 October 2014

The road to heaven


I thought I'd posted up this puzzle ages ago, but a Google search shows no sign of it. As I've recently been discussing it online with Chris Garratty, I thought I'd throw it open to the vast Kree Intelligence that is gamebook fandom. You've played Sorcery, right? You must all have IQs as big as the Death Star. So here goes:
While walking upon a path through unmapped territories, you come across a group of three cowled figures standing where two roads meet. You are informed by one whose counsel you have no reason to doubt that these three are Mung, who keeps the secrets of the grave (for he is the god of death) by invariably lying, Sish, the Destroyer of Hours, who speeds the flight of time's arrow by always telling the truth, and Kib, the god of life, who created Man and consequently lies and tells the truth equally without conscience. Further, you are told that one of the two roads leads to Paradise while the other takes travellers to the lowest circle of Hell. Presupposing that you wish to take the road to Paradise, how can you, by asking one yes-or-no question of one of the three gods (who are, incidentally, indistinguishable), find whether to go left or right?
So, with two questions you might start with the old, "If I asked if the way to Paradise is left, would you say yes?" If you only have a liar and a truth-teller, if the answer is yes you should go left, and if it's no you go right. The snag is, that question sets up a logical impossibility for the god who randomly chooses to lie or tell the truth. Figure that he works out the lying or truthful response to the current question and then flips a mental coin to choose which to say. Your hypothetical question nested within the first is a separate question for which he hasn't yet flipped that coin.

However, if you did have two questions, there is a way to use the first question to weed out Kib. (This is from Ivan Morris, by the way, who originally devised the puzzle.) Say you pick one god (call him A) and you ask, "Is B more likely to tell the truth than C?" If you get a yes, C cannot be Kib. If you get a no, B cannot be Kib. You can then proceed to the question above.

But here's the snag. You don't have two questions, you just have one...