Monday, February 13, 2017

My Last Adventure (Some Unusual Knights and Knaves Part IX)

My last adventure on this island during that particular visit was a curious one. I met a native who said, "This is not the first time I have said what I am now saying."

Was the native a knight or a knave?
(Source: To Mock a Mockingbird and Other Logic Puzzles: Including an Amazing Adventure in Combinatory Logic by Raymond Smullyan)

If the native was a knight, then he has said in the past "This is not the first time I have said what I am now saying" and because he is a knight, that is true. Then he has said the same thing at another, earlier time, and it was equally true then. This ultimately leads to infinite regress. I am not going to offer an opinion on the philosophical issues of infinity here but, on the assumption that knights and knaves are finite beings, the native was definitely a knave. (This is also the answer given in the end-of-chapter solutions, for essentially the same reason.)

The Sociologist (Some Unusual Knights and Knaves Part VIII)

On the next day, I met a sociologist who was visiting the island. He gave me the following report:

"I have interviewed all the natives of this island and I have observed a curious thing: For every native X, there is at least one native Y such that Y claims that X and Y are both knaves."

Does this report hold water?
(Source: To Mock a Mockingbird and Other Logic Puzzles: Including an Amazing Adventure in Combinatory Logic by Raymond Smullyan)

The report does not hold water.

If there is only one individual on the island, then X and Y must be the same person. A knight would not say X and Y are both knaves (i.e. he would not call himself a knave) and a knave would never say that any knave is in fact a knave.

If there are two or more individuals on the island, for any X, if X is a knave, there can be no other Y that would claim X and Y are both knaves. A knight would not claim they are both knaves, because that would be a lie. A knave cannot claim they are both knaves, because that would be the truth. If there at least two individuals on the island, and at least one is a knave, the report can't possibly hold water.

On the other hand, if there are two or more individuals on the island, for any X, if X is a knight, then there can be no other Y who would claim that both X and Y are knaves, for much the same reasons as before. If Y is a knight, then Y would obviously never say that X and Y are both knaves. And, while it is true that a knave Y would say of himself and a knight X that they are both knaves, reversing the values of X and Y would result in the predicament described in the previous paragraph.

Here is Smullyan's proof; it's shorter and I suspect it's essentially equivalent to mine but I don't fully understand it:
If the report is true, we get the following contradiction. For every X there is some Y who claims that X and Y are both knaves. Now, the only way that Y can claim that X and Y are both knaves is that Y is a knave and X is a knight. Therefore every inhabitant X of the island must be a knight. Yet for every inhabitant X there is at least one inhabitant Y who is a knave, since he claims that X and Y are both knaves. So there is at least one knave Y on the island. This contradicts the already proved fact that all the inhabitants are knights.

The Next Day (Some Unusual Knights and Knaves Part VII)

On the next day I was in a rather frivolous mood. I passed a native and asked him: "Do you ever answer no to questions?"

He answered me—that is, he said either yes or no—and then knew for sure whether he was a knight or a knave. Which was he?
(Source: To Mock a Mockingbird and Other Logic Puzzles: Including an Amazing Adventure in Combinatory Logic by Raymond Smullyan)

A "yes" answer can be made by either a knight or a knave. A knight can be taken at his word, and a knave can say "yes" but be full of crap. A "no" answer, however, decides the issue. A knight cannot answer "no" because, in so doing, he is in effect making his answer a lie. On the other hand, a knave who says "no" is making his answer a lie as well. But that's very much the point. The answer was "no" and he was a "knave".

Smullyan continues:
The above puzzle occurred to me as a result of a clever story told to me by the mathematician Stanisław Ulam. Ulam referred to it as a paradox. The story is a true one and refers to a certain past president of the United States.
On television Professor Ulam saw this president address the cabinet on his first day in office. He said to them, in a supercilious tone of voice: "You men are not all yes-men, are you?" They all solemnly replied: "Noooo!"

And so it seems that a person doesn't necessarily have to answer yes to be a yes-man! 1 am also reminded of a cartoon sent to me by one of my readers. It is a drawing of a tough-looking employer saying to his meek-looking employee: "I hate yes-men, Jenkins; don't you?"

The Next Day (Some Unusual Knights and Knaves Part VI)

On the next day I came across a native who said: "My father once said that he and I are different types, one a knight and one a knave."

