Showing posts with label logic puzzles. Show all posts
Showing posts with label logic puzzles. Show all posts
Saturday, March 10, 2018
Mismatched Letters
Soon after her wedding, a young bride hand-writes 100 thank you letters to all of her recent wedding guests and addresses 100 matching envelopes. Being in a hurry to get them in the mail, her new husband randomly stuffs the letters into envelopes and mails them out. What is the probability that exactly 99 of the letters made it into the right envelope?
Labels:
logic puzzles
Saturday, February 24, 2018
Coin Flipping Game
You have ten coins in a row, all facing tails up. You are to perform a sequence of moves on the coins where one move consists of flipping over any one coin from tails to heads, then flipping over the coin to its immediate right (whether the second coin is heads or tails does not matter, just flip it over). Can you prove that no matter what moves you select, there are a finite number of moves in the sequence? (In other words, prove that you will always reach a state where there are no more legal moves.) Click below for the answer.
It helps to try this out a few times to get a feel for how the combinations of coins progresses as you make moves in this game. If you don't have any coins handy, just use 0s (tails) and 1s (heads) on a piece of paper, starting with ten 0s, and work through a few sequences. Here's an example:
00000 00000
00000 11000
00001 01000
00001 10000
00001 11100
00010 11100
...
Now, instead of focusing on the sequence of moves, focus on the sequence of resulting numbers. Do you notice anything? This is a binary number sequence that is always increasing. The rules of the game are designed such that no matter which bit you choose, the next number in the sequence will always be higher. (Because you flip a 0 to a 1, then flip a lower-order bit.) Since the sequence is strictly increasing, you must eventually reach a state where there are no more legal moves.
00000 00000
00000 11000
00001 01000
00001 10000
00001 11100
00010 11100
...
Now, instead of focusing on the sequence of moves, focus on the sequence of resulting numbers. Do you notice anything? This is a binary number sequence that is always increasing. The rules of the game are designed such that no matter which bit you choose, the next number in the sequence will always be higher. (Because you flip a 0 to a 1, then flip a lower-order bit.) Since the sequence is strictly increasing, you must eventually reach a state where there are no more legal moves.
Labels:
logic puzzles
Saturday, February 10, 2018
The King's Adviser
A king decides he is going to fire one of his advisers. He tells him that he has written "You're fired" on one slip of paper, and "You can stay" on another, and that the adviser is to choose one at random. The king has secretly written "You're fired" on both notes, but unbeknownst to the king, the adviser has found this out! How can the adviser keep his job without telling the king that he knows both notes are the same?
The adviser can select either one of the notes, then destroy it by throwing it in the fire (or by eating it, if there is no convenient fire nearby). He can then tell the king to open the other note, and deduce by elimination which was the one selected. Since the remaining note is guaranteed to say "You're fired," the king must pretend that the note the adviser selected said "You can stay."
Labels:
lateral thinking,
logic puzzles
Saturday, January 27, 2018
Knights or Knaves?
You find yourself on the Island of Knights and Knaves, a logical kingdom whose inhabitants either always lie (Knaves) or always tell the truth (Knights). You encounter three of said inhabitants, call them Alice, Bob, and Carol. You ask the following questions.
To Alice you ask, "Is Bob a Knight or a Knave?"
"A Knight," she answers.
To Bob you ask, "Are Alice and Carol both Knights or both Knaves?"
"Yes," replies Bob.
Finally, you ask Carol, "Is Bob a Knight or a Knave?"
"A Knave," she says.
Who is a Knight and who is a Knave? Click below for the answer.
Since Alice and Carol answered differently to the same question, they cannot both be Knights or Knaves, they must represent one of each type. Since this is counter to what Bob answered, he must be lying. Bob must be a Knave. That means that Carol answered truthfully, and is a Knight, and Alice did not, so she is a Knave.
Labels:
logic puzzles
Saturday, January 13, 2018
King's Sentence
A man is caught poaching on the King's property. He is brought before the King to be sentenced.
The King says, "You must give me one statement. If it is true, you will killed by lions. If it is false, you will be killed by trampling of wild buffalo."
In the end, the King has to let the man go.
What was the man's statement? Click below to see the answer.
The man can get out of the punishment by making a paradoxical statement, such as "I will NOT be killed by lions." If that statement was true, the man would be killed by lions, making the statement false. Another statement that would have worked is "I will be killed by trampling of wild buffalo."
Labels:
logic puzzles
Saturday, January 6, 2018
A Boy and a Girl
Two children, one boy and one girl, make the following statements.
"I am a boy" said the child with brown hair.
"I am a girl" said the child with red hair.
At least one of the children is lying. Who is the boy and who is the girl? Click below for the answer.
Both children are lying.
The child with the brown hair is the girl, and the child with the red hair is the boy.
(If only one child had lied, they would both be boys or both be girls.)
The child with the brown hair is the girl, and the child with the red hair is the boy.
(If only one child had lied, they would both be boys or both be girls.)
Labels:
logic puzzles
Saturday, December 30, 2017
Number System
In a slightly eccentric numbering system, the numbers on the left are converted to regular decimal numbers by applying a simple rule.
9999 = 4
8888 = 8
1816 = 3
1212 = 0
Can you answer
2419 = ?
Click below for the answer.
To convert numbers from this system to decimal, just count the number of closed areas in each digit. The digit 9 has one closed area, so 9999 = 4. An 8 has two closed areas, so 8888 = 8, and so on. The digits in 2419 have two closed areas, so 2419 = 2.
Labels:
logic puzzles,
numbers
Saturday, December 16, 2017
Three Water Bottles
You have three water bottles with capacities of 8 quarts, 5 quarts, and 3 quarts. The largest bottle is filled with water, and the other two are empty. If there are no graduation marks on any of the bottles, how can you split the water evenly so that two of the bottles contain exactly 4 quarts each? You can only use these three bottles. Click below for the answer.

