Convert duplicate binary to decimal (series expression?)

Given a binary number that repeats, for example 0. (0011) or 0.0 (101), how could one convert it to decimal?

What I still managed to find is an easy way to convert a finite binary to decimal, as shown below:

res(N+2) = res(N+1) / 2 + res(N)

where res is the result after step N, and N is the current iteration (N = 0; n → (num binary digits)). Applying this repeatedly to a non-changing binary number gives a good approximation, for example

dec:0.4 || bin: 0.(0110):

0     / 2 + 0 = 0
0     / 2 + 0 = 0
0     / 2 + 1 = 1
1/2   / 2 + 1 = 3/2
3/2   / 2 + 0 = 3/4
3/4   / 2 + 0 = 3/8
3/8   / 2 + 1 = 19/16
19/16 / 2 + 1 = 51/32
51/32 / 2 + 0 = 51/64
51/64 / 2 + 0 = 51/128 = 0.3984

which is approximately 0.4.

So, I have a way to calculate the approximations, but I'm struggling to find a way to express this. I started trying to write it down as a series that I can compute at the limit when n-> inf without much success so far.

+3
4

- . r, 1 , 0 <= r < 1, r/(1-r).

0. (0011), 0.0011 3/16. 3 r = 1/16. r/(1-r) = (1/16)/(15/16) = 1/15. , 3 , : 3/15 = 1/5 = 0,2.

+1

, , , 0. (0011) 0.0 (101), ?

(.. ) , . , , , 0.(567), , , 567 , 999 (, n 9 s, n - ) :

0.(567) = 567/999 = 189/333 = 63/111

. @Rick Regan.

, , n 9 n 1 ( 1 - ). , ,

0.(0011) = 0011 / 1111 =(in decimal) 3/15 = 1/5

, : , 0.0(101) 0.(101) 2. 101 / 111 5/7, 0.0(101) > is 5/14.

+3

. . , , 0.3984 0.4.

. . , , , .

, , .

+1

, , , (9 10, 1 2), , , 0, . , :

0.196(2) = (196*9 + 2)/(9000)
0.12(034) = (12*999 + 34)/99900

b0.01(011) = (b1*b111 + b11)/b11100 = (1*7 + 3)/(7*4) = 10/28
0

Source: https://habr.com/ru/post/1729753/


All Articles