Logic Puzzles: Five Murders, Five Friends

Here are two more logic puzzles similar to those we looked at last time. Each is partly solved, enough to teach how to approach such problems (this time, using tables), but leaving enough of a challenge for you to finish up. What’s new here is that we will be using tables to keep track of our thinking.

Five murders: rank, room, and weapon

This is from 2001:

Where and with What Weapon Was Each Man Murdered?

One rainy evening, five military men (a general, a captain, a lieutenant, a sergeant, and a corporal) were murdered in the old mansion on Willow Lane. The murders took place in the bedroom, basement, pantry, den, and attic of the house. No two men were murdered in the same room or with the same weapon. The weapons used were poison, a poker, a gun, a knife, and a shovel. From the clues given, try to determine the room in which each man was killed and the weapon used to do him 
in.

1. The murder with the shovel was not done in
   the den or the attic; neither the captain
   nor the lieutenant was killed with the shovel, 
   nor was either killed in the den or the attic.

2. The captain was not murdered in the bedroom.

3. The poker was not the murder weapon used in
   the attic.

4. Neither the general nor the corporal was
   murdered with poison, a gun, or a shovel.

5. The man murdered in the basement had just
   had dinner with the corporal, the captain,
   the man done in with poison, and the victim 
   of the poker.

This is easier than some, because it has only three attributes. It will be a good opportunity to demonstrate the use of tables to organize the work, which we didn’t see last time. (Below, we’ll have a considerably harder problem with five attributes.)

Doctor Code answered:

Sarah,

To do these types of problems, first set up a grid like this:

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|_|_| |_|_|_|_|_|
captain    |_|_|_|_|_| |_|_|_|_|_|
lieutenant |_|_|_|_|_| |_|_|_|_|_|
sergeant   |_|_|_|_|_| |_|_|_|_|_|
corporal   |_|_|_|_|_| |_|_|_|_|_|
            _ _ _ _ _
shovel     |_|_|_|_|_|
poison     |_|_|_|_|_|
poker      |_|_|_|_|_|
gun        |_|_|_|_|_|
knife      |_|_|_|_|_|

The columns across the top should be labeled:

  Basement, Den, Attic, Pantry, Bedroom for the rooms
  Shovel, Poison, Poker, Gun, Knife for the weapons

I only had room for the first letter of the column names. Notice how the weapons appear twice, both as rows on the bottom-left and as columns on the top-right. We'll see why we need this in a moment.

Things get harder when there are more than three attributes (as in the next problem, below).

Knowing what’s false

Now let's fill in the information from clue #1 into the table. First, "the murder with the shovel was not done in the den or attic."  Put an 'O' in the shovel row and in the den and attic columns, like this:

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|_|_| |_|_|_|_|_|
captain    |_|_|_|_|_| |_|_|_|_|_|
lieutenant |_|_|_|_|_| |_|_|_|_|_|
sergeant   |_|_|_|_|_| |_|_|_|_|_|
corporal   |_|_|_|_|_| |_|_|_|_|_|
            _ _ _ _ _
shovel     |_|O|O|_|_|
poison     |_|_|_|_|_|
poker      |_|_|_|_|_|
gun        |_|_|_|_|_|
knife      |_|_|_|_|_|

The 'O' signifies that something is false; for example, the shovel wasn't used in the den, and the shovel wasn't used in the attic.

Both something we know to be true, and something we know to be false, give us important information! Blank cells are what we know nothing about; we hope to eventually banish them.

Now the 2nd part of clue #1: "Neither the captain nor the lieutenant was killed with the shovel":

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|_|_| |_|_|_|_|_|
captain    |_|_|_|_|_| |O|_|_|_|_|
lieutenant |_|_|_|_|_| |O|_|_|_|_|
sergeant   |_|_|_|_|_| |_|_|_|_|_|
corporal   |_|_|_|_|_| |_|_|_|_|_|
            _ _ _ _ _
shovel     |_|O|O|_|_|
poison     |_|_|_|_|_|
poker      |_|_|_|_|_|
gun        |_|_|_|_|_|
knife      |_|_|_|_|_|

Now you can see why we needed the weapons in two places, so that we can write down information about weapons vs. people, and about weapons vs. rooms.

I’m putting new information in red, which couldn’t be done in the original.

