## 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.

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, July 8, 2017

### 50 factorial

50! = 30414093201713378043612608166064768844377641568960512071337804000

Without doing the full computation, can you tell whether the above statement is true or false? Click below for the answer.

You can probably guess that the statement is false, otherwise it wouldn't be much of a puzzle. The reasoning, though, is that the factorial for 50 must include the factors 10, 20, 30, 40, and 50, so it must end in at least five zeroes. The value above ends in only three zeroes, so it cannot be correct. (The correct value is 30414093201713378043612608166064768844377641568960512000000000000.)

## Saturday, July 1, 2017

### The Missing Fish

Two fathers took their sons fishing. Each man and his son caught one fish, but when they all returned to camp they only had three fish. None of the fish were eaten, lost, or thrown back. How could this be? Click below to see the answer.

There were only three people on the fishing trip. One man was the father and grandfather of the other two.

## Saturday, June 24, 2017

### Bags of Marbles

You have three identical bags, each containing two marbles. Bag A contains two white marbles, Bag B contains two black marbles, and Bag C contains one white and one black marble. You pick a bag at random and draw out one marble. If the marble is white, what is the probability that the other marble in the same bag is also white? Click below to see the answer.

Many people will instinctively answer 50%, or 1/2, since the marble has two possible colors, but the probability is actually 2/3 (66.67%). Why? If the first marble is white, then you know you didn't randomly select Bag B. That means that the first marble you selected has three (not two) possibilities:

- The first marble in Bag A.
- The second marble in Bag A.
- The white marble in Bag C.

If you want to see how you would model this problem in Python, you can look at my solution on GitHub.

Labels:
math,
probability,
puzzles

## Saturday, June 17, 2017

### The Monk and the Mountain Path

One morning at precisely 9:00 AM a monk begins walking up a mountain path. He takes his time, stopping several times to rest along the way. He arrives at the temple at the mountain's summit at precisely 5:00 PM that evening. The next day, the monk leaves the temple at precisely 9:00 AM and makes his way back down the path. Again, he takes his time and rests at several points along the journey. He arrives back at his original starting point at precisely 5:00 PM that evening. Is there any time when the monk is in exactly the same spot on both days? Click below to see the answer.

Since the monk isn't travelling at a constant rate of speed on his two trips, it's tempting to say that there's not

Imagine that you can grab the lines on the plot and bend them however you like, you just can't move the endpoints, and the lines must stay within the bounds of the two axes. No matter how you stretch and bend the lines,

To think of it another way, imagine there were two monks, one at the base of the mountain and one at the temple, and they started their journeys on the same day. If they were to begin and end their trips at the same time, they would have to pass each other on the path at some point during the day.

*necessarily*a time when the monk is in the same spot at the same time on both days. However, such a time and place*must*exist. To see why, take a look at the following plot of the two trips.Imagine that you can grab the lines on the plot and bend them however you like, you just can't move the endpoints, and the lines must stay within the bounds of the two axes. No matter how you stretch and bend the lines,

*they must cross somewhere*.To think of it another way, imagine there were two monks, one at the base of the mountain and one at the temple, and they started their journeys on the same day. If they were to begin and end their trips at the same time, they would have to pass each other on the path at some point during the day.

Labels:
puzzles

## Saturday, June 10, 2017

### The Pigeonhole Principle

The

**pigeonhole principle**states that if a group of pigeons flies into a set of pigeonholes, and there are more pigeons than pigeonholes, then there must be at least one pigeonhole with two pigeons in it. More generally, if

*k + 1*or more objects are placed into

*k*boxes, then there is at least one box containing two or more of the objects. Despite its seeming simplicity (perhaps obviousness), it can be used to solve a surprising range of problems in probability, number theory, and computer science, just to name a few. See if you can use it to solve the following three problems.

- (Warm up) A drawer contains a dozen blue socks and a dozen black socks, all unmatched. If the room is dark, how many socks do you have to take out to be sure you have a matching pair?
- Prove that there are at least two people in Tokyo with exactly the same number of hairs on their heads.
- Prove that if five distinct integers are selected from the numbers 1 through 8, there must be at least one pair with a sum equal to 9.

