Friday, February 25, 2011

Crunching elephants

Apparently the physict Freeman Dyson came up with a complex formula in 1953 and when Enrico Fermi saw it, he just did not like the complexity. Fermi in his quest for simplicity and elegance apparently quoted John von Neumann who had said:
"With four parameters I can fit an elephant, and with five I can make him wiggle his trunk"
I was recently muddling with some techniques for shape quantification which has applications for field biologists, for instance to match or compare biological shapes. Naturally I decided to try out what are termed as elliptic Fourier descriptors - an idea based on the epicyclic movements of planets that goes back to ancient times although the mathematical forms are relatively new. A lovely demonstration of the concept can be found here. The problem of getting the parameters from a given closed curve however is not shown by that applet. The reduced number of terms to describe a closed curve, elliptic Fourier descriptors, have been widely used in analysing shapes for systematics. 
Mathematically reduced elephant

What got my attention was a 2010 paper (I usually stay away from physics) titled "Drawing an elephant with four complex parameters" where the authors try to reconstruct an elephant with four complex numbers and wiggle its trunk with a fifth ! This was attempted earlier in 1975 with least-squares Fourier series fitting but that apparently took 30 parameters. The figures in the new paper show that they managed to do something close.

Program Screenshot: My elephant clearly beats the math
I decided to write up a program and see for myself but have been able to get a passable elephant only with 8 parameters and that is 8 sets of 4 real numbers (a, b, c and d of Kuhl and Giardina can be considered as two complex numbers) and so not as good as the results of the authors of the 2010 paper.  Maybe my elephant is too complex for the math. In case you want to play around with the idea, download (Windows unfortunately, but works in Wine) the small program  that I wrote today from here - you can also find some Matlab code here.

Further reading

1 comment:

  1. Most interesting! But...I'll continue to just draw my elephants:)

    ReplyDelete