For the 3rd part of clue #1: "Nor was either killed in the den or attic."

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|_|_| |_|_|_|_|_|
captain    |_|O|O|_|_| |O|_|_|_|_|
lieutenant |_|O|O|_|_| |O|_|_|_|_|
sergeant   |_|_|_|_|_| |_|_|_|_|_|
corporal   |_|_|_|_|_| |_|_|_|_|_|
            _ _ _ _ _
shovel     |_|O|O|_|_|
poison     |_|_|_|_|_|
poker      |_|_|_|_|_|
gun        |_|_|_|_|_|
knife      |_|_|_|_|_|

That's all the information from clue #1.

That was a dense clue; the rest will go a little faster.

Now for clue #2: "The captain was not murdered in the bedroom."

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|_|_| |_|_|_|_|_|
captain    |_|O|O|_|O| |O|_|_|_|_|
lieutenant |_|O|O|_|_| |O|_|_|_|_|
sergeant   |_|_|_|_|_| |_|_|_|_|_|
corporal   |_|_|_|_|_| |_|_|_|_|_|
            _ _ _ _ _
shovel     |_|O|O|_|_|
poison     |_|_|_|_|_|
poker      |_|_|_|_|_|
gun        |_|_|_|_|_|
knife      |_|_|_|_|_|

Clue #3: "The poker was not the murder weapon used in the attic."

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|_|_| |_|_|_|_|_|
captain    |_|O|O|_|O| |O|_|_|_|_|
lieutenant |_|O|O|_|_| |O|_|_|_|_|
sergeant   |_|_|_|_|_| |_|_|_|_|_|
corporal   |_|_|_|_|_| |_|_|_|_|_|
            _ _ _ _ _
shovel     |_|O|O|_|_|
poison     |_|_|_|_|_|
poker      |_|_|O|_|_|
gun        |_|_|_|_|_|
knife      |_|_|_|_|_|

Clue #4 has a lot of information: "Neither the general nor the corporal was murdered with poison, a gun, or a shovel."

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|_|_| |O|O|_|O|_|
captain    |_|O|O|_|O| |O|_|_|_|_|
lieutenant |_|O|O|_|_| |O|_|_|_|_|
sergeant   |_|_|_|_|_| |_|_|_|_|_|
corporal   |_|_|_|_|_| |O|O|_|O|_|
            _ _ _ _ _
shovel     |_|O|O|_|_|
poison     |_|_|_|_|_|
poker      |_|_|O|_|_|
gun        |_|_|_|_|_|
knife      |_|_|_|_|_|

Using what’s true to fill a row

We haven’t used the last clue yet, but there’s already some additional processing we can do, now that enough has been filled in; we’ve been watching for this to happen!

Now it gets interesting. Notice that the column for the shovel has 4 O's in it. The shovel was not used to kill the general, the captain, the lieutenant, or the corporal. That leaves only one possibility, that the shovel was used to kill the sergeant. We'll mark that fact down with an X:

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|_|_| |O|O|_|O|_|
captain    |_|O|O|_|O| |O|_|_|_|_|
lieutenant |_|O|O|_|_| |O|_|_|_|_|
sergeant   |_|_|_|_|_| |X|_|_|_|_|
corporal   |_|_|_|_|_| |O|O|_|O|_|
            _ _ _ _ _
shovel     |_|O|O|_|_|
poison     |_|_|_|_|_|
poker      |_|_|O|_|_|
gun        |_|_|_|_|_|
knife      |_|_|_|_|_|

Whenever we make an X, we can fill in the rest of the row or column:

Since we know that sergeant was definitely killed with the shovel, we know he wasn't killed with any other weapon, so we can mark O's in all the other columns:

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|_|_| |O|O|_|O|_|
captain    |_|O|O|_|O| |O|_|_|_|_|
lieutenant |_|O|O|_|_| |O|_|_|_|_|
sergeant   |_|_|_|_|_| |X|O|O|O|O|
corporal   |_|_|_|_|_| |O|O|_|O|_|
            _ _ _ _ _
shovel     |_|O|O|_|_|
poison     |_|_|_|_|_|
poker      |_|_|O|_|_|
gun        |_|_|_|_|_|
knife      |_|_|_|_|_|

Now back to the last clue:

Finally we'll fill in clue #5: "The man murdered in the basement had just had dinner with the corporal, the captain, the man done in with poison, and the victim of the poker."  First, the captain and corporal weren't killed in the basement, since they just had dinner with the man who was:

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|_|_| |O|O|_|O|_|
captain    |O|O|O|_|O| |O|_|_|_|_|
lieutenant |_|O|O|_|_| |O|_|_|_|_|
sergeant   |_|_|_|_|_| |X|O|O|O|O|
corporal   |O|_|_|_|_| |O|O|_|O|_|
            _ _ _ _ _
