Logic

Four sentences that find two numbers

Two whole numbers are chosen; one person is told their sum and another their product. The product's holder says she does not know the numbers. The sum's holder says he knew she would not. Then she knows, and then he knows. Nothing in the conversation names a number, and yet out of 2,352 possible pairs exactly one is consistent with it — and the decisive sentence is the second, which is not about the numbers at all but about what someone else could not have known.

Worth reading first: The announcement everybody already knew · The axiom is the shape of the graph.

Two whole numbers xx and yy are chosen, with 1<x<y1 < x < y and x+y≤100x + y \le 100. Sam is told their sum and Polly their product, and both know the rules. They then have the following conversation, which everybody can hear.

  1. Polly says that she does not know the numbers.
  2. Sam says that he knew she did not.
  3. Polly says that now she knows them.
  4. Sam says that now he knows them too.

What are the numbers? The puzzle was published by Hans Freudenthal in a Dutch mathematical journal in 1969, and it has the unsettling property that nothing said contains a number. Each sentence is about somebody’s knowledge, and two of the four are admissions of ignorance. Yet the answer is determined, and it is 44 and 1313.

The puzzle is a close relative of the muddy children, and it can be solved the same way: draw every possibility as a world, join the worlds that a speaker cannot tell apart, and let each public sentence delete the worlds where it would have been false. But it differs from the children in one respect that turns out to carry the whole solution. The children only ever say nobody knows. Sam’s sentence is a statement about what Polly could not know — knowledge of another person’s ignorance — and it removes more than ninety per cent of the worlds still standing at a stroke.

Two thousand worlds, two kinds of blindness

2,352 pairs and the four statements that empty them. N=100: worlds 2352 → 1747 → 145 → 86 → 1; survivor 4,13
Fig. 1 Every pair x < y from 2 up with sum at most 100: 2,352 worlds, the smaller number down the side and the larger across, each shaded by the statement that deletes it. One square, 4 and 13, survives all four.

Before anybody speaks, the possible worlds are the pairs (x,y)(x, y) with 2≤x<y2 \le x < y and x+y≤100x + y \le 100. There are 2,352 of them, and the figure lays them out as a triangle, the smaller number down the side and the larger across. Sam cannot tell apart two worlds with the same sum, so his classes of indistinguishable worlds are the anti-diagonals of that triangle — 2+152 + 15, 3+143 + 14, 4+134 + 13 and so on all look alike to a man who has been told 17. Polly cannot tell apart two worlds with the same product, so her classes are the points on hyperbolas xy=cxy = c: 4×134 \times 13 and 2×262 \times 26 look alike to a woman who has been told 52.

That is a Kripke model with two agents, built exactly as the worlds-and-arrows picture of knowledge prescribes: each agent’s relation is an equivalence relation, and an agent knows a statement at a world when it holds throughout her class. The model is enormous next to the muddy children’s cube, and its two relations are not orthogonal directions of anything, as the children’s were on the cube on which every assignment of truth values is a corner; an anti-diagonal meets a hyperbola in at most one point, but which points they share depends on the arithmetic of factorisation. The puzzle is solved by computing the deletions, and the figure shades each world by the statement that removes it.

The shading already says something the words do not. Most of the triangle is removed by Sam’s sentence, not by Polly’s. Polly’s two sentences together remove fewer than seven hundred worlds; the decisive cut is made by the one sentence in the conversation that reports a fact about the past — what Sam knew before anybody had spoken.

What one admission of ignorance removes

Four sentences and the worlds after each. worlds: 2352, 1747, 145, 86, 1
Fig. 2 The worlds still possible after each public statement, on a logarithmic scale: 2,352, then 1,747, then 145, then 86, then 1.

