History of AI

Who was Hero of Alexandria, and what machines did he describe?

· By Robert Scales · 4 min read

Short answer

Hero of Alexandria was a Greek-speaking mathematician and engineer who worked in Alexandria, Egypt, most likely in the 1st century CE. In books such as the Pneumatics and the Automata he described self-moving devices driven by air, water, weights and ropes, from temple doors that opened on their own to a cart that followed a preset route.

Hero of Alexandria (also spelled Heron) wrote some of the earliest surviving instructions for building machines that move by themselves. His books describe birds that sing when water flows, figures that pour drinks, doors that swing open when a fire is lit, and a little theater whose scenes play out with no one touching it.

None of these machines think. But they show a key step on the long road to computing: the idea that you can set up a sequence of actions in advance and let a machine carry it out alone. In 2019, that idea sits under every program we run.

When and where Hero lived

Very little about Hero's life is certain. His name and his city, Alexandria in Egypt, are nearly all that is known. Even his century has been argued over. The preface to the 1851 English translation of his Pneumatics weighs estimates that placed him anywhere from the 3rd to the 1st century BCE. Modern reference works place him later, in the 1st century CE, often giving his life dates as roughly 10 to 70 CE.

Alexandria was then part of the Roman Empire but remained a center of Greek learning, home to the famous Library and the Musaeum, a research institution. Many of Hero's writings read like lecture notes on mathematics, mechanics and air pressure, which suggests he taught there.

What he wrote

Several of Hero's books survive, some in Greek and some only in Arabic or Latin translation. Two matter most for this story:

  • The Pneumatics, about machines worked by air, steam and water pressure. The 1851 English translation lists 78 devices.
  • The Automata, about devices that create wonders in temples and theaters, such as doors that open by themselves and statues that pour wine.

A sample of devices from the Pneumatics gives a feel for his range:

DeviceWhat it does
Whistling birdA bird figure whistles when flowing water pushes air through a pipe.
Coin-operated vesselDropping in a coin releases a measured amount of water, an early vending machine.
Drinking automatonA figure "drinks" a liquid held up to it.
Dancing figuresHot air from an altar fire turns figures in a dance.
Temple doorsLighting a fire on an altar makes the doors swing open, and they close when it goes out.
Steam devicesA jet of steam holds a ball in the air, and steam boilers make a blackbird sing or a Triton blow a horn.

How the temple doors work

The temple doors are a good example of Hero's thinking, because every step can be followed:

  1. A fire is lit on a hollow altar. The air inside heats up and expands.
  2. The expanding air flows through a tube into a closed sphere half full of water.
  3. The pressure pushes the water out through a bent pipe into a bucket hanging from chains.
  4. The bucket gets heavier and sinks. Its chains are wound around the door hinges, so as it drops, the doors turn open.
  5. When the fire dies, the air cools, the water is drawn back into the sphere, the bucket lightens, and a lead counterweight pulls the doors shut.

To worshippers, it would look as though the gods had accepted the offering. To Hero, it was a chain of cause and effect: heat, pressure, weight, motion.

Try it: Pick something automatic in your home, like a toilet cistern or a thermostat. Write down its steps the way Hero's doors are written above, from trigger to result. You have just described a simple control system.

The mechanical theater and the programmable cart

Hero's Automata goes further. He described a fully mechanical play, about ten minutes long, driven by ropes and knots wound around a rotating cylinder. As a falling weight turned the cylinder, ropes pulled in turn, scenes changed, figures moved, and thunder sounded when metal balls dropped onto a hidden drum.

He also described a small cart powered by a falling weight. The cart's movements were set by the way strings were wound around its drive axle. Change the winding and you change what the cart does.

Can Hero's machines be called programmed?

In a limited but real sense, yes. A program is a set of instructions, prepared in advance, that a machine follows step by step without someone guiding each move. Hero's theater and cart fit that description. The "instructions" are physical: the pattern of rope around an axle, the order of knots and pegs. Rewind the rope differently and the same machine performs a different sequence. That separation between the machine and the instructions it follows is the heart of programming.

What Hero's machines cannot do is respond to the world in any flexible way. They do not sense, decide or learn. Once started, they play their sequence to the end, like a music box. Modern computers add two things Hero lacked: the ability to store and change instructions easily, and the ability to branch, doing one thing or another depending on what they detect.

That is why historians of computing often start with Hero. In 2019, a voice assistant answering a question or a game program choosing a move is still following instructions, though vastly more complex ones, many of them learned from data rather than wound by hand. The basic idea of setting up actions ahead of time and letting a machine carry them out was already on paper in Alexandria nearly two thousand years ago.

Sources

  1. The Pneumatics of Hero of Alexandria (translated by Bennet Woodcroft, 1851) — University of Rochester, Steam Engine Library (web edition 1996), December 1, 1996
  2. Hero of Alexandria — Wikipedia (archived January 2019), January 20, 2019

Get the free Guide to Artificial Intelligence

Sign up for the weekly newsletter and receive the free guide: what changed in AI this week, one lesson, one prompt to try. Unsubscribe in one click.

How we handle your address

Back to top

Display

Your choices are saved in this browser only. No data is sent.

Text size
100%
Colours
Reading
More settings
Accessibility statement