Wednesday, October 4, 2017

Six Languages

At a recent international conference English was the principal language spoken, but interpreters were also present who could, if required, translate what was said into French, German, Dutch, Spanish, Arabic, and Turkish. Mr. Polyglot, of the Foreign Office, went to the trouble of engaging  interpreters whose surnames corresponded to these six foreign tongues. Each of his six interpreters spoke two of the six foreign languages; no two of them spoke the same two languages; each of the six languages was spoken by just two of them. And none of them spoke the language of which he is the namesake.

Mr. Spanish, for example, could speak Dutch and German, while one of his colleagues (his brother-in-law) spoke Dutch and Arabic. Mr. French and Mr. Dutch, between them, spoke all four of the languages of which neither is the namesake. Of the two languages spoken by Mr. Dutch, both the namesakes spoke French.

Neither of the German-speaking interpreters had any knowledge of Arabic.

What two languages were offered by Mr. Turkish?
(Source: My Best Puzzles in Logic and Reasoning by Hubert "Caliban" Phillips)

An initial tabulation shows everything given:

French German Dutch Spanish Arabic Turkish
Mr. French
Mr. German
Mr. Dutch
Mr. Spanish
Mr. Arabic
Mr. Turkish

The most productive thing to do next is to focus in on the proposition: "Of the two languages spoken by Mr. Dutch, both the namesakes spoke French." Only three of the translators can possibly speak French. Of them, there are three pairs:
  1. Mr. German and Mr. Arabic
  2. Mr. German and Mr. Turkish
  3. Mr. Arabic and Mr. Turkish
The first possibility is excluded by virtue of the fact that none of the two German interpreters speaks Arabic. But consider what happens when Mr. Dutch speaks German and Turkish and consequently also when Mr. German and Mr. Turkish both speak French:

French German Dutch Spanish Arabic Turkish
Mr. French
Mr. German
Mr. Dutch
Mr. Spanish
Mr. Arabic
Mr. Turkish

It was said that somebody has got to speak both Dutch and Arabic. Obviously, because of the name, it can't be Mr. Arabic. It can't be Mr. Turkish either, because one of his two slots is already taken up by French. That leaves Mr. German:

French German Dutch Spanish Arabic Turkish
Mr. French
Mr. German
Mr. Dutch
Mr. Spanish
Mr. Arabic
Mr. Turkish

But now Mr. German speaks three languages, which was stipulated not to be possible. The only remaining possibility of the three named earlier is that Mr. Dutch speaks Arabic and Turkish and consequently that Mr. Arabic and Mr. Turkish both speak French:

French German Dutch Spanish Arabic Turkish
Mr. French
Mr. German




Mr. Dutch
Mr. Spanish
Mr. Arabic
Mr. Turkish

It was stated that one of the interpreters speaks both Dutch and Arabic. It can't be Mr. Arabic for the obvious reason of his name. Nor can it be Mr. Turkish because one of his two slots is already taken up by French. The others were ruled out at the outset. That leaves only Mr. German:

French German Dutch Spanish Arabic Turkish
Mr. French
Mr. German
Mr. Dutch
Mr. Spanish
Mr. Arabic
Mr. Turkish

It was also stated that "Mr. French and Mr. Dutch, between them, spoke all four of the languages of which neither is the namesake.". This means that Mr. French speaks German and Spanish and, with this information, the last cells can be filled in:

French German Dutch Spanish Arabic Turkish
Mr. French
Mr. German
Mr. Dutch
Mr. Spanish
Mr. Arabic
Mr. Turkish

Final answer: Mr. Turkish speaks French and Spanish.

Friday, August 11, 2017

Not Remarkably Rich

Annette, Bernice, and Claudia are three remarkable women, each having some remarkable characteristics.
  1. Just two are remarkably intelligent, just two are remarkably beautiful, just two are remarkably artistic, and just two are remarkably rich.
  2. Each has no more than three remarkable characteristics.
  3. Of Annette it is true that:
    if she is remarkably intelligent, she is remarkably rich.
  4. Of Bernice and Claudia it is true that:
    if she is remarkably beautiful, she is remarkably artistic.
  5. Of Annette and Claudia it is true that:
    if she is remarkably rich, she is remarkably artistic.
