Why the Romans were pants at maths

Paul Curzon, Queen Mary University of London

The Romans were great at counting and addition but they were absolutely pants at multiplication. It wasn’t because they were stupid. It was because they hadn’t invented a good way to represent numbers, and that meant they needed really convoluted algorithms.

The Roman system is based on an earlier really simple way of writing numbers. You just put a line for each thing you’ve counted. Its probably the way shepherds kept count of sheep, drawing a line for each sheep. Those lines turned into the Roman letter I. To add 1 to a number you just add another I. You count: I, II, III, and so on and it makes counting easy.

This system is called unary – whereas binary involves counting with two symbols, 1 and 0, in unary you only have one symbol to count with. Addition in unary is easy too at least for small numbers. Take the first number and add on the end all the Is for the second and you’ve got the answer number. This is exactly the way we all start doing addition on our fingers.To add 2+3, hold up 2 fingers (II) then hold up another three fingers (III) and you have the answer (IIIII).

This is fine for small numbers but it gets a bit tedious as the numbers increase (and you run out of fingers!) Comparing numbers is easy in principle – do you have the same number of Is, but hard in practice for large numbers. We can’t keep all those Is in our head so a large number is hard to think about. To get round this the Romans invented new letters to stand for groups of Is. This is what we do when we tally numbers making a crossbar for every fifth number we count. It helps us keep track of larger numbers. The Romans invented a whole bunch of symbols to help: so for example in the Roman numeral system, V stands for 5 (IIIII), X stands for 10, L for 50, C for 100, D for 500 and M for 1000. They had invented a new way to represent numbers.

Image by Katie Rose from Pixabay

This makes it much easier to write and compare larger numbers. Now when counting and you get up to 5 you just replace all those Is with a V and then carry on adding Is: VI, VII, VIII, VIIII. Then you get to VIIIII (10) so replace it all with an X, starting again adding a new lot of Is: XI, XII, XIII, XIIII, XV, and so on. Counting large numbers is now a bit more involved – the algorithm involves more than just adding an I on the end, but it is much more convenient. The addition algorithm has now become more complicated, though it is still fairly simple too. Take any two numbers to add like VII and VIII and string them together: VIIVIII. Now group together the same letters: VVIIIII. Anywhere you have enough to replace symbols with the next character do so. VV can be replaced by X and IIIII can be replaced by V to give XV in the above. Keep making replacements until you can make no more. Put the symbols in order from largest to smallest symbol and you have your answer.

Now the Romans were obviously a bit lazy as bored with writing even four Is in a row they sometimes introduced a new set of abbreviations, so that IIII became IV and VIIII became IX. Putting a smaller symbol (like I) before a larger one (like X) instead of after meant subtract it to get the number. so IX means “one less than 10” or 9. Counting just got a tiny bit more complicated to get the advantage of writing fewer symbols. Addition now needs a more convoluted algorithm though. There are several ways to do it. The easiest is actually just to change the numbers to add to the simpler form (so IV goes back to IIII). You them do the addition that way, and convert back at the end. Addition just got that little bit harder, and all because of a change in representation.

Worse, doing any more complicated maths is even harder still using the Roman number representation. See if you can work out how to multiply Roman numbers. The Roman number system doesn’t help at all. The only really easy way is to just repeatedly add ( so III x VI is VI + VI + VI). That just isn’t practical for large numbers. Try it on XXIII x LXV1. There are other possible ways including one that is actually based on the binary multiplication algorithms computers use – multiplying and dividing repeatedly by 2. See if you can work out how to do it. Whatever way you do it, its clear that the number system the Romans chose made maths hard for them to do!

A good representation makes maths easy. A bad one makes it much harder to do

Image by Michael Kauer from Pixabay

Luckily, Indian and Arabian scholars understood that the representation they used mattered. They invented, and spread, the Hindu-Arabic numbers and decimal system we use today. What is special about it is that rather than introducing new symbols for bigger and bigger numbers, the position of a symbol is used instead. As we go from nine to ten we go back to the start of our symbols, from 9 back to 0, but stick a 1 in a new 10s column to count how many 10s we have. Counting is still pretty easy but suddenly not only is the algorithm for addition straightforward but we can come up with fairly simple algorithms for multiplication and division too. They are the algorithms you learn at school – though as with any algorithm making sure you follow the steps exactly and don’t miss steps is hard for a human (unlike for a computer). That is why we tend to find learning maths hard at first and it gets easier the more we practice.

In fact Romans needing to do serious maths probably used a variation of an abacus representing numbers with stones. They would do a calculation on the abacus and then convert the answer back into the Roman number system. And guess what. The Roman Abacus uses columns to represent larger numbers in a very similar way to the Hindu-Arabic system. The Romans understood that representation matters too.

Image by Hans from Pixabay

Sometimes things are hard to do just because we make them hard! The secret of coming up with good algorithms is often to come up with a good representation first. In programming too, if you come up with a good way to represent data, a good data structure, you can often then make it much easier to write an efficient program.


This article was first published on the original CS4FN website.


EPSRC supports this blog through research grant EP/W033615/1.

Beheading Hero’s mechanical horse – an early ‘magical’ (nearly headless) automaton from Ancient Greece

by Paul Curzon, Queen Mary University of London

Stories of Ancient Greece abound with myths but also of amazing inventions. Some of the earliest automatons, mechanical precursors of robots, were created by the Ancient Greeks. Intended to delight and astound or be religious idols, they brought statues of animals and people to life. One story holds that Hero of Alexandria invented a magical, mechanical horse that not only moved and drank water, but was also impossible to behead. It just carried on drinking as you sliced a sword clean through its neck. The head remained solidly attached to body. Myth or Mystery? How could it be done?