Polly’s first sentence, she does not know the numbers, is true at a world exactly when the product has more than one factorisation into two allowed numbers. It is false at, for instance, (2,3)(2, 3): a product of 6 can only be 2×32 \times 3, since 1×61 \times 6 is excluded. It is false at any pair of distinct primes, whose product pqpq has no other split into two numbers greater than 1 — the fact that a number factors into primes in one way only, used here at its smallest. And it is false at pairs whose product does have other factorisations, but none inside the bounds — 4×53=2124 \times 53 = 212 could also be 2×1062 \times 106, but 108 is too large a sum. Deleting every world at which Polly would have known removes 605 of the 2,352 and leaves 1,747.

That is a modest cut, and it is the kind of deletion the muddy children’s silence made: a public admission that some agent’s class at the actual world is larger than one point. The figure’s second bar sits only a little below the first. If the conversation stopped there, Sam would know almost nothing more than he did; Polly’s ignorance is the ordinary condition of almost every product.

Sam’s reply, he knew she did not, is a different sort of sentence. It says that at the actual world, before Polly spoke, Sam already knew that Polly did not know. In the notation of epistemic logic it is KS¬KPK_S \neg K_P — Sam knows that Polly does not know the pair — and it is true at a world exactly when every world in Sam’s class, every split of the sum, has an ambiguous product. One unambiguous split anywhere on the anti-diagonal is enough to make the sentence false for the whole sum. The third bar shows what that does: 1,747 worlds fall to 145.

There is a small curiosity here worth noticing. Sam’s sentence makes Polly’s redundant. If Sam knew that Polly did not know, then Polly did not know — knowledge implies truth, the axiom that every world sees itself — and every world removed by Polly’s sentence lies on a sum that Sam’s sentence removes anyway. The conversation could begin with Sam and reach the same answer. What Polly’s first sentence contributes is the occasion for Sam’s: he knew she did not is a response, and without a first admission it would be a strange thing to volunteer.

The ten sums that knew in advance

The ten sums that knew in advance. surviving sums 11,17,23,27,29,35,37,41,47,53; prime splits sink 71, others 15
Fig. 3 The sums from 5 to 100 sorted by whether their holder could be sure in advance that the product’s holder did not know. 10 survive; 71 fail because they split into two primes, 15 for other reasons.

Which sums make Sam’s sentence true? The figure sorts every sum from 5 to 100. A sum survives only if none of its splits has a product that factors one way, and the commonest way to fail is to split into two distinct primes, since a product of two primes pqpq can be nothing else. Every even sum from 8 to 100 splits into two distinct primes, which is Goldbach’s conjecture checked over a small range — the same conjecture whose comet of representation counts shows how overwhelmingly true it looks — so every even sum fails. An odd sum ss splits into two primes only as 2+(s−2)2 + (s - 2), since one of two numbers adding to an odd total is even, so an odd sum fails this way exactly when s−2s - 2 is prime. That disposes of 71 sums.

Fifteen more fail for subtler reasons. The sum 6 fails at 2+42 + 4, since 8 is only 2×42 \times 4. The sum 51 fails at 17+3417 + 34, because 578=2×172578 = 2 \times 17^2 can otherwise be made only as 2×2892 \times 289, whose sum is far over the bound. And every sum above 54 fails because it has the split 53+(s−53)53 + (s - 53): the product 53k53k for k≤47k \le 47 has no other allowed factorisation, since any other split would have to put the prime 53 into one factor with something more, pushing that factor past 100. Primes near the edge of the range behave like primes even when paired with composites, because the bound makes their products unique.

What is left is ten sums: 11, 17, 23, 27, 29, 35, 37, 41, 47 and 53, every one odd, every one two more than a composite number, every one below 55. The 145 worlds remaining after Sam’s sentence are the splits of these ten sums that also survived Polly’s. Sam’s sentence was so strong because the condition it imposes is a universal one — all splits of the sum at once — and universal conditions over sets of a dozen or more pairs are hard to satisfy by chance. That is the structural difference from the muddy children: their public silence removed one layer of a cube each round, while knowledge of another’s ignorance quantifies over a whole class of the speaker’s own worlds and over every class of the listener’s that it meets.

