# Which box is safe to open?

One day, you enter your house...and find it has been burglarized. On the table, a note says, "Thank you for your valuables. In return, I left a gift in the basement." Quite confused, you head down to the basement. On the table, there are 9 boxes and a piece of paper. The paper says:

There are 9 boxes on the table. There is one box that has a diamond ring, 4 boxes that will explode, and 4 boxes that contain a deadly gas. As you will notice, the door to the basement has swung shut and locked, because of my trickery. The ring box has a key, to open the door.

The boxes on the left and right are the same. The one in the center is the same as the one to its right. Twice, two poison gas boxes are next to each other. To the left of the center is a poison box.

If you pick up a poison box or exploding box, you'll die. Which box is the safest choice?

• According to the note, there could be. Mar 28, 2018 at 18:17
• "Twice, two poison gas boxes are next to each other." that could be P1-P2-P3 only since P1-P2 is next to each other while P2-P3 is next to each other again?
– Oray
Mar 28, 2018 at 19:04
• How are the nine boxes arranged? Are they all in a single row, are they in a 3×3 grid, what? Mar 28, 2018 at 21:09
• Forget trusting creepy puzzle murder guy. Get your phone out of your pants and call the cops. Mar 28, 2018 at 22:27
• @StevenIrrgang You're correct about the "Much more elegant" part. But apparently, people don't seem to care since this question is currently in the "Hot Network Questions" column Mar 29, 2018 at 4:06

Number the boxes 1 to 9 from left to right.

1 and 9 are bombs. If they were gas, then 2 and 8 would be gas as well, but that plus box 4 makes 5 gas boxes.

Either the boxes 5 and 6 are both gas or both bombs.

• If they are gas, then we have three gas boxes in the middle. Either boxes 3 or 7 must be poison to satisfy the two pairs condition [2 choices]. There are then [3 choices] for the placement of the ring.

• If they are bombs, then 3 must be gas, as well as 7 and 8, so 2 is the ring.

Putting this all together,

there are 2 • 3 + 1 = 7 possible arrangements consistent with the clues. The key is in box #2 in three of these arrangements, in box #8 in two, and both boxes #3 and #7 are correct once. The best choice is therefore #2.

    B-GGGG--B   \ The 3 dashes consist of
B--GGGG-B   / 2 Bs and the ring.
BKGGBBGGB

• better than my answer Mar 28, 2018 at 18:45
• Excellent. You cover every possibility. I could probably not do this well at answering my own question! Mar 29, 2018 at 3:24
• Your first inference is correct, but for the wrong reason. With gas at the ends, you could also have gas at positions e.g. 3 and 8, or 5 and 6, and still satisfy the side-by-side requirements (but not the limit of 4 gas boxes). You could simply state: With gas boxes at the ends, there is no way to position the fourth and final gas box such that two pairs of gas boxes appear side-by-side.
– COTO
Mar 29, 2018 at 12:41
• Isn't this only for the 1x9 (horizontal row) case? There are many other cases
– smci
Mar 29, 2018 at 21:11
• @smci If the boxes aren't in a horizontal row, the notion of the box on the "left" and "right" and at the "center" is kind of ill-defined. I think it's safe to assume that the question-poser meant the boxes to all be in a horizontal row. Mar 29, 2018 at 23:40

The safest choice is:

to open no box. Instead, pull out your cell phone to call the police, and let them bring a locksmith to get you out. And possibly, have them also bring a bomb squad just in case the burglar put a booby trap on the door and neglected to mention it in the note. The bomb squad would also help in disposing of the boxes afterwards.

