# Number of symbols required to represent a number in unary?

I was thinking about the different number systems, and realised that technically binary is not the simplest. The simplest is unary - i.e. powers of 1. Wikipedia confirms this view: https://en.wikipedia.org/wiki/Unary_numeral_system

I was wondering what the representation of a number would look like in this system and it seems to be a tally format.

However, this system does not seem to fit the pattern we see in other bases. Decimal requires 10 different symbols (if you include 0), nonary requires 9, down to binary which requires 2. Surely then unary should require 1 by following this pattern through. You could argue it does, and that unary has its equivalent in a tally system. However, by including the symbol 1, do we not implicitly imply the existence of the symbol 0? If there is something, then surely its absence implies nothing? This would mean of course that both binary and unary require two symbols to represent them.

Even if you argue that decimal only really requires 9 symbols, with 0 being implied by the absence of a symbol. In this case, how could we possibly represent a number in unary with no symbol other than the implied 0?

• Unary system is very old: our ancestors were already using it to tally on a bone the number of sabertooth tigers they had killed... – Jean Marie Apr 1 '17 at 23:21

The name "unary" is a bit of a misnormer because it is not the same as a base-$b$ positional system with $b$ set to $1$. Really, as you say, it is just a tally system that has been unjustly dignified with a fancier name. But that doesn't change what it is.

In a positional system we have digits to represent the numbers from $0$ to $b-1$, inclusive, but in unary representation, the single symbol represents $1$ instead of the $0$ one would get by setting $b=1$.

In practice both systems require an additional symbol (or some kind of out-of-band signaling) to delineate where the representation of a number starts and ends. For theoretical purposes base-$b$ gives us the option of observing that leading zeroes don't matter, so we can pretend a base-$b$ representation is an infinite (to the left) sequence of digits of which only finitely many is nonzero -- but that is not practical for actually writing down things.

One might attempt to define a positional system that would generalize to unary for $b=1$ in a smoother way. Then the digits would be $1$ through $b$, so in base ten we would count

1, 2, 3, 4, 5, 6, 7, 8, 9, X, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1X, 21, 22, ...


A hundred would be 9X, hundred and one would be X1, a thousand would be 99X, zero would not be representable (or be represented by the empty string of digits), and there would be no concept of leading zeros; each positive number having exactly one representation.

But there would still be uneasy points. Carries when adding in base ten or base two would still be bounded, but in base one arbitrarily large carries can be necessary when adding large numbers.

All in all, probably not worth the trouble.

When binary is defined to be only using 1 and 0, then unary can ONLY use 1, and zero has to be implicit.

Worth noting: unary is a terrible counting system, take the number 128(decimal) this translates to 80 in hex, or 10000000 in binary, or 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 in unary, now its clear to see why NO ONE uses the system, you can't see at a glance the range of orders of magnitude you're dealing with, also it takes ages to count, every other sensible base system can be counted quickly

back to the question: "I was wondering what the representation of a number would look like in this system and it seems to be a tally format." it is literally a tally format, and it is a very bad system, also you can't ahve zero... its only used in specific circumstances