Eleven and seventeen

The sums 11 and 17 after P has spoken twice. 11: P knows at 2+9,3+8,4+7; 17: P knows at 4+13
Fig. 4 After the first two statements, the splits of 11 and of 17 still possible, each with the other surviving splits of its product. Where none survives, the product’s holder now knows. For 11 that happens at 3 of 4 splits; for 17 at 1 of 7.

Now Polly announces that she knows. She has heard Sam, so she can delete every world not on one of the ten sums; she knows the product; and she knows the pair exactly when, among the 145 surviving worlds, her product appears only once. The statement deletes every surviving world at which her product still appears twice, leaving 86.

The figure follows two sums through that step. Take Sam’s position if he holds 11. The four surviving splits are 2+92 + 9, 3+83 + 8, 4+74 + 7 and 5+65 + 6. At 2+92 + 9 the product 18 could also be 3×63 \times 6, but 9 is not one of the ten sums, so that rival was deleted by Sam’s own sentence and Polly would know. Likewise at 3+83 + 8 (24, whose rivals 2×122 \times 12 and 4×64 \times 6 have sums 14 and 10) and at 4+74 + 7 (28, whose rival 2×142 \times 14 has sum 16). Only at 5+65 + 6 does a rival survive: 30 is also 2×152 \times 15, and 17 is one of the ten sums. So if Sam holds 11, Polly’s now she knows is true at three worlds and Sam cannot tell which.

If Sam holds 17, the seven surviving splits are 2+152 + 15 through 8+98 + 9, and at six of them the product keeps a surviving rival: 30 has 5×65 \times 6 on 11, 42 has 2×212 \times 21 on 23, 60 has 3×203 \times 20 on 23, 66 has 2×332 \times 33 on 35, 70 has 2×352 \times 35 on 37, 72 has 3×243 \times 24 on 27. Only at 4+134 + 13 does the product 52 stand alone, its rival 2×262 \times 26 having been deleted with the sum 28. So Polly’s sentence leaves Sam a single world, and he knows. That is the fourth statement, and when it is made public it deletes every sum at which Sam would still be guessing — nine of the ten — and leaves exactly one world.

The pair of columns is the puzzle in miniature. The difference between 11 and 17 is not that one has more splits; it is how the rivals of each split’s product fall across the ten surviving sums. Nothing local to the sum decides it. Whether 17 is the answer depends on whether 37 survived Sam’s sentence, which depends on whether every split of 37 has an ambiguous product, which depends on the factorisations of numbers near 300. The answer is reached by following the arithmetic through the model, which is what the shading of the first figure records.

A single answer inside a window

The answer as the bound on the sum moves. 40:none 50:none 60:none 62:none 64:none 65:4+13 80:4+13 100:4+13 200:4+13 400:4+13 800:4+13 1200:4+13 1600:4+13 1684:4+13 1685:4+13/4+61 1800:4+13/4+61
Fig. 5 The same four statements with the bound on the sum changed. Below 65 the conversation is impossible; from 65 to 1,684 the answer is 4 and 13 alone; at 1,685 the pair 4 and 61 joins it.

The bound of 100 looks like a convenience, a way of making the set of worlds finite. It is more than that, because the puzzle’s answer is a property of the whole model, and the model changes with the bound. The figure reruns all four statements for bounds from 40 to 1,800.

Below 65 there is no answer at all: no world survives the fourth statement, and the conversation as reported could not have happened. The reason is visible in the column for 17. With a bound of 64, the split 7+107 + 10 leaves Polly knowing too, because the rival of 70, namely 2+352 + 35, lies on the sum 37 — and 37 only becomes one of the sums that survive Sam’s sentence once the bound reaches 65. Below that, 17 has two splits at which Polly would know, and Sam, holding 17, could not claim to know. Every other candidate fails for reasons of the same kind.