(Somewhat tongue-in-cheek: I realize there wasn't a "lateral-thinking" tag on the problem...)

• I guess you thought out of the box! Badum ssshhhh Mar 29, 2018 at 3:20
• Yes, but if the boxes were rigged smart enough, they would explode/poison gas no matter who actually came. The only way to disable the box would be to safely activate it. However, that would still possibly blow up your basement and/or destroy a diamond ring. Mar 29, 2018 at 15:29

I believe the answer is actually

2,7,8 are having the same chance to have diamond ring.

Because it is stated that

"Twice, two poison gas boxes are next to each other.", and since it is not required unique poison gas boxes for each paired boxes, we can also consider P1-P2-P3 next to each other twice (P1-P2 and P2-P3) is valid for this part.

As a result we get such a table below with everything included (I do not want to add anything to Mike Earnest's deduction)

• If we confider PPP as valid for "twice, two poison boxes are next to each other", then PPPP wouldn't be valid because that's more than twice. Mar 28, 2018 at 20:41
• @BlueRaja-DannyPflughoeft why is that? If I told you you buy two apples, then you go and buy 3 apples, actually you would have bought two apples too. that would be the minimum requirement in my opinion. it does not say "exactly twice"
– Oray
Mar 28, 2018 at 20:44
• So if it said "0 times, two boxes are adjacent", that would mean any configuration is valid? Mar 28, 2018 at 20:58
• @BlueRaja-DannyPflughoeft i believe there is existence or non-existence case in your 0 case. so you cannot think in that way.
– Oray
Mar 28, 2018 at 21:02
• I would still assign slightly more weight to number 2 than to 7 or 8 because the question is ambiguous. If there is any doubt, 2 becomes the preferred choice. Mar 29, 2018 at 15:30

I would choose (technically partial because of assumptions)

2

because

1/9 are out from 'The boxes on the left and right are the same' - these will be exploding boxes. 4 is a poison box. 5/6 are also both deadly from 'The one in the center is the same as the one to its right' - these could be either exploding boxes or poison. If 5/6 are poison then for the poison in twos rule to be true 3/7 would have to be poison. That means our highest chance to survive is 8/2.

with assumptions

if 1/9 are exploding boxes and 5/6 are exploding boxes we are given 4 is poison. Since poison comes in pairs then 3 would be poison, and 7/8 would be poison. That leaves only 2 left to choose.

• @downvoter, care to give me a reason? Apr 3, 2018 at 15:33

I think the answer requires interpretation of the "Twice, two poison gas boxes are next to each other." clue.

If the clue means 'at least twice'

then arrangements like ..pppp..., ..ppp..., and .pp..pp.. fit the description. But then there are 4 arrangements for each of boxes 2,7, and 8 being the key (and 3 arrangements with box 3 being the key), so there is no 'safest' choice.

If the clue means 'exactly twice, but consider each box only once',

then the is only one arrangement with two independent pairs of poisons of the form ..pp..pp... that fits the description. So box 2 would be the safe choice, all the rest being deadly. But it could be argued that this is not the 'safest' as that requires more than one 'safe-ish' choice to chose from.

If the clue means 'exactly twice, but a box can be part of two distinct pairs'

then box 7 is 'safest' with 3 chances of life, compared with 2 chances for each of boxes 2,3, and 8.

So my meta-conclusion is that the poster meant

'exactly twice, but a box can be part of two distinct pairs', and box 7 with chance of life of 1/3 is the safest choice.

• I have two objections to your meta-reasoning for rejecting "exactly twice, but consider each box only once": 1. If you have only one choice, it is certainly the safest -- and the deadliest. 2. In this scenario, you always have at least 9 choices, one for each box, so if you know exactly one is safe, and the other are deadly, that one is by far the safest, even if you don't agree with point (1). Mar 30, 2018 at 0:59

Throwing my hat into the proverbial ring:

Code here.

box 8 (the second from the right), because it has an 8/34 chance of being safe according to my program. The the output below and code should verify the correctness of this solution.

The possible arrangements:

0 = safe, 1 = poison, and 2 = explosion.
102222111 110222211 111220221 111222021 111222201 112220211 112222011 120222111 122220111 201111222 201112122 201112212 201221112 202111122 202111212 202112112 210111222 210221112 211220112 211221102 212111022 212111202 220111122 220111212 220112112 221110122 221110212 221111022 221111202 221112012 221112102 222110112 222111012 222111102

which yields probabilities of safety:

box 1: 0/34 chance of success
box 2: 6/34 chance of success
box 3: 6/34 chance of success
box 4: 7/34 chance of success
box 5: 0/34 chance of success
box 6: 0/34 chance of success
box 7: 7/34 chance of success
box 8: 8/34 chance of success
box 9: 0/34 chance of success

footnotes: I interpret the "Twice, two poison gas boxes are next to eachother" line to mean that there are at least two distinct poison boxes with a poison box to their right.

I interpret "to the left of the center" as boxes 1, 2, 3 or 4.

• Presume you are using a different interpretation of 'to the left of the center is a poison box' than me. As in somewhere to the left, rather than immediately to the left... Mar 28, 2018 at 21:28
• @Penguino I interpreted "to the left of the center" as any box left of the center, IE boxes 1, 2, 3, and 4. Mar 28, 2018 at 21:31
• @Penguino My code would only need a slight alteration, a replacement of the lines 19 to 22 inclusive with "return getBox(3, code) == poison", to calculate based on your interpretation. Mar 28, 2018 at 21:33
• I'm wondering what the percentage of Stack Exchange users is that knows how to program Apr 24, 2018 at 14:23

the safe box is

2

As

1,5,6,9 are bombs(as same) and 3,4,7,8 are gas boxes(as next to each other)

Given the clear ambiguity in what the burglar wrote, as well as our lack of trust of the burglar having actually thought the question through properly, the correct answer would be a weighted average of the answers to this question, weighted by the number of votes given.

This still makes picking box 2 the best chance of survival, followed closely by "call the police".

• Welcome to Puzzling.SE! Firstly, I'm not sure whether "a weighted average of everyone else's answers" is an answer in its own right. The person in the riddle wouldn't have access to this exact Q&A page. Secondly, could you edit your answer to include spoiler tags, to avoid spoiling your solution for anyone who wants to have a go at the puzzle themselves? Mar 29, 2018 at 15:42
• True @F1Krazy, but rinspy's own answer elevates choice 2 as a weighted average (so would appear make his own answer proportionally more 'valid', using his logic for answer choice). It is an interesting tactic...(or is it a meta-tactic?). Apr 2, 2018 at 5:32

Originally this was a similar answer to Mike Earnest, but with slightly different reasoning.

Now there is an extra answer which may be different to others on the basis that gas can be 4 in a row rather than 2 pairs of boxes separated. -- but turns out it is exactly the same as Mike Earnest's answer.

Boxes 1=Left, 9=Right

centre(5) and to its right(6) are the same and to the left of centre(4) is toxic gas - now if the centre and right were gas then we would have 3 or 4 gases in a row not two pairs or two, so (5)and (6) must be bombs, so (4) and (3) must be gas - (1) and (9) must be bombs because otherwise gas would not be in two pairs... this leaves only (2), (7) and (8) unknown - which are ring and key plus two gases - the two gases are together so they are (7) and (8) and the ring is in (2)

However

OP says that there can be 4 poison gas in a row... so now other possibilities include (1-2)explode (3)key (4)-(7)poison gas (8-9)explode - there are many possibilites

So in summary if we can put 4 gas in a row

key could be in boxes 2,3,7,8 if toxic gas is a block of four boxes...- see note at bottom this is the same as Mike Earnest's answer, but probably not expressed so well

Because

boxes 4,5 and 6 are gas along with 3 or 7 and bombs are in 1 and 9

if

gas is in 3 then two bombs and key are split between 2,7 and 8

if

gas is in 7 then two bombs and key are split between 2,3 and 8

This final part is exactly the same as Mike Earnest's answer...!

• OP said there can be 4 toxic boxes in a row - but if we assume there can't be then I would agree. Mar 28, 2018 at 19:06
• @Jordan.J.D Oh rats ---- I got badly confused there... sorry
– tom
Mar 28, 2018 at 19:21
• @Jordan.J.D - but without that requirement we can't know which box it is in....
– tom
Mar 28, 2018 at 19:42
• I agree, there are multiple choices from the requirements. Mar 28, 2018 at 19:43
• @Jordan.J.D Indeed there are. I am looking for the answer with the best logic and reasoning. Mar 29, 2018 at 3:14