shovel     |_|O|O|_|_|
poison     |_|_|_|_|_|
poker      |_|_|O|_|_|
gun        |_|_|_|_|_|
knife      |_|_|_|_|_|

The man killed in the basement had dinner with the poison and poker victims, so that means those weapons weren't used in the basement:

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|_|_| |O|O|_|O|_|
captain    |O|O|O|_|O| |O|_|_|_|_|
lieutenant |_|O|O|_|_| |O|_|_|_|_|
sergeant   |_|_|_|_|_| |X|O|O|O|O|
corporal   |O|_|_|_|_| |O|O|_|O|_|
            _ _ _ _ _
shovel     |_|O|O|_|_|
poison     |O|_|_|_|_|
poker      |O|_|O|_|_|
gun        |_|_|_|_|_|
knife      |_|_|_|_|_|

The corporal and captain had dinner with the poison and poker victims too, so they weren't killed with either of those weapons:

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|_|_| |O|O|_|O|_|
captain    |O|O|O|_|O| |O|O|O|_|_|
lieutenant |_|O|O|_|_| |O|_|_|_|_|
sergeant   |_|_|_|_|_| |X|O|O|O|O|
corporal   |O|_|_|_|_| |O|O|O|O|_|
            _ _ _ _ _
shovel     |_|O|O|_|_|
poison     |O|_|_|_|_|
poker      |O|_|O|_|_|
gun        |_|_|_|_|_|
knife      |_|_|_|_|_|

Once again, we now look for rows with only one empty cell. Here I’ll use red for what we fill in first (an X in a row, another in a column, and O’s filling out the rest of the column and row respectively), and green for a second round after those are done):

Now look at the people versus weapons grid. It's almost finished. We'll add X's to the only open spot in all the rows that already have 4 O's in them, and then the same thing for columns:

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|_|_| |O|O|X|O|O|
captain    |O|O|O|_|O| |O|O|O|X|O|
lieutenant |_|O|O|_|_| |O|X|O|O|O|
sergeant   |_|_|_|_|_| |X|O|O|O|O|
corporal   |O|_|_|_|_| |O|O|O|O|X|
            _ _ _ _ _
shovel     |_|O|O|_|_|
poison     |O|_|_|_|_|
poker      |O|_|O|_|_|
gun        |_|_|_|_|_|
knife      |_|_|_|_|_|

Now we know exactly who was killed with what weapon. We just have to figure the rooms out, so we'll add X's to the people vs. rooms grid:

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|O|_| |O|O|X|O|O|
captain    |O|O|O|X|O| |O|O|O|X|O|
lieutenant |_|O|O|O|_| |O|X|O|O|O|
sergeant   |_|_|_|O|_| |X|O|O|O|O|
corporal   |O|_|_|O|_| |O|O|O|O|X|
            _ _ _ _ _
shovel     |_|O|O|_|_|
poison     |O|_|_|_|_|
poker      |O|_|O|_|_|
gun        |_|_|_|_|_|
knife      |_|_|_|_|_|

Interactions among tables

Here it gets a little tricky. We don't have any more columns or rows that have 4 O's, but that's okay. We can combine some of the X's to form new facts. For example, we know the captain was killed in the pantry, and we know he was killed with the gun. That means the gun was the weapon used in the pantry, and we can fill in that information in the rooms vs. weapons grid:

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|O|_| |O|O|X|O|O|
captain    |O|O|O|X|O| |O|O|O|X|O|
lieutenant |_|O|O|O|_| |O|X|O|O|O|
sergeant   |_|_|_|O|_| |X|O|O|O|O|
corporal   |O|_|_|O|_| |O|O|O|O|X|
            _ _ _ _ _
shovel     |_|O|O|O|_|
poison     |O|_|_|O|_|
poker      |O|_|O|O|_|
gun        |O|O|O|X|O|
knife      |_|_|_|O|_|

You can think of this mechanically, as filling out a rectangle in the diagram:

We can do the same thing with one O and one X. Look at the corporal row. We know he was killed with the knife, and we know he wasn't killed in the basement. That means the knife wasn't used in the basement. We'll record that fact in the weapons vs. rooms grid again:

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|O|_| |O|O|X|O|O|
captain    |O|O|O|X|O| |O|O|O|X|O|
lieutenant |_|O|O|O|_| |O|X|O|O|O|
sergeant   |_|_|_|O|_| |X|O|O|O|O|
corporal   |O|_|_|O|_| |O|O|O|O|X|
            _ _ _ _ _
shovel     |_|O|O|O|_|
poison     |O|_|_|O|_|
poker      |O|_|O|O|_|
gun        |O|O|O|X|O|
knife      |O|_|_|O|_|

You can think of this, too, as a mechanical operation on the tables:

And now we know that the shovel was used in the basement (it's the only weapon left):

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |_|_|_|O|_| |O|O|X|O|O|
captain    |O|O|O|X|O| |O|O|O|X|O|
lieutenant |_|O|O|O|_| |O|X|O|O|O|
sergeant   |_|_|_|O|_| |X|O|O|O|O|
corporal   |O|_|_|O|_| |O|O|O|O|X|
            _ _ _ _ _
shovel     |X|O|O|O|O|
poison     |O|_|_|O|_|
poker      |O|_|O|O|_|
gun        |O|O|O|X|O|
knife      |O|_|_|O|_|

We know the shovel was used in the basement, and we know the sergeant was killed with the shovel. That means the sergeant was killed in the basement:

            B D A P B   S P P G K
            _ _ _ _ _   _ _ _ _ _
general    |O|_|_|O|_| |O|O|X|O|O|
captain    |O|O|O|X|O| |O|O|O|X|O|
lieutenant |O|O|O|O|_| |O|X|O|O|O|
sergeant   |X|O|O|O|O| |X|O|O|O|O|
corporal   |O|_|_|O|_| |O|O|O|O|X|
            _ _ _ _ _
shovel     |X|O|O|O|O|
poison     |O|_|_|O|_|
poker      |O|_|O|O|_|
gun        |O|O|O|X|O|
knife      |O|_|_|O|_|

No, we’re not going to fill in everything for you; but you’ve now seen all the kinds of reasoning you need. (This puzzle, at least so far, doesn’t require the trick we saw last time, assuming one of two possibilities is true and looking for a contradiction; you may need to refer back to that if you run across a dead-end in this or another puzzle.)

Even though we ran out of clues a long time ago, we can still get lots more information from the facts we already know, because of the way they were organized in the grid. Continuing in this fashion will allow you to complete the rest of the grid, and then you will have all the answers.

Let me know if you need more help.

Give it a try!

Five card collectors: full names, sports, numbers, containers

A similar question came in the next month, from a reader who tried to apply the same method to a more complicated problem (so that the two discussions were combined):

Hello Dr. Math. 

From the following clues, can you determine the full name of each friend (one surname is Milnes), the sport on which he or she reported, and the number of cards that he or she has collected, as well as the type of container in which each person stores his or her cards?

1. The one surnamed Frede isn't Sally.
2. Peter and the one surnamed Clemont both
   own an even number of cards; the person
   whose oral report was about hockey (who
   isn't Betty) and the one who stores cards
   in a shoe box both have an odd number of
   cards.
3. The one surnamed Daly owns 5 more cards
   than the one who collects basketball cards,
   who has acquired more cards than Andy.
4. The one who stores cards in a manila
   envelope didn't give a report on the game
   of soccer.
5. The one surnamed Rousse (who isn't Betty)
   has more cards than Sally, who owns more
   cards than the collector who stores cards
   in a drawer.
6. The person who stores cards in an album
   owns more cards than Javier, who has
   acquired five more cards than the one
   whose favorite sport is soccer.
7. The one who collects baseball cards has
   fewer than 235 cards.

I've mainly been trying to figure this out by trial and error. Some I've gotten from looking at the clues. I have a table so that way I can see what I am doing. Here is the information. 

First names: Peter, Andy, Sally, Betty, Javier
Surnames: Milnes, Rousse, Clemont, Daly, Frede
Sports: Baseball, hockey, soccer, basketball, football
Numbers: 214, 219, 224, 229, 235
Container: drawer, tupperware, manila envelope, shoebox, album

I tried to use your method to solve my problem, but it seems to me that it's a different kind of problem from the one shown above. For example: 

3. The one surnamed Daly owns 5 more cards
   than the one who collects basketball cards,
   who has acquired more cards than Andy.  

How could I put that on my grid? Can you help me get started?

Thanks for your time and consideration, Dr. Math!

This problem has five attributes, not just three! The student (whose first name is given only as D) has listed all the choices for each attribute from the problem; I initially thought the list of numbers was deduced from the clues, but since none of the clues give actual numbers, it must be that the list was actually given as part of the problem, not deduced from clues.

Doctor Code answered again, more briefly:

These can be tricky.  Let's look at clue #3:

3. The one surnamed Daly owns 5 more cards
   than the one who collects basketball cards,
   who has acquired more cards than Andy.

First you can get the following three facts from the clue:

  - Andy's last name is not Daly
  - Daly doesn't collect basketball cards
  - Andy doesn't collect basketball cards

Put O's in these spots on the grid.

This is not all the information in the clue. The parts about numbers of cards is a little different from the previous problem, so it requires a different approach.

Next you can order the three people mentioned in clue #3 by the number of cards they have:

    Daly > Basketball > Andy

Since Daly has more cards than at least two other people, he cannot have 214 or 219 cards. He must have at least 224 in order to have more cards than at least two other people. By this same logic, Andy cannot have 235 or 229 cards. Basketball cannot have 235 or 214 cards.

Finally, Daly has 5 more cards than Basketball, which means Daly cannot have 235 cards. If Daly had 235, then Basketball would have 230, but 230 is not one of the numbers available. Therefore, Daly must have either 229 or 224. Since Basketball has 5 less than Daly, Basketball must have either 224 or 219. Since Andy has less cards than Basketball, Andy must have either 219 or 214.

So now you've narrowed down Andy, Basketball, and Daly to two possibilities each for their number of cards. Clues 5 and 6 give you similar ordering relationships for the cards. Keep these three inequality sentences written down somewhere. After you make a first pass through all the clues, recording information as you go, you can discover more information just based on these three inequality sentences.

Write back if you need more help.

Here is how we might arrange the table, which covers all ten pairs of attributes:

            Surname      Sport     Container    Number
                                               2 2 2 2 2
                                               1 1 2 2 3
           C D F M R   BsBkF H S   A D E S T   4 9 4 9 5
           _ _ _ _ _   _ _ _ _ _   _ _ _ _ _   _ _ _ _ _
Andy      |_|_|_|_|_| |_|_|_|_|_| |_|_|_|_|_| |_|_|_|_|_|
Betty     |_|_|_|_|_| |_|_|_|_|_| |_|_|_|_|_| |_|_|_|_|_|
Javier    |_|_|_|_|_| |_|_|_|_|_| |_|_|_|_|_| |_|_|_|_|_|
Peter     |_|_|_|_|_| |_|_|_|_|_| |_|_|_|_|_| |_|_|_|_|_|
Sally     |_|_|_|_|_| |_|_|_|_|_| |_|_|_|_|_| |_|_|_|_|_|
                       _ _ _ _ _   _ _ _ _ _   _ _ _ _ _ 
Clemont               |_|_|_|_|_| |_|_|_|_|_| |_|_|_|_|_|
Daly                  |_|_|_|_|_| |_|_|_|_|_| |_|_|_|_|_|
Frede                 |_|_|_|_|_| |_|_|_|_|_| |_|_|_|_|_|
Milnes                |_|_|_|_|_| |_|_|_|_|_| |_|_|_|_|_|
Rousse                |_|_|_|_|_| |_|_|_|_|_| |_|_|_|_|_|
                                   _ _ _ _ _   _ _ _ _ _
Baseball                          |_|_|_|_|_| |_|_|_|_|_|
Basketball                        |_|_|_|_|_| |_|_|_|_|_|
Football                          |_|_|_|_|_| |_|_|_|_|_|
Hockey                            |_|_|_|_|_| |_|_|_|_|_|
Soccer                            |_|_|_|_|_| |_|_|_|_|_|
                                               _ _ _ _ _
Album                                         |_|_|_|_|_|
Drawer                                        |_|_|_|_|_|
Envelope                                      |_|_|_|_|_|
Shoebox                                       |_|_|_|_|_|
Tupperware                                    |_|_|_|_|_|

This is a much more challenging problem than the other! There is more to learn as you work on it.

I’ll have another example, with somewhat different tools, next time.

1 thought on “Logic Puzzles: Five Murders, Five Friends”

  1. Pingback: Logic Puzzles: Who Owns the Fish? – The Math Doctors

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.