Logic Puzzles


Warning: Solutions are currently displayed. To hide and show the solutions as desired, enable javascript on your browser

Logic problems that can keep you thinking on a long commute.

1. The Most Intelligent Prince

A king wants his daughter to marry the smartest of 3 extremely intelligent young princes, and so the king's wise men devised an intelligence test.

The princes are gathered into a room and seated, facing one another, and are shown 2 black hats and 3 white hats. They are blindfolded, and 1 hat is placed on each of their heads, with the remaining hats hidden in a different room.

The king tells them that the first prince to deduce the color of his hat without removing it or looking at it will marry his daughter. A wrong guess will mean death. The blindfolds are then removed.

You are one of the princes. You see 2 white hats on the other prince's heads. After some time you realize that the other prince's are unable to deduce the color of their hat, or are unwilling to guess. What color is your hat?

Note: You know that your competitors are very intelligent and want nothing more than to marry the princess. You also know that the king is a man of his word, and he has said that the test is a fair test of intelligence and bravery.

Hint:

Based on what you know, why are the other princes unable to solve this puzzle?

Solution:

White.

The king would not select two white hats and one black hat. This would mean two princes would see one black hat and one white hat. You would be at a disadvantage if you were the only prince wearing a black hat.

If you were wearing the black hat, it would not take long for one of the other princes to deduce he was wearing a white hat.

If an intelligent prince saw a white hat and a black hat, he would eventually realize that the king would never select two black hats and one white hat. Any prince seeing two black hats would instantly know he was wearing a white hat. Therefore if a prince can see one black hat, he can work out he is wearing white.

Therefore the only fair test is for all three princes to be wearing white hats. After waiting some time just to be sure, you can safely assert you are wearing a white hat.


2. 100 Gold Coins

Five pirates have obtained 100 gold coins and have to divide up the loot. The pirates are all extremely intelligent, treacherous and selfish (especially the captain).

The captain always proposes a distribution of the loot. All pirates vote on the proposal, and if half the crew or more go "Aye", the loot is divided as proposed, as no pirate would be willing to take on the captain without superior force on their side.

If the captain fails to obtain support of at least half his crew (which includes himself), he faces a mutiny, and all pirates will turn against him and make him walk the plank. The pirates start over again with the next senior pirate as captain.

What is the maximum number of coins the captain can keep without risking his life?

Hint:

Each pirate cares first about staying alive, then about getting as many coins as possible. A pirate will vote “Aye” only if the proposal gives them more than they would get after mutiny. Side deals, promises, and revenge votes do not count, because the pirates are selfish and treacherous.

What happens if there are two pirates? Who completely loses out? What happens if there are three pirates? Who completely loses out? What happens if there are four pirates? Which two pirates completely lose out?

Solution:

98

The captain says he will take 98 coins, and will give one coin to the third most senior pirate and another coin to the most junior pirate. He then explains his decision in a manner like this...

  1. Pirate 1: most junior, keeps 1 coin.
  2. Pirate 2: fourth most senior, keeps 0 coins.
  3. Pirate 3: third most senior, keeps 1 coin.
  4. Pirate 4: second most senior, keeps 0 coins.
  5. Pirate 5: captain, most senior, keeps 98 coins.

If there were 2 pirates, because pirates 3,4 & 5 had walked the plank, then pirate 2 would be the most senior, and he would just vote for himself and that would be 50% of the vote, so he's obviously going to keep all the money for himself.

If there were 3 pirates, because pirates 4 & 5 had walked the plank, pirate 3 has to convince at least one other person to join in his plan. Pirate 3 would take 99 gold coins and give 1 coin to pirate 1. Pirate 1 knows if he does not vote for pirate 3, then he gets nothing, so obviously is going to vote for this plan.

If there were 4 pirates, because the captain had to walk the plank, pirate 4 would give 1 coin to pirate 2, and pirate 2 knows if he does not vote for pirate 4, then he gets nothing, so obviously is going to vote for this plan.

As there are 5 pirates, pirates 1 & 3 had obviously better vote for the captain, or they face choosing nothing or risking death.

Pirates left Winning proposal
2 Senior pirate keeps 100.
3 Captain keeps 99, gives 1 to Pirate 1.
4 Captain keeps 99, gives 1 to Pirate 2.
5 Captain keeps 98, gives 1 each to Pirates 1 and 3.

3. 1 Gold Coin

The five pirates mentioned previously are joined by a sixth, then plunder a ship with only one gold coin.

