# Unary: Stone Age Numbers

Even stone age people did computation. They needed a representation of numbers. What did they use? And how does it link to the prayers of Muslims, Buddhists, Christians, Sikhs and Hindus?

Unary is the simplest way to represent a number. It is also the oldest, dating back to the Stone Age and used ever since. We still use it today when we count on our fingers, or keep simple tallies. Representing a number in unary just means using some object (like a finger or a pebble)  and collecting that particular number of things to keep track of how many of something else we have (cattle perhaps). Alternatively you can use a symbol (like X or 1) and just write it the right number of times.

So if I want to represent the number three then I can do that in unary by holding up 3 fingers or pushing three pebbles together. Using symbols instead of objects I could mark  XXX or 111 in the sand. To represent 9, I might hold up 9 fingers or write 111111111.

Unary therefore represents numbers using a single symbol (like 1). Compare that to our modern decimal system where we represent numbers using ten symbols (0,1,2,3,4,5,6,7,8 and 9). Computers represent numbers using binary. Then they have just two symbols (0 and 1) to make numbers from.

Stone Age people used unary to record numbers using symbols in a way that would last. They didn’t have paper or computers though. Instead they used lines as their symbol and carved lines as notches into animal bones or pieces of wood. The earliest examples  that have been found that might be tally sticks go back 40,000 years. For example the “Lebombo bone” is over 43,000 year old. It is a leg bone of a baboon, but may also represent the number 29 as it is carved with 29 notches.

What number does the bone above represent? (answer below)

Activity: Make your own tally stick

Find a nice stick and carve notches along it to record your favourite number.

Alternatively, get some modelling clay, shape it in to a long flat shape and mark notches in it to represent a particular number. Once dried, paint a colourful pattern on it, to show it is not just any old stone but something special that has a meaning.

The bone picture above is not just a bone, it is the number 6!

Algorithms on Numbers

Each different representation of a number leads to different algorithms to do computation with them. You probably have learnt how to do lots of things like add and subtract using our decimal system. Some operations are really easy in unary. Others are harder. Work out an algorithm to do each of the following in unary, assuming you are writing the symbol 1 multiple times on a piece of paper to represent a number. You have a rubber. You must write down one or more precise steps that someone else could follow to do the calculation.

• One of your cattle has a baby, so you want to add one more to your record of how many cattle you have.
• Subtract one
• One of your cattle dies, having been attacked by a wolf. You must subtract one from the total in your record of cows.

Try to work it out and write it down before you read on. These need only one step algorithms. Start by thinking of a specific example eg you have 4 cattle and want to add one. Your final instructions should work whatever the number.

Solutions

```To add one:
1. Mark a new 1 on the paper after the others```
```To subtract one:
1. Rub out the last 1 on the paper```

More algorithms

The following are slightly harder. You now need an instruction to repeat an operation eg

```REPEAT UNTIL  <something is true>
i) do the first step
ii) do the second step```
• You marry and so have combined two herds of cattle. You now want a record of the total number of cattle you own together.
• Subtract one number from another
• You swap three cattle with your neighbour for a pig. You want to still keep track of your total number of cattle.

Solutions

```To add any two numbers:
1. REPEAT UNTIL there are no 1s in the second number
i) rub out a 1 from the end of the second number
ii) put a 1 on the end of the first number```
```To subtract a second number from a another number:
1. REPEAT UNTIL there are no 1s in the second number
i) rub out a 1 from the end of the second number
ii) rub out a 1 from the end of the first number```

By the way dd you notice I am using unary to label the separate instructions in my loop!

In the above we have assumed you can rub out your marks. If you are carving marks on to a bone, rather than writing on paper, subtraction is a bit harder! You have a new restriction that you cannot remove a notch. Can you work out an algorithm that would allow you to subtract unary numbers and still maintain your records. HINT: You have lots of bones!What does this have to do with prayers in lots of different religions. Watch this space!.. But perhaps you can work it out for yourself.