Is it possible that his father really said that?
(Source: To Mock a Mockingbird and Other Logic Puzzles: Including an Amazing Adventure in Combinatory Logic by Raymond Smullyan)

If the native is a knight, then his claim that his father said the two are of different types is true. But if the father is a knight, the two are not of different types. And if the father is a knave, then his statement is true. If, on the other hand, the native in question is a knave, then his father did not in fact say that. In either case, it couldn't have happened.

My Second Day (Some Unusual Knights and Knaves Part V)

On the next day I came across a native who made a certain statement. I thought for a moment and said: "You know, if you hadn't made that statement, I could have believed it! Before you said it, I had no idea whether it was true or not, nor did I have any prior knowledge that you are a knave. But now that you have said it, I know that it must be false and that you are a knave."

Can you supply a statement that could fulfill those two conditions? Note: The statement "Two plus two is five" won't work; I would have already known that statement to be false before he made it.
(Source: To Mock a Mockingbird and Other Logic Puzzles: Including an Amazing Adventure in Combinatory Logic by Raymond Smullyan)

The solution I came up with, which is very similar to what Smullyan described one of his students coming up with in the solutions, is "I will not say anything to you". (The solution suggested was "I am mute".)

My First Adventure (Some Unusual Knights and Knaves Part IV)

Inspector Craig left the island shortly after winding up the case of Arthur York. Two days later, I came to this island looking for adventure.

On the first day I arrived, I met an inhabitant and asked him: "Are you a knight or a knave?" He angrily replied: "I refuse to tell you!" and walked away. That's the last I ever saw or heard of him.

Was he a knight or a knave?
(Source: To Mock a Mockingbird and Other Logic Puzzles: Including an Amazing Adventure in Combinatory Logic by Raymond Smullyan)

He refused to give an answer and then proceeded not to give an answer. He is a knight.

The Third Trial (Some Unusual Knights and Knaves Part III)

"Don't despair," said Craig to the chief of the island police, "we may find our man yet!"

Well, a third suspect was arrested and brought to trial. He brought with him his defense attorney, and the two made the following statements in court.

DEFENSE ATTORNEY: My client is indeed a knave, but he is not Arthur York.
DEFENDANT
: My attorney always tells the truth!
Is there enough evidence either to acquit or convict the defendant?
(Source: To Mock a Mockingbird and Other Logic Puzzles: Including an Amazing Adventure in Combinatory Logic by Raymond Smullyan)

If the defense attorney is a knight, then it is the case that the defendant is a knave. Then the defendant's claim that his attorney always tell the truth (i.e. is a knight) is false, which means that the defense attorney is actually a knave! There is a contradiction here and the defense attorney cannot be a knight.

When I initially tried to solved this, my reasoning was that the defense attorney could not be a knave either, and no verdict could be attained. This conclusion was based on the belief that, for the defense attorney to be a knave, both conjuncts of the statement "My client is indeed a knave, but he is not Arthur York" would have to be false. In other words, "My client is indeed a knave" and "He is not Arthur York" would both have to be false. This assumption would lead to another contradiction: "My client is indeed a knave" would mean that the defendant is actually a knight, which would in turn mean that the defense attorney is a knight.

But in Smullyan's knights and knaves puzzles, being a knave really has the weaker meaning that at least one of the conjuncts of an "and" statement—"but" is a form of "and"—is false, though not necessarily both. In this case, the first conjunct of his statement is true (i.e., the defendant is a knave) but the second must then be false. This means the defendant is in fact Arthur York.

The Second Trial (Some Unusual Knights and Knaves Part II)

Another suspect was arrested and brought to trial. Here is a transcript of the trial:

CRAIG: The last suspect was a queer bird; he actually claimed to be Arthur York! Did you ever claim to be Arthur York?
DEFENDANT: No.
CRAIG: Did you ever claim that you are not Arthur York?
DEFENDANT: Yes.

Craig's first guess was that the defendant was not Arthur York, but are there really sufficient grounds for acquitting him?
(Source: To Mock a Mockingbird and Other Logic Puzzles: Including an Amazing Adventure in Combinatory Logic by Raymond Smullyan)

