The Impossible Puzzle

Here is a puzzle, known as "the impossible puzzle", which has appeared in print at least 5 or 6 times. The wording of the puzzle varies; in some cases, a slight rewording of the puzzle makes it ambiguous or insoluble. But when correctly stated and understood, it is possible for the two characters to logically solve the puzzle, and more importantly, for the listener to determine how it was done!

Hans Freudenthal,
Nieuw Archief Voor Wiskunde, Series 3,
Volume 17, 1969, page 152:

No. 223. A zegt tot S en P: Ik heb twee gehele getallen x, y gekozen met 1 < x < y en x+y <= 100. Straks deel ik s=x+y aan S aleen mee, en p=x*y aan P alleen. Deze mededelingen blijven geheim. Maar jullie moeten je inspannen om het paar (x,y) uit te rekenen.

Hij doet zoals aangekondigd. Nu volgt dit gesprek:

  1. P zegt: "Ik weet het niet."
  2. S zegt: "Dat wist ik al."
  3. P zegt: "Nu weet ik het."
  4. S zegt: "Nu weet ik het ook."
Bepaal het paar (x,y).


No. 223. A says to S and P: I have two whole numbers x, y chosen with 1 < x < y and x+y <= 100. Soon tell I s=x+y to S only, and p=x*y to P only. These communications remain secret. But you must work so the pair (x,y) out to reckon.

He does as announced. Now follows this conversation:

  1. P says: "I know it not."
  2. S says: "That knew I already."
  3. P says: "Now know I it."
  4. S says: "Now know I it also"
Determine the pair (x,y).

David Sprows,
Mathematics Magazine,
Volume 49, Number 2, March 1976, page 96:

977. Let x and y be two integers with 1 < x < y and x+y <= 100. Suppose Ms S is given the value of x+y and Mr P is given the value of x*y.

  1. Mr P says: "I don't know the values of x and y."
  2. Ms S replies: "I knew that you didn't know the values."
  3. Mr P responds: "Oh, then I do know the values of x and y."
  4. Ms S exclaims: "Oh, then so do I."
What are the values of x and y?

Martin Gardner,
"A Pride of Problems, Including One that is Virtually Impossible",
Scientific American,
Volume 241, December 1979:

The Impossible Problem. This beautiful problem, which I call "impossible" because it seems to lack sufficient information for a solution, began making the rounds of mathematics meetings a year or so ago. I do not know its origin. Mel Stover of Winnipeg was the first to call it to my attention.

Two numbers (not necessarily different) are chosen from the range of positive integers greater than 1 and not greater than 20. Only the sum of the two numbers is given to mathematician S. Only the product of the two is given to mathematician P.

On the telephone S says to P: "I see no way you can determine my sum."

An hour later, P calls back to say: "I know your sum."

Later S calls P again to report: "Now I know your product."

What are the two numbers?

To simplify the problem, I have given it here with an upper bound of 20 for each of the two numbers. This means that the sum cannot be greater than 40 or the product greater than 400. If you succeed in finding the unique solution, you will see how easily the problem can be extended by raising the upper bound. Surprisingly, if the bound is raised to 100, the answer remains the same. Stover tells me that a computer program in Israel checked on all numbers up to two million without finding a second solution. It may be possible to prove that the solution is unique even if there is no upper bound whatsoever.

Martin Gardner,
Scientific American,
Volume 242, June 1980:

Many variations on last December's "impossible puzzle" have been received that eliminate the need for an upper bound on the two numbers to guarantee a unique solution. One of the most elegant comes from Barry Wolk of the University of Manitoba. As in the original version, mathematicians S and P are discussing two unknown integers, both greater than 1. S knows only the sum of the numbers, whereas P knows only their product.:

  1. S: "I see no way you can determine my sum."
  2. P (after a suitable delay): "That didn't help me. I still don't know your sum."
  3. S (after another delay): "Now I know your product."
What are the two numbers?

Brian Smith,
"The Semantics of Clocks", in Aspects of Artifical Intelligence,
edited by James Fetzer,
Kluwer, 1988:

The famous puzzle of Mr S and Mr P:

There are two numbers between 1 and 100. Mr P knows their product, and Mr S their sum. They have the following conversation:

  1. Mr P: "I don't know the numbers."
  2. Mr S: "I knew you didn't. Neither do I."
  3. Mr P: "Now I do."
  4. Mr S: "Now I do, too."
What are the numbers?

Lee Sallows,
The Impossible Problem,
Mathematical Intelligencer,
Volume 17, Number 1, Winter 1995, pages 27-33.

The article in Mathematical Intelligencer is extensive, and it is inappropriate and unnecessary to quote it in full. The point of the article can be captured in just a few quotes.

Sallows begins by quoting Gardner's formulation of December 1979, and then notes:

...And the problem lived up to its name. Its solution was not only elegant, it called for some delicate thinking. Having triumphed at last, I then reached for Mathematical Games to see how Gardner's approach compared. A surprise awaited me: his answer was different from mine...

Suddenly I had an idea. Of course: it had to be an error. A correction was certain to be found in a subsequent column where all would be explained. I immediatedly began looking through succeeding issues of Mathematical Games. Sure enough, there it was in a postscript at the end of the column for March 1980: "As hundreds of readers have pointed out," I read, "the 'impossible problem' given in this department for December turned out to be literally impossible."

...Or so he thought. It was a natural assumption for one who believed the intended solution was unique. I had therefore discovered something that Martin Gardner never guessed. His Impossible Problem with its lower bound of 20 is not insoluble. But it is a tough cookie, in my estimation at least.

From the previous discussions of Martin Gardner's formulation of the problem, you should already be convinced that the Impossible Problem is literally impossible. And yet, Lee Sallows, not knowing the problem was impossible, found a solution. How can this be?

Can you see what Lee Sallows is talking about? To share his insight, it would be best to go back to the text of Martin Gardner's December 1980 formulation, "forget" that the problem is impossible, and try to imagine a way of seeing the problem that allows for a solution.

Yan Fridman,
"More Logicians",
July/August 2006.

You may recall that late in 2004 and in the beginning of 2005 we published a few logician puzzles. Here's another one of the kind, suggested by Bob Gabriel and revised to shorten the computation time.

Two brilliant, perfect logicians, Green and Blue, are given the following information about two positive integers, A and B: They are both greater than 1, A < B, and their sum is less than 40.

Green is told the product of A and B, and Blue is given the sum of A and B. The logicians are then engaged in the following conversation:

  1. Green: "I know the product."
  2. Blue: "I know the sum."
  3. Green: "I don't know the sum."
  4. Blue: "I already knew that."
  5. Green: "I now know the sum."
  6. Blue: "I now know the product."

Please answer the following questions:

  1. What are the numbers A and B?
  2. Is there only one solution?
Show all work.

I give up, show me the solution.

Last revised on 08 November 2006