Friday, September 05, 2008

Euler or Broke

Two weekends ago via XKCD I found out about Project Euler. It's a series of maths/computer programming problems to be solved. It's proved an interesting project to while away my hours. I don't think I've played Civilization IV since I started on the problems.

I think though I've now reached the point where I've got most of the low lying fruit. The first problems were easy enough, but now they're taking a lot longer to solve. It also seems to be a test of the strengths of your language of choice. So far I've been using a Matlab clone. On one problem it wasn't giving me the right answer despite everything I did to refine my code. When I put the same algorithm into Mathematica, it gave me the correct answer right away. That really annoyed me. I'm not sure if I make a full switch, since that'll take a fair bit of learning to get up to the same speed on Mathematica as I'm at with Matlab, although it seems to make a few things a lot easier. One problem can be done in one line of Mathematica that took me about 60 lines in Matlab. Admittedly it was a rather crude algorithm but still, that's a big change, and it ran a lot quicker too.

There is no doubt though that I will not complete all the problems any time soon. Problem #202 seems well beyond me (take a look for yourself if you think I'm wussing out), and there are more, tougher problems on the way.

I have learnt a few things along the way, and it's been good to flex the old maths muscles again.

End Post
Writing time: 19 minutes
Time since last post: Too long
Current media: The Colbert Report

No comments: