Puzzle...

One of my managers, who also happens to be a pretty smart guy, and I were having a discussion today. We were talking about various interesting subjects including Engineering subjects like Natural Language Processing (NLP) and AI. And he asked me, "How do we make a computer smart enough to be able to solve a puzzle?" Now the puzzle could be a mathematical puzzle, a logical puzzle or even a language puzzle. And just to give me an example he asked me a puzzle.

What is a 2 digit number, that, when multiplied with 9, gives a 3 digit number. Now the first digit of the 3 digit answer is the same as the first digit of the original 2 digit number and the last digit of the 3 digit answer is the same as the 2nd digit of the original 2 digit number and the 2nd digit of the 3 digit answer is 0.

so if XY * 9 = X0Y, what is X and Y?

Now the problems is quite simple and I could solve it in the time required by me to leave from my desk to my bike parked below. And that's like less than 2 minutes. The issue here is how did you approach this problem and how do you make a computer arrive to the best approach.

So this is a question to all readers. Please solve this problem and tell me how you solved it and what approach you took.

Published Thursday, January 03, 2008 4:51 PM by Nilotpal Das

Comments

Thursday, January 03, 2008 10:41 AM by Zach

# re: Puzzle...

Use the equation: (10x + y) * 9 = 100x + y

Solving yields: x = .8y

Since x and y must be whole numbers and single digit, the only solution is x = 4, y = 5.

Mathematically, you could solve for:

x/4 = y/5

Solving this equation with the constraints

0 <= x < 9 and 0 <= y < 9 will yield the same result as above. (yes, x = 0, y = 0 is also a valid solution)

A computer could also iterate through all possible values until it found a suitable answer.

Leave a Comment

(required) 
(required) 
(optional)
(required)