The unary numeral system is the bijective base-1 numeral system. It is the simplest numeral system to represent natural numbers: in order to represent a number N, an arbitrarily chosen symbol representing 1 is repeated N times. For example, in this system the number 0 would be represented as the empty string, i.e. the absence of symbols, and the numbers 1, 2, 3, 4, 5, 6... would be represented as: These numbers should be distinguished from repunits, which are also written as sequences of ones but have their usual decimal numerical interpretation. This system is used in tallying. For example, using the tally mark|, the number 3 is represented as |||. In East Asian cultures, the number three is represented as “”, a character that is drawn with three strokes. In China and Japan, the character "正" is used to represent "five" in some situations because it is drawn with 5 strokes.
Compared to standard positional numeral systems, the unary system is inconvenient and hence is not used in practice for large calculations. It occurs in some decision problem descriptions in theoretical computer science, 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 a polynomial function of the length of the input as run-time if the input is given in binary, but it only needs linear runtime if the input is presented in unary. However, this is potentially misleading. Using a unary input is slower for any given number, not faster; the distinction is that a binary input is proportional to the base 2 logarithm of the number while unary input is proportional to the number itself. Therefore, while the run-time and space requirement in unary looks better as function of the input size, it does not represent a more efficient solution. In computational complexity theory, unary numbering is used to distinguish strongly NP-complete problems from problems that are NP-complete but not strongly NP-complete. A problem in which the input includes some numerical parameters is strongly NP-complete if it remains NP-complete even when the size of the input is made artificially larger by representing the parameters in unary. For such a problem, there exist hard instances for which all parameter values are at most polynomially large.