Numeral system
A numeral is a symbol or group of symbols that represents a number. Numerals differ from numbers just as words differ from the things they refer to. The symbols "11", "eleven" and "XI" are different numerals, all representing the same number. This article treats the various systems of numerals. See also number names.
A numeral system (or system of numeration) is a framework where a set of numbers are represented by numerals in a consistent manner. It can be seen as the context that allows the numeral "11" to be interpreted as the roman numeral for two, the binary numeral for three or the decimal numeral for eleven.
Ideally, a numeral system will:
- Represent a useful set of numbers (e.g. all whole numbers, integers, or real numbers)
- Give every number represented a unique representation (or at least a standard representation)
- Reflect the algebraic and arithmetic structure of the numbers.
Numeral systems are sometimes called number systems, but that name is misleading: different systems of numbers, such as the system of real numbers, the system of complex numbers, the system of p-adic numbers, etc., are not the topic of this article.
Table of contents |
2 History 3 Bases used 4 Positional systems in detail 5 Specific numeral systems 6 Change of radix 7 See also 8 External resources |
Types of numeral systems
The simplest numeral system is the unary numeral system, in which every natural number is represented by a corresponding number of symbols. If the symbol ′ is chosen, for example, then the number seven would be represented by ′′′′′′′. The unary system is normally only useful for small numbers. It has some uses in theoretical computer science. Elias Gamma coding is commonly used in data compression; it includes a unary part and a binary part.
The unary notation can be abbreviated by introducing different symbols for certain new values. Very commonly, these values are powers of 10; so for instance, if ′ stands for one, - for ten and + for 100, then the number 304 can be compactly represented as +++ ′′′′ and number 123 as + -- ′′′. The ancient Egyptian system is of this type, and the Roman system is a modification of this idea.
More useful still are systems which employ special abbreviations for repetitions of symbols; for example, using the first nine letters of our alphabet for these abbreviations, with A standing for "one occurence", B "two occurences", and so on, we could then write C+ D′ for the number 304. The numeral system of English is of this type ("three hundred [and] four"), as are those of virtually all other languages.
More elegant is a positional system: again working in base 10, we use ten different digits 0,...,9 and use the position of a digit to signify the power of ten that the digit is to be multiplied with, as in 304 = 3*100 + 0*10 + 4. Note that zero, which is not needed in the other systems, is of crucial importance here, in order to be able to "skip" a power. The Arabic numeral system is a positional base 10 system; it is used today throughout the world.
Arithmetic is much easier in positional systems than in the earlier additive ones; furthermore, additive systems have a need for a potentially infinite number of different symbols for the different powers of 10; positional systems need only 10 different symbols (assuming that it uses base 10).
History
- See also History of natural numbers and the status of zero.
The earliest known written tallies appear in the ruins of the Sumerian empire, using clay tablets impressed with a sharp stick and baked. The Sumerians had quite an exotic system based on counts to 60, used in astronomical and other calculations. This system was imported and used by every Mediterranean nation that used astronomy, including the Greeks, Romans and Egyptians. We still use it to count time (minutes per hour), and angle (degrees).
In China, armies and provisions were counted using modular tallies of prime numbers. Unique numbers of troops and measures of rice appear as unique combinations of these tallies. A great convenience of modular arithmetic is that it is easy to multiply, though quite difficult to add. This makes use of modular arithmetic for provisions especially attractive. Conventional tallies are quite difficult to multiply and divide. In modern times modular arithmetic is sometimes used in Digital signal processing.
The Roman empire used tallies written on wax, papyrus and stone, and roughly followed the Greek custom of assigning letters to various numbers. The Roman system remained in common use in Europe until positional notation came into common use in the 1500s.
The Incan Empire ran a large command economy using quipu, tallies made by knotting colored fibers. Knowledge of the encodings of the knots and colors was suppressed by the Spanish conquistadors in the 16th century, and has not survived although simple quipu-like recording devices are still used in the Andean region.
Some authorities believe that positional arithmetic began with the wide use of the abacus in China. The earliest written positional records seem to be tallies of abacus results in China around 400. In particular, zero was correctly described by Chinese mathematicians around 932, and seems to have originated as a circle of a place empty of beads.
From China, both the abacus and written tallies may have moved to India, perhaps via Chinese traders and businesses. In India, recognizably modern positional numeral systems, used for astronomy and accounting, appeared in the Mogul empire.
From India, the thriving trade between Islamic Moguls and Africa carried the concept to Cairo. Arabic mathematicians extended the system to decimal fractions, and al-Khwarizmi wrote an important work about it in the 9th century. The system was introduced to Europe with the translation of this work in the 12th century in Spain and Leonardo of Pisas Liber Abaci of 1201.
The binary system (base 2), propagated in the 17th century by Gottfried Leibniz who had heard about it from China, came in common use in the 20th century because of computer applications.
Bases used
The base-10 system, the one most commonly used by humans today, originated because we have ten fingers, thus allowing for simple counting. A base-eight system was devised by (at least) the Yuki Pomo of Northern California, who used the spaces between the fingers to count. The Maya civilization and other civilizations of Pre-Columbian Mesoamerica used base 20, (possibly originating from the number of a person's fingers and toes). Base 60 was used by the Sumerians and survives today in our system of time (hence the division of an hour into 60 minutes and a minute into 60 seconds). Base-12 systems were popular because multiplication is easier in them than in base-10, (addition just as easy) and because the year has twelve months; we still have a special word for "dozen" and use 12 hours for every night and day.
Switches (and their electronic successors, build of vacuum tubes, or later of transistors) have only 2 possible states: "open" and "closed". Substituting open=1 and closed=0 (or the other way around), one yields exactly the set of binary digits. Because arithmetics in a binary system are the easiest to describe electronically (using Boolean algebra), the binary system became natural for electronic computers. It is used to perform integer arithmetic in almost all electronic computers (the only exception being the exotic base-3 and base-10 designs that were discarded very early in the history of computing hardware). Note however that a computer does not treat all of its data as integers. Thus, some of it may be treated as texts and program data. Real numbers (numbers that can be not whole) are usually written down in the floating point notation, that has different rules of arithmetic.
Positional systems in detail
In a positional base-b numeral system (with b a positive natural number known as the radix), b basic symbols (or digits) corresponding to the first b natural numbers including zero are used. To generate the rest of the numerals, the position of the symbol in the figure is used. The symbol in the last position has its own value, and as it moves to the left its value is multiplied by b.
For example, in the decimal system (base 10), the numeral 4327 means (4×10^{3}) + (3×10^{2}) + (2×10^{1}) + (7×10^{0}), noting that 10^{0} = 1.
In general, if b is the base, we write a number in the numeral system of base b by expressing it in the form a_{1}b^{k} + a_{2}b^{k-1} + a_{3}b^{k-2} + ... + a_{k+1}b^{0} and writing the digits a_{1}a_{2}a_{3} ... a_{k+1} in order. The digits are natural numbers between 0 and b-1, inclusive.
If a text (such as this one) discusses multiple bases, and if ambiguity exists, the base is added in subscript to the right of the number, like this: number_{base}. Numbers without subscript are considered to be decimal.
By using a dot to divide the digits into two groups, one can also write fractions in the positional system. For example, the base-2 numeral 10.11 denotes 1×2^{1}+ 0×2^{0} +1×2^{-1} +1×2^{-2} = 2.75.
In general, numbers in the base b system are of the form:
If b=p is a prime number, one can define base-p numerals whose expansion to the left never stops; these are called the p-adic numbers.
Specific numeral systems
Positional systems
- b=2: Binary
- b=3: Ternary
- b=4: Quaternary
- b=5: Quinary
- b=6: Senary
- b=7: Septimal
- b=8: Octal or Octonary
- b=9: Novenary
- b=10: Decimal or Denary
- b=12: Duodecimal (used in the Chepang language of Nepal)
- b=13: Base 13
- b=16: Hexadecimal
- b=20: Vigesimal (see Maya numerals)
- b=25: Base 25 (see D'ni numerals)
- b=27: Base 27
- b=60: Sexagesimal (see Babylonian numerals)
- b=64: Base 64
- b=120: Base 120
- b=-3: Negaternary
- b=-2: Negabinary
- b=φ: Golden mean base
- b=2i: Quater-imaginary base
- b=sqrt(2)i: Binary square-root-2 times i base
- b=i - 1: Binary i-1 base
- b=Fibonacci number: Fibonacci coding
- b varies: Mixed radix
Other systems
Change of radix
The easiest way of converting integers between positive-integer radices is repeated division by the target radix; the remainders give the "digits" starting at the least significant. E.g., 1020304 base X into base VII:1020304 / 7 = 145757 r 5E.g., 10110111 base II into base V:145757 / 7 = 20822 r 3 20822 / 7 = 2974 r 4 2974 / 7 = 424 r 6 424 / 7 = 60 r 4 60 / 7 = 8 r 4 8 / 7 = 1 r 1 => 11446435
10110111 / 101 = 100100 r 11 (3)To convert a "decimal" fraction, do repeated multiplication, taking the protruding integer parts as the "digits". Unfortunately even a terminating fraction in one base may not terminate in another. E.g., 0.1A4C base XVI into base IX:100100 / 101 = 111 r 1 (1) 111 / 101 = 1 r 10 (2) => 1213
0.1A4C × 9 = 0.ECAC 0.ECAC × 9 = 8.520C 0.520C × 9 = 2.E26C 0.E26C × 9 = 7.F5CC 0.F5CC × 9 = 8.A42C 0.A42C × 9 = 5.C58C => 0.082785...
See also
External resources
D. Knuth. The Art of Computer Programming. Volume 2, 3rd Ed. Addison-Wesley. pp.194-213, "Positional Number Systems"