A non-integer representation uses non-
integer
An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
numbers as the
radix
In a positional numeral system, the radix (radices) or base is the number of unique digits, including the digit zero, used to represent numbers. For example, for the decimal system (the most common system in use today) the radix is ten, becaus ...
, or base, of a
positional numeral system
Positional notation, also known as place-value notation, positional numeral system, or simply place value, usually denotes the extension to any base of the Hindu–Arabic numeral system (or decimal system). More generally, a positional system ...
. For a non-integer radix ''β'' > 1, the value of
:
is
:
The numbers ''d''
''i'' are non-negative integers less than ''β''. This is also known as a ''β''-expansion, a notion introduced by and first studied in detail by . Every
real number
In mathematics, a real number is a number that can be used to measure a continuous one- dimensional quantity such as a duration or temperature. Here, ''continuous'' means that pairs of values can have arbitrarily small differences. Every re ...
has at least one (possibly infinite) ''β''-expansion. The
set
Set, The Set, SET or SETS may refer to:
Science, technology, and mathematics Mathematics
*Set (mathematics), a collection of elements
*Category of sets, the category whose objects and morphisms are sets and total functions, respectively
Electro ...
of all ''β''-expansions that have a finite representation is a
subset
In mathematics, a Set (mathematics), set ''A'' is a subset of a set ''B'' if all Element (mathematics), elements of ''A'' are also elements of ''B''; ''B'' is then a superset of ''A''. It is possible for ''A'' and ''B'' to be equal; if they a ...
of the
ring Z
−1">'β'', ''β''−1
There are applications of ''β''-expansions in
coding theory
Coding theory is the study of the properties of codes and their respective fitness for specific applications. Codes are used for data compression, cryptography, error detection and correction, data transmission and computer data storage, data sto ...
and models of
quasicrystal
A quasiperiodicity, quasiperiodic crystal, or quasicrystal, is a structure that is Order and disorder (physics), ordered but not Bravais lattice, periodic. A quasicrystalline pattern can continuously fill all available space, but it lacks trans ...
s.
Construction
''β''-expansions are a generalization of
decimal expansion
A decimal representation of a non-negative real number is its expression as a sequence of symbols consisting of decimal digits traditionally written with a single separator:
r = b_k b_\cdots b_0.a_1a_2\cdots
Here is the decimal separator ...
s. While infinite decimal expansions are not unique (for example, 1.000... =
0.999...), all finite decimal expansions are unique. However, even finite ''β''-expansions are not necessarily unique, for example ''φ'' + 1 = ''φ''
2 for ''β'' = ''φ'', the
golden ratio
In mathematics, two quantities are in the golden ratio if their ratio is the same as the ratio of their summation, sum to the larger of the two quantities. Expressed algebraically, for quantities and with , is in a golden ratio to if
\fr ...
. A canonical choice for the ''β''-expansion of a given real number can be determined by the following
greedy algorithm, essentially due to and formulated as given here by .
Let be the base and ''x'' a non-negative real number. Denote by the
floor function
In mathematics, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least integer greater than or eq ...
of ''x'' (that is, the greatest integer less than or equal to ''x'') and let be the fractional part of ''x''.
There exists
There may refer to:
* ''There'' (film), a 2009 Turkish film (Turkish title: ''Orada'')
* ''There'' (virtual world)
*''there'', a deictic adverb in English
*''there'', an English pronoun used in phrases such as '' there is'' and ''there are''
{ ...
an integer ''k'' such that . Set
:
and
:
For , put
:
In other words, the canonical ''β''-expansion of ''x'' is defined by choosing the largest ''d''
''k'' such that , then choosing the largest ''d''
''k''−1 such that , and so on. Thus it chooses the
lexicographically largest string representing ''x''.
With an integer base, this defines the usual radix expansion for the number ''x''. This construction extends the usual algorithm to possibly non-integer values of ''β''.
Conversion
Following the steps above, we can create a ''β''-expansion for a real number
(the steps are identical for an
, although must first be multiplied by to make it positive, then the result must be multiplied by to make it negative again).
First, we must define our value (the exponent of the nearest power of greater than , as well as the amount of digits in
, where
is written in base ). The value for and can be written as:
:
After a value is found,
can be written as , where
:
for . The first values of appear to the left of the decimal place.
This can also be written in the following
pseudocode
In computer science, pseudocode is a description of the steps in an algorithm using a mix of conventions of programming languages (like assignment operator, conditional operator, loop) with informal, usually self-explanatory, notation of actio ...
:
function toBase(n, b)
Note that the above code is only valid for
and
, as it does not convert each digits to their correct symbols or correct negative numbers. For example, if a digit's value is , it will be represented as instead of .
Example implementation code
To base
*
JavaScript
JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior.
Web browsers have ...
:
function toBasePI(num, precision = 8)
From base
* JavaScript:
function fromBasePI(num)
Examples
Base
Base
behaves in a very similar way to
base 2 as all one has to do to convert a number from
binary into base is put a zero digit in between every binary digit; for example, 1911
10 = 11101110111
2 becomes 101010001010100010101
and 5118
10 = 1001111111110
2 becomes 1000001010101010101010100
. This means that every integer can be expressed in base without the need of a decimal point. The base can also be used to show the relationship between the
side of a
square
In geometry, a square is a regular polygon, regular quadrilateral. It has four straight sides of equal length and four equal angles. Squares are special cases of rectangles, which have four equal angles, and of rhombuses, which have four equal si ...
to its
diagonal
In geometry, a diagonal is a line segment joining two vertices of a polygon or polyhedron, when those vertices are not on the same edge. Informally, any sloping line is called diagonal. The word ''diagonal'' derives from the ancient Greek � ...
as a square with a side length of 1
will have a diagonal of 10
and a square with a side length of 10
will have a diagonal of 100
. Another use of the base is to show the
silver ratio as its representation in base is simply 11
. In addition, the area of a
regular octagon with side length 1
is 1100
, the area of a regular octagon with side length 10
is 110000
, the area of a regular octagon with side length 100
is 11000000
, etc...
Golden base
In the golden base, some numbers have more than one decimal base equivalent: they are ambiguous. For example:
11
φ = 100
φ.
Base ψ
There are some numbers in base
ψ that are also ambiguous. For example, 101
ψ = 1000
ψ.
Base ''e''
With base
''e'' the
natural logarithm
The natural logarithm of a number is its logarithm to the base of a logarithm, base of the e (mathematical constant), mathematical constant , which is an Irrational number, irrational and Transcendental number, transcendental number approxima ...
behaves like the
common logarithm
In mathematics, the common logarithm (aka "standard logarithm") is the logarithm with base 10. It is also known as the decadic logarithm, the decimal logarithm and the Briggsian logarithm. The name "Briggsian logarithm" is in honor of the British ...
in base 10, as ln(1
''e'') = 0, ln(10
''e'') = 1, ln(100
''e'') = 2 and ln(1000
''e'') = 3 (or more precisely the representation in base ''e'' of 3, which is of course a non-terminating number). This means that the integer part of the natural logarithm of a number in base ''e'' counts the number of digits before the separating point in that number, minus one.
The base ''e'' is the most economical choice of radix ''β'' > 1, where the
radix economy is measured as the product of the radix and the length of the string of symbols needed to express a given range of values. A binary number uses only two different digits, but it needs a lot of digits for representing a number; base 10 writes shorter numbers, but it needs 10 different digits to write them. The balance between those is base ''e'', which therefore would store numbers optimally.
Base π
Base
π can be used to more easily show the relationship between the
diameter
In geometry, a diameter of a circle is any straight line segment that passes through the centre of the circle and whose endpoints lie on the circle. It can also be defined as the longest Chord (geometry), chord of the circle. Both definitions a ...
of a
circle
A circle is a shape consisting of all point (geometry), points in a plane (mathematics), plane that are at a given distance from a given point, the Centre (geometry), centre. The distance between any point of the circle and the centre is cal ...
to its
circumference
In geometry, the circumference () is the perimeter of a circle or ellipse. The circumference is the arc length of the circle, as if it were opened up and straightened out to a line segment. More generally, the perimeter is the curve length arou ...
, which corresponds to its
perimeter
A perimeter is the length of a closed boundary that encompasses, surrounds, or outlines either a two-dimensional shape or a one-dimensional line. The perimeter of a circle or an ellipse is called its circumference.
Calculating the perimet ...
; since circumference = diameter × π, a circle with a diameter 1
π will have a circumference of 10
π, a circle with a diameter 10
π will have a circumference of 100
π, etc. Furthermore, since the
area
Area is the measure of a region's size on a surface. The area of a plane region or ''plane area'' refers to the area of a shape or planar lamina, while '' surface area'' refers to the area of an open surface or the boundary of a three-di ...
= π ×
radius
In classical geometry, a radius (: radii or radiuses) of a circle or sphere is any of the line segments from its Centre (geometry), center to its perimeter, and in more modern usage, it is also their length. The radius of a regular polygon is th ...
2, a circle with a radius of 1
π will have an area of 10
π, a circle with a radius of 10
π will have an area of 1000
π and a circle with a radius of 100
π will have an area of 100000
π.
Properties
In every positional number system, not all numbers be expressed uniquely. For example, in base 10, the number 1 has two representations: 1.000... and
0.999.... The set of numbers with two different representations is
dense in the reals, but the question of classifying real numbers with unique ''β''-expansions is considerably more subtle than that of integer bases.
Another problem is to classify the real numbers whose ''β''-expansions are periodic. Let ''β'' > 1, and Q(''β'') be the smallest
field extension
In mathematics, particularly in algebra, a field extension is a pair of fields K \subseteq L, such that the operations of ''K'' are those of ''L'' restricted to ''K''. In this case, ''L'' is an extension field of ''K'' and ''K'' is a subfield of ...
of the
rationals containing ''β''. Then any real number in
converse need not be true. The converse does hold if ''β'' is a Pisot number,
although necessary and sufficient conditions are not known.
See also
* Beta encoder
* Non-standard positional numeral systems
* Decimal expansion
* Power series
*
Ostrowski numeration
References
Footnotes
Sources
*
*.
*.
*.
*.
*.
*.
*.
*.
*.
*
Further reading
*
External links
*
{{DEFAULTSORT:Non-Integer Representation
Number theory
Ring theory
Coding theory
Non-standard positional numeral systems