If the defendant is a knight, then the issue of deciding whether he is Arthur York is as simple as taking his words at face value, which would mean he is not Arthur York. If, however, he is a knave, then he is lying about his claim that he never claimed to be Arthur York. This would mean that the defendant claimed to be Arthur York in the past but is lying. So he is not Arthur York. This impression is confirmed by the defendant's claim that he claimed he is not Arthur York in the past. If he is a knave, what that would really mean is that he did not ever claim he was Arthur York in the past. That's good for completing the case that the defendant is not Arthur York, because any claim by a knave defendant that he is not Arthur York would of course be false. Fortunately no such claim has been made and we can let this defendant off the hook for the unnamed crime York was accused of (although possibly not for perjury).

The First Trial (Some Unusual Knights and Knaves Part I)

Inspector Craig of Scotland Yard-of whom you will read much in this book-was called to the Island of Knights and Knaves to help find a criminal named Arthur York. What made the process difficult was that it was not known whether Arthur York was a knight or a knave.

One suspect was arrested and brought to trial. Inspector Craig was the presiding judge. Here is a transcript of the trial:

CRAIG: What do you know about Arthur York?
DEFENDANT: Arthur York once claimed that I was a knave.
CRAIG: Are you by any chance Arthur York?
DEFENDANT: Yes.

Is the defendant Arthur York?
(Source: To Mock a Mockingbird and Other Logic Puzzles: Including an Amazing Adventure in Combinatory Logic by Raymond Smullyan)

If the defendant is Arthur York, then, if he is a knight, he would not have claimed that he is a knave (even in the third person). If, on the other hand, he is a knave, then he would have not claimed this of himself either. It's not clear whether Arthur York is a knight or a knave, but in either case the defendant isn't Arthur York.

Sunday, February 12, 2017

Introduction to Some Unusual Knights and Knaves

My earlier puzzle books—What Is the Name of This Book?, The Lady or the Tiger?, and Alice in Puzzle-Land—are chock-full of puzzles about an island in which every inhabitant is either a knight or a knave, and knights make only true statements and knaves only false ones. These puzzles have proved popular, and I give some new ones in this chapter. First, however, we will consider five questions that will serve both as an introduction to knight-knave logic for those not familiar with it and as a brief refresher course for those who are. Answers are given following the fifth question.

Question 1: Is it possible for any inhabitant of this island to claim that he is a knave?

Question 2: Is it possible for an inhabitant of the island to claim that he and his brother are both knaves?

Question 3: Suppose an inhabitant A says about himself and his brother B: "At least one of us is a knave." What type is A and what type is B?

Question 4: Suppose A instead says: "Exactly one of us is a knave." What can be deduced about A and what can be deduced about B?

Question 5: Suppose A instead says: "My brother and I are the same type; we are either both knights or both knaves." What could then be deduced about A and B? Suppose A had instead said: "My brother and I are different types." What can then be deduced?

Answer 1: No; no inhabitant can claim to be a knave because no knight would lie and say he is a knave and no knave would truthfully admit to being a knave.

Answer 2: This question has provoked a good deal of controversy! Some claim that anyone who says that he and his brother are both knaves is certainly claiming that he is a knave, which is not possible, as we have seen in the answer to Question 1. Therefore, they conclude, no inhabitant can claim that he and his brother are both knaves.

This argument is wrong! Suppose an inhabitant A is a knave and his brother B is a knight. Then it is false that he and his brother are both knaves, hence he, as a knave, is certainly capable of making that false statement. Therefore it is possible for an inhabitant to claim that he and his brother are both knaves, but only if he is a knave and his brother is a knight.

This illustrates a curious principle about the logic of lying and truth-telling: Normally, if a truthful person claims that both of two statements are true, then he will certainly claim that each of the statements is true separately. But with a constant liar, the matter is different. Consider the following two statements: (1) My brother is a knave; (2) I am a knave. A knave could claim that (1) and (2) together are both true, provided his brother is actually a knight, but he cannot claim (1) and claim (2) separately, since he cannot claim (2). Again, a knave could say: "I am a knave and two plus two is five, " but he cannot separately claim: (1) "I am a knave"; (2) "Two plus two is five."

Answer 3: A says that, of A and B, at least one is a knave. If A were a knave, then it would be true that at least one of A and B is a knave and we would have a knave making a true statement, which is not possible. Therefore A must be a knight. Since he is a knight, his statement is true, hence at least one really is a knave. It is then B who must be the knave. So A is a knight and B is a knave.

Answer 4: A is saying that exactly one of the persons A and B is a knave. If A is a knight, his statement is true, exactly one is a knave, and so B is a knave. If A is a knave, his statement is false, hence B must again be a knave, because if B were a knight, then it would be true that exactly one is a knave! And so regardless of whether A is a knight or a knave, B is a knave. As for A, his type cannot be determined; he could be either a knight or a knave.

