A deduction question for perfect logicians

1k Views Asked by At

A colleague of mine recently messaged me a riddle. It is about a deduction process between two perfect logicians.

The riddle is as follows:

A person writes two non-zero digits on a paper. He tells person A the product of the digits, and person B the sum of the digits. The both persons have the following conversation:

A: "I don't know the digits"

B: "I don't know the digits"

A: "I don't know the digits"

B: "I don't know the digits"

A: "I don't know the digits"

B: "I don't know the digits"

A: "I don't know the digits"

B: "I don't know the digits"

Then person A says "I know the digits"

From this conversation I'm supposed to obtain the digits which were written. I can express this as a mathematical statemente but I lack the idea of how to deduce this riddle.

I know that the first person chose two numbers $x,y\in [9]:=\{1,\cdots,9\}$ and that person A knows $x+y$ and person B knows $xy$. If $x,y$ are different then $x+y \le 17$ and $xy\le 72$. Otherwise, $x+y\le 18$ and $xy\le 81$.

Now I think I must search for numbers below 81 such that any of $[9]$ divides. Definitely any prime is not such a number and I'm sure there are a couple more. Also, for numbers below 18, it is possible to count the partitions of each number reducing the number of cases which $x,y$ can meet.

I think that this is not a correct approach to this problem and I would like to hear a good approach, albeit without giving the complete answer if possible. Also if there is anything wrong with my reasoning, please tell me so I can correct it.

2

There are 2 best solutions below

1
On BEST ANSWER

We may suppose that $x\ge y$.

A: "I don't know the digits", so we see that $(x,y)$ is either of the followings where red numbers, green numbers represent $xy,x+y$ respectively :

$\qquad\qquad\qquad$enter image description here

B: "I don't know the digits", so we see that $(x,y)=(2,2),(9,4),(6,6)$ were impossible since each of $\color{green}{4,12,13}$ appears at only one place.

A: "I don't know the digits", so we see that $(x,y)=(4,1)$ was impossible since $\color{red}{4}$ appears at only one place.

B: "I don't know the digits", so we see that $(x,y)=(3,2)$ was impossible since $\color{green}{5}$ appears at only one place.

A: "I don't know the digits", so we see that $(x,y)=(6,1)$ was impossible since $\color{red}{6}$ appears at only one place.

B: "I don't know the digits", so we see that $(x,y)=(4,3)$ was impossible since $\color{green}{7}$ appears at only one place.

A: "I don't know the digits", so we see that $(x,y)=(6,2)$ was impossible since $\color{red}{12}$ appears at only one place.

B: "I don't know the digits", so we see that $(x,y)=(4,4)$ was impossible since $\color{green}{8}$ appears at only one place.

A: "I know the digits", so we see that $(x,y)=(8,2)$ was possible since $\color{red}{16}$ appears at only one place, and that $(8,1),(9,1),(4,2),(9,2),(3,3),(6,3),(8,3),(6,4)$ were impossible since if $(x,y)$ were either of them, then A would have said "I don't know the digits").

It follows that the written digits are $2$ and $8$.

1
On

To illustrate a possible approach, let's consider the simpler case in which the digits are limited to $1,2,3,4,6,8$. (It's convenient for illustrative purposes to omit the primes $5$ and $7$ but include the composites $6$ and $8$).

The possible products told to A are $1,2,3,4,6,8,9,12,16,18,24,32,36,48,64$. The only products which can be formed in more than one way, and in brackets the corresponding implied sums, are: $$4 = 1*4 = 2*2\quad (5,4)$$ $$8 = 1*8 = 2*4\quad (9,6)$$ $$12 = 2*6 = 3*4\quad (8,7)$$ $$16 = 2*8 = 4*4\quad (10,8)$$ $$24 = 3*8 = 4*6\quad(11,10)$$

So if A says "I don't know ..." B will know the product must be one of $4,8,12,16,24$. Note the assumptions here and below that B knows that A knows the product, A knows that B knows the sum, and both always say the truth.

If B then says "I don't know ...", the sum must be either $8$ or $10$, the only sums which occur above more than once. The possible products are therefore $12,16,24$.

If A again says "I don't know ...", the product cannot be $12$ or $24$, as the only product with possible sums $8$ and $10$ is $16$.

So B can then say "I know the digits" ($(4,4)$ if the sum is $8$, $(2,8)$ if it's $10$).

This sort of approach with digits $1,\dots,9$ should solve the riddle, although the details will probably be quite tedious.