Showing posts with label logic. Show all posts
Showing posts with label logic. Show all posts

Thursday, February 16, 2017

More Man Who Counted (gaps and notes)

As previously mentioned, we have been reading The Man Who Counted. While the story is good and there are nice math puzzles, we've found some of our best conversations have come from errors or weaknesses in the book. Here are three examples:

How old was Diophantus?

In chapter 24, we encounter a puzzle to figure out how old Diophantus was when he died. In summary, the clues are:

  1. he was a child for 1/6 of his life
  2. he was an adolescent for 1/12 of his life. (J1: "what's that?" J0: "a teenager")
  3. childless marriage for 1/7 of his life
  4. Five more years passed, then had a child
  5. The child got to half its father's age, then died.
  6. Diophantus lived for four more years
Perhaps we are wrong about our interpretation of the clues, but we noticed two things:
(a) the answer is not a whole number of years.
(b) the answer given in the book doesn't fit the clues.

For the first part, it seems a natural assumption of these types of puzzles that we are only working with whole number years. Sometimes, this is an interesting assumption to directly challenge.
Here, since the clues involve a second person (Diophantus's child) we felt whole numbers were a strong assumption. Also, the name Diophantus, you know?

Each clue required some discussion for us to agree on the interpretation. The one that seems most open is the fifth clue. In particular, did the child live until its age was half of the age of its father at the time of birth or to the point that, contemporaneously, it was half its father's age?

For completeness, I'd note that neither interpretation matches the book's answer. The first interpretation does allow a whole number answer, but it doesn't give whole numbers for all the listed segments of Diophantus's life.

Just so you can check for yourself, the solution given in the book is 84 years old.

How do you fix it?
We discussed several possible fixes:

  • accept answers that aren't whole numbers or require whole number segments for each clue. This allows us to take the alternative interpretation of the fifth clue (though that still isn't satisfying) or to accept the clues and just take a new answer. This isn't satisfactory because... Diophantus.
  • Change clue 4 or clue 5 to match the book's answer. This approach seemed to fix the puzzle without distorting it or changing the mathematics required to analyze it.
  • Change clue 1, 2, or 3. While possible, these seemed to open the possibility of changing the character of the puzzle. Also, these fractions were plausible based on our own experience of human life spans.
Of course, an even more satisfying answer would be to introduce a further variable and make the puzzle into one that makes heavy(ier) use of the integer restriction.

Clever Suitors

In chapter 31, Beremiz is confronted by a nice logic puzzle. Three suitors are put to a test, each is blindfolded and has disc strapped to his back. The background of the discs: other than color, the discs are all identical, there are five to choose from, 2 black and 3 white.

The first suitor is allowed to see the colors of the discs on the backs of his two competitors, then required to identify the color of his own disc and explain his reasoning. He fails and is dismissed.

The second suitor is allowed to see the disc on the back of the third suitor, then required to identify the color of his own disc and explain his reasoning. He fails and is dismissed.

Finally, the third suitor is required to identify the color of his own disc and explain his reasoning.  He succeeds.

Weakness 1
As a logic puzzle, we enjoyed this. Our problems came from the context in the story. This challenge was set to the three suitors as a way of fairly judging between them by finding the most clever suitor. However, this process was clearly unfair. In fact, it is inherent in the solution that it was impossible for the first and second suitors to determine the color of their own discs.

This led to a nice discussion about who really held the power in this process: the person who structured the problem by deciding what color disc should be on which suitor and what order they would be allowed to give their answers.

Extensions:
  • consider all arrangements of discs. Are there any arrangements where none of the suitors can answer correctly?
  • What is the winning fraction for each suitor? If you were a suitor, would you prefer to answer first, second, or third?

Weakness 2
Our second objection was non-mathematical, but again related to the story context. The fundamental problem wasn't how to choose a suitor. The fundamental problem was how the king could remain peacefully friendly toward all the suitors' home nations through this process.

For this discussion, we went back to the story of Helen of Sparta, which we'd read a long time ago in the D'Aulaire's Book of Greek Myths. Of course, that also led to discussion of the division of the golden apples, another puzzle we all felt surely could have been solved more effectively with some mathematical reasoning...

