This article mayrequirecleanup to meet Wikipedia'squality standards. The specific problem is:the article does not meet Wikipedia’s quality standards. Please helpimprove this article if you can.(July 2025) (Learn how and when to remove this message) |
This article includes a list ofgeneral references, butit lacks sufficient correspondinginline citations. Please help toimprove this article byintroducing more precise citations.(March 2019) (Learn how and when to remove this message) |
| Part ofa series on | |||
| Numeral systems | |||
|---|---|---|---|
| |||
| |||
| List of numeral systems | |||
Anon-integer representation uses non-integer numbers as theradix, or base, of apositional numeral system. For a non-integer radixβ > 1, the value of
is
The numbersdi are non-negative integers less thanβ. This is also known as aβ-expansion, a notion introduced byRényi (1957) and first studied in detail byParry (1960). Everyreal number has at least one (possibly infinite)β-expansion. Theset of allβ-expansions that have a finite representation is asubset of theringZ[β, β−1].
There are applications ofβ-expansions incoding theory[1] and models ofquasicrystals.[2]
β-expansions are a generalization ofdecimal expansions. 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β =φ, thegolden ratio. A canonical choice for theβ-expansion of a given real number can be determined by the followinggreedy algorithm, essentially due toRényi (1957) and formulated as given here byFrougny (1992).
Letβ > 1 be the base andx a non-negative real number. Denote by⌊x⌋ thefloor function ofx (that is, the greatest integer less than or equal tox) and let{x} =x − ⌊x⌋ be the fractional part ofx.There exists an integerk such thatβk ≤x <βk+1. Set
and
Fork − 1 ≥ j > −∞, put
In other words, the canonicalβ-expansion ofx is defined by choosing the largestdk such thatβkdk ≤x, then choosing the largestdk−1 such thatβkdk + βk−1dk−1 ≤x, and so on. Thus it chooses thelexicographically largest string representingx.
With an integer base, this defines the usual radix expansion for the numberx. This construction extends the usual algorithm to possibly non-integer values ofβ.
Following the steps above, we can create aβ-expansion for a real number (the steps are identical for an, althoughn 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 ourk value (the exponent of the nearest power ofβ greater thann, as well as the amount of digits in, where isn written in baseβ). Thek value forn andβ can be written as:
After ak value is found, can be written asd, where
fork − 1 ≥ j > −∞. The firstk values ofd appear to the left of the decimal place.
This can also be written in the followingpseudocode:[3]
functiontoBase(n,b){k=floor(log(b,n))+1precision=8result=""for(i=k-1,i>-precision-1,i--){if(result.length==k)result+="."digit=floor((n/b^i)modb)n-=digit*b^iresult+=digit}returnresult}
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 is10, it will be represented as10 instead ofA.
functiontoBasePI(num,precision=8){letk=Math.floor(Math.log(num)/Math.log(Math.PI))+1;if(k<0)k=0;letdigits=[];for(leti=k-1;i>(-1*precision)-1;i--){letdigit=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,".");returndigits.join("");}
functionfromBasePI(num){letnumberSplit=num.split(/\./g);letnumberLength=numberSplit[0].length;letoutput=0;letdigits=numberSplit.join("");for(leti=0;i<digits.length;i++){output+=digits[i]*Math.pow(Math.PI,numberLength-i-1);}returnoutput;}
Base√2 behaves in a very similar way tobase 2 as all one has to do to convert a number frombinary into base√2 is put a zero digit in between every binary digit; for example, 191110 = 111011101112 becomes 101010001010100010101√2 and 511810 = 10011111111102 becomes 1000001010101010101010100√2. This means that every integer can be expressed in base√2 without the need of a radix point. The base can also be used to show the relationship between theside of asquare to itsdiagonal as a square with a side length of 1√2 will have a diagonal of 10√2 and a square with a side length of 10√2 will have a diagonal of 100√2. Another use of the base is to show thesilver ratio as its representation in base√2 is simply 11√2. In addition, the area of aregular octagon with side length 1√2 is 1100√2, the area of a regular octagon with side length 10√2 is 110000√2, the area of a regular octagon with side length 100√2 is 11000000√2, etc...
In the golden base, some numbers have more than one decimal base equivalent: they areambiguous. For example, 11φ = 100φ, since φ² = φ + 1.
There are some numbers in baseψ, the supergolden ratio, that are also ambiguous. For example, 101ψ = 1000ψ, since ψ³ = ψ² + 1.
With basee thenatural logarithm behaves like thecommon logarithm in base 10, as ln(1e) = 0, ln(10e) = 1, ln(100e) = 2 and ln(1000e) = 3 (or more precisely the representation in basee of 3, which is of course a non-terminating number). This means that the integer part of the natural logarithm of a number in basee counts the number of digits before the separating point in that number, minus one.
The basee is the most economical choice of radixβ > 1,[4] where theradix 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 basee, which therefore would store numbers optimally.
Baseπ can be used to more easily show the relationship between thediameter of acircle to itscircumference, which corresponds to itsperimeter; 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 thearea = π ×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]
In every positional number system, not all numbers are expressed uniquely. For example, in base 10, the number 1 has two representations: 1.000... and0.999.... The set of numbers with two different representations isdense 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, andQ(β) be the smallestfield extension of therationals containingβ. Then any real number in [0,1) having a periodicβ-expansion must lie inQ(β). On the other hand, theconverse need not be true. The converse does hold ifβ is aPisot number,[8] although necessary and sufficient conditions are not known.