Who is not remarkably rich?
(Source: Test Your Logic: 50 Puzzles in Deductive Reasoning by George J. Summers)

This looks pretty difficult because, in themselves, implications with false antecedents don't tell us anything about the truth of their consequents. This means, for example, that if Annette is not remarkably intelligent, whether or not she is remarkably rich is still up in the air. Fortunately, there really is enough structure here to determine the truth. One can start with the assumption that Annette is remarkably intelligent. If she is remarkably intelligent then she is also remarkably rich. If she is remarkably rich, then she is also remarkably artistic. Additionally, because two of the women have to be remarkably beautiful, and none of them have more than three remarkable traits, the two remarkably beautiful women must be Bernice and Claudia. This implies in turn that they are both remarkably artistic:

Intelligent Beautiful Artistic Rich
Annette
Bernice
Claudia

Uh-oh! We already have a problem. Fortunately, the problem stems entirely from the single assumption that Annette is remarkably intelligent; nothing further needed to be added and so this assumption can in no sense be seen as "protected", which is a good thing, because we already have some solid truth about what is the case: Annette is not remarkably intelligent and, because two of the women must be remarkably intelligent, Bernice and Claudia are. All further calculations must then start with these facts:

Intelligent Beautiful Artistic Rich
Annette

Bernice

Claudia


After I reached this point, I had to pause for a while to figure out my next step. It turned out that it was fruitful to assume that Annette is remarkably rich, which in turn implied that she is remarkably artistic:

Intelligent Beautiful Artistic Rich
Annette
Bernice

Claudia


This is a good assumption to try because it means that exactly one of Bernice and Claudia can (and must) be remarkably beautiful, but not both, because remarkable beauty in either also implies remarkable artistry for the same woman, and that would leave us with three remarkably artistic women, which is a no-no. Moreover, because only one of Bernice and Claudia can be remarkably beautiful, this assumption also means that Annette has to pick up the slack for the remaining slot, which may as well be added now:

Intelligent Beautiful Artistic Rich
Annette
Bernice

Claudia


Of Bernice and Claudia, which is remarkably beautiful? What if it's Bernice? If Bernice is remarkably beautiful, then she is remarkably artistic. This confers three remarkable qualities on Bernice and so she can't be remarkably rich. This means Claudia must be remarkably rich and, if Claudia is remarkably rich, then she is also remarkably artistic:

Intelligent Beautiful Artistic Rich
Annette
Bernice
Claudia

Déjà vu! We have a problem again. As before, all three women are now remarkably artistic, which is not possible. This means that, under the current assumption, Claudia must be remarkably beautiful. Can it work or do we have to go back to the drawing board? If Claudia is remarkably beautiful, then she is also remarkably artistic. That means Claudia now has three remarkable traits and cannot have a fourth of being remarkably rich. Bernice must then be remarkably rich and here is our completed tableau:

Intelligent Beautiful Artistic Rich
Annette
Bernice
Claudia

This tableau indeed fulfills all the criteria set out in the beginning. Exactly two of the women have each of the four traits and none has more than three. Remembering that only implications with true antecedents need to be checked, it is equally true that, if Claudia is remarkably beautiful, she is remarkably artistic and that, if Annette is remarkably rich, she is remarkably artistic. Which leaves Claudia without remarkable wealth, but I suppose if she really wanted it she could go into consulting or modeling or the like with her other assets.

Final answer: Claudia is not remarkably rich.

Tuesday, July 25, 2017

De Morgan and Another

Augustus De Morgan, the mathematician who died in 1871, used to boast that he was $x$ years old in the year $x^2$. Jasper Jenkins [possibly not a real person], wishing to improve on this, told me in 1925 that he was $a^2 + b^2$ in $a^4 + b^4$; that he was $2m$ in the year $2m^2$; and that he was $3n$ years old in the year $3n^4$. Can you give the years in which De Morgan and Jenkins were respectively born?
(Source: 536 Curious Problems and Puzzles by Henry Ernest Dudeney)

Squaring away the year of birth for De Morgan is pretty easy. The maximum value possible for $x$ is the floor of the square root of 1871, which is 43. 43 squared is 1849, which seems like a reasonable value. This would mean that De Morgan was born in 1806, which is correct.