Answer 5: If B were a knave, no native would claim to be the same type as B, because that would be tantamount to claiming to be a knave. Therefore B must be a knight, since A did claim to be of the same type as B. As for A, he could be either a knight or a knave.

If A had instead said that he and B were different types, this would be equivalent to the statement "One of us is a knight and one of us is a knave," which in turn is the same as the statement "Exactly one of us is a knave." This is really the same as Question 4, and so the answer is that B is a knave and A is indeterminate.

Looked at another way, if B were a knight, then no inhabitant would claim to be a different type than B!

Now that the review is over, the fun will start!
(Source: To Mock a Mockingbird and Other Logic Puzzles: Including an Amazing Adventure in Combinatory Logic by Raymond Smullyan)

Saturday, February 11, 2017

What to Do in the Forest of Werewolves Part VII

Here is an elegantly simple one involving just two inhabitants, A and B. Just one of them is a werewolf. They make the following statements:
  1. The werewolf is a knight.
  2. The werewolf is a knave.
Which one would you select for your traveling companion?
(Source: What Is the Name of This Book? The Riddle of Dracula and Other Logical Puzzles by Raymond Smullyan)

If it is the case that A is the werewolf, then consider the two possibilities for him. If he is a knight, then the prior assumption checks out. If he is a knave, then, although this may sound a bit trivial, it is the case that the werewolf is a knave. But it still is possible for A to be the werewolf in either case.

Now, if it is the case that B is a werewolf, then consider the two possibilities for him. If B is a knight, then he would never say that he (the werewolf) is a knave. So he cannot be a knight. But he can't be a knave either because a knave would never report that he is a knave.

I don't believe it's possible to figure out who is a knight or a knave here, other than to say that if A is a knight, then B is a knave, and vice versa. Having said that, if not traveling with a werewolf is of the utmost importance, go with B.

What to Do in the Forest of Werewolves Part VI

In this problem we are given that there is exactly one werewolf and that he is a knight, and that the other two are knaves. Only one of them, B, makes a statement: "C is a werewolf."

Who is the werewolf?
(Source: What Is the Name of This Book? The Riddle of Dracula and Other Logical Puzzles by Raymond Smullyan)

If B is a knight, then C is the werewolf, and is a knight. But it was said that there is only one knight here. So B is actually a knave. This means C is not the werewolf. B can't be the werewolf, because he's a knave. That leaves guess who? A is the werewolf and a knight.

What to Do in the Forest of Werewolves Part V

In this problem we get the following two statements:
  1. At least one of the three of us is a knave.
  2. C is a werewolf.
Again, there is exactly one werewolf and he is a knight. Who is he?
(Source: What Is the Name of This Book? The Riddle of Dracula and Other Logical Puzzles by Raymond Smullyan)

Here again, A is necessarily a knight for the same reason as in the previous problem. The only difference here is that B is claiming C is a werewolf rather than a knight. But, as before, B can't be a knight because that would entail the whole lot being knights, which can't happen, because A is a knight and has said there is at least one knave. Again A is the only werewolf and a knight. (A little disappointing that this one is barely different from the last. Usually he did much better.)

What to Do in the Forest of Werewolves Part IV

This time, we get the following statements:
  1. At least one of the three of us is a knave.
  2. C is a knight.
Given that there is exactly one werewolf and that he is a knight, who is the werewolf?
(Source: What Is the Name of This Book? The Riddle of Dracula and Other Logical Puzzles by Raymond Smullyan)

Be careful here, the condition that the werewolf is a knight does not mean there are not one or two other knights here not so cursed.

Anyway, thinking along similar lines as in the last puzzle, consider whether A can actually be a knave. If he is a knave, then what he's saying is true, which is a contradiction, so A is in fact a knight. This means that there really is at least one knave in the lot.

Now on to B's claim. If B is a knight, then so is C. But we've already established that there is at least one knave here. So B is actually a knave and, on that account, so is C. A is the only knight and so is the werewolf.

What to Do in the Forest of Werewolves Part III

In this and the next two problems there are again three inhabitants A, B, C, each of whom is either a knight or a knave. However only two of them, A, B, make statements. But in these statements, the word "us" refers to the three people A, B, C—not to just A and B.

