Tuesday, February 3, 2009

Project Euler: a good source of programming problems

Project Euler might be a good source of programming problems for a CS1 course.
"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."
The project was started in 2001 and now has 230 problems. Each one has a short description and can be solved by a computer program that runs in a minute or less on a modest computer. Here's an example of one of the problems (#5):
"2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.What is the smallest number that is evenly divisible by all of the numbers from 1 to 20?"
The site shows statistics (if you register) that show the programming languages used by people who have submitted solutions. Python is second only to C/C++ in the ranking.

1 comment:

Will Murnane said...

Interesting that this is mentioned; I've solved 57 of the Euler problems so far. I think some of the problems are too math-oriented to make them reasonable intro-to-CS problems, but nonetheless there are some very interesting algorithmic concerns with some of the problems that might be good for a more advanced class. Problem 14, for example, might be a neat way to introduce memoization, while problem 18 followed by 67 make a great dynamic programming problem.