The Last Matter of Love

The last puzzle of the book is in chapter 33. It is another logic puzzle, again intended to test the merit of a suitor in marriage. The test:

  • there are five people
  • two have black eyes and always tell the truth
  • three have blue eyes and always lie
  • the suitor is permitted to ask three of them, in turn, a "simple" question each.
  • the suitor must determine the eye color of all five people
As a logic puzzle, we readers get some extra information:
  1. The first person is asked: "what are the color of your eyes?" The answer is unintelligible.
  2. The second is asked: "What did the first person say?" The answer is "blue eyes."
  3. The third is asked: "What are the eye colors of the first and second people?" The answers are "the first has black eyes and the second has blue eyes."
Simple questions
Our first objection was the part about asking "simple" questions. Having developed our taste for these types of puzzles through the knights and knaves examples of Raymond Smullyan (RIP, we loved your work!!!), the third question really bothered us. If you're going to go that far, why not ask the third person for the color eyes of all five people?

Personally, I would prefer that the puzzle require us to ask each person a single yes/no question.

As an extension: can you solve the puzzle with that restriction? 

Getting lucky
Again, we felt that this puzzle didn't meet the requirements of the context: to prove the worthiness of the suitor. Putting aside the question of whether this is really an appropriate way to decide whether two people should be allowed to marry, the hero here got lucky.

Extension: what eye color for the third person would have caused the suitor to fail?
Extension: what answer from the third person would have caused the suitor to fail?
Extension: for what arrangement of eye colors would the questions asked by the suitor guarantee success?
Extension: what was the suitors' probability of success, given those were the three questions asked?

Waste
Our final objection was the simple waste in the first question. From a narrative perspective, this is justified and even seems made to serve the purposes of the suitor. However, it opens another idea:
can you solve the puzzle, regardless of eye color arrangement, with only two questions?

Feel free to test this with yes/no questions only or your own suitable definition of a "simple" question.

The power of...

As a final thought, let me say that I think errors and ambiguity in a text are a feature, not a bug. It is another great opportunity for us to emphasize that mathematics is about the power of reasoning, not the power of authority.

Thursday, December 17, 2015

Some easy logic grid puzzles

In our math games classes recently, we've been introducing more puzzles. One class of puzzle I loved as a kid is the logic grid. There are some nice websites that specialize in these puzzles, namely:

I wanted some easy puzzles to use as introduction and was surprised not to be able to find any two factor puzzles, so I went ahead and started creating some. Here are three, for your amusement. If you know a source of others, please let me know!







Some reasons why two dimensions aren't popular
I see two weaknesses of the small puzzles.

First, there is a strong temptation to make puzzles about people. That means names are one common dimension. If we restrict to two dimensions, then the puzzles are all of the form "match the people on this list with one of their attributes from this other list." That quickly feels repetitive.

I'm open to the idea that this is just my own weakness as a puzzle writer, maybe exacerbated by the fact that I've just started trying to write these. If so, then I should be able to create more interesting contexts over time. Puzzle 3 is in that spirit.

Second, structurally, 2 dimensional puzzles are missing some important and difficult inference rules. Let's use the terms (names and instruments) from my Puzzle 1 and add another dimension where the kids like different sports (football, tennis, volleyball, and biking). Taken from this paper, the key inference rules are:
  1. Related by elimination. For example, if we know that Aaron doesn't play violin, trumpet, or drums, then he must play piano.
  2. Not related by exclusion. For example, if the violin is played by Carly, the it isn't played by Aaron, Benjamin, or Diana
  3. Related by transitivity: No example from Puzzle 1. Using the extra dimension, if Benjamin plays violin and the violin player likes biking, then we can conclude Benjamin likes biking.
  4. Not related by transitivity: Again, our basic puzzles can't illustrate this. Illustrating with the extra dimensions, say Carly doesn't play piano and the piano player likes tennis, then Carly doesn't like tennis.

Empirically, the transitivity rules make puzzles much harder, partly because the grids make the other two rules visually clear.