There may be other ways to solve this problem, but here's one sequence that works.
- Fill the 5 quart bottle, leaving 3 quarts in the 8 quart bottle.
- Pour 3 quarts from the 5 quart bottle into the 3 quart bottle, leaving 2 quarts in the 5 quart bottle.
- Empty the 3 quart bottle into the 8 quart bottle , leaving 6 quarts in the 8 quart bottle.
- Pour the 2 quarts from the 5 quart bottle into the 3 quart bottle.
- Fill the 5 quart bottle from the 8 quart bottle , leaving 1 quart in the 8 quart bottle.
- Pour 1 quart from the 5 quart bottle into the 3 quart bottle (filling it), leaving 4 quarts in the 5 quart bottle.
- Pour the 3 quarts from the 3 quart bottle into the 8 quart bottle, leaving 4 quarts in the 8 quart bottle.
| 8 qt. | 5 qt. | 3 qt. |
|---|---|---|
| 8 | 0 | 0 |
| 3 | 5 | 0 |
| 3 | 2 | 3 |
| 6 | 2 | 0 |
| 6 | 0 | 2 |
| 1 | 5 | 2 |
| 1 | 4 | 3 |
| 4 | 4 | 0 |
Labels:
logic puzzles,
math,
numbers
Saturday, October 28, 2017
Tic-Tac-Toe
In a standard game of Tic-Tac-Toe, players take turns placing X's and O's on a 3x3 grid until one player makes three-in-a-row in any direction (horizontally, vertically, or diagonally). Because of these rules, you can only place a maximum of five of either symbol on the board during a game, often ending in a draw.
Can you place six X's on a Tic-Tac-Toe board without making three-in-a-row in any direction? (Without placing any O's.) Click below for the solution.

I found the solution below with a little trial and error. The trick to this puzzle is that you cannot solve it with an X in the center position.


Labels:
logic puzzles
Saturday, August 26, 2017
Replacing Marbles
We place 15 black marbles and 15 white marbles in an urn. We have 30 additional black marbles in a bag. Then we follow these rules.
1. Remove two marbles from the urn.
2. If they are different colors, put the white marble back in the urn and the black marble in the bag.
3. If they are the same color, put both marbles in the bag, then put one black marble from the bag into the urn.
Continue following these rules until only one marble is left in the urn. What color is that marble? Click below for the answer.
When I first heard this puzzle, I immediately thought of writing a Python script, since that's my favorite method for dealing with problems in probability. This is a logic problem in disguise, though. I realized that as I tried to figure out the best way to set up the problem in code. If you pay close attention to the rules for adding and removing marbles from the urn, and the initial conditions, you'll notice a couple of things.
1. You start with an odd number of both black and white marbles in the urn.
2. The rules force you to always keep an odd number of white marbles in the urn (they can only be removed two at a time), but allow for both odd and even numbers of black marbles.
From those observations it's easy to see that when you get down to one marble, it must be a white marble.
1. You start with an odd number of both black and white marbles in the urn.
2. The rules force you to always keep an odd number of white marbles in the urn (they can only be removed two at a time), but allow for both odd and even numbers of black marbles.
From those observations it's easy to see that when you get down to one marble, it must be a white marble.
Labels:
logic puzzles,
math
Saturday, July 22, 2017
Counting Socks
All my socks are red except two. All my socks are white except two. All my socks are blue except two. How many socks do I have? Click below for the answer.
Oddly, I only have three socks. Don't let the fact that socks normally come in matching pairs distract you. No other number satisfies all three conditions above.
Labels:
logic puzzles
Saturday, July 15, 2017
Circumnavigation
From 1519 until 1522, Ferdinand Magellan's Victoria was the first ship to successfully circumnavigate the globe. (Magellan himself did not survive the entire voyage.) Can you tell me which part of the ship traveled the greatest distance? Click below for the answer.
If you remembered the Rope Around the Earth puzzle I posted a few months ago, you probably got this one pretty quickly. Since the world is roughly spherical, the tip of the tallest mast of the ship would have traveled the greatest distance in sailing around the globe. Imagine if a boat sailed in a perfect circle around the equator. The part of the boat deepest under water (the keel) would create a smaller circle than the tip of the mast several feet above the water, so the tip of the mast travels the greatest distance during the voyage.