From 65 all the way to 1,684, the answer is 44 and 1313 and nothing else. At 1,685 a second pair, 44 and 6161, becomes consistent with all four sentences, and from then on the conversation no longer determines the numbers. So the uniqueness that makes the puzzle satisfying is a fact about a window of bounds roughly a thousand six hundred wide, and Freudenthal’s 100 sits comfortably inside it. Published versions that bound the larger number rather than the sum, or allow x=yx = y, move the window and occasionally the answer; the conversation is the same in every version, and what it determines depends on the model it is spoken in.

That dependence is exactly what modal logic predicts. A sentence like he knew she did not know has no fixed content; its content is the set of worlds at which it is true, and that set is computed from the model. Two models that no formula can tell apart give every sentence the same content, but two that merely agree on every world near the answer can still disagree about which worlds survive, because a world far away, such as the split 2+352 + 35 of 37, is linked through Polly’s relation to a world near it.

Cheryl’s ten dates

Cheryl's ten dates and three sentences. 10 dates; deletions by statement 1, 2, 3; 16 July survives
Fig. 6 Cheryl’s ten dates, Albert told the month and Bernard the day. Each cell is marked with the statement that deletes it; 16 July survives all three.

In 2015 a question set for secondary-school students in Singapore went round the world. Cheryl tells Albert and Bernard that her birthday is one of ten dates — 15, 16 or 19 May; 17 or 18 June; 14 or 16 July; 14, 15 or 17 August — and then tells Albert the month and Bernard the day. Albert says that he does not know when it is, and that he knows Bernard does not know either. Bernard says that at first he did not know, but now he does. Albert says that then he knows too.

It is the sum and the product shrunk to ten worlds, and the figure solves it the same way. Albert’s classes are the rows, Bernard’s the columns. Albert’s first sentence is knowledge of another’s ignorance again: Bernard would know only if his day appeared in one month alone, which happens for the 18th and the 19th, so Albert is certain of Bernard’s ignorance only if his month contains neither — which deletes May and June. Bernard’s reply keeps the days that are now unique, deleting the 14th, which still appears in both July and August. Albert’s last sentence keeps the month with one date left, deleting August, where the 15th and 17th both survive. What remains is 16 July.

The puzzle’s fame came partly from the number of people who answered 17 August, which is what results if Albert’s first sentence is read as a statement about the dates rather than about Bernard’s knowledge. That misreading is instructive. Deleting the dates Bernard could know removes only 18 June and 19 May; deleting the months in which Albert could not be sure that Bernard does not know removes five dates. The difference between those two deletions is the whole difference between a fact and knowledge of the absence of a fact — the same gap that hat-guessers exploit in guesses that are wrong together, where what nobody else can see is made to do the work.

The step that turns a sentence into a deletion

Both puzzles rest on one rule. A public announcement of a sentence φ\varphi replaces the model by the part of it where φ\varphi is true, and the agents’ knowledge afterwards is evaluated in the smaller model. That is the semantics of public announcement logic, and the sum and product puzzle has become one of its standard test cases: Hans van Ditmarsch and colleagues formalised the four sentences in it and checked the solution with an automated model checker. The computation in the figures is the same procedure carried out directly.

The rule makes the order of the sentences part of their meaning. Sam’s now he knows them too is true at the actual world only because Polly’s now she knows has already been heard; spoken first, at the start of the conversation, it would have been false at every one of the 2,352 worlds, since every sum below 100 has at least two splits. Each sentence is evaluated in the model left by the ones before it, and the figures follow them in the order they were spoken. A conversation is therefore not a set of facts but a sequence of operations on a model, and the same words in a different order can describe a different conversation altogether.

The other consequence is that a statement about knowledge in the past, such as he knew she did not, has to be evaluated in the model as it stood before the intervening announcements. Sam’s sentence refers to his knowledge before Polly spoke, and the computation honours that: it asks, for each sum, whether every split had an ambiguous product in the full model of 2,352 worlds, not in the model of 1,747 left after Polly’s sentence. Evaluated in the smaller model instead, the sentence turns out to be true at all 1,747 surviving worlds and would delete nothing at all: once Polly has announced her ignorance, everybody knows of it. The tense is not a matter of style; it chooses the model.

