I like logic puzzles. Over time I’ve collected them. A few get their own articles because I think the analysis I’ve come up with is deep and unique. These following ones I do not have such an analysis for. I apologize if I’ve copied any of these unfairly, I don’t really know how logic puzzle copyright works. Send me an email.
You’re in a complex cave system. Guards are positioned at each branch, and they can help you discern which branch (left or right) to take. In particular, you can ask any one guard one yes or no question.
At the first branch, there are two guards. One lies, and the other tells the truth. What do you ask?
At the next branch, there are two guards and a supervisor. Of the guards, one lies, and the other tells the truth. One of the guards is named John. If you point at John, the supervisor will point at which branch to take, if you point at the wrong guard, the supervisor will not let you pass. The supervisor doesn’t like it when people talk, so your question to the guard has to be 3 words or less. What do you ask?
At the next branch, there is a guard that either lies or tells the truth. What do you ask?
At the next branch, there is a guard that always tells the truth, but answers in “ja” and “da”, one of which means yes and the other no. What do you ask?
At the next branch, there is a guard that either lies or tells the truth and answers in “ja” and “da”. What do you ask?
You exit the cave and get to your destination. Here there are three gods: a truth teller, a liar, and one who answers randomly. The gods answer in “ja” and “da”. You may ask them three yes or no questions. How do you determine who is who?
Warden and Prisoners…
There are 100 prisoners and a warden. The prisoners are told they will be lined up from tallest to shortest, then instructed to face toward the shortest man. The shortest man will face the same way and see no one. The warden will then place a hat on each prisoner, either white or black. The warden will then go to the tallest prisoner, and ask what color hat they are wearing. If the prisoner gets it right, they go free, otherwise they are imprisoned forever. The prisoners are allowed to form a plan before this all happens. They make a plan which guarantees the escape of everyone except the tallest prisoner, who has a 50% chance of survival. What is their plan?
There are 100 prisoners and a warden. The prisoners are told they will be put into cells completely separated from each other. Randomly, the warden will take a prisoner and put him in a room with a light and a switch. The prisoner may turn the light on or off, or leave it as is. The prisoner will then be taken back to their cell. The other prisoners will not know when this happens. The light is initially off. Once all the prisoners have been into the room with the light, a prisoner may tell the warden this is true and they will all go free. If this is done prematurely, the prisoners remain prisoners forever. The prisoners are allowed to form a plan beforehand. What plan do they make to ensure they will someday escape?
Before taking the first prisoner into the room, the warden goes in and randomly flips the switch. The prisoners are told this will happen. How can they accommodate for it in their plan?
Warning: in my estimation, this is by far the hardest logic puzzle.
You are the janitor at a prison with 100 prisoners locked in separate, soundproof and windowless cells.
You watch one day as the warden brings the prisoners out to a central room where there are 100 boxes laid out, labeled 1 through 100. He hands each prisoner a slip of paper and a pen, and asks everyone to write their name on their slip and hand it back to him. All the prisoners have different names.
The warden then makes a proposition to the prisoners. He will put them back in their cells and will put each of the 100 slips of paper into a different box. The prisoners will then be brought out one by one in a random order. When a prisoner comes out, he will get to open 50 boxes. He doesn’t need to select which boxes he’ll open up front; he can choose as he goes along. He is not allowed to rearrange the boxes or the names as he does this.
If any of the 50 boxes he opens contains the slip with his name on it, then that prisoner is sent back to his cell, all of the boxes will be closed, and the next prisoner will be brought out. If any prisoner opens 50 boxes and none of them contain his name, then all 100 prisoners are prisoners forever, otherwise they all go free, and you get a raise. Note that prisoners have no way of passing information on to any of the prisoners who go after them.
The warden will let you help the prisoners in the following way. After he’s put all of the names in the boxes, he will let you look at all the names in all the boxes, and then, if you choose to, switch two names with each other. For example, you could switch the names in boxes 35 and 77. You are only allowed to make one switch. Afterward, you will be sent out of the prison and will not be able to communicate with the prisoners.
Before this strange game begins, you get to meet with the prisoners to discuss a strategy. This strategy must have two parts:
1) How do you decide which names to switch, if any?
2) How does each prisoner decide which 50 boxes he will open?
What plan do you come up with to ensure that the prisoners will all go free?
A group of people with assorted eye colors live on an island. They are all perfect logicians — if a conclusion can be logically deduced, they will do it instantly. No one knows the color of their eyes. Every night at midnight, a ferry stops at the island. Any islanders who have figured out the color of their own eyes then leave the island, and the rest stay. Everyone can see everyone else at all times and keeps a count of the number of people they see with each eye color (excluding themselves), but they cannot otherwise communicate. Everyone on the island knows all the rules in this paragraph.
On this island there are 100 blue-eyed people, 100 brown-eyed people, and the Guru (she happens to have green eyes). So any given blue-eyed person can see 100 people with brown eyes and 99 people with blue eyes (and one with green), but that does not tell him his own eye color; as far as he knows the totals could be 101 brown and 99 blue. Or 100 brown, 99 blue, and he could have red eyes.
The Guru is allowed to speak once (let’s say at noon), on one day in all their endless years on the island. Standing before the islanders, she says the following:
“I can see someone who has blue eyes.”
Who leaves the island, and on what night?
Engineers and Managers
You have just purchased a small company called Company X. Company X has N employees, and everyone is either an engineer or a manager. You know for sure that there are more engineers than managers at the company.
Everyone at Company X knows everyone else’s position, and you are able to ask any employee about the position of any other employee. For example, you could approach employee A and ask “Is employee B an engineer or a manager?” You can only direct your question to one employee at a time, and can only ask about one other employee at a time. You’re allowed to ask the same employee multiple questions if you want.
Your goal is to find at least one engineer to solve a huge problem that has just hit the company’s factory. The problem is so urgent that you only have time to ask N-1 questions.
The major problem with questioning the employees, however, is that while the engineers will always tell you the truth, the managers may lie to you if they like.
How can you find at least one engineer?
You meet a magician and his assistant, who offer to show you a trick.
The assistant leaves the room, and the magician hands you an ordinary deck of 52 cards. He has you choose any 5 cards from the deck and give them to him.
He looks over the 5 cards you chose, takes one of them, and hands it back to you.
“That going to be your card,” he says. He asks you to put it in your pocket out of sight.
He then takes the four remaining cards and arranges them in a stack in a special order. All four cards in the stack are face-down.
He hands you the stack of four cards and asks you to place them on the table however you like (as long as you don’t change the order). He then calls the assistant back in. The assistant picks up the four cards, looks them over, and tells you what your card is.
Note that the magician did not do anything extra to communicate information to the assistant. The only information the assistant has in figuring out your card is the order of the four cards on the table.
How was the assistant able to figure out your card?
You have 25 horses. When they race, each horse runs at a different, constant pace. A horse will always run at the same pace no matter how many times it races.
You want to figure out which are your 3 fastest horses. You are allowed to race at most 5 horses against each other at a time. You don’t have a stopwatch so all you can learn from each race is which order the horses finish in.
What is the least number of races you can conduct to figure out which 3 horses are fastest?
There are 100 closed lockers. You toggle every ith locker for i from 1 to 100. That is, you open every locker, then close every other locker starting with the second, then toggle every third locker starting with the third, and so on, until you toggle just the 100 locker. How many lockers are open?