The
unary numeral system is the simplest system for representing
natural numbers. In using the system, an arbitrary symbol is chosen; in order to represent a number
N, the chosen symbol is repeated
N times. For example, if we choose the symbol
X, the number 5 is represented as
XXXXX. The number of symbols is thus in one-to-one correspondence with the number to be represented. Counting on one's fingers is effectively a unary system. Unary may also be considered the base-
1 numeral system, with the exception that the unary digit represents the number 1 instead of 0, unlike
numeral systems of other bases, where digits typically range from 0 to the base minus one.
Compared to positional numeral systems, the unary system is inconvenient and is not used in practice. It would be cumbersome, for instance, to calculate 500 + 700 in the unary system. It occurs in some problem descriptions in theoretical computer science (e.g. some P-Complete problems), where it is used to "artificially" decrease the run-time or space requirements of a problem. For instance, the problem of integer factorization is suspected to require more than polynomial run-time if the input is given in binary, but it only needs linear runtime if the input is presented in unary.
All Wikipedia text
is available under the
terms of the GNU Free Documentation License