Anyway, I'll test these out with the kids and report back.

Sunday, November 22, 2015

Love Letter (game review)

A very quick note on a fun game with some cool opportunities for practicing logical inferences and probability. Upfront, I want to say that this review is not sponsored or supported in any way. Indeed, you will see below that we managed to play the game without even using an official set of cards.

The game is Love Letter. It is a knock-out card game using a set of special cards where, mostly, you try to figure out what cards the other players have. Here are the cards; you can see each has a number in the upper left corner (a level) and a description of its action below the picture:


Each player has only one card in their hand, which they keep secret from the other players. On a turn, the active player draws a card, then chooses which of their two cards to play down, thereby activating that card's action. For example, if a player puts down a guard, they then choose another player and guess what card that player is holding.

There are only 16 cards in the deck: 5 guards, 2 each of Priests, Barons, Handmaids, and Princes, one King, one Countess, and one Princess. If, through game play, all but one player is eliminated, then that player gets a point for the round. If the deck of cards is exhausted first, then the player holding the highest level card wins that round.

Playing today with the two older J's, we simulated the deck with normal playing cards with the following mapping:

  • 4 aces and a joker in place of the Guards
  • two 2s in place of the Priests
  • two 3s for the Barons
  • two 4s for the Handmaids
  • two Jacks for the princes
  • one king for the King
  • one queen for the Princess
For the 6 and 8 year old, it only took one or two rounds for them to pick up the powers of the cards.

Here are some sample deduction scenarios that came up during play and surrounding discussion. I will leave them as exercises to you readers:

  1. You play a Priest against Player A and see she is holding a handmaid. On her next turn, she draws and plays a Guard. What card is she holding at the end of her turn?
  2. You are the first to lead the round, holding a Baron and draw a Guard. What should you play?
  3. What is the implication if a player has the King and Princess at the same time?
  4. Player A puts down the Baron and forces Player B to compare. B losses and puts down the countess, dropping out of the round. What card is player A holding?
  5. With two remaining players, you are holding a King and Guard. Which card should you play?

Overall, the game was a lot of fun, easy to pick up (even using surrogate cards), and led to some fun logic mini-puzzles. It also links readily to concepts around public, private, and asymmetric information which I'm sure we will be exploring as we play the game more.






Wednesday, July 29, 2015

ABCs of logic puzzles

who: J1
when: while on holiday from school

After a long gap, I had a chance to look at Tanya Khovanova's math blog again recently. She has a nice mix of questions/puzzles, some of which are beyond our kids right now while others are perfect. Yesterday, we talked about a pair of problems involving a trio of puzzling characters: Alice, Bob, and Carl.

My hidden number
In the first puzzle, Carl has a secret number and gives out some clues. This puzzle shares characteristics with the (recently) famous Cheryl's Birthday puzzle. In particular:

  1. There is some common information
  2. There is some private information that the characters in the story have, but we don't have
  3. The characters make comments about whether someone else can solve the puzzle
  4. Being told something you already seem to have known (e.g., "You don't know the answer") actually gives the character enough additional information

I like Tanya's puzzle more than CBP because it is more self-contained and also invites us to a bunch of (elementary) number theory observations in addition to working through the logic.

Here are some highlights of the discussion:

  • Realizing that there are some numbers where it is sufficient to see either the 10s or the 1s digit to reconstruct the whole number (given multiple of 7, less than 100, etc)
  • Realizing that there are some numbers where one person could know the answer, but the other doesn't and that it could be either the person with the tens or the ones digit.
  • Thinking about what it meant to Bob when Alice said that he didn't know the number.
  • Identifying related clusters of multiples of 7 (like {14, 84}, {21, 28, 91, 98}) that helps us see some (slightly) more subtle relationships between numbers we don't normally associate

Where's the party
In the prior puzzle, we could trust everything that Alice, Bob, and Carl said as being true. In our second challenge, where's the party, we now confront a problem where there is always something distorted in their comments.

Once again, we felt there were some parallels with some of the scenario's from Smullyan's Alice in Puzzle Land. You have to play with the statements you are given to extract the useful information.

