Improve your math and programming skills with Project Euler

Project Euler can be an addictive site for people who are passionate about mathematics and programming. You don’t need to be an expert in either of these two disciplines to participate in it’s challenges, but any such skills you may already possess will be an asset.

The author of the site, describes the project as follows:

Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.

When you first register, you will be presented with 252 problems available to be solved. This number changes frequently, however, as new problems are routinely created and added to the list. The solutions to some problems veer towards the obvious, while others require advanced mathematics to tackle. Likewise, a few can be solved with paper and pencil and a good dose of insight. Most however, will require the aid of a computer program written in the language of your choice.

A Project Euler problem
A sample problem (187)

Each program you execute should output your result within a minute. That’s part of the challenge, even though there is no way for the site to enforce this rule.

When you think you’ve found the correct result for a given problem, you can fill in the result field for the problem, and see if you got it right. If you have, your answer will be added to the list of problems you solved and will count towards your overall score, while bumping up your position on the participant scoreboards. There are several scoreboards, depending on what level you are at, which in turn is determined by the number of problems you have solved so far.

More importantly, solving a problem will gain you access to the respective forum (for that problem), where you’ll be able to see solutions and discussions from other participants, who may have used different languages and solution strategies.

Project Euler is appealing for a variety of reasons. In particular:

  • It allows you to explore areas of math that you might not be familiar with. Solving certain problems may require you do a fair amount of research and in turn help you to learn more about certain branches of mathematics;
  • If you are a math major who is trying to hone their programming skills, you’ll find Project Euler to be challenging, fun, and an excellent opportunity for improvement. Having to implement several small programs and being able to compare your style with those of other people in the forum, will definitely end up improving your knowledge of many algorithms and your skills as a programmer;
  • The site’s one minute rule has an important consequence. The computational complexity of your programs really ends up mattering. While some simple problems can in fact be brute forced, the majority of them require you to write faster algorithms and take advantage of mathematical insight so as to improve the performance of your program. For certain problems a naive approach would take more than a lifetime on current PCs;
  • Finally, if you are a programmer who’s scoping out a new programming language, be it Python, Ruby, Scala, Haskell or Erlang, you’ll find a great ally in Project Euler. Having to write hundreds of programs in a given language, will naturally increase your familiarity with that language. And again, comparing your newcomer coding style with those of more experience participants, will no doubt contribute to your advancement within the given language you’re focusing on.

Project Euler truly deserves five stars. I recommend it highly to anyone who is unafraid of writing a few lines of code in order to solve interesting math problems.

6 Comments

  1. Mike August 19, 2009
  2. NotMike August 19, 2009
  3. Antonio Cangiano August 19, 2009
  4. Matt August 19, 2009
  5. Lucas Gallindo August 24, 2009
  6. Seanba December 23, 2009

Leave a Reply