
Computer scientists and mathematicians can be poets too, even writing poems about computation. One of my favourite poems is about recursion and was written by the Victorian logician Augustus De Morgan who is famous for his laws of boolean logic that are a mainstay of reasoning about boolean tests in programs.
Great fleas Have Lesser Fleas,
upon Their backs To Bite’em,
And Lesser Fleas Have Lesser fleas,
And So, Ad infinitum.
and Those great Fleas, Themselves, In turn
Have Greater Fleas To go On;
while Those Again have Greater still,
And greater Still, And So on.– Augustus De Morgan
Recursion, solving problems by breaking them into smaller versions of the same problem, is a way of writing programs that repeat just using function call (no while loops or for loops needed). It is a core concept of the programming paradigm, functional programming. Using recursion in a way that goes on forever as in the poem leads to non-terminating programs.
De Morgan was also Maths tutor of Victorian mathematician and computer scientist, Ada Lovelace. Her father was the great poet Lord Byron though (philistine that I presumably am) I like De Morgan’s poem better than Byron’s.
De Morgan made the idea of mathematical induction rigorous. It is the basis of how you prove recursive programs (and iterative ones) are correct.
Paul Curzon, Queen Mary University of London
More on …
Subscribe to be notified whenever we publish a new post to the CS4FN blog.