Click below to see the answers.

- (Warm up) If you've only heard one problem involving the pigeonhole principle, it was probably the classic sock drawer problem. You only need to pick three socks to make sure you have one matching pair. When you pick two socks, you might already have a matching pair, or you might have one of each color sock. Selecting one more sock ensures that you have at least two socks of one color or the other.
- The Tokyo hairs problem sounds like something you might be asked as a "brain teaser" interview question. If you're stuck in an interview, then the first step is to show off your estimating skills. Since we're not in that situation, we can just use Google to find out that there are about 100,000 hairs on the average human head, and that Tokyo is home to about 13.6 million people. That's more than enough people for our proof. For the sake of simplicity, let's say that 200,000 is the
**maximum**number of hairs a person can have on their head. Then, if you select 200,001 people who happen to each have a distinct number of hairs on their heads (zero is a valid number of hairs to have on your head), you only need one more to ensure that two people have the same number of hairs. (Note: This puzzle will work with any city larger than 200,001 residents.) - To see how the pigeonhole principle applies to this problem, you just need to group the numbers 1 through 8 in pairs that sum to 9. {1,8}, {2,7}, {3,6}, {4,5}. Now, if I select four distinct numbers from that range, I might select one number from each of the four pairs. If I select a fifth number, then I must complete one of the pairs that sums to 9.

## Saturday, June 3, 2017

### Coffee with Cream

Suppose you have two cups in front of you, one with precisely 8 fluid ounces of coffee, and the other with precisely 8 fluid ounces of cream. You take precisely one teaspoon of the cream and add it to your coffee. You stir it in so that it's thoroughly mixed. Then you take precisely one teaspoon of that coffee/cream mixture and put it back into the cup of cream. Does the cup of coffee have more cream in it, or does the cup of cream contain more coffee? Click below for the answer.

This question is a bit tricky. It's tempting to think that the cup of coffee contains more cream, because the teaspoon of cream added to the coffee was 100% pure, while the teaspoon of coffee added to the cream was diluted. However, it's important to remember that the total volume of each vessel changed by one teaspoon after the first transfer of fluid. The coffee/cream mixture was greater by two teaspoons than the pure cream. Before I reveal the answer, let's re-frame the question in discrete units.

Suppose that instead of liquids, our two cups contained 20 black marbles and 20 white marbles. You take 5 white marbles and thoroughly mix then in with the black marbles. Then you randomly select 5 marbles from the black/white marble mixture and place them back in the cup of white marbles. Are there more white marbles in the black cup or more black marbles in the white cup?

If you're like me, you may be tempted to treat this as a probability problem, but it isn't one. When I think about randomly drawing marbles, I want to immediately start writing a quick simulation in Python, but as you'll see, that isn't necessary. We can easily enumerate all possible outcomes in this scenario to find the answer to the question. When we draw 5 marbles from the cup with a mixture of 20 black and 5 white marbles, then place them in the cup with the other 15 white marbles, there are only 6 possible outcomes:

So the black/white ratio of the 5 marbles in the second transfer doesn't really matter. The end result is that

The same is true of the original coffee/cream problem. The ratio of the two liquids in the teaspoon that is transferred to the cup of cream is such that you will end up with precisely the same volume of coffee in your cream as there is cream in your coffee. So the answer to the trick question posed at the beginning is "neither, they are the same."

Suppose that instead of liquids, our two cups contained 20 black marbles and 20 white marbles. You take 5 white marbles and thoroughly mix then in with the black marbles. Then you randomly select 5 marbles from the black/white marble mixture and place them back in the cup of white marbles. Are there more white marbles in the black cup or more black marbles in the white cup?

If you're like me, you may be tempted to treat this as a probability problem, but it isn't one. When I think about randomly drawing marbles, I want to immediately start writing a quick simulation in Python, but as you'll see, that isn't necessary. We can easily enumerate all possible outcomes in this scenario to find the answer to the question. When we draw 5 marbles from the cup with a mixture of 20 black and 5 white marbles, then place them in the cup with the other 15 white marbles, there are only 6 possible outcomes:

black | white | black/white mix | white/black mix |
---|---|---|---|

5 | 0 | 15/5 | 15/5 |

4 | 1 | 16/4 | 16/4 |

3 | 2 | 17/3 | 17/3 |

2 | 3 | 18/2 | 18/2 |

1 | 4 | 19/1 | 19/1 |

0 | 5 | 20/0 | 20/0 |

So the black/white ratio of the 5 marbles in the second transfer doesn't really matter. The end result is that

*there are always the same number of white marbles in the black cup as there are black marbles in the white cup*.The same is true of the original coffee/cream problem. The ratio of the two liquids in the teaspoon that is transferred to the cup of cream is such that you will end up with precisely the same volume of coffee in your cream as there is cream in your coffee. So the answer to the trick question posed at the beginning is "neither, they are the same."

## Saturday, May 27, 2017

### Letter Groupings

The letters of the (English) alphabet can be grouped into four distinct categories.

A M

B C D E K

F G J L

H I

Based on the categories established by the first 13 letters, can you place each of the remaining 13 letters in the correct group?

This question is tricky because it's not about the sounds the letters make, or the frequency of letters, but about the shapes of the (capital) letters.

The categories are:

A M T U V W Y (left-right mirror images)

B C D E K (top-bottom mirror images)

F G J L N P Q R S Z (no symmetry)

H I O X (symmetry about both axes)

The categories are:

A M T U V W Y (left-right mirror images)

B C D E K (top-bottom mirror images)

F G J L N P Q R S Z (no symmetry)

H I O X (symmetry about both axes)

Labels:
brain teasers,
puzzles

## Saturday, May 20, 2017

### Number Words

In the solution to A Unique Number, I asked a bonus question. "Can you think of a number whose letters when spelled out in English are all in alphabetical order?" Several people replied via Twitter with the correct answer of "forty." You may have found a shortcut to the solution if you noted that none of the single-digit numbers have their letters in alphabetical order, nor does the word "teen." This allows you to skip ahead to 20, 30, etc. Can you use a similar strategy to answer the following questions?

- What is the lowest number that requires the five vowels A, E, I, O, and U only once each in its spelling?
- What is the lowest number that requires the six letters A, E, I, O, U, and Y only once each in its spelling?

The lowest number that requires the five vowels A, E, I, O, and U once each in its spelling is

The lowest number that requires the six letters A, E, I, O, U, and Y once each in its spelling is

The strategy to quickly find these answers is to note which vowels are used in the base numbers, one, two, three, etc, then avoid combinations that include multiples of the same vowel. For example, you can skip past the 100s entirely, because "one-hundred" contains two of the letter "e".

**206**(two-hundred and six).The lowest number that requires the six letters A, E, I, O, U, and Y once each in its spelling is

**230**(two-hundred and thirty).The strategy to quickly find these answers is to note which vowels are used in the base numbers, one, two, three, etc, then avoid combinations that include multiples of the same vowel. For example, you can skip past the 100s entirely, because "one-hundred" contains two of the letter "e".

Labels:
brain teasers,
numbers,
puzzles

## Saturday, May 13, 2017

### The Nine Dot Puzzle

The following is a classic "thinking outside the box" puzzle. Can you connect all nine dots below by drawing exactly four straight lines, without lifting your pencil or tracing back over any line?

Give it a try before you click below for the answer.

If this puzzle looks familiar, it's because it dates back at least as far as Sam Loyd's 1914

*Cyclopedia of Puzzles*. When I said this was a classic "thinking outside the box" puzzle, that was a clue. You have to think outside the bounds of the box created by the nine dots to come up with a solution.## 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, April 29, 2017

### Common Thread

What do the following words have in common?

- dust
- seed
- left
- resign
- weather
- sanction

Each word has at least two meanings, and in each case one of those meanings is the opposite of the other.