The key issue in our discussion of this puzzle was the process of going back and forth between "true" numbers and numbers spoken by the characters. This led us to talk about functions, like Alice(t) is the number Alice will say when she is talking about true number t and the inverse functions. J1 called the function inverse operator Undo, so Undo(Bob)(Bob(t))=t and Bob(Undo(Bob)(s)) = s.

Suddenly, J1 had so many questions about these new objects, Alice(), Bob(), Carl(), and their Undo relatives:

  • When are they the same, i.e., Alice(t) = Bob(t)?
  • Which one is larger, for a given true number t?
  • Do we ever have Alice(t) = Undo(Alice)(t)?
  • etc, etc

This was an invitation to make some pictures, a simple graph of the three functions. Here is J1's and then the one we made together:



The pictures then gave us some new things to notice. For example:

  • Carl only says the largest number for a bounded region of true numbers
  • For any true number, Carl never says the smallest number

A call for puzzle extensions/mash-ups 
J1 asked something I wouldn't have considered on my own: are these the same Alice, Bob, and Carl in the two puzzles? If so, does something interesting happen if we combine the distortions of the second puzzle with the basic set-up from the first puzzle? What if Alice and Bob don't know Carl's constant?

Please go forth and consider this version, as well as create new ones of your own. If you need further inspiration, consider this mash-up Cheryl's sweets, from the fantastic Aperiodical crew.

Tuesday, June 16, 2015

Is John a liar? and other good puzzles

who: J1 and J2
what did we use: Smullyan's Alice in Puzzle Land and some online games
when: after dinner

This post is basically a thank-you to all the people who create wonderful books, puzzles, and games. Also, thanks to the people who spread the message by telling us about these resources. In this case, we're directly indebted to A O Fradkin, Annie at the Math Forum, Mike Lawler for these specific activities.

Alice in Puzzle Land

The title of this post comes from one of the opening puzzles in Smullyan's book of logic puzzles: Alice in Puzzle Land. Here's how it goes:
John, and his brother, have the peculiar characteristic that one always tells the truth and the other always lies. Unfortunately, we don't know which one tells the truth and we don't know which one is John. Gosh, we don't even know John's brother's name! What single yes/no question can you ask one of the brothers to figure out which is John? 
What if we want to figure out whether John always tells the truth or always lies, what single yes/no question can we ask one of the brothers to determine this?
To be honest, I didn't get the answer, but J2 managed to figure it out after they posed a bunch of questions and we worked through the possibilities together, example "what if the one we are asking is John and he tells the truth?"

The Js (mostly J1 and J2) have had a lot of fun discussing this particular challenge and have also really enjoyed the tart-ingredient thieves series. They are currently working on the "very complicated logic puzzle" at the end of the first chapter to determine whether the Gryphon or the Mock Turtle was the tart thief.

SolveMe Mobiles

Since we started teaching the math games class at school last year, I have had a strong bias away from on-line games and puzzles. Part of this is simply that we wouldn't be able to use these puzzles in the class, but also because I wanted to help parents see that they don't need any special tools to help their kids have deep mathematical experiences.

Anyway, the SolveMe Mobiles and Game About Squares (below)  helped me recognize and reject this bias!

The mobile puzzles are from EDC, a group with which I am not affiliated, but which I hold in high regard. Each puzzle gives you a balanced mobile that, secretly, codes equations to solve for the weights of the various shapes. J2 (5yrs old) has especially enjoyed this and has just finished puzzle 51:

Even J3 (3yrs old) has gotten something out of this puzzle. She was looking at the screen and we (J0, J1, J2) asked: what do you see, what do you notice, what do you wonder (not all at once.) She talked about shapes, she talked about how many, she asked questions about what different things meant, she tested putting numbers into the blanks.

Game About Squares

Another cool puzzle: Game About Squares. I don't know who to thank for creating this and making it freely available, but it was part of a really nice Notice and Wonder post by Annie which is, itself, great and you should go read it. In the spirit of the game, I'm not really going to tell you much about it, just go play!