Math Geeks Only

I wanted to take a brief moment to call some attention to Project Euler. Though I stumbled across it just recently, Project Euler has been around for nearly a decade now, and I find myself wishing that I had discovered it earlier. Like back when I was still in college and had loads to time to waste on arbitrary diversions.

But in any case, Project Euler is a set of mathematic-themed programming problems that anyone can attempt to solve. There are just over 300 problems available at the moment, and the difficulty increases progressively as you move from problem to problem. Solve enough of them, and you can be immortalized on the Project Euler leader-board (100 solutions are required to earn the first permanent ranking), if you care about that kind of thing.

Since finding Project Euler I’ve been compulsively solving problems almost non-stop. They start out quite easy, though some of the later ones do require a thoughtful approach to solve effectively. Particularly when you consider their “one-minute rule” in conjunction with the fact that there have been 5 to 6 iterations of Moore’s Law between now and when Project Euler was founded. One minute of computation-time back then should equate to roughly just 2-3 seconds of compute-time on a modern CPU (or perhaps more like 8-12 seconds for a single-threaded solution given that the past few iterations of Moore’s Law have focused more on increasing thread-level parallelism than on performance-per-clock in single-threaded workloads), which makes the “one-minute rule” quite a bit more challenging.

If you feel up to the task and don’t mind the possibility of introducing a massive time-sink into your life, I encourage you to give Project Euler a go. If you’re a coder with a head for numbers who likes to be challenged, I think you’ll find yourself enjoying it.

If you do take a shot at it, my advice is to keep your solutions as modular as possible (don’t just stuff all your code into main()). Many of the later problems build incrementally upon concepts introduced in previous problems, so if you always take the time to construct modular and well-defined functions (particularly in the areas of primality testing, factorization, and permutation computation) that can be reused in multiple solutions, you will be ahead of the curve.

This entry was posted in banter and tagged . Bookmark the permalink.

Leave a Reply