For these and more, see the Mental Floss article 25 Words That Are Their Own Opposites.

**dust**- as a verb can mean either to add or remove something.**seed**- also means either to add or remove something. If you seed the lawn you add seeds, but if you seed a tomato you remove them.**left**- can mean either remaining or departed.**resign**- can mean "to quit" but can also mean "to sign up again."**weather**- can mean "to withstand or make through" (weather the storm) or can mean "to be worn away."**sanction**- can mean 'give official permission or approval for (an action)' or conversely, 'impose a penalty on.'

For these and more, see the Mental Floss article 25 Words That Are Their Own Opposites.

Labels:
brain teasers,
puzzles

## Saturday, April 22, 2017

### Marking a Ruler

A 13-inch ruler only needs four markings on it so that it can be used to measure any whole number of inches from 1 to 13. At what positions should the four markings be? (Do not include the two ends, which are understood to be markings 0 and 13.) Click below to see the answer.

The markings should be at the 1, 2, 6, and 10-inch positions. Use the following markings to measure each whole-number length:

1 inch: 0 to 1

2 inches: 0 to 2

3 inches: 10 to 13

4 inches: 2 to 6

5 inches: 1 to 6

6 inches: 0 to 6

7 inches: 6 to 13

8 inches: 2 to 10

9 inches: 1 to 10

10 inches: 0 to 10

11 inches: 2 to 13

12 inches: 1 to 13

13 inches: 0 to 13

1 inch: 0 to 1

2 inches: 0 to 2

3 inches: 10 to 13

4 inches: 2 to 6

5 inches: 1 to 6

6 inches: 0 to 6

7 inches: 6 to 13

8 inches: 2 to 10

9 inches: 1 to 10

10 inches: 0 to 10

11 inches: 2 to 13

12 inches: 1 to 13

13 inches: 0 to 13

Labels:
brain teasers,
puzzles

## Saturday, April 15, 2017

### Move One Digit

The following equation is incorrect. Can you make the equation balanced by moving only a single digit?

101 - 102 = 1

Click below to see the answer.

The digit that needs to be moved is the 2. Just move it up into the exponent and the equation is correct.

101 - 10

101 - 10

^{2}= 1## Saturday, April 8, 2017

### What is the next number in the sequence?

Without Googling it, can you tell me the next number in the following sequence?

1

11

21

1211

111221

312211

13112221

1113213211

That should be enough to see the pattern, but this sequence goes on infinitely. Click below to see the answer.

This sequence is known as the "Look and Say" or "Say What You see" sequence. Each term is formed by describing the previous term. The first term is just the digit 1. To describe it you would say "one one," so the next term is 11. To describe that you'd say "two one," and so on. The next term after the ones shown is 31131211131221. Check the Online Encyclopedia of Integer Sequences (A005150) for more terms following that.

## Saturday, April 1, 2017

### Beer Run

A man runs

*laps around a circular track with a radius of*

**n***miles. He says he will drink*

**t***quarts of beer for every mile he runs. How many quarts will he drink? Click below for the answer.*

**s**He will only need one quart, no matter how far he runs. If the radius of the track is

*miles, then the circumference is 2*pi*t miles. The man will run***t***laps, so the total distance is 2*pi*n*t miles. If he drinks***n***quarts per mile, then the total amount of beer is 2*pi*n*t*s, which equals one quart!***s**## Saturday, March 25, 2017

### 10-digit Number

Find a 10-digit number where the first digit is how many 0's there are in the number, the second digit is how many 1's in the number, the third digit is how many 2's, and so on, until the tenth digit which is how many 9's there are in the number.

Click below to see the answer.

As a programmer, I'm often tempted to try to use a brute force approach to find the answers to number puzzles. That often works, but when brute force involves looping through all 10-digit numbers, you should probably look for a more elegant approach.

Let's see if we can construct the solution using logic instead. We can't have 0 zeroes, because then we would have to put 0 in the zeroes digit, and it would immediately be wrong. I'll start with a 9 in the zeros digit and the rest zeros, then make corrections until we hit on a solution.

