• Welcome to Valhalla Legends Archive.
 

Math logic

Started by Arsenic, June 13, 2004, 02:29 AM

Previous topic - Next topic

Arsenic

Here's an easy for you guys:

Quote
A professor invites two intelligent students to his classroom.  He tells them he is thinking of a two digit number.  To one student he whispers the sum of the two digits in the number.  He whispers the product of the two numbers to the other student.  The two students then have the following conversation:
Student A:  I don't know the numbers.
Student B: I don't know the numbers either, and I knew you wouldn't know them.
Student A: I now know the numbers.
Student B: I also now know the numbers.

What is the number?

Arsenic

No one solved it yet?

Yoni

#2
I will begin by ignoring the line:

Student A:  I don't know the numbers.

Why? Because Student B says he "knew" Student A wouldn't know them.
So, that line is useless to Student B.
However, Student B's claim is useful for us, since we can examine how he deduced this.

I'll begin by looking at Student B's information.
He knows the product of the two digits, but that is not enough to find the original digits.
That means this product has more than one option for the original digits.

I will write a Mathematica 5 script to find all such products.
(I'm relatively new to Mathematica 5 scripting, please reply if you know better and have suggestions on improving this.)


For[i = 0, i <= 81, i++,
   P[i] = {}];
For[x = 1, x <= 9, x++,
   For[y = 0, y <= 9, y++,
     P[x y] = Union[P[x y], {{Min[x, y], Max[x, y]}}]]];
For[i = 0, i <= 81, i++,
   Print["Product ", i, " = ", P[i]]];


The products that have more than one option (and therefore, Student B didn't know the answer) are:

Product 0 = {{0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 6}, {0, 7}, {0, 8}, {0, 9}}
Product 4 = {{1, 4}, {2, 2}}
Product 6 = {{1, 6}, {2, 3}}
Product 8 = {{1, 8}, {2, 4}}
Product 9 = {{1, 9}, {3, 3}}
Product 12 = {{2, 6}, {3, 4}}
Product 16 = {{2, 8}, {4, 4}}
Product 18 = {{2, 9}, {3, 6}}
Product 24 = {{3, 8}, {4, 6}}
Product 36 = {{4, 9}, {6, 6}}

Student B knows that Student A doesn't know the numbers either.
Student B realizes that Student A wouldn't know the numbers if the sum the professor told him is between 2 and 16. (For a sum of 1, the only possibility is {0, 1}, for a sum of 17, the only possibility is {8, 9}, and for a sum of 18, the only possibility is {9, 9}.)
We can then eliminate the "Product 0" line. If the product were 0, then Student B wouldn't have been able to know that Student A doesn't know the numbers.

The possibilities are therefore:
Product 4 = {{1, 4} (sum 5), {2, 2} (sum 4)}
Product 6 = {{1, 6} (sum 7), {2, 3} (sum 5)}
Product 8 = {{1, 8} (sum 9), {2, 4} (sum 6)}
Product 9 = {{1, 9} (sum 10), {3, 3} (sum 6)}
Product 12 = {{2, 6} (sum 8), {3, 4} (sum 7)}
Product 16 = {{2, 8} (sum 10), {4, 4} (sum 8)}
Product 18 = {{2, 9} (sum 11), {3, 6} (sum 9)}
Product 24 = {{3, 8} (sum 11), {4, 6} (sum 10)}
Product 36 = {{4, 9} (sum 13), {6, 6} (sum 12)}

Student A, realizing these are the only possibilities, suddenly knows what the numbers were.
But if the sum were 5, 6, 7, 8, 9, 10, or 11, then as you see above, there would still be multiple options.
So the sum must be either 4, 12 or 13, and the numbers are either {2, 2}, {4, 9} or {6, 6}.

Student A claims he knows the numbers.
Student B then realizes the only options are {2, 2}, {4, 9}, {6, 6}.

Product 4 = {2, 2} (sum 4)
Product 36 = {4, 9} (sum 13), {6, 6} (sum 12)

Student B then claims he knows the numbers as well.
From this we can deduce the only option for the numbers was {2, 2}, and the number was 22.

Edit: Some 8's turned into smilies, disabled smilies.

Hazard

Yoni you're my hero.

"Courage is being scared to death - but saddling up anyway." --John Wayne

Yoni


Adron

I went at it a slightly different way, but the end result would've ended up the same, if I hadn't gotten distracted.

I narrowed it down to numbers with both digits the same (since those are the only ones that the students could figure out), and then stroke off those that don't have alternatives. But I never got the whole post finished, and now I don't feel like redoing it :P

Arsenic

Yoni, you got it all right.

Although you cheated a bit by using a script to generate the possibilities ;)

Yoni

Quote from: Arsenic on June 19, 2004, 02:16 PM
Yoni, you got it all right.

Although you cheated a bit by using a script to generate the possibilities ;)
Cheated? Naa, I just shortened my work (did calculations automatically instead of manually). The logic is all mine.