# Lewis Carroll's Logic Problem: what do you know about great-grandsons?

This is from "Symbolic Logic, part 1 and part 2", by Lewis Carroll, edited by W.W. Bartley (1977), page 362:

1. A man can always master his father;

2. An inferior of a man's uncle owes that man money;

3. The father of an enemy of a friend of a man owes that man nothing;

4. A man is always persecuted by his son's creditors;

5. An inferior of the master of a man's son is senior to that man;

6. A grandson of a man's junior is not his nephew;

7. A servant of an inferior of a friend of a man's enemy is never persecuted by that man;

8. A friend of a superior of the master of a man's victim is that man's enemy;

9. An enemy of a persecutor of a servant of a man's father is that man's friend.

The problem is to deduce some fact about great-grandsons. [N.B. In this Problem it is assumed that all the men, here referred to, live in the same town, and that every pair of them are either "friends" or "enemies," that every pair are related as "senior and junior," "superior and inferior," and that certain pairs are related as "creditor and debtor," "father and son," "master and servant," "persecutor and victim," "uncle and nephew."]

• #6 is ambiguous. Does "his" refer to the man, or the man's junior? i.e. This could be read as "A grandon of a man's junior is not that man's newphew" or "A grandson of a man's junior is not that junior's nephew." I suspect it is the first, because a grandson of someone cannot also be the nephew of the same person (barring some rather wonky and incestuous family trees...). Commented Jun 20 at 17:37
• "His" would refer to the man I would think. You gave a good reason. Commented Jun 20 at 18:06
• Do you know whether we're supposed to assume that seniority and superiority are transitive? Commented Jun 25 at 8:06
• I don't think that seniority and superiority are transitive. Commented Jun 25 at 10:57

I coded this in Fortran to search for combinations of pairs of persons along with their relationships that satisfied all problem requirements. The simplest family tree involves 6 people but there are multiple ways to construct such a family tree. So I tried all of those possible ways but found only one that satisfied problem requirements. The number of unique combinations of people and relationships is 10^35 so a brute force approach of taking random combinations and testing them is not feasible. So I made many runs within the program with each run starting with a random combination for all person pairs and all their relationships. Then I iterated these combinations while forcing convergence. Out of 23x10^6 runs I had success (a good run) 230 times. There was only one relationship involving the great-grandsons that appeared in all 230 successful runs. Although I didn't test all 10^35 combinations the forced convergence allowed an answer. (It should be noted that I tried the brute force method as a test and the result was no successful runs out of 10^7 attempts.) I consider my solution correct because I know that Lewis Carroll had an answer to this problem (but that solution was lost) and I only found one relationship involving the great grandsons. My solution and the Fortran program are here: https://pastebin.com/9vyazLGg

I found one other attempt to solve this problem which was done by a group at Sandia Labs using the Otter theorem prover. It appeared to me that they did not have or use all the information on this problem. Although they failed to find a solution they provided their code: https://netlib.sandia.gov/problem-set/puzzles/carroll/problems

Great-grandsons are mutual enemies.

UPDATE: As a further test I made a lengthy search with 675x10^6 runs looking for solutions where the great-grandsons are friends (not enemies). I found 9 such solutions with the only common relationship other than "friends" was "not creditor/debtor".

So my answer would be that the vast majority of solutions that satisfy all problem statements would be that great-grandsons are enemies. However there are rare occurrences where they are friends but not creditor/debtor.

• This is potentially a pretty exciting answer; could you include the final result in the answer text itself? Commented Jun 24 at 16:06

Fact:

A debtor to a man's great-grandson is senior to that man.

Using:

1. A man can always master his father;
This means the master of a man is his son,

We can rewrite:

5. An inferior of the master of a man's son is senior to that man. to
An inferior of a man's son's son (grandson) is senior to that man.

Then using:

An inferior of a man's grandson is senior to that man. and
2. An inferior of a man's uncle owes that man money;

We know that a man's inferior is both his grandfather's senior and his nephew's debtor.

A man's grandfather and his nephew are related to each other as great-grandfather and great-grandson.

And we now know that they are also related by another man. The great-grandson's debtor is senior to his great-grandfather

There is also the trivial:

A man's great-grandson is his master's master's master.

• I think your first inference is incorrect. Just because every man's son is his master does not mean every man's master is his son. Commented Jun 21 at 20:26
• True, a man could have multiple masters, including ones that are not a son of his. But I understood the clues to be general rules, e.g. "An inferior of the master of a man's son is senior to that man" is equivalent to "any man inferior to any master of at least one son of a man is senior to that man." In which case I believe this would still hold. However, if we are supposed to interpret it as "There exists at least one inferior of a master of a man's son that is senior to that man" then yeah my answer falls apart. Commented Jun 21 at 21:15