The word "base" in mathematics has several meanings, generally referring to an object chosen as a reference or building block.
In geometry, a base is a designated side of a plane figure or planar boundary region of a solid, often used as the reference from which an altitude is measured. In two dimensions, any side of a triangle may be chosen as its base, while the parallel sides of a trapezoid are its two bases. In three dimensions, a prism or cylinder has two congruent parallel bases, whereas a pyramid or cone has one base. A base need not be the lowest side or boundary region in a drawing.
In arithmetic, "base" has two closely related uses: the base of a numeral system and the base of a logarithm.
A real number can be represented using an integer
base
with
(sometimes also called a radix or scale). The choice
of a base yields a representation of numbers known as a number system. In base
, the digits
0, 1, ...,
are used (where, by convention,
for bases larger than 10, the symbols A, B, C, ... are generally used as symbols
representing the decimal numbers 10, 11, 12, ...).
The digits of a number
in base
(for integer
) can be obtained in the Wolfram
Language using IntegerDigits[x,
b].
Let the base
representation of a number
be written
|
(1)
|
(e.g., ). Then, for example, the
number 10 is written in various bases as
|
(2)
| |||
|
(3)
| |||
|
(4)
| |||
|
(5)
| |||
|
(6)
| |||
|
(7)
| |||
|
(8)
| |||
|
(9)
| |||
|
(10)
| |||
|
(11)
|
since, for example,
|
(12)
| |||
|
(13)
| |||
|
(14)
|
and so on.
Common bases are given special names based on the value of , as summarized in the following table. The most common bases
are binary and hexadecimal
(used by computers) and decimal (used by people).
| base | number system |
| 2 | binary |
| 3 | ternary |
| 4 | quaternary |
| 5 | quinary |
| 6 | senary |
| 7 | septenary |
| 8 | octal |
| 9 | nonary |
| 10 | decimal |
| 11 | undenary |
| 12 | duodecimal |
| 16 | hexadecimal |
| 20 | vigesimal |
| 60 | sexagesimal |
The index of the leading digit needed to represent the number is
|
(15)
|
where is the floor
function. Now, recursively compute the successive digits
|
(16)
|
where and
|
(17)
|
for ,
, ..., 1, 0, .... This gives the base
representation of
. Note that if
is an integer, then
need only run through 0, and that if
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
.
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).
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
,"
.
Even more unexpectedly, the representation of a given integer in an irrational base
may be nonunique, for example
|
(18)
| |||
|
(19)
|
where is the golden
ratio.
It is also possible to consider negative bases such as negabinary and negadecimal (e.g., Allouche and Shallit 2003). The digits in a negative base may be obtained with the Wolfram Language code
NegativeIntegerDigits[0, n_Integer?Negative] := {0}
NegativeIntegerDigits[i_, n_Integer?Negative] :=
Rest @ Reverse @ Mod[
NestWhileList[(# - Mod[#, -n])/n& ,
i, # != 0& ],
-n]
The base of a logarithm is a number used to define the number system in which the logarithm
is computed. In general, the logarithm of a number
in base
is written
. The symbol
is an abbreviation regrettably used both for the common
logarithm
(by engineers and physicists and indicated on pocket calculators) and for the natural logarithm
(by mathematicians).
denotes the natural logarithm
(as used by engineers and physicists
and indicated on pocket calculators), and
denotes
.
In this work, the notations
and
are used.
To convert between logarithms in different bases, the formula
|
(20)
|
can be used.