90000 00000

Now we have a 9, so there should also be a 1 in the 9 column.

90000 00001

But now there aren't 9 zeroes, there are only 8. There's also a 1, which means we have to change the first and second digits.

81000 00001

Wait, now there isn't a 9, so we have to move that last 1 over. There are also two 1's, so we have to change the second digit.

82000 00010

That's closer, but now there is a 2, so we have to record it in the twos column. There are also fewer 0's, so we have to change the first digit as well.

72100 00010

Still not quite right. There are now only six 0's, so we have to change the first digit again. There's also no longer an 8. We can make both of these changes at once, giving us a final answer of

62100 01000

Let's see if we can construct the solution using logic instead. We can't have 0 zeroes, because then we would have to put 0 in the zeroes digit, and it would immediately be wrong. I'll start with a 9 in the zeros digit and the rest zeros, then make corrections until we hit on a solution.

90000 00000

Now we have a 9, so there should also be a 1 in the 9 column.

90000 00001

But now there aren't 9 zeroes, there are only 8. There's also a 1, which means we have to change the first and second digits.

81000 00001

Wait, now there isn't a 9, so we have to move that last 1 over. There are also two 1's, so we have to change the second digit.

82000 00010

That's closer, but now there is a 2, so we have to record it in the twos column. There are also fewer 0's, so we have to change the first digit as well.

72100 00010

Still not quite right. There are now only six 0's, so we have to change the first digit again. There's also no longer an 8. We can make both of these changes at once, giving us a final answer of

62100 01000

## 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, March 11, 2017

### Arranging Eights

Can you arrange eight 8's so that when added they will equal 1000? Click below to see the answer.

It's certainly possible to try all 22 different ways to partition eight identical digits, but there is a shortcut.

All of the numbers that are created by arranging eight 8's will end in the digit 8, and the sum of the last digits of those numbers must be a multiple of 10 (because the target sum of 1000 ends in 0), so we know there must be exactly five groups of digits in the correct solution. That means we only have to check 3 different partitions of the eight digits.

8888 + 8 + 8 + 8 + 8

888 + 88 + 8 + 8 + 8

88 + 88 + 88 + 8 + 8

These are the only three ways to partition eight identical objects into five groups, and they are the only groupings whose sums end in the digit 0. You can check with quick mental arithmetic that the second grouping is the correct solution.

All of the numbers that are created by arranging eight 8's will end in the digit 8, and the sum of the last digits of those numbers must be a multiple of 10 (because the target sum of 1000 ends in 0), so we know there must be exactly five groups of digits in the correct solution. That means we only have to check 3 different partitions of the eight digits.

8888 + 8 + 8 + 8 + 8

888 + 88 + 8 + 8 + 8

88 + 88 + 88 + 8 + 8

These are the only three ways to partition eight identical objects into five groups, and they are the only groupings whose sums end in the digit 0. You can check with quick mental arithmetic that the second grouping is the correct solution.

## Saturday, March 4, 2017

### A Unique Number

What is unique about the number 8,549,176,320? Click below to see the answer (and a bonus question).

There's nothing

*numerically*particularly unique or interesting about the number above. It is made up of all of the digits from 0 to 9, but a lot of numbers have that property. The unique thing about this number is that all of the digits from 0 to 9 are in alphabetical order when spelled out in English.**Bonus question:**Can you think of a number whose letters when spelled out in English are all in alphabetical order? Example: The first three letters of the word "five" are in alphabetical order, but the "e" at the end spoils it.
Labels:
brain teasers,
numbers,
puzzles

## Saturday, February 25, 2017

### Best Poker Hand

Which of the following poker hands is the best? Assume one standard 52-card deck is used. The game is five-card draw, so there are no community cards, with no wild cards.

For reference, here are the rankings of poker hands.

