Lecture 37: Know/Don't Know Problem


The Know/Don't know problem is a riddle that uses topics we learned in Chapter 1, namely divisibility and prime numbers. The guidelines:

X and Y are mystery numbers, such that X>1 and Y>1, S=X+Y, P=XY, X<100. Adding Anthony is told S but not P, and Multiplying Megan is told P but not S.

As an example, let's let P=35, and S=12. It can easily be determined that X=5 and Y=7.

In our problem, Anthony and Megan have a conversation that allows them to figure out their products and sums. The conversation goes:

Multiplying Megan: I cannot find your sum.
Adding Anthony: I was sure that you could not find my sum.
Multiplying Megan: Then, I found your sum.
Adding Anthony: If you could find it, then I also found your product.

From this conversation and the guidelines given earlier, the problem is to find X, Y, S, and P.

Solving the Riddle

The conversation between Anthony and Megan does not give us any obvious answers at first. But, we can figure out the solution by finding restrictions on what the numbers can’t be.

P can’t be the product of two primes: If both X and Y are prime, then Multiplying Megan would know right away what the two numbers are and she would be able to find the sum. For example, if P=35, $35=5*7$ or $1*35$, but we can’t have $1*35$ because X and Y>1. So the only option is X=5 and Y=7.

P can’t be prime: If P is prime, then its only factors are 1 and itself. This violates the restriction that X and Y>1, so it is not possible.

P can’t be the square of a prime number: If P is the square of a prime number, then the only factors would be the prime itself, so Multiplying Megan would know the answer. For example, if P=9, $9=3*3$, so they only option (with X>1 and Y>1) is X=3 and Y=3.

P can’t be the cube of a prime number: If P is the cube of a prime number, then its only factors would be the prime and the prime squared, so Multiplying Megan would know the answer. For example, if P=27, $27=3*9$, so the only option (with X>1 and Y>1) is X=3 and Y=9.

S can’t be expressed as a sum of two primes: Unlike the first four which came from just the first line of the conversation, this restriction comes from the second line. If S could be expressed as a sum of two primes, then Adding Anthony would not be able to say that he was sure that Multiplying Megan didn’t know the sum. For example, if S=12, then it is possible that X=5 and Y=7, meaning P would be 35 and Megan would know S right away. Thus, Anthony could not be sure Megan did not know S.

Note: This last restriction goes along with the first restriction. Likewise, we can come up with other restrictions on S like that it can’t be expressed as a prime plus itself or a prime plus its square. It is easy to see that these cases will always yield even numbers. Goldbach’s conjecture tells us that all even integers can be expressed as the sum of two primes. Therefore, the last restriction covers these others, and we will only consider that S can’t be expressed as a sum of two primes.

In solving this problem, we will have two lists of Natural numbers, one for what P could possibly be, the P-List, and one for what S could possibly be, the S-List. (Note: these are not the entire lists, as they would take too long to go through. This is just a sufficient sample set that gives an example of how the entire process works.)

For our sample P-List, we will have:

P-List: 9, 18, 20, 24, 28, 35, 52, 76, 112, 120, 125

And for our sample S-List, we will have:

S-List: 11, 17, 23, 26, 49, 60

We will now examine each number of these lists to see if we can rule them out using the restrictions we have given, starting with the P-List

We can see that 9 is the square of a prime ($9=3^2$), 35 is the product of two primes ($35=5*7$), and 125 is the cube of a prime ($125=5^3$), so we can rule these off of our P-List, because they are no longer possibilities to give us an answer for P. All of the other numbers (18, 20, 24, 28, 52,76, 112, and 120) pass these restrictions and remain on the P-List.

Now we want to look at the numbers on the S-List to see if we can rule any of them out. We need to break each S into possible X's and Y's and see what we find. First, with 11, we see that 11=2+9, 3+8, 4+7, or 5+6. None of these sums gives us an X and Y that are both prime, so 11 passes this test. When we look at 17, we see 17=2+15, 3+14, 4+13, 5+12, 6+11, 7+10, or 8+9. Again, there are no sums that are made up of two primes, so 17 passes this test. When we go through this process with 23, we will see that it passes as well. However, when we look at 26, we find that 26=7+19, and 7 and 19 are both prime. Therefore, 26 is not a possible S, and we can rule it off the list. We can also find that 49=47+2 and 60=23+37, so we can rule both 49 and 60 off of our list.

After going through these steps, we now have updated lists:

P-List: 9, 18, 20, 24, 28, 35, 52, 76, 112, 120, 125

S-List: 11, 17, 23, 26, 49, 60