The second part seems harder because it contains information that is extraneous to getting the solution (though I suppose one might consider the extra statements "bonus rounds"). But really all that one need focus on is the last statement, that he was $3n$ years old in the year $3n^4$. In other words:

\[ y + 3n = 3n^4 \]

Or:

\[ y = 3n(n^3 - 1) \]

Where $y$ is the year of his birth. This one is the easiest to work with because there is only one variable and the cubic term blows up quickly, meaning only a few values of $n$ need to be tried. Reformulating a little, one has to try different values of the function:

\[ y(n) = 3n(n^3 - 1) \]

Starting at zero, these are:

\begin{align*}
y(0) &= 0 \\
y(1) &= 0 \\
y(2) &= 42 \\
y(3) &= 234 \\
y(4) &= 756 \\
y(5) &= 1860 \\
y(6) &= 3870
\end{align*}

Like I said, the cubic term has let us dash through Antiquity, jump over the Early Middle Ages and land right in the Victorian era before going almost two millennia into the future. (By comparison, the naive guess-and-check method used here, but with the second statement that involves only a squared term, requires thirty-two iterations, starting from zero, to get the right answer.) 1860 is indeed the right answer and it can be verified by noting that, in this instance, the third statement means that he was 15 ($3n$) in 1875 ($3n^4$).

Final answer: De Morgan was born in 1806; Jenkins, in 1860.

Wednesday, July 12, 2017

The Logic Question Almost Everyone Gets Wrong

Jack is looking at Anne, but Anne is looking at George. Jack is married, but George is not. Is a married person looking at an unmarried person? [Possible answers: yes, no, cannot be determined]
(Source: an article in The Guardian by Alex Bellos)

This is the sort of question like the one about the cost of a bat and a ball where a reflexive answer will tend to be wrong. Because Anne's marital status has not been given upfront, as it has with Jack and George, one might immediately suspect that it cannot be determined. But consider that "being married" is an obviously binary predicate. So look at both possibilities: if Anne is married, then a married person (Anne) is looking at an unmarried one (George) and if Anne is unmarried then a married person (Jack) is still nonetheless looking at an unmarried person (Anne). Anne's marital status is irrelevant, so the answer is yes.

Wednesday, June 21, 2017

Will You Crack the Code?


(Source: all over the place; no idea about exact origin)

First, note that an implicit assumption in the problem is that no digits will be repeated in the solution. Then start with the first triplet, 682. One (and presumably only one) digit is correct and well-placed. It can't be six because then the description of the second triplet could not be true. Nor can it be eight, because the fourth triple, 738, is described as having nothing correct. This means that two is correct and in the right place.

Next, focus on the last two triplets. The "intersection" of the two, as it were, is seven and eight, that is, the two digits they have in common. Because everything is wrong in the fourth triplet, this means that the one correct, but wrongly placed digit is zero.

It is already known that the zero can't occupy the third position of the triplet, because two already has that. Additionally, the third triplet and its description tell us the middle position cannot be occupied by zero, leaving us with 0-2. The only task remaining is to find out the middle digit.

All but two candidates can be ruled out. Zero and two have already been used up. Three, seven and eight are explicitly ruled out. Six was implicitly ruled out in the first paragraph of this solution. That leaves one and four. If the missing digit is one, then the description of the second triplet is false. All that leaves is four.

