Sally asks Sam "Is your house number a perfect square?". He answers. Then Sally asks "Is is greater than 50?". He answers again.

Sally thinks she now knows the address of Sam's house and decides to visit.

Since Sally thinks that she has enough information, I deduce that Sam answered that his house number was a perfect square greater than 50. There are two of these {64,81} and Sally must live in one of them in order to have decided she knew where Sam lives.

When she gets there, she finds out she is wrong. This is not surprising, considering Sam answered only the second question truthfully.

So Sam's house number is greater than 50, but not a perfect square.

Sue, unaware of Sally's conversation, asks Sam two questions. Sue asks "Is your house number a perfect cube?". He answers. She then asks "Is it greater than 25?". He answers again.

Observation: perfect cubes greater than 25 are {27, 64}, less than 25 are {1,8}.

Sue thinks she knows where Sam lives and decides to pay him a visit. She too is mistaken as Sam once again answered only the second question truthfully.

Since Sam's house number is greater than 50, he told Sue that it was greater than 25 as well. Since Sue thought she knew which house was his, she must live in either of {27,64}.

If I tell you that Sam's number is less than Sue's or Sally's,

Since Sam's number is greater than 50, and Sue's is even bigger, she must live in 64. Assuming Sue and Sally are not roommates (although awkward social situations of this kind are not without precedent), Sally lives in 81.

and that the sum of their numbers is a perfect square multiplied by two, you should be able to figure out where all three of them live.

Sue + Sally + Sam = 2 p^2 for p an integer 64 + 81 + Sam = 2 p^2

Applying the constraint 50 < Sam < 64, looks like Sam = 55 (p = 10).

In summary,

Sam = 55 Sue = 64 Sally = 81

-- Tom Smith <tom@ulysses.att.com>

lib/DbaDatabase.php:134: Warning: dba_replace() [<a href='function.dba-replace'>function.dba-replace</a>]: You cannot perform a modification to a database without proper access