The Ancient Greeks were clever. With many inventions we think of as modern, the Greeks got there first. They even invented the first known computer. Hero of Alexandria was one of the cleverest, an engineer and prolific inventor. Despite living in the first century, he invented the first known steam engine (long before the famous ones from the start of the industrial revolution), the first vending machine, a musical instrument that was the first wind-powered machine, and even the pantograph, a parallelogram structure used to make exact copies of drawings, enlarged or reduced. Did Hero invent a magical mechanical horse? He did, and you really could slice cleanly through its robotic neck with a sword, leaving the head in place.

Magic, myth and mystery

Queen Mary’s Peter McOwan* was fascinated by magic and especially Hero’s horse as a child, and was keen to build one. When TEMI, a European project was funded he had his chance. TEMI aimed to bring more showmanship, magic and mystery to schools to increase motivation. By making lessons more like detective work, solving mysteries, they can be lots more fun. The project needed lots of mysteries, just like Hero’s horse, and artist Tim Sargent was commissioned to recreate the horse.

If you’re ever in Athens, you can see a version of Hero’s horse, as well as many other Greek inventions at Kotsanas Museum of Ancient Greek Technology.

How does it work?

The challenge was to create a version that used only Ancient Greek technology – no electricity or electromagnets, only mechanical means like gears, bearings, levers, cogs and the like. It was actually done with a clever rotating wheel. As the sword slices through a gap in the neck, it always connects head and body together first in front, then behind the blade. Can you work out how it was done?

See a video of the mechanism in action below, with Peter introducing it.


This article was first published on the original CS4FN website and there is a copy in Issue 26 of the CS4FN magazine which is a memorial issue for *Peter McOwan, who died in June 2019. Peter, along with Paul Curzon, was one of the co-founders of CS4FN. You can download a free PDF copy of the magazine, called “Peter W McOwan: Serious Fun”, from our downloads site – along with copies of all of our other free material.


Related Magazine …


EPSRC supports this blog through research grant EP/W033615/1.

An ode to technology

by Paul Curzon, Queen Mary University of London

Cunning contraptions date back to ancient civilisations.

A female statue staring with head turned
Image by Devanath from Pixabay

People have always been fascinated by automata: robot-style contraptions allowing inanimate animal and human figures to move, long before computers could take the place of a brain.

Records show they were created in ancient Egypt, China, and Greece. In the renaissance Leonardo designed them for entertainment, and more recently magicians have bedazzled audiences with them.

The island of Rhodes was a centre for mechanical engineering in Ancient Greek times, and the Greeks were great inventors who loved automata. According to an Ode by Pindar the island was covered with automata:

The animated figures stand.

Adorning every public street.

And seem to breathe in stone,

Or move their marble feet.

Pindar

More on …

Cunning Computational Contraptions

Related Magazines …


This article was funded by UKRI, through Professor Ursula Martin’s grant EP/K040251/2 and grant EP/W033615/1.

AI Detecting the Scribes of the Dead Sea Scrolls

Computer science and artificial intelligence have provided a new way to do science: it was in fact one of the earliest uses of the computer. They are now giving new ways for scholars to do research in other disciplines such as ancient history, too. Artificial Intelligence has been used in a novel way to help understand how the Dead Sea Scrolls were written, and it turns out scribes in ancient Judea worked in teams.

The Dead Sea Scrolls are a collection of almost a thousand ancient documents written several thousand years ago that were found in caves near the Dead Sea. The collection includes the oldest known written version of the Bible.

The cave where most of the Dead Sea Scrolls were found.

Researchers from the University of Groningen (Mladen Popović, Maruf Dhali and Lambert Schomaker) used artificial intelligence techniques to analyse a digitised version of the longest scroll in the collection, known as the Great Isaiah Scroll. They picked one letter, aleph, that appears thousands of times through the document, and analysed it in detail.

Two kinds of artificial intelligence programs were used. The first, feature extraction, based on computer vision and image processing was needed to recognize features in the images. At one level this is the actual characters, but also more subtly here, the aim was that the features corresponded to ink traces based on the actual muscle movements of the scribes.

The second was machine learning. Machine Learning programs are good at spotting patterns in data – grouping the data into things that are similar and things that are different. A typical text book example would be giving the program images of cats and of dogs. It would spot the patterns of features that correspond to dogs, and the different pattern of features that corresponds to cats and group each image into one or the other pattern.

Here the data was all those alephs or more specifically the features extracted from them. Essentially the aim was to find patterns that were based on the muscle movements of the original scribe of each letter. To the human eye the writing throughout the document looks very, very uniform, suggesting a single scribe wrote the whole document. If that was the case, only one pattern would be found that all letters were part of with no clear way to split them. Despite this, the artificial intelligence evidence suggests there were actually two scribes involved. There were two patterns.

The research team found, by analysing the way the letters were written, that there were two clear groupings of letters. One group were written in one way and the other in a slightly different way. There were very subtle differences in the way strokes were written, such as in their thickness and the positions of the connections between strokes. This could just be down to variations in the way a single writer wrote letters at different times. However, the differences were not random, but very clearly split at a point halfway through the scroll. This suggests there were two writers who each worked on the different parts. Because the characters were otherwise so uniform, those two scribes must have been making an effort to carefully mirror each other’s writing style so the letters looked the same to the naked eye.

The research team have not only found out something interesting about the Dead Sea Scrolls, but also demonstrated a new way to study ancient hand writing. With a few exceptions, the scribes who wrote the ancient documents, like the Dead Sea Scrolls, that have survived to the modern day, are generally anonymous, but thanks to leading-edge Computer Science, we have a new way to find out more about them.

Explore the digitised version of the Dead Sea Scrolls yourself at www.deadseascrolls.org.il

– Paul Curzon, Queen Mary University of London