# Why is unary not a legitimate radix?

In binary the only digits are '0' and '1'. Let's define base-one (unary) as having '0' as its sole digit. There's an obvious problem, though - there can be no numeral representing zero, but there's also an obvious fix: '0' can represent (drum roll) zero, '00' represents one, '000' represents two, etc. '-00000000000' is negative ten in unary, for example. '$\frac{00}{000}$' in unary is a rational number, one half. It is clear to see that any rational can be represented in unary.

Question: in what ways is this radix a misfit? It can represent any number base-N can represent for any natural N greater than or equal to two, or can it?

• A positional system is defined by multiplying each digit with its positional value and adding up. Multiplying with $0$ always gives $0$, and adding those $0$s up still gives $0$. What you describe is, of course, a way to write integers, but not a positional system. – celtschk Sep 28 '16 at 19:10
• This amounts to denoting numbers using tally marks, just with 0 instead of a line and an extra mark appended to all tallies so as to include 0. – Semiclassical Sep 28 '16 at 19:16

The problem is that when an integer is represented in base $B$, its standard form is $n =\sum_{k=0}^{m(n)} d(n)_kB^k$ where $0 \le d_k < B$.

If $B=1$, then all the "digits" $d_k(n)$ have to be zero, so, as you have done, the number of unary digits for $n$ is $n$ (or $n+1$ to have a non-void representation of zero). This seems odd, which, of course, does not rule it out.

From a practical point of view, if $B > 1$, the base $B$ representation of $n$ takes $O(\log n)$ storage (more precisely, $O((\log B)(\log n))$ bits). Many algorithms working with integers depend on this to have a reasonable execution time.

My take: Yes, you can do it, and it might be OK if you are programming a Turing machine, but it would almost never be used in a real algorithm or computation.

• So, the main point is that unary doesn't fit the general standard definition of base-N? I can see that now. But unary is capable of representing the reals, right? – Michael Smith Sep 29 '16 at 9:05
• How would you represent $\pi$ in unary? – marty cohen Sep 29 '16 at 20:47
• π is irrational, meaning it has an infinite number of digits. However, it is impossible to write them all down. You can approximate π with rationals to any desired degree of accuracy, and write the result down (ignoring the physical limitations). – Michael Smith Sep 29 '16 at 23:42
• How would you represent 1/3 in unary? – marty cohen Sep 29 '16 at 23:53
• $\frac{00}{0000}$ – Michael Smith Sep 29 '16 at 23:55