Number Systems
Number Systems
Number Systems
Systems
Is it a number?
2005
No!!
Binary 2 0,1
Ternary 3 0,1,2
Octal 8 0,1,2,3,4,5,6,7
Decimal 10 0,1,2,3,4,5,6,7,8,9
Hexadecimal 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,
F
Vigesimal 20 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,
F,G,H,I,J
Some Facts About Num.
Systems
• Binary is used in representing data and in
operational activities of computers.
• Ternary numbers arise in a number of problems
in mathematics, including some problems of
weighing.
• A ternary representation can be used to uniquely
identify totalistic cellular automaton rules, where
the three colors (white, gray, and black)
correspond to the three numbers 0, 1 and 2
(Wolfram 2002, pp. 60-70 and 886).
Some Facts About Num.
Systems
• We use decimal system in real life.
• Some aspects of a base-12 system are
preserved in the terms dozen and gross.
Some Facts About Num.
Systems
• The hexadecimal system is particularly important
in computer programming, since four bits (each
consisting of a one or zero) can be succinctly
expressed using a single hexadecimal digit. Two
hexadecimal digits represent numbers from 0 to
255, a common range used, for example, to
specify colors. Thus, in the HTML language of
the web, colors are specified using three pairs of
hexadecimal digits RRGGBB, where RR is the
amount of red, GG the amount of green, and BB
the amount of blue.
Some Facts About Num.
Systems
• A base-20 number system was used by
the Aztecs and Mayans. The Mayans
compiled extensive observations of
planetary positions in base-20 notation.
• A base-60 number system was used by
the Babylonians and is preserved in the
modern measurement of time (hours,
minutes, and seconds) and angles
(degrees, arc minutes, and arc seconds).
Mixture of Bases
• Some number systems use a mixture of
bases for counting. Examples include the
Mayan calendar and the old British
monetary system (in which ha'pennies,
pennies, threepence, sixpence, shillings,
half crowns, pounds, and guineas
corresponded to units of 1/2, 1, 3, 6, 12,
30, 240, and 252, respectively).
Irrational Base
• Bergman (1957/58) considered an
irrational base, and Knuth (1998)
considered transcendental bases. This
leads to some rather unfamiliar results,
such as equating π to 1 in "base π,"
π=10π. Even more unexpectedly, the
representation of a given integer in an
irrational base may be nonunique, for
example
Num. Rep. Base
10 = 10100.010010101011Ф 18
= 10100.0101Ф 19
where and
for i = n, n-1, ..., 1, 0, .... This gives the base b
representation of x. Note that if x is an integer, then
i need only run through 0, and that if x has a
fractional part, then the expansion may or may not
terminate. For example, the hexadecimal
representation of 0.1 (which terminates in decimal
notation) is the infinite expression
Number length.1
• The length of a number n in base b is the
number of digits in the base-b numeral for
n, given by the formula