# Five coloured doors, which leads to freedom?

You have been incarcerated in a high-security prison for several nefarious crimes which we need not go into here. The warden, being a kindly logician, offers you a single chance to escape. You are blindfolded and given a choice of five doors, one of which leads to freedom and the other four to prison cells. You know that the doors are red, blue, green, yellow, and white; they are evenly spaced, each 2 paces from the next; and you are standing in front of the middle one. There is a guard standing by each door, and all five guards tell the truth (weren't expecting that, were you?). They make the following statements:

• The red door is somewhere to the left of the door leading to freedom.
• The blue door is not at either end.
• The green door is 3 doors away from the door leading to freedom (2 doors between them).
• The yellow door is adjacent to the door leading to freedom.
• The white door is the middle one.

To find out how many paces you need to take to which side in order to be standing in front of the door to freedom, you need to answer the following two questions:

• What is the order of the coloured doors, left to right?
• Which colour of door leads to freedom?

You may assume that all statements made about "left" and "right" refer to your left and right.

(I found more or less this puzzle on the internet and thought it would be easy, but for some reason it's a fair bit harder than it looks!)

• Wow, three seconds is the difference. Apr 29, 2015 at 18:54
• This question is now #1 on HNQs!!! Apr 29, 2015 at 22:39
• Surely this kind of inappropriate treatment counts as "Cruel and Unusual punishment" and hence your sentence would be struck down by the courts. All the doors lead to freedom, metaphorically speaking. Jan 5, 2017 at 16:50
• Ach. You are blatantly trying to get a gold badge... :P Jan 5, 2017 at 16:59
• @Mithrandir I did improve the accepted answer quite a bit! Jan 5, 2017 at 17:02

Here is my answer. Doors from left to right:

Green, Red, White, Blue, Yellow.

The

blue

Explanation follows.

The white door is in the center, you can mark each possible placement of the doors as follows:

The correct door just kind of follows suit, you can rule out Yellow, Red, Green and White because green can't be 2 spaces from white, which leaves blue. Because yellow has to be glued to blue and red has to be to the left of it, that means automatically that blue is in the 4th spot with yellow in the 5th. From there Green goes in the first spot and Red in second.

• You get the accept for a better explanation than itriedacrab or leoll (also you were probably first). BTW, I realise why I thought this was harder than it is: I started by trying to deduce the order of the colours, rather than just going straight to blue=freedom. Apr 29, 2015 at 19:53
• Why can't the rightmost door be Green in your initial picture? It can be ruled out quickly, but you did not show how.
– mafu
May 29, 2016 at 13:17
• The diagram is a chaotic mix of reasoned positioning, and rule positioning, not my best. Originally, 3 of us answered extremely quickly, I modified as little as possible since OP was unsure which answer to accept - I did not want an edited answer to weigh on it. The diagram should have the addition of green in last, and should not be in second. Reasoning goes; Red has to be left of white/blue, so position 1/2. Blue has to be in position 2/4. White is 3rd. Yellow can be anywhere else than 3. Green can be anywhere 3 spaces from blue/white (position 2/3/4 - leaving the first or last spot) May 30, 2016 at 18:31
• I can't understand this answer... Sep 6, 2016 at 13:19

White can't be the door to freedom because it is not possible for it to be three doors away from Green. None of Green, Red and Yellow can be the door to freedom since the descriptions of their locations imply so. Thus Blue is the door to freedom.

Since Blue is not on either end, and can't be in the middle, it is the second or fourth door from the left. If we suppose that it is the second door, then Red must be the first door, but then Yellow can not be adjacent to Blue. This means that Blue is the fourth door. The only option for Green is to be the first door. Red and Yellow both have one option making them the second and fifth doors respectively.

The prisoner will have to take two paces to the right.

• This is the best explanation here. Succinct but complete. Apr 29, 2015 at 20:28

This seems to be compatible with all the statements.

• The first submission was incorrect, with white being marked as the door to freedom, so he hid and corrected it. Apr 29, 2015 at 18:56
• @itriedacrab Yes, but I've edited it 30 seconds later or so! Apr 29, 2015 at 18:56
• Ah 30 seconds to late as depending on internet latency, both me and itriedacrab posted 1 second apart with the correct answer at the same time too. Apr 29, 2015 at 19:11
• We all ninja'd one another. :P Apr 29, 2015 at 19:11
• Never said so either. We're all geniuses :) Rand knows how to make us feel good about ourselves :P Apr 29, 2015 at 19:14

G R W B Y, where B leads to freedom.

I did it by elimination...

Either W is the freedom door or B is, which cuts down on the problem set.

The order of the doors is:

GRWBY

and the door to freedom is:

Blue (4th door)

Our limitations are:

R R R R
B B B
G G   G G
W
Y Y Y Y Y


It can't be the first door, since R can't be left of it
It can't be the second door, since R would have to left and W is in the middle, so Y couldn't be next to it.
It can't be middle, since G can't be 3 away from it.
It can't be last, since only Y and G can be in the last column, and neither can be the door.

• R is left of freedom, and G must be 2 doors away from freedom, which means the freedom is either #4 or #5, therefore, G cannot be on the right hand side.
– Kami
Apr 30, 2015 at 9:57

Without cheating, I got:

- Green Red White Blue Yellow
- And Blue is the freedom door

Freedom door deducement

- Yellow can't be the freedom door - it is adjacent to it.
- Green can't be the freedom door - it is 3 doors away from it.
- Red can't be the freedom door - it has to be to the left of it.
- White is in the middle. It can't be the freedom door because it cannot be 3 doors away from the green door.
- So Blue is the freedom door.

Position deducement

- Blue can't be on either end, so it must be either just left or right of white.
- Since red has to be to the left of blue (the freedom door), red must go into either slot #1 (if blue in #2) or slot #1/#2 (if blue is in slot #4).
- If blue is in slot #2, yellow cannot be beside it, as required, since red must be to its left. Blue must therefore go into slot #4 and yellow, beside it, into slot #5.
- Since green must be 3 doors down from blue, green must go into slot #1. Red must then take the only remaining slot, slot #2.

• I really liked your deductions :) Thanks! Dec 21, 2015 at 14:16
• This is much better explanation than in the other answers.
– mafu
May 29, 2016 at 13:22

I also did this by elimination:

Only Blue and White can be the Freedom Door

Then I narrowed it down even further:

Blue has to be to the left or right of the White door

And even further-er!

To be two doors away Green has to be on the end

More further-er-er!

White can not be the freedom door and still satisfy the Green door condition, so Blue is the freedom door

How much more further!?

Red has to be to left of blue and Yellow must be next to blue

Finally everything fell into place with:

Green Red White Blue Yellow

• Hah, yeah I wasn't sure else how to word it Apr 29, 2015 at 19:56

The order of the doors, from left to right, is...

Green, Red, White, Blue, Yellow

And the door to freedom is...

Blue

Because...

According to statement 5, the white door is in the middle, so our door configuration looks like:

_ _ W _ _

Also, according to statement 3, the green door has two doors between it and the door to freedom. In the configuration we have now, it is impossible for the white door to be the door to freedom, even if the green door is at either end. Also, as per statement 3, the green door cannot be 3 doors down from itself, so it can't be the door to freedom.
As per statements 1 and 4, neither the red door nor the yellow door are the doors to freedom, as the red door cannot be left of itself and the yellow door cannot be adjacent to itself. Thus, the blue door must be the door to freedom.

So now, we simply need to try the blue door in various positions in a process of elimination. Since the blue door is not on the end, it only has two possible positions.

First assume the blue door is in the second position. Because the red door needs to be to the left of the blue (freedom) door, we would have:

R B W _ _

But now, we have no place to insert the yellow door, as it needs to be adjacent to the blue (freedom) door.
Thus, the blue door needs to be in the forth position. The only adjacent spot for the yellow door to fit now is in the fifth position. The green door, being three doors down from the blue door can only go in the first position, leaving the second position for the red door, which allows it to be left of the blue door. Thus, the solution becomes:

G R W B Y

Where B is the door to freedom.

I did a slightly different method from everyone else, finding the order of colors first and the color of the door to freedom last, so I guess I'll post it. I started out with the third requirement: G is 3 away from F (the "Freedom door").

... G _ _ F ... (one side or the other is filled in, not both)

White clearly must go between them. If white goes in the left slot...

... G W _ F ...

Then since white is in the middle, the remaining door would have to be to the left of G.

_ G W _ F

Then since yellow is next to F, we would get

_ G W Y F

And every door except the two on the end is assigned, so blue would not be able to be placed anywhere.

So, by elimination, white must go in the right slot, and since it is in the middle, the extra door must be to the right of the Freedom door.

G _ W F _

Now there is only one place for the yellow door to go...

G _ W F Y

The blue door is allowed to go in either remaining slot. The only remaining requirement is that R is to the left of F. If the Freedom door is R, then this requirement clearly cannot be met. So the R has to go in the slot that isn't F, and B has to be the Freedom Door.

G R W BF Y

Luckily, when I worked this out on paper I put the doors in the right order, but if I hadn't I would have reflected them horizontally at this stage to make R be on the left rather than on the right.