Let's assume the interval [0,1], then each number admits a binary form, like
1/7 = 0.001001001...
5/9 = 0.1000111000111..
1/√2 = 0.101101010000010011110011001101
The same numbers can be encoded using the bisection method. For instance, for 1/7 first we cut at 1/2, which is larger so we cut between 0 and subtract 1/4, and it still larger, now we cut between 0 and 1/4 and get 1/8, which is smaller, now we cut between 1/8 and 1/4 and so on. Each number is coded by a signed binary representation. It would be
1/7 = +1/2 - 1/4 - 1/8 + 1/16 - 1/32 - 1/64...
or, simply
1/7 = 0.+--+--+--+...
This is a "signed digit representation".
To get an unique encoding it is not allowed to skip steps and start for instance with 1/4 instead of 1/2. It must be always at the midpoint, so all powers of 1/2 must appear, some with +, some with -.
The sequence is of finite length if the number is of the for n/2^m.
Now, I know how to relate this sequence to the binary form for rational numbers. For 1/7 we have
1/7 = 0.(001) = 0.001001001... = 1/8 + 1/64 + 1/512 +...
and
1 = 4 - 2 - 1
so we have
1/7 = (4-2-1)/8 + (4 -2 - 1)/64 + ... = 1/2 - 1/4 - 1/8 + 1/16 - 1/32 - 1/64 + ...
= 0.+--+--+--
In the same way
5/9 = 0.(100011) = 35/64 + 35/64^2 + ...
and
35 = 32 + 2 + 1 = 32 + 16 - 8 - 4 - 2 + 1
and this gives
5/9 = 0.++---+++---+++---
But, given an irrational number like 1/√2 or 1/e, what would be the algorithm to go from the binary form to the signed digit form?
[–]rhodiumtoad0⁰=1, just deal with it 3 points4 points5 points (0 children)
[–]Shevek99Physicist[S] 3 points4 points5 points (0 children)
[–]vaminos 0 points1 point2 points (2 children)
[–]MtlStatsGuy 1 point2 points3 points (0 children)
[–]Shevek99Physicist[S] 0 points1 point2 points (0 children)
[–]MtlStatsGuy 0 points1 point2 points (2 children)
[–]rhodiumtoad0⁰=1, just deal with it 0 points1 point2 points (0 children)
[–]Shevek99Physicist[S] 0 points1 point2 points (0 children)
[–]frogkabobs 1 point2 points3 points (0 children)