What the triangle leaves out

The pictures assume every condition the puzzle states and several it does not. Sam and Polly are perfect reasoners; each knows the other is; each tells the truth; and the bounds and the rules are common knowledge before the conversation starts. If Polly could be mistaken about her own product, or could lie like the islanders in the question a liar answers truthfully, or if Sam did not know that the bound was 100, the model would need worlds the triangle has no square for — worlds about what the other person believes the rules to be — and the deletions would no longer reach a single pair.

The figures also show the model, not the reasoning anybody would carry out. A human solver does not inspect 2,352 pairs; she notices that Sam’s sentence excludes every sum with a prime split, recognises the role of Goldbach’s conjecture and of the primes near the bound, and checks a few sums by hand. The computation is a certificate that the shortcut gives the right answer. It cannot show which shortcut is the natural one, nor why 4 and 13 should be the pair; it shows only that every other pair falls, and at which sentence.

Finally, a figure of one bound is a fact about that bound. The window from 65 to 1,684 was found by running the model at many bounds, and its edges were located exactly, but between the bounds tried the claim that the answer never changes rests on the computation at every bound, not on any argument. There is no known formula for where new answers appear.

Still open: the conversation with no bound at all

Remove the bound, and let xx and yy be any whole numbers with 1<x<y1 < x < y. Then the second sentence depends on a conjecture nobody has proved. Sam, holding an even sum, could truthfully claim that he knew she did not know only if that sum were not the sum of two distinct primes — and whether every even number from 8 up is such a sum is Goldbach’s conjecture, checked by computer far beyond any range a puzzle needs and still open. If it is true, no even sum survives Sam’s sentence in the unbounded model, just as none did below 100. If it failed somewhere, the unbounded conversation would have worlds at that sum that no bounded version ever shows.

The unbounded model has other difficulties. Without the bound, a product such as 4×534 \times 53 is no longer unique, since 2×1062 \times 106 is now allowed, so the subtle failures of the bounded version disappear and the analysis becomes almost purely a question about primes. Whether the unbounded conversation has a unique answer, many, or none has been argued about since the puzzle appeared, and the arguments rest on heuristics about how often numbers near a given size have one prime factor too large to share — the territory of the infinitude of primes and its quantitative refinements, rather than of logic.

What is settled is the shape of the problem. The two-agent model is finite at every bound, so each bounded version is decided by exhaustion, and the logic of public announcements is decidable over finite models — unlike the questions of expressive power and complexity that remain open for the many logics a single knower already has. The open question is not about knowledge at all. It is about whether the arithmetic that knowledge quantifies over behaves the way the computations suggest it does, and that is the oldest kind of open question in number theory.

Ignorance of ignorance is information

Out of 2,352 pairs, four sentences about knowledge leave one: 44 and 1313. The product’s holder admits ignorance, which removes 605 worlds; the sum’s holder says he knew she would be ignorant, which requires every split of his sum to have an ambiguous product and cuts 1,747 worlds to 145, leaving only the ten sums 11, 17, 23, 27, 29, 35, 37, 41, 47 and 53; the product’s holder then knows, which leaves 86; and the sum’s holder knows too, which only 17 allows, since among its seven splits only 4+134 + 13 has a product with no surviving rival. Most sums fail the decisive sentence by splitting into two primes, so the answer leans on Goldbach’s conjecture over the range; it holds for every bound on the sum from 65 to 1,684, below which the conversation is impossible and above which 44 and 6161 joins it. Cheryl’s birthday is the same second sentence on ten dates — and in both, a statement that someone else could not have known turns out to carry more information than any statement of fact in the conversation.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

Common knowledgeExhaustive searchGoldbach conjectureKripke modelPublic announcementUnique factorisation