After venting some of their frustration by killing all on board the ship, they now need to divvy up the one coin. They are so angry, they now value in priority order: 
1. Their lives
2. Getting money
3. Seeing other pirates die.

So if given the choice between two outcomes, in which they get the same amount of money, they'd choose the outcome where they get to see more of the other pirates die.

How can the captain save his skin?

Hint:

Use the same approach.

Solution:

The most senior pirate could give the coin to the least senior pirate. He can use the same logic in the previous puzzle to explain the futility of anyone trying to keep the coin for himself.

Pirates left Captain needs Result
2 1 vote Pirate 2 keeps the coin. His own vote is enough.
3 2 votes Pirate 3 gives the coin to Pirate 1. Pirate 1 would get 0 if Pirate 3 dies.
4 2 votes Pirate 4 gives the coin to Pirate 2 or Pirate 3. Either would otherwise get 0.
5 3 votes Pirate 5 cannot survive. He has only one coin and needs two extra votes.
6 3 votes Pirate 6 gives the coin to Pirate 1. Pirate 5 votes yes because he dies if Pirate 6 dies. Pirate 1 votes yes for the coin.

4. The Greek Philosophers

One day three Greek philosophers settled under the shade of an olive tree, opened a bottle of Retsina, and began a lengthy discussion of the Fundamental Ontological Question: Why does anything exist?

After a while, they began to ramble. Then, one by one, they fell asleep.

While the men slept, three owls, one above each philosopher, completed their digestive process, dropped a present on each philosopher's forehead, the flew off with a noisy "hoot."

Perhaps the hoot awakened the philosophers. As soon as they looked at each other, all three began, simultaneously, to laugh. Then, one of them abruptly stopped laughing. Why?

Hint:

The one who stopped laughing, asked himself what the other philosophers were seeing that made them laugh.

Solution:

If he (the smartest philosopher) had nothing on his head, then he realized that the second smartest philosopher would have quickly worked out that the third smartest was laughing only at the second smartest philosopher, and thus the second smartest philosopher would have stopped laughing.


5. The 100 Coins

There are 10 sets of 10 coins. You know how much the coins should weigh. You know all the coins in one set of ten are exactly a hundredth of an ounce off, making the entire set of ten coins a tenth of an ounce off. You also know that all the other coins weight the correct amount. You are allowed to use an extremely accurate digital weighing machine only once.

How do you determine which set of 10 coins is faulty?

Hint:

You can weigh as few or as many of the ten coins from each set as you choose.

Solution:

One coin from the first set is placed on the scale along with two from the second set etc... If the weight is off by one hundredth of an ounce then it is the first set that is faulty, if the weight is off by two hundred of an ounce then it is the second set which is faulty, etc...


6. The Monkey and the Coconut

Ten people land on a deserted island. There they find lots of coconuts and a monkey. During their first day they gather coconuts and put them all in a community pile. After working all day they decide to sleep and divide them into ten equal piles the next morning.

That night one castaway wakes up hungry and decides to take his share early. After dividing up the coconuts he finds he is one coconut short of ten equal piles. He also notices the monkey holding one more coconut. So he tries to take the monkey's coconut to have a total evenly divisible by 10. However when he tries to take it the monkey conks him on the head with it and kills him.

Later another castaway wakes up hungry and decides to take his share early. On the way to the coconuts he finds the body of the first castaway, which pleases him because he will now be entitled to 1/9 of the total pile. After dividing them up into nine piles he is again one coconut short and tries to take the monkey's slightly bloodied coconut. The monkey conks the second man on the head and kills him.

One by one each of the remaining castaways goes through the same process, until the 10th person to wake up gets the entire pile for himself. What is the smallest number of possible coconuts in the pile, not counting the monkeys?

Hint:

 Look up the formula for the LCM.

Solution:

2519

The solution for the answer is the LCM (Lowest Common Multiple) of 10,9,8,7,6,5,4,3,2,1 -1. LCM would give the least number which is divisible by all of these number and subtracting one would give us the number of coconuts which were initially there.


7. Flipping Coins

There are twenty coins sitting on the table, ten are currently heads and tens are currently tails. You are sitting at the table with a blindfold and gloves on. You are able to feel where the coins are, but are unable to see or feel if they heads or tails. You must create two sets of coins. Each set must have the same number of heads and tails as the other group. You can only move or flip the coins, you are unable to determine their current state. How do you create two even groups of coins with the same number of heads and tails in each group?

Solution:

Create two sets of ten coins. Flip the coins in one of the sets over, and leave the coins in the other set alone. The first set of ten coins will have the same number of heads and tails as the other set of ten coins.

Flipping Coins Simulator

This randomly arranges 20 coins, exactly 10 heads and 10 tails. It then randomly chooses 10 coins for Group A. Flip Group A and compare the two groups.

Group A

Group B


8. Two Children

I ask people at random if they have two children and also if one is a boy born on a tuesday. After a long search I finally find someone who answers yes. What is the probability that this person has two boys? Assume an equal chance of giving birth to either sex and an equal chance to giving birth on any day.

Hint: If I ask people at random if they have two children and if the youngest is a boy, then the probability that this person has two boys is 1/2.

If I asked people at random if they have two children and if one is a boy, then the probability that this person has two boys is 1/3.

Possibility Has at least one boy? Two boys?
BB yes yes
BG yes no
GB yes no
GG no no


My question is excluding anyone with two girls, so therefore there are only three cases left, only one of which has two boys.
Solution:

13/27. If you think the answer should be 1/2, you would be wrong. If you knew which child was a boy (say, the younger one), you would be closer to the truth. But since the boy could be either the younger or the older child, the analysis is more subtle. But what does Tuesday have to do with it?


9. Three Coworkers Would Like to Know Their Average Salary

Three coworkers would like to know their average salary. how can they do it, without disclosing their own salaries?

Solution:

