Skip to content

The Unary System

How do you represent quantities in the most primitive way possible?

You just asked the question all of humanity asked itself thousands of years ago. And the answer they found was so simple it's almost disappointing.

One mark for each thing.

Want to count how many sheep are leaving the pen? Make a mark for each one on its way out. Want to know how many days you've been locked in that cell? Scratch a line on the wall for each day that goes by. How many blue Beetles drove past in an hour? A little dot in your notebook for each one you see.

Unary SystemUnary System
Unary System Richard Dias Alves @ Ultimate Rust, 2025. License CC BY-NC-SA 4.0.

That's the unary system. There's only one symbol (chosen by you), like a mark, a line, a pebble, a knot in a rope, and the value of any quantity is simply the number of times that symbol appears. There's nothing complex anyone needs to learn to understand this counting system. Nothing to memorize. If you can count, you can use the unary system.

It Works. But...

The unary system solves the problem we identified in the previous section: information leaves your head and goes somewhere physical. You can look at the cave wall and know, without depending on your memory, how many days have gone by.

But try to picture the following scene: you're a general in charge of an army of 900 soldiers. You need to send a message to the king reporting how many men you have under your command. Using the unary system, how would you do that?

Using the unary system, that message would be a sheet of paper with nine hundred marks.

900 soldiers900 soldiers
900 soldiers Richard Dias Alves @ Ultimate Rust, 2025. License CC BY-NC-SA 4.0.

If you stop and think, you'll conclude on your own that this brings two main problems:

  • The first is practical: writing nine hundred marks takes time.
  • The second is the one that matters most: even if you wrote them all, the king wouldn't be able to read it. Not easily. Looking at a page covered in marks and knowing there are exactly 900 - and not 899 or 901 - means counting every single one yourself. And what if you lose track halfway through?

The information is there, but it's inaccessible at any real scale.

The unary system scales very badly. It works perfectly for small quantities - five sheep, seven days, ten Beetles... But as the numbers grow, it becomes slower and slower to write and harder and harder to read.

What the Unary System Teaches Us

Despite its limitations, the unary system proved something that will be fundamental to everything we study from here on out: it's possible to represent the idea of "how much there is" using something physical, in a way that another person, in another place and at another time, can recover exactly the same information. That principle works. The problem is just the efficiency of the representation.

And once you understand that, it's natural for another question to pop into your head: what makes a representation good?

The unary system uses one symbol to represent each unit. What if, instead, we used different symbols to represent different quantities? For example, a vertical line could keep being a symbol that represents 1 unit, but we could decide that the same line drawn horizontally now represents 2 units.

While writing this, I kept track of how many times I looked at my cat. See if you can figure out how many times it was:

Times I looked at my catTimes I looked at my cat
Times I looked at my cat Richard Dias Alves @ Ultimate Rust, 2025. License CC BY-NC-SA 4.0.
Answer

7 times

With just five lines, I managed to represent a quantity greater than the number of lines I drew. It's starting to get better, but how do we improve it even more?

See, I decided that one of those lines would mean two units of something. But it could've been three, ten, a hundred... For a symbol to have meaning, all it takes is for the person writing and the person reading to agree on what it means. You and I agreed it would be that, but if someone else saw only the lines, would they be able to tell that it means I looked at my cat that many times? And what if we had more symbols for different quantities, and we all reached a consensus on their meanings?

That's the intuition behind practically every numbering system humans have ever invented, including the one you and I use every single day.

Before moving on

Can you explain how the unary system works and why it scales badly?

If so, you're ready for the next page.