« Groaner | Main | Groaner II »

September 07, 2004

TechTip: Google Labs Aptitude Test (GLAT)

A friend sent me an interesting puzzle. The gist of it is an equation: WWWDOT-GOOGLE=DOTCOM. The only other information was that there were no leading zeros. I sort of assumed that meant that each letter stands for a single digit (no repeats) between 0 and 9. Fooling around with some logic, I derived two solutions but I wondered how many more there could be.

Later I realised that there were only 9 letters (not 10) so maybe the numbers should have been 1..9 instead of 0..9.

I decided instead of attacking the problem logically to attack it programatically instead. It turns out that there are no solutions in the 1..9 space (assuming no two numbers are the same) and there are exactly two solutions in the 0..9 space (again with no two numbers the same).

If any one cares, I can post the code (or the working) but why not try solving it for yourselves?

Posted by Ozguru at September 7, 2004 06:00 AM


In the puzzle the values for m and e can be interchanged...

Posted by: dogsoldier at September 7, 2004 07:09 PM

That was my conclusion as well. I derived two answers by building sets of equations but I wasn't sure if they were the only two answers (i.e. had I missed any). So I wrote a perl program to test a;; 1e6 permutations and it turns out that:

1. there are no solutions if you use 1..9

2. there are exactly two solutions if you use 0..9 (and as you noted e/m are interchangeable)

3. there are 216 solutions if you don't insist on unique numbers.

Hope you had fun doing it :-)

Posted by: Ozguru at September 7, 2004 07:09 PM

Hey Oz,

I figured it out by guess and check. Spent about 5 hours straight on it. Woo hoo! =)

Posted by: NotOzguru at September 7, 2004 07:09 PM

Well that was quicker than me. I should have thought of coding it sooner instead of trying to solve it algebraically. Coding all the combinations took me about 3 hours but the algebraic method took about 10 hours over four days - my maths must be getting rusty.

Congrats on such a quick result.

Posted by: Ozguru at September 7, 2004 07:09 PM

Thanks. I thought about coding it too, but I thought it was a waste of time.

Posted by: Kareem at September 7, 2004 07:09 PM

[...] ptitude Test Filed under: Puzzles — Ozguru @ 10:00 pm Ever since I posted this article about the Google Labs Aptitude Test puzzle [...]

Posted by: G'day Mate! » Google Labs Aptitude Test at September 7, 2004 07:09 PM