Binary representation of real numbers
Real numbers :
Vulgar fraction with even denominator:
- Finite binary decimals = finite binary representation ( extension) of decimal numbers
All dyadic rational numbers = p/2^{n} have a binary representation with a finite number n of binary digits after the radix point.
for example :
1/2_{10}=1/2^{1}_{10}=0.1_{2}
1/4_{10}=1/2^{2}_{10}=0.01_{2}
1/8_{10}=1/2^{3}_{10}=0.001_{2}
1/16_{10}=1/2^{4}_{10}=0.0001_{2}
1/32_{10}=1/2^{5}_{10}=0.00001_{2}
...
1/2^{n}_{10}= 0.00..1_{2}
For every positive integer n vulgar fraction 1/denominator with denominator with only powers of 2 as factors
will be represented by 0.00..1_{2} with binary digit 1 on n-th place after the radix point.
1/8_{10}=0.001_{2}
3/8_{10}=0.011_{2}
7/8_{10}=0.111_{2}
???? Equivalent conditions:
- denominator = p / 2 ^{n}
- every prime factor of denominator = 2
- Mixed recurring binary decimals
The binary expansion for a fraction with denominator = (2^{k})*q
with q odd consists of k digits followed by a repeating decimal with period n .
Period n is computed in the same way as in pure recurring binary decimals ( Vulgar fraction with odd denominator ).
1/6_{10} = 1/ (2*3) _{10}= 0.0(01)..._{2}
1/10_{10} = 1/(2*5)_{10} =0.0(0011)... _{2
1/12 10= 1/(22*3)10=0.00(01)...2
1/1410 = 1/(2*7)10 =0.0(001)... 2
1/2010 = 1/( 22*5)10 =0.00(0011)...2
}
Vulgar fraction with odd denominator = other rational numbers
- Pure recurring binary decimals
have infinite binary representation ( not terminating ) with a finite sequence of binary digits repeating indefinitely.
1/3_{10} = 1/(2^{1}+1)_{10} = 0.3_{10} = 0.01_{2}= 1_{2}/11_{2} period = 2
1/5_{10} = 1/(2^{2}+1)_{10} = 0.2_{10} = 0.0011_{2}= 1_{2}/11_{2} period = 4
The binary expansion for a fraction with denominator 2^n - 1 is a repeating decimal with period n.
???? Equivalent conditions:
- denominator has only factors other then power of 2
- denominator mod 2 = 1
- gcd(denominator,2)=1
- denominator and 2 are relatively prime = coprime
- Odd(denominator) = true
- denominator = 2k+1, where k is an integer
length of digit sequence = period of external angle under doubling map = period of hyperbolic component =
"The expansion of a fraction of the form m/(2k-1) is simply the number m written in binary and then converted to a repeating sequence of length k.
The expansion of 1/21, for example, can be thought of as 3/63, i.e., 3/(2^6-1). "
Fractions in Base 2 by urticator
m = 3_{10}= 11_{2}
k = 6_{10
3/6310 = (0.000011)2 = (11)/(111111)2
}
Irrational numbers
have infinite decimal and binary expansions ( neither terminate nor recur ).
Underline digit : 0. 1 means digits repeating endlessly = 0.11111111111....
0.1_{10} decimal digit = 1/10
0.1_{2} binary digit = 1/ 2
Program which converts decimal fraction ( vulgar fraction) to binary form in Delphi with sources
Main page
Feel free to e-mail me!
Author: Adam Majewski adammaj1-at-o2-dot-pl
About
http://republika.pl/fraktal/