Suppose A, B make the following statements:
  1. At least one of the three of us is a knight.
  2. At least one of the three of us is a knave.
Given that at least one of them is a werewolf, and that none of them is both a knight and a werewolf, which ones are werewolves?
(Source: What Is the Name of This Book? The Riddle of Dracula and Other Logical Puzzles by Raymond Smullyan)

Thinking about this a little, I think it makes sense to fix attention first on B's claim and whether he can be a knave. If he is a knave then what he's saying is true, but knaves always lie. So B is necessarily a knight. Now we turn our attention to A. If he is a knave then there are in fact no knights among the whole lot of them. But it's already established that one is a knight. A is a knight too then. Because one of them has to be a werewolf, and any werewolves in this scenario can't be knights, C is a werewolf and a knave. A dangerous combination!

What to Do in the Forest of Werewolves Part II

Again, each of A, B, C is a knight or a knave and exactly one of them is a werewolf. They make the following statements:
  1. I am a werewolf.
  2. I am a werewolf.
  3. At most one of us is a knight.
Give a complete classification of A, B and C.
(Source: What Is the Name of This Book? The Riddle of Dracula and Other Logical Puzzles by Raymond Smullyan)

The same approach as before will be used. If A is the werewolf, then A is a knight, B is a knave and C cannot be classified. This should be familiar now. If C is a knight, then there are two knights, and so his statement false. If, however, he is a knave, then what he's saying is true. This rules out A being the werewolf. Virtually identical reasoning rules out B. This leaves only the possibility that C is the werewolf. Accordingly, A is a knave and so is B. C is the werewolf, but he is at least honest: if he were not a knight and instead a knave, there would be at least two knights and there are not. So he is a knight.

What to Do in the Forest of Werewolves Part I

You are interviewing three inhabitants, A, B, and C, and it is known that exactly one of them is a werewolf. They make the following statements:
  1. C is a werewolf.
  2. I am not a werewolf.
  3. At least two of us are knaves.
Our problem has two parts:
  1. Is the werewolf a knight or a knave?
  2. If you have to take one of them as a traveling companion, and it is more important that he not be a werewolf than that he not be a knave, which one would you pick?
(Source: What Is the Name of This Book? The Riddle of Dracula and Other Logical Puzzles by Raymond Smullyan)

The best way to approach this is to consider what it would mean for each of the three inhabitants to be a werewolf.

If A is a werewolf, then A is a knave and B is a knight. What about C? If C is a knight, then at least two of the three are knaves. But only one is a knave under these circumstances, so C can't be a knight. If C is a knave, however, then what he's saying is in fact true! C can be neither knight nor knave and so it's impossible that A is a werewolf.

Now we turn our attention to B. If B is a werewolf, then A is a knave and B is a knave. C can be a knight, because it's true that the other two are knaves.

But we're not finished yet! C could also be a werewolf. If so, then A is a knight, B is a knight, and C is a knave, because there aren't "at least two".

So, all told, it's entirely possible that either B or C is the werewolf. In either case, (a) can be answered now: the werewolf is a knave. Regarding (b): if it's of the utmost importance that one's traveling companion is not a werewolf, then go with A. He can't be the werewolf. Plus, assuming each possible state of affairs is equally likely, there's a two-thirds chance he's a knight!

Introduction to What to Do in the Forest of Werewolves

Suppose you are visiting a forest in which every inhabi­tant is either a knight or a knave. (We recall that knights always tell the truth and knaves always lie.) In addition, some of the inhabitants are werewolves and have the annoying habit of sometimes turning into wolves at night and devouring people. A werewolf can be either a knight or a knave.
(Source: What Is the Name of This Book? The Riddle of Dracula and Other Logical Puzzles by Raymond Smullyan)

Friday, February 10, 2017

RIP Raymond Smullyan

http://www.ibtimes.co.uk/mathematician-puzzle-maker-raymond-smullyan-dead-97-1605912

In pace requiescat.

I don't think I'd be very good at writing an obituary, but the next series of puzzles will be drawn from his work and dedicated to him.

No, ONE isn't 1!

\begin{align*}
TWO &= 2 \\
SEVEN &= 7 \\
EIGHT &= 8 \\
TEN &= 10 \\
TWENTY &= 20 \\
SEVENTY &= 70 \\
EIGHTY &= 80 \\
ONE &= ?
\end{align*}
(Source: Brilliant.org (problem page))