Person A writes a number that is her salary plus a random amount (AS + AR) and hands it to B, without showing C. B then adds his salary plus a random amount (BS + BR) and passes it to C (at each step, they write on a new paper and don't show the 3rd person). C adds CS + CR and passes it to A. Now A subtracts her random number (AR) and passes it to B. B and C each subtract their random number and pass. After C is done, he shows the result and they divide by 3.

As has been noted already, there's no way to liar-proof the scheme.

It's also worth noting that once they know the average, any of the three knows the sum of the other 2 salaries.

Solution contributed by Jeebok.


10. Chessboard and Dominoes

You have a chessboard with two diametrically opposite squares cut out. How can you cover the remaining 62 squares completely with 31 domino pieces ?(without breaking the dominoes or the board of course). Each domino covers exactly two squares.

Solution:

It is impossible to cover the remaining 62 squares with 31 dominoes after cutting out two opposite corners of the chessboard. Each domino covers one black and one white square, and removing two opposite corners (which are the same color) leaves an imbalance of colors, resulting in 32 squares of one color and 30 of the other, making it impossible to cover the board completely.

Why 31 dominoes can never cover this board

A normal chessboard has:

32 light squares
32 dark squares

The two opposite corner squares are the same color. Removing them leaves:

32 light squares
30 dark squares

But every domino placed on a chessboard must cover exactly one light square and one dark square:

31 dominoes would need
31 light squares + 31 dark squares

But the board has
32 light squares + 30 dark squares

Therefore, the board cannot be covered completely.


11.

Morning Walk Logic

A man goes out for a walk. He walks 1 mile to the south, then 1 mile to the east and finally 1 mile to the north and ends up in the same place he started. Where did he start from? Where else might he have started from?

Solution:

The man either started at the North Pole, or the man started at a point just over a mile north of the South Pole, or at any latitude where walking 1 mile south takes him to a circle of latitude with a circumference that is an exact factor of 1 mile (such as 1/2 mile, 1/3 mile, etc.). After walking 1 mile south, he reaches this latitude, then walks 1 mile east, completing a full circle back to his starting point on that latitude, and finally walks 1 mile north to return to his original position.


12. In a Far Away Land, it Was Known That If You Drank Poison...

In a far away land, it was known that if you drank poison, the only way to save yourself is to drink a stronger poison, which neutralizes the weaker poison. The king that ruled the land wanted to make sure that he possessed the strongest poison in the kingdom, in order to ensure his survival, in any situation. So the king called the kingdom's pharmacist and the kingdom's sage, he gave each a week to make the strongest poison. Then, each would drink the other one's poison, then his own, and the one that will survive, will be the one that had the stronger poison.
The pharmacist went straight to work, but the sage knew he had no chance, for the pharmacist was much more experienced in this field, so instead, he made up a plan to survive and make sure the pharmacist dies. On the last day the pharmacist suddenly realized that the sage would know he had no chance, so he must have a plan. After a little thought, the pharmacist realized what the sage's plan must be, and he concocted a counter plan, to make sure he survives and the sage dies. When the time came, the king summoned both of them. They drank the poisons as planned, and the sage died, the pharmacist survived, and the king didn't get what he wanted.
What exactly happened there?

Solution:

The sage's plan was to drink a weak poison prior to the meeting with the king, and then he would drink the pharmacist's strong poison, which would neutralize the weak poison. As his own poison he would bring water, which will have no effect on him, but the pharmacist who would drink the water, and then his poison would surely die. When the pharmacist figured out this plan, he decided to bring water as well. So the sage who drank poison earlier, drank the pharmacist's water, then his own water, and died of the poison he drank before. The pharmacist would drink only water, so nothing will happen to him. And because both of them brought the king water, he didn't get a strong poison like he wanted.


13. Five-Card Prediction

Alex shuffles an ordinary deck of 52 playing cards (no Jokers) and chooses any five cards. Peter is not watching.
Alex hands the five selected cards to You (the Magician).
You secretly look at the five cards, pick one of them, and hand that single card back to Alex face-down. You then arrange the remaining four cards in a specific order, place them face-down in a tidy pile, and give the pile to Peter.
Peter turns the four cards face-up, studies their order for a moment, and immediately announces the exact suit and rank of the card that Alex is still holding.

Assuming Peter and You have agreed on a method beforehand (but have no hidden markings or outside communication), explain in detail how this feat is always possible and how the four face-up cards unequivocally reveal the fifth.

Hint:

Among any five cards there must be at least two of the same suit. Use one of those as a “key” card. The order of the four cards can encode up to 24 different messages.

Solution:

Among any five cards, at least two cards must have the same suit, because there are only four suits. Choose two cards of the same suit. One of them will be hidden, and the other will be shown as the first card in the pile.

Use the rank order:

A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, then back to A.

Between two cards of the same suit, one direction around the cycle is always between 1 and 6 steps. Choose the visible card so that the hidden card is 1 to 6 ranks ahead of it.

The first visible card tells Peter the suit of the hidden card. The order of the other three visible cards tells Peter how many ranks to count forward.

Beforehand, Peter and the magician agree on a fixed sorting order for cards, for example:

Clubs, Diamonds, Hearts, Spades, and within each suit A, 2, 3, ..., K.

After the key card is placed first, sort the remaining three cards by that agreed order and call them A, B, and C.

Use this code:

ABC = 1
ACB = 2
BAC = 3
BCA = 4
CAB = 5
CBA = 6

So the magician puts the key card first, then arranges the other three cards in one of those six orders to encode the distance.

Example:

Suppose the five cards are:

♣9, ♥K, ♦4, ♣3, ♠A

The two clubs are ♣3 and ♣9.

Choose ♣3 as the key card and hide ♣9, because counting forward from 3 to 9 gives:

4, 5, 6, 7, 8, 9

That is 6 steps.

The remaining cards are:

♥K, ♦4, ♠A

Sorted by the agreed order, they are:

A = ♦4
B = ♥K
C = ♠A

Distance 6 is encoded by CBA, so the magician gives Peter the four cards in this order:

♣3, ♠A, ♥K, ♦4

Peter sees ♣3 first, so he knows the hidden card is a club. He sees the remaining three cards are in CBA order, so the distance is 6. He counts six ranks forward from 3 and gets 9.

Therefore Peter announces:

Nine of Clubs

The trick works every time because the first card gives the suit, and the six possible orders of the remaining three cards give the rank distance from 1 to 6.


14. Nine Nines Puzzle

This array of 9 nines contains 8 straight lines, each totaling 27 (3 across, 3 down, 2 diagonal). Show how to move 4 nines to new positions to make 10 straight lines, each totaling 27.

Solution:

Original: New:

9 9 9 9 9 9
9 9 9 9 9 9
9 9 9 9 9 9

So the four moves are:
top-left moves left
top-right moves right
bottom-left moves left
bottom-right moves right

The 10 lines of three 9s are:

3 horizontal rows
1 vertical center line
2 long diagonals
4 shorter diagonals


15. Tennis Ball Weighing Problem

You have 12 tennis balls, 1 is heavier or lighter than the rest. You get 3 weighings with a balance beam scale. After the third weighing, you have to be able to tell me which ball and if it's heavier or lighter.

Solution:

First, divide the 12 balls into three groups of four. Weigh two groups against each other. Depending on the outcome, you will know if the odd ball is in one of those groups or in the group not weighed. Continue to narrow it down using the balance scale until you identify the odd ball and determine if it is heavier or lighter.


Submit a Puzzle

Puzzles

Site Map | Contact Us