Monday, 31 October 2011

Math(s) puzzle

Work on Topia continues but it's one of those phases where it's all UI and making underlying systems more flexible as it evolves from a tech demo into a real game, all stuff that would be pretty boring to blog about and possibly expose me as a hopelessly retro coder which I could probably attempt to pass off as hardcore optimisation or valid prototyping but, as I said, it would be pretty boring.

Instead, I'm going to set a very simple mathematical problem based on something I saw pointed out last week, I will credit where I saw it but not yet as that kind of ruins the effect. It's really simple maths, or as americans would say "math", I assume they dropped the 's' to make it available for referring to Lego as "Legos"...

The "puzzle"

You have to crack a combination lock with a 7 dials, each dial can be turned to ten positions, showing the digits 0-9, the only slightly weird thing about the lock is that each digit can occur only once in the correct combination.

You can try one combination per second.

How long will it take to try all valid combinations?

Give the answer in weeks, days, hours, minutes & seconds

(don't scroll down if you want to work it out, this is just padding
in case anyone is actually interested enough 
to post the answer in the comments)



  1. Huh - elegant answer. Similar to the observation I saw recently that 10! seconds is 6 weeks because 6 weeks is:

    (6) [weeks]
    *(7) [days in week]
    *(3*8) [hours in day]
    *(sqrt(9)*5*4) [minutes in hour]
    *(sqrt(9)*10*2) [second in minute]

  2. Exactly 7 days... Interesting

  3. 1 week. You have 10 possiblities for the first lock, but only 9 left for the second and 8 for the third... So, the number of combination (or seconds) is 10*9*8*7*6*5*4=604800 seconds... that's 1 week.

  4. I just thought it was cool, I saw the Mathjam Tweet (as described by Tom) but wanted to eliminate the '6' from the six week answer, 7 of 10 dials is 10!/3! combinations and 3! is of course 6. More proper blog posts coming soon