The letters are each variables that multiply together to create the end result. The key to starting to solve the problem is to notice in particular that, while $SEVEN$ is equal to seven, $SEVENTY$ is equal to 70. So $TY$ is equal to ten. Then notice dividing the equation $EIGHTY = 80$ by the other equation $EIGHT = 8$ results in $Y = 10$. This means that $T$ is equal to one. Accordingly, because $TEN = 10$, then $EN$ is equal to ten. This means in turn that $TWENTY = TW(10)(10) = 20$. $TW$ is equal to $\frac{1}{5}$. Then $TWO = \frac{1}{5}O = 2$. This means that $O$ is equal to ten. $NE$ has already been figured out, since it's the same as $EN$ due to commutativity. $ONE$ is then equal to 100.

Thursday, February 9, 2017

Whodunni's Dice

Grumpelina, the Great Whodunni's beautiful assistant, placed a blindfold over the eyes of the famous stage magician. A member of the audience then rolled three dice.

'Multiply the number on the first dice by 2 and add 5,' said Whodunni. 'Then multiply the result by 5 and add the number on the second dice. Finally, multiply the result by 10 and add the number on the third dice.'

As he spoke, Grumpelina chalked up the sums on a blackboard which was turned to face the audience so that Whodunni could not have seen it, even if the blindfold had been transparent.

'What do you get?' Whodunni asked.
'Seven hundred and sixty three,' said Grumpelina.

Whodunni made strange passes in the air. 'Then the dice were '