**Royal flush**- A, K, Q, J, 10, all the same suit.**Straight flush**- Five cards in a sequence, all the same suit.**Four of a kind**- Four cards all of the same rank.**Full house**- Three of a kind with a side pair.**Flush**- Any five cards, all the same suit**Straight**- Five cards in a sequence, any suits.**Three of a kind**- Three cards all of the same rank.**Two pair**- Two different pairs.**One pair**- Two cards of the same rank.**High card**- Highest card in your hand.

Click below to see the answer.

Hand #1 is the highest-ranking hand shown, but since all of these hands cannot occur on the same deal, it isn't the best hand to have in a real game.

To determine which hand is

To determine which hand is

*best*, you have to look at how many other hands can beat each hand when dealt from the same deck. All of the hands above can be beaten by the same number of four-of-a-kinds, but by different numbers of straight flushes. Having two sixes as your side pair breaks up more of these possible straight flushes than having two kings, so hand #4 is actually the best hand to have. (There are 32 possible straight flushes that beat the kings hand, but only 24 that beat the sixes.)
Labels:
brain teasers,
logic,
puzzles

## 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

## Saturday, February 4, 2017

### Animal Kingdom

What do the following animals all have in common?

- firefly
- jackrabbit
- koala bear
- prairie dog
- silkworm
- guinea pig

Click below to see the answer.

All of the animals listed above are impostors.