Final answer: 042. (Don't panic?)

Sunday, May 21, 2017

Regex Crossword

I'm going to phone this one in, sort of, because it's an entire site of puzzles. Regex Crossword is a twist on the traditional crossword concept. In each cell you have to enter in a character that satisfies two or more regular expressions that apply to the cell in question. They start out really trivial but start to get very difficult later on. This is the last one I solved and holy shit was it ever tough:

I'm hooked. Go check these out.

Thursday, May 18, 2017

The Merchants and the Coin Purse

Three merchants saw in the road a purse [containing money].
One said, "If I secure this purse, I shall become twice as rich as both of you together."
Then the second said, "I shall become three times as rich."
Then the third said, "I shall become five times as rich."
What is the value of the money in the purse, as also the money on hand [with each of the three merchants]?
(Source: The Penguin Book of Curious and Interesting Puzzles by David Wells, this puzzle by way of the Bakhshali manuscript)

Let $p$ be the value of the contents of the purse and $m_1$, $m_2$ and $m_3$ be the values of the cash on hand held by the first, second and third merchants, respectively. If you read the problem right, this problem becomes a system of linear equations:

\begin{align*}
p + m_1 &= 2(m_2 + m_3) \\
p + m_2 &= 3(m_1 + m_3) \\
p + m_3 &= 5(m_2 + m_3)
\end{align*}

You may notice that there are four unknowns and only three equations, making the system underdetermined. (But that's just as well given that my knowledge of medieval Indian currency is effectively nonexistent.) That being said, to the extent that it can be solved—I did so in Maxima—the answer is $p = 3$, $m_1 = \frac{r_1}{5}$, $m_2 = \frac{3 r_1}{5}$, $m_3 = r_1$, where $r_1$ is effectively an arbitrary constant. But if we hone in on the solution that has the smallest values possible without allowing fractional coins, then the merchants, in order, hold one, three and five coins of equal value, respectively, and the purse contains 15 coins of that value. This means, for example, that by securing the purse, the first merchant would then hold 16 coins, twice as many as three held by the second and the five held by the third added together.

Extracting the Cherry

This puzzle is a golden oldie, with a simple but elusive answer.

The cocktail cherry is inside the glass, which is formed from four matches. Your task is to move at most two of the matches, so that the cherry is then outside the glass. You can turn the glass sideways or upside down if you wish, but the shape must remain the same.

Move two matches to extract the cherry.
(Source: Professor Stewart's Cabinet of Mathematical Curiosities by Ian Stewart)

The solution I came up with was to shift the horizontal match far enough to the right that its non-flammable end touches that of the lower vertical match and then take the left vertical match at the top and set it perpendicular to the flammable end of the horizontal match, so that it forms a new "side" of the glass. (Of course this process can also by started by shifting the horizontal match to the left and the answer will be symmetrical to the one obtained doing things how I did them.)

If that description was confusing—I wouldn't blame you for finding it thus—here's how it's portrayed in the solutions:

Wednesday, April 19, 2017

Hitler and Goering

Add Hitler to Goering and get—what? Letters substitute for digits in the sum below. The same letter stands for the same digit wherever it appears, and different letters stand for different digits.
The slightly inappropriate addition puzzle
Find the digits the letters represent.
(Source: Brain Puzzler's Delight by E.R. Emmet)

The key to getting started is focusing on the leftmost column, where the result of the addition is an H. This can only be a one carried over from the column to the right, so H is equal to one. Then we turn our attention to second leftmost column. Recalling that this column carries over into the last, the only possibility with only one number in the column is for G to be nine with a carryover from the third leftmost column, adding to ten, making T zero. In turn, that carryover from the third leftmost column is only possible if—remembering that each letter stands for a different digit—there was a carryover from the fourth leftmost column and if O is equal to eight. Four letters are already knocked out!

Now look at the rightmost column. This contains two known columns and one unknown that can be solved. G (nine) adds with R, resulting in H (one) and a carry digit, meaning that G plus R equals 11. This means that R is equal to two. The middle column that contains R can then be figured out. T (zero) adds with R (two), resulting in L. Again, because each of the letters stands for a different digit, the only way this is possible is if there was a carryover from the column to the right, with the result that L is equal to three.

The last three letters fall into place pretty quickly now. The least significant digit of L (three) plus I is H (one), meaning that they added up to 11. Eight has already been used up by O, so I is equal to seven, and there was a carryover from the column to the right. In turn, the least significant digit of I (seven) plus E is L (three), meaning they added up to 13, which is only possible if E is equal to six. Finally, the least significant digit of E (six) plus N is H (one) again, meaning they added up to 11. Recall that there is a carry digit from the rightmost column, so N is equal to four.

Final answer: 1,170,362 plus 9,862,749 equals 10,033,111.

Carnival Dice Game

The following dice game is very popular at fairs and carnivals, but since two persons seldom agree on the chances of a player winning, I offer it as an elementary problem in the theory of probability.

On the counter are six squares marked 1, 2, 3, 4, 5, 6. Players are invited to place as much money as they wish on any one square. Three dice are then thrown. If your number appears on one die only, you get your money back plus the same amount. If two dice show your number, you get your money back plus twice the amount you placed on the square. If your number appears on all three dice, you get your money back plus three times the amount. Of course if the number is not on any of the dice, the operator gets your money.

To make this clearer with an example, suppose that you bet $1 on No. 6. If one die shows a 6, you get your dollar back plus another dollar. If two dice show 6, you get back your dollar plus two dollars. If three dice show 6, you get your dollar back plus three dollars.

A player might reason: the chance of my number showing on one die is 1/6, but since there are three dice, the chances must be 3/6 or 1/2, therefore the game is a fair one. Of course this is the way the operator of the game wants everyone to reason, for it is quite fallacious.

Is the game favorable to the operator or the player, and in either case, just how favorable is it?
(Source: Mathematical Puzzles of Sam Loyd, Volume 1, edited by Martin Gardner)

This is an example of the binomial distribution in action. The probability that exactly one die comes up with the chosen number is $\binom 31 \left(\frac{1}{6}\right)^1 \left(\frac{5}{6}\right)^2$ or about 0.347. Computed in much the same way, the probabilities that exactly two or three die come up with the chosen number are, respectively, about 0.069 and 0.005. One notices there is actually a more or less geometric decay in the probabilities of these latter outcomes, and that should be seen as foreshadowing. The probability of none of the dice coming up with the chosen number is then one minus the sum of the three other probabilities, or about 0.579. The expected value of the game is then about $0.579 \times -1 + 0.347 \times 1 + 0.069 \times 2 + 0.005 \times 3$ or a little more than negative 8¢. The game is favorable to the operator, but only by a bit. This is also how the standard game of craps goes, although the edge in favor of the house is even smaller, a bit more than 1¢. Perhaps this can help explain why craps remains popular while—to my knowledge—this game is no longer played at carnivals. (Samuel Loyd lived from 1841 to 1911.)

Tuesday, April 11, 2017

Have Your Cake and Eat It Too

Classic puzzles are fun to revisit now and then, especially if there's a new twist.

In this puzzle, see if you can be as successful as John in retrieving water for his mother. The new twist? The buckets are different sizes.

John's mother told him to go to the river and bring back exactly 9 gallons of water in one trip. She gave him a six-gallon bucket and a five-gallon bucket to complete his task. Of course, John's mother told him she'd bake his favorite cake if he came back with the 9 gallons.

John had his cake and ate it, too. Can you?
(Source: The Big Book of Mind-Bending Puzzles by Terry Stickels)

John took the following steps:
  1. He filled the five-gallon bucket.
  2. He emptied the five-gallon bucket into the six-gallon bucket.
  3. He filled the five-gallon bucket again.
  4. He topped off the six-gallon bucket with the five-gallon bucket, leaving four gallons in the latter.
  5. He emptied the six-gallon bucket back into the river (or on the ground, whatever you like).
  6. He emptied the five-gallon bucket into the six-gallon bucket which, per step four, left four gallons of water in the latter.
  7. He filled the five-gallon bucket.
  8. Then he went home with exactly nine gallons.
Given that, at this point, the six- and five-gallon bucket respectively weighed about 33 and 42 lbs., he may have worked up quite an appetite by the time he got home.

Thursday, March 30, 2017

Beef and Sausages

"A neighbour of mine," said Aunt Jane, "bought a certain quantity of beef at two shillings a pound [i.e. at 24 pence a pound], and the same quantity of sausages at eighteenpence a pound. I pointed out to her that if she had divided the same money equally between beef and sausages she would have gained two pounds in the total weight. Can you tell me exactly how much she spent?"

"Of course, it is no business of mine," said Mrs. Sunniborne; "but a lady who could pay such prices must be somewhat inexperienced in domestic economy."

"I quite agree, my dear," Aunt Jane replied, "but you see that is not the precise point under discussion, any more than the name and morals of the tradesman."
(Source: Amusements in Mathematics by Henry Ernest Dudeney)

(This background information on currency may be useful.) 

The key here is to focus on a variable, let's call it $b$ (for budget, denominated in pence) and then relate that to the amounts of each product bought. It should be clear that, if she had bought one pound of beef and another of sausages, she would have spent a total of 3s.6d. (or 42 pence). If it had been two pounds of each, she would have spent 7s. even (or 84 pence) and so on.

It is also important to note that the amount of beef bought is equal to $b \times \frac{24}{42} \times \frac{1}{24}$, or just $\frac{b}{42}$. This means to say that the amount of beef bought is equal to the fraction of the budget spent on beef, divided by the price per pound. Similarly, the amount of sausages bought is also $\frac{b}{42}$. Therefore the total amount of pounds of meat bought all told is $\frac{b}{21}$.

If, on the other hand, the neighbor had spent an equal amount of her budget on both of the two foodstuffs, then the amount of beef bought would have been $b \times \frac{1}{2} \times \frac{1}{24}$ and, of sausages, $b \times \frac{1}{2} \times \frac{1}{18}$. All that remains now is to add two to the poundage of the items that she did in fact buy and equate it with the poundage that she might have bought as described here. Simplifying a bit:

\[ \frac{b}{21} + 2 = \frac{b}{2} \times \left(\frac{1}{24} + \frac{1}{18}\right) \]

Solving for $b$ reveals that it is equal to £8.8s. (or 2016 pence). Because the total poundage of meat bought is equal to the budget divided by 21, she bought 96 total, or 48 of each. Had she spent equal amounts on each of the two foodstuffs she would have bought 42 pounds of beef and 56 of sausages for a total of 98.

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.

Sunday, January 29, 2017

What is Each Man's Artistic Field?

Boronoff, Pavlow, Revitsky, and Sukarek are four talented creative artists, one a dancer, one a painter, one a singer, and one a writer (though not necessarily respectively).
  1. Boronoff and Revitsky were in the audience the night the singer made his debut on the concert stage.
  2. Both Pavlow and the writer have sat for portraits by the painter.
  3. The writer, whose biography of Sukarek was a best-seller, is planning to write a biography of Boronoff.
  4. Boronoff has never heard of Revitsky.
What is each man's artistic field?
(Source: 101 Puzzles in Thought and Logic by Clarence Raymond Wylie, Jr.)

Let's take stock of the available facts one by one and rule out what is impossible in a table.

"Boronoff and Revitsky were in the audience the night the singer made his debut on the concert stage" means that neither Boronoff nor Revitsky are the singer:

Dancer Painter Singer Writer
Boronoff
Pavlow
Revitsky
Sukarek

"Both Pavlow and the writer have sat for portraits by the painter" means that Pavlow is not the painter. It also means that he is not the writer:

Dancer Painter Singer Writer
Boronoff
Pavlow
Revitsky
Sukarek

"The writer, whose biography of Sukarek was a best-seller, is planning to write a biography of Boronoff" means that neither Sukarek nor Boronoff are the writer (on the assumption that neither biography is an autobiography, which turns out to be justified later):

Dancer Painter Singer Writer
Boronoff
Pavlow
Revitsky
Sukarek

The meaning of the fourth fact will come up shortly, but notice that everyone but Revitsky has been ruled out as the writer, making him the writer and excluding all other possibilities:

Dancer Painter Singer Writer
Boronoff
Pavlow
Revitsky
Sukarek

Now we can come to the significance of "Boronoff has never heard of Revitsky". Initially, this confused me. The trick is to realize that this interacts with the second fact: "both Pavlow and the writer have sat for portraits by the painter". In this context, "sitting for a portrait" means that the painter has "heard of" the subjects of his paintings, something that doesn't seem to be the case necessarily. But, taking this into account, this means that Boronoff cannot be the painter, because the writer (i.e. Revitsky) has been a subject of the painter. This simultaneously entails that Boronoff is the dancer and excludes that field for everyone else:

Dancer Painter Singer Writer
Boronoff
Pavlow
Revitsky
Sukarek

Boronoff's field being nailed down then means that Pavlow is the singer and excludes this for the only remaining individual for whom this possibility has not already been ruled out (Sukarek):

Dancer Painter Singer Writer
Boronoff
Pavlow
Revitsky
Sukarek

The only remaining possibility is for Sukarek to be the painter, completing the table:


Dancer Painter Singer Writer
Boronoff
Pavlow
Revitsky
Sukarek