What? And how did he do it?
(Source: Professor Stewart's Hoard of Mathematical Treasures by Ian Stewart)

Let the faces shown on the cast dice be represented as $d_1$, $d_2$ and $d_3$, respectively, and let the results called for by Whodunni be represented as $r_1$, $r_2$ and $r_3$, respectively. Then:

\begin{align*}
r_1 &= 2 \times d_1 + 5 \\
r_2 &= 5 \times r_1 + d_2 \\
r_3 &= 10 \times r_2 + d_3 = 763
\end{align*}

An assumption we seem warranted in making here is that the faces on the dice all have integer values. I will also assume, provisionally, that they are of the standard cubic variety (so-called d6s). If that is so, then $r_2$ can only be an integer if $d_3$ is three. If so, then $r_2$ is 76. Then $5 \times r_1 + d_2 = 76$. There are two possible ways for this equation to be satisfied, at first glance. $d_2$ could be 6. Then $r_1$ would have to be 14. This creates a problem. $2 \times d_1 + 5 = 14$, only possible with a non-integer solution for $d_1$. The other possibility is that $d_2$ is one. In this case, $r_1$ is 15. This is actually viable, because it means $d_1$ is five.

All told, the values on the dice were five, one and three, respectively.

In my opinion, Stewart's approach to solving this is even more interesting. Note that the calculation produces the numbers:

$$
2a + 5 \\
5(2a + 5)b \  (\text{or} \ 10a + b + 25) \\
10(10a + b + 25) + c \ (\text{or} \ 100a + 10b + c + 250)
$$

Subtracting 250 from their total, already known to be 763, results in 513. Determining the faces of the dice is then simply a matter of knowing how place value functions.

The Schoolboy's Route

Each morning Boris walks to school. At one-fourth of the way he passes the machine and tractor station; at one-third of the way, the railroad station. At the machine and tractor station its clock shows 7:30, and at the railroad station its clock shows 7:35.

When does Boris leave his house, when does he reach school?
(Source: The Moscow Puzzles: 359 Mathematical Recreations by Boris A. Kodermsky, edited by Martin Gardner)

An unstated assumption here is that walking speed is constant. If so, then five minutes is how long it takes to go $\frac{1}{3} - \frac{1}{4}$, or $\frac{1}{12}$ of the way. Accordingly it takes an hour for his total journey. But when does he start? By the time he reaches the machine and tractor station, it is 7:30. One-fourth of his journey, or fifteen minutes, have elapsed at this point, so he starts at 7:15 and gets there at 8:15.

White, Black and Brown

Professor Merle White of the mathematics department, Professor Leslie Black of philosophy, and Jean Brown, a young stenographer who worked in the university's office of  admissions, were lunching together.

"Isn't it remarkable," observed the lady, "that our last names are Black, Brown and White and that one of us has black hair, one brown hair and one white."

"It is indeed," replied the person with black hair, "and have you noticed that not one of us has hair that matches his or her name?"

"By golly, you're right!" exclaimed Professor White.

If the lady's hair isn't brown, what is the color of Professor Black's hair?
(Source: My Best Mathematical and Logic Puzzles by Martin Gardner)

The solution to this in the back actually uses a surprising amount of unnecessary reasoning about the genders of the people involved. It is given that no one's hair matches their name, so Professor White doesn't have white hair. Professor White responds to the one with black hair, so, barring talking to oneself, Professor White doesn't have black hair either. This means Professor White has brown hair. Professor Black is then required to have white hair, which solves the problem. (But, for completion, Professor Brown can only have black hair.)

Wednesday, February 8, 2017

A New "Colored Hats" Problem

Three subjects—A, B, and C—were all perfect logicians. Each could instantly deduce all consequences of any set of premises. Also, each was aware that each of the others was a perfect logician. The three were shown seven stamps: two red ones, two yellow ones, and three green ones. They were then blindfolded, and a stamp was pasted on each of their foreheads; the remaining four stamps were placed in a drawer. When the blindfolds were removed, A was asked, "Do you know one color that you definitely do not have?" A replied, "No." Then B was asked the same question and replied, "No."

Is it possible, from this information, to deduce the color of A's stamp, or of B's, or of C's?
(Source: The Lady or the Tiger: And Other Logic Puzzles by Raymond Smullyan)

Well, to start with, it is not possible that both B and C have red or yellow stamps on their foreheads. If they did, then A would know that he does not have either a red or yellow stamp on his forehead. Now here's where things get tricky with meta-reasoning: it is not possible for C to have a red stamp on his forehead. Why not? Because, if C did have a red stamp, then B, having heard what A said, would know that he does not also have a red stamp on his forehead. The same goes for the color yellow. Therefore, C's stamp is green. (Nothing can be deduced about the color of the stamps of A and B.)

Eye to Eye

[Background: the great mathematical savant Beremiz Samir, having served the caliphate with great distinction, is offered any reward he wants by the caliph.  Beremiz asks for the hand of Sheik Iezid Abul Hamid's daughter in marriage. The caliph agrees, but only if Beremiz can solve the following puzzle.]

And so the caliph spoke: "I own five beautiful slave girls, recently purchased from a Mongol prince. Two of those young enchantresses have black eyes; the other three, blue eyes. The two with black eyes always give a truthful answer to any question, whereas the three with blue eyes are born liars and never answer with the truth. In a few moments, the five of them will be brought here, all of their faces covered by a heavy veil, which will make it impossible for you to see their faces. You must discover, with no room for error, which of them have black eyes and which blue eyes. You may question three of the five slaves, one question to each one. From the three answers, you must solve the problem and explain the precise reasoning that led you to your answer. Your questions should be quite simple ones, well within the compass of these slaves to answer."

Some moments later, watched curiously by everyone present, the five slave girls appeared in the reception hall, their faces covered with black veils, like phantoms of the desert.

"Here they are," said the emir somewhat proudly. "Two of them as I told you have black eyes and speak only the truth. The other three have blue eyes and always lie."

"What a scandal!” muttered the thin old man. “Imagine my bad luck! My uncle’s daughter has black eyes, very black—yet she lies all day long!"

His remark seemed to me out of order. It was a very serious moment, no time for jokes. Luckily, no one paid any attention to the nasty words of the impertinent old man. Beremiz realized that he had reached a decisive moment, perhaps the high point of his whole life. The problem that the caliph of Baghdad had presented him with was original and difficult and could be full of pitfalls. He was free to question three of the slave girls. But how would their replies indicate the color of their eyes? Which of them should he question? How would he know the eye colors of the two he could not question?

There was only one certainty, that the two with black eyes always spoke the truth and the other three invariably lied. But would that be enough? When Beremiz questioned them, the question had to be quite natural, well within the reach of the girl questioned. But how could he be sure of her reply, whether it was true or false? It was really very difficult indeed.

The five veiled slave girls lined up in the middle of the sumptuous hall in complete silence. The sheiks and viziers waited for the solution to this singular problem set by their king with a lively interest. The Man Who Counted approached the first slave girl on the right of the row, at the end, and asked her quietly, "What color are your eyes?"

The girl replied in a language that was apparently Chinese, a language that nobody present could understand. It made no sense to me. Hearing her, the caliph ordered that the other replies be in Arabic, simple and precise.

This unexpected setback made things more difficult for Beremiz. He had only two questions left, and the answer to his first question had been completely lost.

This did not seem to upset him, however, as he approached the second slave and asked her, "What was the reply that your companion just gave?"

The second slave answered, "She said, 'My eyes are blue.'"

That reply cleared up nothing. Had the second slave told the truth, or was she lying? And the first? Was that her real reply?

The third slave girl, in the center of the row, was questioned next by Beremiz. "What color are the eyes of those two girls I have just questioned?"

And the third girl, the last to be questioned, replied as follows: "The first girl has black eyes and the second blue eyes."
(Source: The Man Who Counted: A Collection of Mathematical Adventures by Júlio César de Mello e Souza)

How did he answer? I was able to figure out the answer before reading ahead, but the way I did it was to consider the implications of the third slave having black or blue eyes. In my opinion, Beremiz Samir's solution was even better. It hinges on the fact that all of the slaves can only ever report that they have black eyes: the black-eyed ones, because it is so, and the blue-eyed ones, because they always lie. This means the second slave is lying right off the bat. Because one thing the third slave said is true, so is the other. The first and third slaves have black eyes; the others, blue.

But, for the record, here's how it goes in the book:
Beremiz paused a moment and then calmly approached the throne, speaking as follows: "Lord of all believers, Shadow of Allah on earth, I have a solution to your problem, arrived at through strict logic. The first slave girl on the right has black eyes. The second has blue eyes. The third has black eyes, and the other two have blue eyes."

At this the five slave girls lifted their veils, uncovering smiling faces. Great sighs arose throughout the reception hall. Beremiz in his faultless intelligence had exactly determined the color of all their eyes.

"All praise to the Prophet!" cried the king. "This problem has been set to hundreds of wise men, poets, and scribes, and at last this modest Persian is the only one who has been able to solve it. How did you come by your answer? Show us how you came to be so certain of your solution."

The Man Who Counted gave the following explanation:

"When I asked the first question—what is the color of your eyes—I knew that the slave girl's answer had to be 'My eyes are black,' because if she had black eyes she would have to tell the truth, or if she had blue eyes, she would have to lie. So there could be only one reply, namely, 'My eyes are black.' I expected that answer; but when the girl replied to me in an unknown language, she helped me enormously. Claiming not to have understood, I asked the second slave girl, 'What was the reply your companion just gave?' and received the second answer—'She said: my eyes are blue.' That reply proved to me that the second girl was lying, since, as I have already shown, it could not have been the reply of the first girl. Consequently, if the second slave was lying, she had blue eyes. This was an important point, O King, in solving the problem. Of the five slave girls, there was at least one whom I had identified with mathematical certainty, namely, the second. She had lied, and so she had blue eyes."

"My third and last question I asked of the girl in the center of the row. 'What color are the eyes of those two girls I have just questioned?' She gave me the following reply: 'The first girl has black eyes and the second blue eyes.' Since I knew already that the second did have blue eyes, what conclusion was I to come to over the reply of the third girl? Very simple. The third girl was not lying, since she was confirming what I already knew, namely, that the second girl had blue eyes. Her reply also told me that the first slave girl had black eyes. Since the third girl was not lying, her words spoke the truth, and therefore she too had black eyes. From there, it was simple to deduce that the two other girls, by exclusion, had blue eyes."

Friday, February 3, 2017

Cyclic Equations

For an integer $n > 2$, we have real numbers $a_1, a_2, \cdots, a_n$ such that (here with $n > 4$ for clarity):

\begin{align*}
a_2 + a_3 + a_4 +\cdots + a_n &= a_1 \\
a_1 + a_3 + a_4 + \cdots + a_n &= a_2 \\
&\vdots \\
a_1 + a_2 + a_3 + \cdots + a_{n-1} &= a_n
\end{align*}

(In other words, $a_i = \Sigma_{\{j \mid 1 \le j \le n, i \ne j\}} a_j$)

What is the value of $a_1 + a_2 + a_3 + \cdots + a_n$?
(Source: Brilliant (problem page))

This one is as straightforward as adding all the equations together, and seeing what happens. The result will be the equation $(n - 1)(a_1 + a_2 + a_3 + \cdots + a_n) = a_1 + a_2 + a_3 + \cdots + a_n$. (Try it at $n=3$ and $n=4$ for simple concrete examples, if needed.) Whenever, as stated, $n > 2$, the sum of the variables can only ever be zero.