- The firefly is not a fly. It is a beetle.
- The jackrabbit is not a rabbit. It is a hare.
- The koala is not a bear. It is a marsupial.
- The prairie dog is not a dog. It is a rodent.
- The silkworm is not a worm. It is a caterpillar.
- The guinea pig is not a pig. It is a rodent. (And it's not even from Guinea, a country on the west coast of Africa. Guinea pigs originated in the Andes mountains in South America.)

Labels:
brain teasers,
puzzles

## Saturday, January 28, 2017

### Name this Book

When this book first came out, it was only read by a handful of rather wealthy people. Now almost everyone has a copy, and many people read it regularly. You cannot buy it from a bookstore or borrow it from the library. Can you name this book? Click below for the answer.

It's a phone book.

This is a good example of an old riddle that has not aged well, so don't feel bad if you found it a bit tricky. Newer technology has rendered phone books practically useless, yet I still get one delivered to my house every year. In another generation or so, many people might not know what they were used for.

This is a good example of an old riddle that has not aged well, so don't feel bad if you found it a bit tricky. Newer technology has rendered phone books practically useless, yet I still get one delivered to my house every year. In another generation or so, many people might not know what they were used for.

Labels:
brain teasers,
puzzles,
riddles

## Saturday, January 21, 2017

### The Brodie Helmet

At the outbreak of World War I, none of the combatant nations provided steel helmets to their troops. Soldiers of most nations went into battle wearing cloth or leather hats that offered little protection from modern weapons. As a result, many soldiers suffered head injuries from exploding shrapnel.

In April of 1916, British soldiers began using a metal helmet in battle called the Brodie helmet, but authorities discovered that the proportion of head injuries then

*increased*. Why should the incidence of head injuries increase when soldiers wore metal helmets rather than cloth caps? Click below to see the answer.

The number of recorded head injuries did increase after the introduction of the Brodie helmet, but the number of deaths

*decreased*. Prior to the introduction of metal helmets, if a soldier were hit in the head with a piece of shrapnel, it would have likely killed him. This would have been recorded as a death, not a head injury. More head injuries were recorded after the helmets were introduced due to the simple fact that more soldiers were surviving them.## Saturday, January 14, 2017

### Panama Canal

A ship sailed through the Panama Canal going from west to east. When it exited the canal, it entered the Pacific Ocean. (The ship did not double back.) How can this be so? Click below to see the answer.

Normally when we think about the American continents, we think of the Pacific Ocean being to the west and the Atlantic Ocean to the east, but that isn't strictly the case. Panama is an isthmus that curves, and the Panama Canal was constructed so that it runs from the Caribbean Sea on the northwest end to the Pacific Ocean on the southeast. In the age of instant access to world maps, this "puzzle" is probably a lot easier to verify now than when the canal was originally built.

## Saturday, January 7, 2017

### Rope Around the Earth

Suppose you tie a rope tightly around the Earth at the equator. (Assume the Earth is perfectly spherical, and that the surface is smooth so that the rope lies tight against the surface at all points.) Now suppose that you add an additional 6 feet to the length of the rope. How high off the surface would the rope lie? You could look up the Earth's circumference and do the math to come up with an exact answer, but can you quickly come up with an intuitive guess? (High enough to slide a piece of paper under? To wave your hand under? To walk under?) Click below to see a hint or the answer.

**Hint:**If I reversed the parameters and told you that I increased the length enough to raise the rope 6 feet from the surface in all directions, could you tell me how much was added to the length of the rope? (Given the formula for the circumference of a circle, C = 2Ď€r, but not knowing the circumference of the Earth, can you come up with a guess?) Reversing that, can you come up with the answer to the original problem?

**Answer:**The first time they hear this puzzle, many people will try to do the math starting with the circumference of the Earth. That doesn't matter though. It's a property of any circle that if you increase the circumference by a fixed amount, the radius will change by that amount divided by 2Ď€ (because r = C/2Ď€). The rope could be tied around a beach ball or a tennis ball and the answer would not change. So the exact answer to the problem is 0.95493 feet, but if you said "about 1 foot" you were right.

## Sunday, January 1, 2017

### Voyageurs

I've been reading

*The Revenant*by Michael Punke and came across the following few passages. The main character, Hugh Glass, is embarking on a canoe trip up the Missouri River with a group of French Canadian fur traders known as voyageurs....For the rest of their voyage, Glass manned not a paddle but an enormous sponge, constantly bailing water as it pooled on the bottom of the canoe.

It was a full-time job, since theIf you've ever maintained a large code base, you probably already see where I'm going with this. The constant patching and plugging of leaks, the fragility of the craft, one man constantly bailing out water while several others row the boat guided by a steersman. These elements all remind me of several large software projects I've been on. The passage continues.bĂ˘tardleaked steadily. The canoe reminded Glass of a floating quilt. Its patchwork skin of birch bark was sewn together withwattope, the fine root of a pine tree. The seams were sealed with pine tar, reapplied constantly as leaks appeared. As birch had become more difficult to find, the voyageurs were forced to use other materials in their patching and plugging. Rawhide had been employed in several spots, stitched on and then slathered in gum. Glass was amazed at the fragility of the craft. A stiff kick would easily puncture the skin, and one of La Vierge's main tasks as steersman was the avoidance of lethal, floating debris. At least they benefited from the relatively docile flow of the fall season. The spring floods could send entire trees crashing downstream.

There was an upside to theThis reminds me not only of the relationship programmers have with our code, but also of the relationship we have with our tools. How much time do we spend complaining about an IDE or a framework? How much time configuring them? But after we've gotten comfortable using them, most of us will strongly resist switching to a new one. Finally...bĂ˘tard'sshortcomings. If the vessel was frail, it was also light, an important consideration as they labored against the current. Glass came quickly to understand the odd affection of voyageurs for their craft. It was a marriage of sorts, a partnership between the men who propelled the boat and the boat that propelled the men. Each relied upon the other. The voyageurs spent half their time complaining bitterly about the manifold ails of the craft, and half their time nursing them tenderly.

They took great pride in the appearance of theThis final bit surprises me the most, but in a way I suppose it shouldn't. I don't know much about boating, but I do know that you should fix the leaks in your boat before you bother to decorate it. But that isn't how we always approach software development, is it? I've seen people spend plenty of time refactoring and cleaning code that didn't really need to change, or adding test cases just to get a higher percentage in test coverage. At times I've been guilty of this myself. I guess it's worth it to ask yourself, before you make a change to your code, am I fixing a leak, or am I just painting a stag's ass on this canoe?bĂ˘tard,dressing it in jaunty plumes and bright paint. On the high prow they had painted a stag's head, its antlers tilted challengingly toward the flowing water. (On the stern, La Vierge had painted the animal's ass.)

Labels:
engineering,
history,
software

Subscribe to:
Posts (Atom)