Non-integer base of numeration
This article includes a list of general references, but it lacks sufficient corresponding inline citations. (March 2019) |
Part of a series on |
Numeral systems |
---|
List of numeral systems |
A non-integer representation uses non-integer numbers as the radix, or base, of a positional numeral system. For a non-integer radix β > 1, the value of
is
The numbers di are non-negative integers less than β. This is also known as a β-expansion, a notion introduced by Rényi (1957) and first studied in detail by Parry (1960). Every real number has at least one (possibly infinite) β-expansion. The set of all β-expansions that have a finite representation is a subset of the ring Z[β, β−1].
There are applications of β-expansions in coding theory[1] and models of quasicrystals.[2]
Construction
β-expansions are a generalization of
Let β > 1 be the base and x a non-negative real number. Denote by ⌊x⌋ the
and
For k − 1 ≥ j > −∞, put
In other words, the canonical β-expansion of x is defined by choosing the largest dk such that βkdk ≤ x, then choosing the largest dk−1 such that βkdk + βk−1dk−1 ≤ x, and so on. Thus it chooses the
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 n must first be multiplied by −1 to make it positive, then the result must be multiplied by −1 to make it negative again).
First, we must define our k value (the exponent of the nearest power of β greater than n, as well as the amount of digits in , where is n written in base β). The k value for n and β can be written as:
After a k value is found, can be written as d, where
for k − 1 ≥ j > −∞. The first k values of d appear to the left of the decimal place.
This can also be written in the following pseudocode:[3]
function toBase(n, b) {
k = floor(log(b, n)) + 1
precision = 8
result = ""
for (i = k - 1, i > -precision-1, i--) {
if (result.length == k) result += "."
digit = floor((n / b^i) mod b)
n -= digit * b^i
result += digit
}
return result
}
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 10, it will be represented as 10 instead of A.
Example implementation code
To base π
- JavaScript:[3]
function toBasePI(num, precision = 8) { let k = Math.floor(Math.log(num)/Math.log(Math.PI)) + 1; if (k < 0) k = 0; let digits = []; for (let i = k-1; i > (-1*precision)-1; i--) { let digit = Math.floor((num / Math.pow(Math.PI, i)) % Math.PI); num -= digit * Math.pow(Math.PI, i); digits.push(digit); if (num < 0.1**(precision+1) && i <= 0) break; } if (digits.length > k) digits.splice(k, 0, "."); return digits.join(""); }
From base π
- JavaScript:[3]
function fromBasePI(num) { let numberSplit = num.split(/\./g); let numberLength = numberSplit[0].length; let output = 0; let digits = numberSplit.join(""); for (let i = 0; i < digits.length; i++) { output += digits[i] * Math.pow(Math.PI, numberLength-i-1); } return output; }
Examples
Base √2
Base
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 also some numbers in base ψ are also ambiguous. For example, 101ψ = 1000ψ.
Base e
With base e the natural logarithm behaves like the common logarithm as ln(1e) = 0, ln(10e) = 1, ln(100e) = 2 and ln(1000e) = 3.
The base e is the most economical choice of radix β > 1,[4] 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.
Base π
Base π can be used to more easily show the relationship between the diameter of a circle to its circumference, which corresponds to its perimeter; 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 = π × radius2, 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π.[5]
Properties
In no positional number system can every number be expressed uniquely. For example, in base ten, the number 1 has two representations: 1.000... and 0.999.... The set of numbers with two different representations is dense in the reals,[6] but the question of classifying real numbers with unique β-expansions is considerably more subtle than that of integer bases.[7]
Another problem is to classify the real numbers whose β-expansions are periodic. Let β > 1, and Q(β) be the smallest
See also
- Beta encoder
- Non-standard positional numeral systems
- Decimal expansion
- Power series
- Ostrowski numeration
References
Footnotes
- ^ Kautz 1965
- ^ Burdik et al. 1998; Thurston 1989
- ^ a b c "Home", decimalsystem.js.org
- ^ Hayes 2001
- ^ "Weird Number Bases", DataGenetics, retrieved 2018-02-01
- ^ Petkovšek 1990
- ^ Glendinning & Sidorov 2001
- ^ Schmidt 1980
Sources
- Bugeaud, Yann (2012), Distribution modulo one and Diophantine approximation, Cambridge Tracts in Mathematics, vol. 193, Cambridge: Zbl 1260.11001
- Burdik, Č.; Frougny, Ch.; Gazeau, J. P.; Krejcar, R. (1998), "Beta-integers as natural counting systems for quasicrystals", Journal of Physics A: Mathematical and General, 31 (30): 6449–6472, MR 1644115.
- Frougny, Christiane (1992), "How to write integers in non-integer base", LATIN '92, Lecture Notes in Computer Science, vol. 583/1992, Springer Berlin / Heidelberg, pp. 154–164, ISSN 0302-9743.
- MR 1851269.
- Hayes, Brian (2001), "Third base", American Scientist, 89 (6): 490–494, doi:10.1511/2001.40.3268, archived from the originalon 2016-03-24.
- Kautz, William H. (1965), "Fibonacci codes for synchronization control", Institute of Electrical and Electronics Engineers. Transactions on Information Theory, IT-11 (2): 284–292, MR 0191744.
- S2CID 116417864.
- MR 1048915.
- S2CID 122635654.
- Schmidt, Klaus (1980), "On periodic expansions of Pisot numbers and Salem numbers", The Bulletin of the London Mathematical Society, 12 (4): 269–278, MR 0576976.
- Thurston, W.P. (1989), "Groups, tilings and finite state automata", AMS Colloquium Lectures
Further reading
- Sidorov, Nikita (2003), "Arithmetic dynamics", in Bezuglyi, Sergey; Kolyada, Sergiy (eds.), Topics in dynamics and ergodic theory. Survey papers and mini-courses presented at the international conference and US-Ukrainian workshop on dynamical systems and ergodic theory, Katsiveli, Ukraine, August 21–30, 2000, Lond. Math. Soc. Lect. Note Ser., vol. 310, Cambridge: Zbl 1051.37007