Note: After these steps, the actual entire S-List will be 11, 17, 23, 27, 29, 35, 37, 41, 47, 51, 53, 57, 59, 65, 67, 71, 77, 79, 83, 87, 89, 93, 95, 97. The P-List will be much, much larger.

Now we will continue on to the third and fourth statements.

Multiplying Megan: Then, I found your sum.

This tells us that because Megan knew it was not possible to find her sum, Anthony can now eliminate more numbers from his S-List, which will then leave exactly one number.

Adding Anthony: If you could find it, then I also found your product.

This tells us that Megan can now examine her P-List and eliminate all numbers that would not tell Anthony for sure what the sum is, and this would also leave her with a lone number left, which is S. To explain this more, we’ll begin to look at each of the numbers.

What we will do is examine each factorization of our possible P’s, and look at what sum they would give us. Starting with 20: $20=2*10$ or $4*5$. This gives us possible S values of 2+10=12 and 4+5=9. However, since neither 9 nor 12 appear on our S-List, 20 cannot possibly be P, so we can cross it off our P-List. As we continue down the list:

$28 = 2*14$, $4*7$ -> S = 2+14 = 16, 4+7 = 11 (11 is on the list, 28 passes)
$52 = 2*26$, $4*13$ -> S = 2+26 = 28, 4+13 = 17 (17 is on the list, 52 passes)
$18 = 9*2$ -> S = 9+2 = 11
$24 = 8*3$ -> S = 8+3 = 11
$76 = 4* 19$ -> S = 4+19 = 23
$112 = 7*16$ -> S = 7+16 = 23

120 is a special case. There are seven factorizations of 120, but we will choose two specific factorizations for our purpose.
$120 = 5*24$, $8*15$ -> S = 5+24 = 29, 8+15 = 23
Since both these numbers appear on the S-List, it would appear at first that 120 passes. However, as we stated earlier, these last two statements say that both Anthony and Megan need to be able to eliminate all but one number for P and S, respectively. However, if P=120, Megan would not be able to tell if S is 23 or 29, because they are both possibilities in this case. So Megan would need another step (which doesn’t happen in our problem) to determine what S is. Thus, we can cross 120 off our list.

This gives a new, updated P-List of:

P-List: 9, 18, 20, 24, 28, 35, 52, 76, 112, 120, 125

Now, we must look at each of these possible S’s and their corresponding P’s, and see what it all means. We can look at our first number on the S-List, 11. From our abbreviated example, we see that 11 has numerous possibilities for P, namely P=28, 18, or 24. However, as we stated earlier, at this point in the problem Anthony needs to be able to clearly see what P is. If his sum was 11, he would not know if P was any of these three numbers, therefore 11 is not possible for S. As we can see from looking over here, 23 can also be crossed off the S-List, because like 11, it appears more than once, so it would not be obvious to Anthony what P is. If we were to do this for every single number on the S-List, we would see that 23 of the 24 numbers will appear more than once as possible S’s; the only one that occurs a single time is 17, seen here as 4+13. Thus, Megan can tell that this is the only possible S, and Anthony can tell that 52 is the only possible P. This gives us our answer as:

$X=4$ $Y=13$ $S=17$ $P=52$


Now that we have solved the riddle, we will look back at our initial setup. If we change the range from greater than 1 to greater than 2, we get new restrictions at the beginning, which then leads us to a different solution.

P can’t be 4 times a prime: If P is 4 times a prime then the only factorization is 4 times the prime and 2 times twice the prime. This second case can’t happen because X and Y >2. Which only leaves one case, so Multiplying Megan would be able to find out the solution right away. For example, if P=52, $52= 4*13$ or $2*26$. But X=2 and Y=26 will not work because X<2 here, so X=4 and Y=13 is the only possible solution. Notice that this eliminates our solution from the original problem.

P can’t be 2 times a prime squared: If p is 2 times a prime squared then the only valid factorization is the prime times twice itself. In which case, Multiplying Megan would be able to find out the answer immediately. For example, if P=18, then the only possible solution with X>2 and Y>2 is $18=3*6$.

If we continue on with the problem in the same fashion as the original, we will find the solution to be: (X = 13 and Y = 16 so S = 29 and P = 208)

$X=13$ $Y=16$ $S=29$ $P=208$

If we go back to the original problem with X,Y>1, we can change the bounds to gives us more answers than the original. These answer are:

$X=16$ $Y = 111$ $S=127$ $P=1776$

$X=201$ $Y=556$ $S=757$ $P=111756$

$X=421$ $Y=576$ $S=997$ $P=242496$

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License