Did you clear up it? Prisoners and bins | Arithmetic

Earlier right now I set you a puzzle about Piper and Alex, two prisoners who’re set a seemingly not possible problem.

Right here is the issue once more, this time with the answer.

The 4 bins

Piper and Alex share the identical cell. A guard is available in and tells them that they’re to be set a problem which will win them their freedom. It entails each prisoners being taken one after the opposite right into a separate cell the place there are 4 an identical empty bins, numbered 1, 2, 3 and 4. The process is as follows:

i) Piper shall be led into the brand new cell. The guard will then take a bit of paper from his pocket and randomly place it into one of many 4 bins. Piper will see which field the paper is in. The guard will shut the bins. He’ll flip a coin and place it on Field 1. He’ll flip one other coin and place it on Field 2, and so forth for Containers 3 and 4. Every coin has a 50/50 likelihood of being heads or tails. Piper will be capable to see the faces of all cash.

Did you clear up it? Prisoners and bins | Arithmetic

ii) Piper should flip a single coin over. (She will be able to select any one of many 4 cash, and when she does, a head turns into a tail, or vice versa.) She is going to then be led out the cell and brought to a 3rd cell on her personal.

iii) Alex is now taken into the cell with the bins. She won’t be able to see contained in the bins since they’re closed. However she is going to be capable to see the faces of the cash. She shall be requested to open a field. If the field has the paper in it each girls are freed. If it doesn’t have the paper in it, the ladies are returned to their cell.

What technique ensures that the prisoners will win their freedom?

The prisoners are allowed to debate their technique earlier than Piper is taken into the cell with the bins, and decide on a plan. However as soon as Piper goes into that cell she has no communication with Alex, aside from the ‘message’ she provides Alex by turning over a single coin.


I advised that the best way to deal with this drawback is to simplify the scenario, to see if any insights bounce out. Let’s begin by fixing the very same puzzle when there are solely two bins within the cell. That’s, Piper shall be led right into a room with solely TWO bins. The guard goes by way of the rigmarole of placing the paper in one of many bins, and inserting a coin randomly on every field. Piper is aware of which field has the paper, and she will be able to see each cash, every of which has a 50/50 likelihood of being heads or tails.

prisoner puzzle

Piper should flip just one coin over after which depart the room. How does she talk with that ‘transfer’ which of the bins has the paper?

On this case, the answer is sort of trivial. Right here’s the only technique: the prisoners resolve that one field will take the position of ‘indicator’, that’s, the coin on it should point out the place the paper is. Let’s say they resolve that Field 1 is the indicator field, with the rule that if the coin on Field 1 is heads, the paper is in Field 1, and if the coin on Field 1 is tails, the paper is in Field 2.

So, if Piper sees the guard put the paper in Field 2, all she must do is make it possible for the coin on Field 1 is exhibiting tails. If the coin on Field 1 is heads, she turns it over, and whether it is tails, she turns the coin on Field 2. (Which is ok, for the reason that standing of the coin on Field 2 is irrelevant to the identification of the right field.)

Now to the 4 field model. The answer makes use of the identical thought. On this case, three bins, shall we say Containers 1, 2 and three, will make up the ‘indicator’. As above, the coin on the remaining field, Field 4, is simply turned if the cash on 1, 2 and three are indicating the right field.

Let’s look extra carefully at our three-box indicator. There are eight potential positions of the cash on these bins:


What’s exceptional and surprising (or it actually was to me!) is that there’s a approach of assigning combos to point bins in such a approach that regardless of the given mixture of cash, you may point out any of the 4 bins by turning over at most one coin.

Right here’s a option to do it. Let the combos point out the bins within the following approach:

Field 1: HHH and TTT

Field 2: HHT and TTH

Field 3: HTH and THT

Field 4: THH and HTT

In different phrases, if the primary three bins have HHH, or TTT, then which means that the paper is in Field 1, and so forth.

Now simply say Piper needs to point Field 2. And let’s say that when she arrives within the cell, the bins present HTH (which signifies field 3). All she must do is flip the primary coin over, to get TTH, which signifies field 2.

If you happen to look carefully on the combos, you will get from a mixture that signifies any field, to a mixture that signifies some other field by turning over a single coin.

bellos puzzle

This diagram might show you how to see what’s gong on. Blue signifies field 1, purple Field 2, pink Field 3, and inexperienced Field 4. Combos are linked to different combos that contain just one coin being turned over. Each mixture is linked to 3 different combos, every of a unique color.

The diagram tells us that no matter mixture on our ‘indicator’, we are able to change it to point one other field by turning over a single coin. Now what about if Piper sees a mixture that’s already indicating the right field? Straightforward: she turns over the coin on Field 4. (Similar to within the first problem, we’d like a ‘redundancy’ field whose place has no bearing on the indication.)

It’s a surprising end result. No matter mixture Piper sees on the primary three bins, she will be able to change it to no matter mixture she wants, by turning over at most a single coin.

If you wish to learn extra concerning the arithmetic behind this puzzle, a extra difficult model utilizing a chessboard initially appeared within the Information Genetics weblog and was mentioned by maths communication legends Matt Parker and Grant Sanderson (aka 3blue1brown) on this video right here.

Pierre Chardaire, a retired laptop scientist, simplified the chessboard puzzle to create the model we now have solved right here.

I hope you loved right now’s puzzle, I’ll be again in two weeks.

I set a puzzle right here each two weeks on a Monday. I’m all the time on the look-out for nice puzzles. If you want to recommend one, electronic mail me.

I give faculty talks about maths and puzzles (on-line and in individual). In case your faculty is please get in contact.

Related Articles