Home Home  Article Index Article Index  
GuruPedia  

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 , the number 6 is represented as ′′′′′′. While counting, this allows updating written intermediate results without erasing or discarding anything written down.

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.

Popular Topics

This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.  For the live article, click here.

Privacy