Replica of the Victoria, Photograph by Gnsin - Own work, CC BY-SA 3.0
Labels:
logic puzzles
Saturday, May 6, 2017
Apples and Oranges
You work in a factory boxing fruit. In front of you are three boxes labeled "apples," "oranges," and "apples & oranges." One box contains only apples, one contains only oranges, and one contains a mixture of both apples and oranges. Unfortunately, the label machine has gone haywire and has mislabeled all three boxes. Can you look at one piece of fruit from only one of the boxes and correctly label all three? Click below for the solution.
The key to this puzzle is that the type of fruit you pull from the box is not the only piece of information you have to work with. You also have the three labels that you know are incorrect. Pull a piece of fruit from the box labeled "apples & oranges." If it is an apple, then you know that this is the apples-only box. That means that the box (incorrectly) labeled "oranges" must be the box with both apples and oranges, and the box labeled "apples" must contain only oranges.
(It's interesting to note that if you pick from either the box labeled "apples" or the box labeled "oranges," you can't figure out the composition of the box. Only selecting from the box labeled "apples & oranges" leads to a solution.)
(It's interesting to note that if you pick from either the box labeled "apples" or the box labeled "oranges," you can't figure out the composition of the box. Only selecting from the box labeled "apples & oranges" leads to a solution.)
Labels:
logic puzzles
Saturday, March 18, 2017
The Extra Dollar
Here is an old math puzzle that you can find many versions of online.
Two friends have a meal at a restaurant, and the bill is $25. The friends pay $15 each, which the waiter gives to the cashier. The cashier gives back $5 to the waiter. The friends tell the waiter to keeps $3 as a tip, so he hands back $1 to each of the two diners.
So, the friends paid $14 each for the meal, for a total of $28. The waiter kept $3, and that makes $31. Where did the extra dollar come from? Give yourself a moment to think about it before clicking below for the solution.
$25 is sitting with the cashier, $2 is back with the diners, and $3 is with the waiter. That adds to the required $30, so there really is no extra dollar.
The mistake is expecting that what the diners paid and what the waiter kept to add up to what they initially gave. Adding $28 and $3 is just a bit of sleight-of-hand. It's the amount that the meal effectively cost them (including tip), plus the amount they received back, that should add to $30.
The mistake is expecting that what the diners paid and what the waiter kept to add up to what they initially gave. Adding $28 and $3 is just a bit of sleight-of-hand. It's the amount that the meal effectively cost them (including tip), plus the amount they received back, that should add to $30.
Labels:
logic puzzles,
numbers
Saturday, February 18, 2017
The Collapsing Bridge
The bridge will collapse in 17 minutes! Four people need to cross the bridge before it collapses. It is a dark night and they have only one flashlight among them.
Only two people can cross at a time.
- Alice takes one minute to cross.
- Bob takes two minutes.
- Carol takes five minutes
- Dave takes 10 minutes to cross.
The trick to this puzzle is to get the slowest members of the group to cross only once together, while the fastest members cross back and forth multiple times.
- Alice and Bob cross first using up 2 minutes.
- Alice comes back making it 3.
- Carol and Dave cross together making it 13 minutes.
- Then Bob crosses back, making it 15 minutes.
- Finally, Alice and Bob cross together to make it a total of 17 minutes.

Labels:
brain teasers,
logic puzzles,
math
Friday, February 10, 2017
The Island of Knights and Knaves
Raymond Smullyan, one of the grand masters of logic puzzles, sadly passed away at the age of 97 earlier this week. In his honor, I present a classic puzzle adapted from his book What Is the Name of This Book?
There is a wide variety of puzzles about an island in which certain inhabitants called "knights" always tell the truth and others called "knaves" always lie. It is assumed that every inhabitant of the island is either a knight or a knave.
In this problem, there are only two people, A and B, each of whom is either a knight or a knave. A makes the following statement: "At least one of us is a knave." What are A and B?
Click below for the solution.
The solutions to these puzzles are often found by making one or more assumptions, then reasoning out whether or not it can be true. In this case, assume A is a knave. Then the statement "At least one of us is a knave" would be false, since knaves always lie. Hence, both A and B would be knights, which is impossible because we started with the assumption that A is a knave. Therefore, A must be a knight, and the statement "At least one of us is a knave" must be true, and B is a knave.
Raymond Smullyan presented a couple more of his puzzles in a 1982 interview on the Tonight Show with Johnny Carson. When you see the white hair and long beard, it seems like even 35 years ago that Smullyan was an old man, but the twinkle in his eye and the playfulness in his voice reveal that he was always a child at heart. Watch the full interview below.
If these puzzles seem too easy, they're just a small sample of Dr. Smullyan's brilliant work. If you really want a challenge, I encourage you to check out some of his books, or The Hardest Logic Puzzle Ever, also credited to Smullyan.
Finally, I leave you with a quote.
Why should I be worried about dying?
It's not going to happen in my lifetime!
-Raymond Smullyan (1919 - 2017)
Labels:
logic puzzles,
smullyan
Subscribe to:
Posts (Atom)