Hand-drawn picture of Turing Machine

What is a Unary Number?



This question could also have been asked as What is the Unary Notation for a number? or What is the Unary Numerical System?



The Unary Notation is one of the five numerical notations discussed in Chapter 2 of Sir Roger Penrose's book The Emperor's New Mind. The other four notations are Binary, Denary, Expanded Binary, and Machine State. The last one is not so much a numerical notation as it is the Transition Function for a Turing Machine, but it can be converted to any one of the other notations, and for that reason it can also be thought of as a numerical notation.





The Unary Notation can be used to express any positive integer, and it is the simplest of all numerical notations. To represent a number in Unary Notation, you simply write the number 1 as many times as the value of the number.

For Example:

1 is written as 1
2 is written as 11
3 is written as 111
4 is written as 1111
5 is written as 11111

And so on.




Also, there may be leading and/or trailing 0's with the number, and its value does not change.

For Example:

001111111, 1111111000, 0011111110, and 000111111100000, are all representations of the same number 7.






Of the five numerical notations, only the Unary and Expanded Binary can be used to represent data on the paper tape that's used by the type of Turing Machine described in Roger Penrose's book The Emperor's New Mind. (The only exception is the Binary Notation, and that's only when it represents the Turing Machine Number for use by the Universal Turing Machine.)




Version 1.0 -- April 23, 2017
Template Version 1.0 -- May 19, 2017