Project Euler


See Project Euler.

There are 50+ questions in Stack Overflow tagged "project-euler".  I suspect there are as many more that aren't properly tagged.

I had a vague sense of what Project Euler was about, and made the mistake of diving in a few weeks ago.  I've just reached level one and realized that the Project Euler problems are like shots of fine, single-malt scotch.  (Think Laphroaig.) 

An acquired taste, but very satisfying in appropriate doses.  

Python

I'm solving them in Python.   This would be a good way to learn or brush up on another language.  But, it's too much fun writing snappy little algorithms in Python.

The top 5 languages ranked (in order) are

  1. PARI/GP.  A library and shell for basic algebraic manipulations.
  2. Mathematica.  Famous toolset for doing mathematics in all forms.
  3. Python.  While I use it every day for basic business data processing, and I use it for Project Euler, I didn't realize it was so popular for this kind of mathematical work.
  4. Haskell.  Purely functional programming language.  
  5. APL/J/K.  APL, the J Language and the K Language are array-oriented languages, which makes them like a hybrid functional/procedural language.

Really, Python is ranked third.

I think I can see why.  Problems like Project Euler 1 can be solved in the interactive Python interpreter without really writing a proper script.

Python in Business

I use Python for business data processing because a lot of what constitutes the "IT" programming job is transformation of representation.  Database rows, XML documents, Python objects, Spreadsheets, HTML pages, JSON documents are all variant representations of the same underlying objects.

Since Python is interpreted, the mappings among the various representations are trivially represented as simple Python code.

But, because Python is partly functional, these complex Project Euler problems are made relatively easy. And is also simplifies the business data processing problems I'm paid to solve.


Posted: Saturday - March 07, 2009 at 10:18 AM
       

Author: Steven Lott
Technorati Tags:
Technorati Cosmos: Technorati Cosmos
Technorati Watchlist: Technorati Watchlist
Add this entry to: