[Puzzle] Guess the numbers

11 views
Skip to first unread message

Pranjal

unread,
Aug 15, 2009, 6:53:39 AM8/15/09
to DS & Algo@itbhu
Rob:

"I just picked two integers greater than one and their sum is less
than 100."
"Adam, their sum is ..." (he whispers it to Adam).
"Rohit, their product is..." (he whispers it to Rohit).

Adam:

"Rohit, we don't know the numbers."

Rohit:

"Now I do."

Adam:

"Me too".

What were the numbers?

Karan Jain

unread,
Aug 15, 2009, 7:48:33 AM8/15/09
to ds--al...@googlegroups.com
Numbers are 13 & 4
 
  • Since Rohit does not know the numbers even after knowing the product, this means that both the numbers cannot be prime.
  • Now Adam knows that Rohit does not know the number => The sum cannot be expressed as sum of 2 primes. Also both the numbers cannot be non-prime since it would not be possible to determine them. Hence, exactly 1 number should be prime & 1 non-prime.
  • Now the sum of 2 nos. cannot be even since every even umber can be expressed as a sum of 2 primes which violates the above case. Due to the same reason, nos. given by prime + 2 can also not be the sum. Ruling out all these gives way to some 24 possible values of sum b/w 1 & 99 which is the set {11 17 23 27 29 35 37 41 47 51 53 57 59 65 67 71 77 79 83 87 89 93 95 97}
  • Now later Rohit says that he knows the numbers => which means he is able to factorize the product into numbers which gives the sum in the above set. So, developing the set of products & corresponding sums for numbers which lead to sum in above set.
  • Now Adam knows the numbers => there could be only 1 possible product that could yield that sum.
On solving, numbers come out to be 13 & 4; sum = 17 & product = 52
--
Regards,

Karan

gagan chaudhary

unread,
Aug 15, 2009, 10:21:06 AM8/15/09
to ds--al...@googlegroups.com
wat abt 7 & 4 sum = 11 and product = 28

Karan Jain

unread,
Aug 15, 2009, 11:30:41 AM8/15/09
to ds--al...@googlegroups.com
Now, in case of 4 & 7, Rob must have told Rohit the product to be 28. Now, Rohit finds out that 28 cannot be factorized into 2 primes & so, the factors possible are (2,14) or (4,7). But he also knows the sum cannot be even, hence (2,14) cannot be the case. So, as soon as you tell Rohit the product as 28, he can say that the numbers are 4 & 7. However, the problem says that he cannot find out the numbers initially until Adam admits that they cannot find the numbers. So, this case cannot hold owing to the given sequence of events.




--
Regards,

Karan

Shishir Mittal

unread,
Aug 15, 2009, 5:50:39 PM8/15/09
to ds--al...@googlegroups.com
You can download a detailed solution of the problem from http://www.cs.utexas.edu/users/EWD/ewd06xx/EWD666.PDF .
It describes well how from the 24 possible values for Sum and much more possible combinations of the answers, the final unique answer is retrieved.

I couldn't understand the given explanation for why the numbers (4,7) do not form a solution. Here is how I conclude that it isn't the answer.
S=11, P = 52,

11 can be expressed as sum of two numbers in multiple ways as (9+2,8+3,7+4,6+5) none of which is sum of two primes.
Hence, Adam concludes that both him and Rohit do not know the numbers.

P = 52 = 2 X 26 = 4 X 13.
Rohit is confused between two combinations (2, 26) and (4, 13). Possible sums being 28 and 17.
Rohit thinks that had the sum been 28, Adam could not have concluded that I do not know the numbers, because 28 can be expressed as sum of two primes (23 + 5). Hence, Rohit is sure that the Sum is 17, and the numbers are 13 & 4.

But, the key point here is the last statement from Adam "Me too".
In this case, he is unable to conclude the numbers from Rohit's answer, because he thinks that as Sum is 11, Rohit may have:
2 X 9 = 18, 3 X 8 = 24, 4 X 7 = 28, 5 X 6 =30.

18 = 2 X 9 = 3 X 6. Possible Sums ( 11, 9) among which only 11 can't be expressed as sum of primes => possible solution for Adam
24 = 2 X 12 = 3 X8 = 4X6 . Possible Sums (14, 11, 10) among which only 11 can't be expressed as sum of primes =>possible solution for Adam
30 = 2 X 15, 3 X 10, 5 X 6. Possible Sums (17, 13, 11) among which 17, 11 can't be expressed as sum of primes.

So, overall even after Rohit's answer, Adam would have been confused between the pairs (2,9), (3, 8), (4,7).
Hence (4,7) is not the solution to the problem.
--
Shishir Mittal
Ph: +91 9936 180 121
Reply all
Reply to author
Forward
0 new messages