Unary numeral system

The unary numeral system is the numeral system that represents natural numbers by stringing together multiple instances of an arbitrarily-chosen symbol; in order to represent a number N, the chosen symbol is repeated N times. For example, if we choose the symbol | (a tally mark), the number 6 is represented as ||||||. While counting, this allows updating written intermediate results without erasing or discarding anything written down.


8 in unary
||||||||
||||| |||
/|||| /||
|||| |||

Often marks are clustered in groups of five. Often the first or fifth mark is written at an angle to the others. (This should not be mistaken for a base-5 numeral system.)

Counting on one's fingers is effectively a unary system.

Addition is particularly easy in the unary system, as it is nothing but string concatenation. Multiplication is very cumbersome, however.

Compared to positional numeral systems, the unary system is inconvenient and is not used in practice for large calculations. 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.


sl:Eniški_številski_sistem

This article is licensed under the GNU Free Documentation License. It uses material from Wikipedia article. Browse Wikipedia for more information.