A little under two millennia ago1 there lived in the Egyptian city of Alexandria a Greek mathematician and inventor named Hero2, and he was a total badass who invented things that you probably thought came way later, and come up with mathematical tricks that we still use to this day3.
Inventions
Hero is variably credited with inventing, in some cases way earlier than you’re expecting:- automatic doors (powered either by pressure plates or by lit fires),
- vending machines, which used the weight of a dispensed coin to open a valve and dispense holy water,
- windmills (by which I mean wind-powered stationary machines capable of performing useful work),
- the force pump – this is the kind of mechanism found in traditional freestanding village water pumps – for use in a fire engine,
- float-valve and water-pressure based equilibrium pumps, like those found in many toilet cisterns, and
- a programmable robot: this one’s a personal favourite of mine because it’s particularly unexpected – Hero’s cart was a three-wheeled contraption whose wheels were turned by a falling weight pulling on a rope, but the rope could be knotted and looped back over itself (here’s a modern reimplementation using Lego) to form a programmed path for the cart
Mathematics
If you know of Hero because of his mathematical work, it’s probably thanks to his pre-trigonometric work on calculating the area of a triangle based only on the lengths of its sides.
But I’ve always been more-impressed by the iterative5 mechanism he come up with by which to derive square roots. Here’s how it works:
- Let n be the number for which you want to determine the square root.
- Let g1 be a guess as to the square root. You can pick any number; it can be 1.
- Derive a better guess g2 using g2 = ( g1 + n / g1 ) / 2.
- Repeat until gN ≈ gN-1, for a level of precision acceptable to you. The algorithm will be accurate to within S significant figures if the derivation of each guess is rounded to S + 1 significant figures.
That’s a bit of a dry way to tell you about it, though. Wouldn’t it be better if I showed you?
Put any number from 1 to 999 into the box below and see a series of gradually-improving guesses as to its square root6.
Interactive Widget
(There should be an interactive widget here. Maybe you’ve got Javascript disabled, or maybe you’re reading this post in your RSS reader?)
Maths is just one of the reasons Hero is my hero. And now perhaps he can be your hero too.
Footnotes
1 We’re not certain when he was born or died, but he wrote about witnessing a solar eclipse that we know to have occurred in 62 CE, which narrows it down a lot.
2 Or Heron. It’s not entirely certain how his name was pronounced, but I think “Hero” sounds cooler so I’m going with that.
3 Why am I blogging about this? Well: it turns out that every time I speak on some eccentric subject, like my favourite magic trick, I come off stage with like three other ideas for presentations, which leads to an exponential growth about “things I’d like to talk about”. Indeed, my OGN talk on the history of Oxford’s telephone area code was one of three options I offered to the crowd to vote on at the end of my previous OGN talk! In any case, I’ve decided that the only way I can get all of this superfluity of ideas out of my head might be to blog about them, instead; so here’s such a post!
4 If the diagram’s not clear, here’s the essence of the aeolipile: it’s a basic steam reaction-engine, in which steam forces its way out of a container in two different directions, causing the container to spin on its axis like a catherine wheel.
5 You can also conceive of it as a recursive algorithm if that’s your poison, for example if you’re one of those functional purists who always seem somehow happier about their lives than I am with mine. What’s that about, anyway? I tried to teach myself functional programming in the hope of reaching their Zen-like level of peace and contentment, but while I got reasonably good at the paradigm, I didn’t find enlightenment. Nowadays I’m of the opinion that it’s not that functional programming leads to self-actualisation so much as people capable of finding a level of joy in simplicity are drawn to functional programming. Or something. Anyway: what was I talking about? Oh, yeah: Hero of Alexandria’s derivation of square roots.
6 Why yes, of course I open-sourced this code.
0 comments