# Fractals/Iterations in the complex plane/subwake

Jump to navigation Jump to search

How to find the angles of external rays that land on the root point of any Mandelbrot set's component which is accesible from main cardioid ( M0) by a finite number of boundary crossing ?

# Algorithm = Douady tuning

"The r/s internal ray in $M_{p/q}$ is the landing point of external rays $\theta _{\pm }(p/q,r/s)$ obtained from $\theta _{\pm }(r/s)$ by replacing:

• the digit 0 by repeating block ( of length q) from $\theta _{-}(p/q)$ • the digit 1 by repeating block ( of length q) from $\theta _{+}(p/q)$ "

"By repeating the same process ( which is known as 'tuning') we can compute the arguments of external rays landing on the boundary of any component which is accesible from $M_{0}$ by a finite number of boundary crossing." ( Shaun Bullett )

Douady tuning 

# Examples Wakes near the period 1 continent in the Mandelbrot set. Boundary of the Mandelbrot set rendered with distance estimation (exterior and interior). Labelled with periods (blue), internal angles and rays (green) and external angles and rays (red).

## 1 angle

### 1/2 family

$1\quad {\xrightarrow {1/2}}\ 2\quad {\xrightarrow {1/2}}\ 4\quad {\xrightarrow {1/2}}\ 8\quad {\xrightarrow {1/2}}\ 16....\ \mathbf {MF} _{1/2}$ where:

• $\mathbf {MF} _{1/2}$ is the Myrberg-Feigenbaum point c = −1.401155 with external angles = (0.412454 , 0,58755)

## 2 angles

 $1\quad {\xrightarrow {p/q}}\ q\quad {\xrightarrow {r/s}}\ s*q$ describes a way:

• from center of period 1 hyberbolic component c=0
• along internal ray for angle p/q toward root point ( p/q-bond )
• along internal ray for angle r/s toward center ( nucleus) of s*q component of hyperbolic component

where:

• 1, q,s are periods of hyperbolic components
• p/q, r/s are internal angles

### (1/3,1/25)

Angled internal address:

 $1\quad {\xrightarrow {1/3}}\ 3\quad {\xrightarrow {1/25}}\ 3*25=75$ First compute external angles for p/q and r/s wakes :

$\theta _{-}(r/s)=\theta _{-}(1/25)=0.(0000000000000000000000001)$ $\theta _{+}(r/s)=\theta _{+}(1/25)=0.(0000000000000000000000010)$ $\theta _{-}(p/q)=\theta _{-}(1/3)=0.({\color {Blue}001})$ $\theta _{+}(p/q)=\theta _{+}(1/3)=0.({\color {Red}010})$ then in $\theta (r/s)$ replace :

• digit 0 by block of length q from $\theta _{-}(p/q)$ • digit 1 by block of length q from $\theta _{+}(p/q)$ Using this c program one gets:

input string = sIn = 0.(0000000000000000000000001)
Input Length = 25

replace string for digit 0 = sR0 = 0.(001)
Length of sR0 = 3

replace string for digit 1 = sR1 = 0.(010)
Length of sR1 = 3
output string in plain form sOut = 0.(001001001001001001001001001001001001001001001001001001001001001001001001010)
Output Length = 75

output string in wikipedia math formula form = sOutf =
0.(\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Blue}001}\ {\color{Red}010})


so the result is:

$\theta _{-}(p/q,r/s)=\theta _{-}(1/3,1/25)=0.(\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Red}010})$ $\theta _{+}(p/q,r/s)=\theta _{+}(1/3,1/25)=0.(\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Red}010}\ {\color {Blue}001})$ One can not check it using :

• program Mandel by Wolf Jung because period 75 exceeds the capacity of Mandel (verison 5.14)
• knowledgedoor calculator : "There are more than 100000 fractional digits in the new number. We are sorry, but we had to abort the calculation to control the loading on our server" 
• Binary to Decimal converter from xploringbinary because : ***ERROR: invalid characters in input

Floating point decimal value can be computed ( xploringbinary calculator):

0.00100100100100100100100100100100100100100100100100100100100100100100100101001001001001001001001001001001001001001001001001001001001001001001001001010010010010010010010010010010010010010010010010010010010010010010010010010100100100100100100100100100100100100100100100100100100100100100100100100101000100100100100100100100100100100100100100100100100100100100100100100100101000100100100100100100100100100100100100100100100100100100100100100100100101000100100100100100100100100100100100100100100100100100100100100100100100101 = 0.14285714285714285714288739403383051072639529883365108929843563075583153775763414823768752002069960029227911125999721923628800596414804821292109009060239475901499810101181257672784693799296426200506484998155193353019205064595746824097168836030939675768822757699065155639759014879516081816465598503673993914613650270765449619097486325642647311484333459622592887076714167693559186268814330532241007104844902043043591808926221035405535394453260989380025345642382995407618853788922160842622677279223353252746164798736572265625


note that

1/7 = 0.(001) = 0.(142857)= 0.1428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571428...


so the difference is on the 23 decimal position

Using mandelbrot-symbolics:

 ./m-binangle-to-rational ".(001001001001001001001001001001001001001001001001001001001001001001001001010)"
5396990266136737387082/37778931862957161709567

 ./m-binangle-to-rational ".(001001001001001001001001001001001001001001001001001001001001001001001010001)"
5396990266136737387089/37778931862957161709567


Or using web interface with input : 1_1/3->3_1/25->75

### (1/3,1/2)

Angled internal address:

 $1\quad {\xrightarrow {1/3}}\ 3\quad {\xrightarrow {1/2}}\ 6$ First compute external angles for p/q and r/s wakes :

$\theta _{-}(r/s)=\theta _{-}(1/2)=0.(01)$ $\theta _{+}(r/s)=\theta _{+}(1/2)=0.(10)$ $\theta _{-}(p/q)=\theta _{-}(1/3)=0.({\color {Blue}001})$ $\theta _{+}(p/q)=\theta _{+}(1/3)=0.({\color {Red}010})$ then in $\theta (r/s)$ replace :

• digit 0 by block of length q from $\theta _{-}(p/q)$ • digit 1 by block of length q from $\theta _{+}(p/q)$ Result is :

$\theta _{-}(p/q,r/s)=\theta _{-}(1/3,1/2)=0.({\color {Blue}001}\ {\color {Red}010})$ $\theta _{+}(p/q,r/s)=\theta _{+}(1/3,1/2)=0.({\color {Red}010}\ {\color {Blue}001})$ One can check it using program Mandel by Wolf Jung :

The angle  10/63  or  p001010
has  preperiod = 0  and  period = 6.
The conjugate angle is  17/63  or  p010001 .
The kneading sequence is  AABAA*  and
the internal address is  1-3-6 .
The corresponding parameter rays are landing
at the root of a satellite component of period 6.
It is bifurcating from period 3.
Do you want to draw the rays and to shift c
to the corresponding center?


### (1/3,1/3)

First compute external angles for p/q and r/s wakes ( here p/q=r/s) :

$\theta _{-}(p/q)=\theta _{-}(1/3)=0.({\color {Blue}001})$ $\theta _{+}(p/q)=\theta _{+}(1/3)=0.({\color {Red}010})$ then in $\theta (r/s)$ replace :

• digit 0 by block of length q from $\theta _{-}(p/q)$ • digit 1 by block of length q from $\theta _{+}(p/q)$ Result is :

$\theta _{-}(p/q,r/s)=\theta _{-}(1/3,1/2)=0.({\color {Blue}001}\ {\color {Blue}001}\ {\color {Red}010})$ $\theta _{+}(p/q,r/s)=\theta _{+}(1/3,1/2)=0.({\color {Blue}001}\ {\color {Red}010}\ {\color {Blue}001})$ One can check it using program Mandel by Wolf Jung :

The angle  74/511  or  p001001010
has  preperiod = 0  and  period = 9.
The conjugate angle is  81/511  or  p001010001 .
The kneading sequence is  AABAABAA*  and
the internal address is  1-3-9 .
The corresponding parameter rays are landing
at the root of a satellite component of period 9.
It is bifurcating from period 3.
Do you want to draw the rays and to shift c
to the corresponding center?


### (1/3,1/4)

First compute external angles for p/q and r/s wakes :

$\theta _{-}(r/s)=\theta _{-}(1/4)=0.(0001)$ $\theta _{+}(r/s)=\theta _{+}(1/4)=0.(0010)$ $\theta _{-}(p/q)=\theta _{-}(1/3)=0.({\color {Blue}001})$ $\theta _{+}(p/q)=\theta _{+}(1/3)=0.({\color {Red}010})$ then in $\theta (r/s)$ replace :

• digit 0 by block of length q from $\theta _{-}(p/q)$ • digit 1 by block of length q from $\theta _{+}(p/q)$ Result is :

$\theta _{-}(p/q,r/s)=\theta _{-}(1/3,1/4)=0.({\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Red}010})$ $\theta _{+}(p/q,r/s)=\theta _{+}(1/3,1/4)=0.({\color {Blue}001}\ {\color {Blue}001}\ {\color {Red}010}\ {\color {Blue}001})$ One can check it using program Mandel by Wolf Jung :

The angle  586/4095  or  p001001001010
has  preperiod = 0  and  period = 12.
The conjugate angle is  593/4095  or  p001001010001 .
The kneading sequence is  AABAABAABAA*  and
the internal address is  1-3-12 .
The corresponding parameter rays are landing
at the root of a satellite component of period 12.
It is bifurcating from period 3.
Do you want to draw the rays and to shift c
to the corresponding center?


### (1/3,3/4)

First compute external angles for p/q and r/s wakes :

$\theta _{-}(r/s)=\theta _{-}(3/4)=0.(1101)$ $\theta _{+}(r/s)=\theta _{+}(3/4)=0.(1110)$ $\theta _{-}(p/q)=\theta _{-}(1/3)=0.({\color {Blue}001})$ $\theta _{+}(p/q)=\theta _{+}(1/3)=0.({\color {Red}010})$ then in $\theta (r/s)$ replace :

• digit 0 by block of length q from $\theta _{-}(p/q)$ • digit 1 by block of length q from $\theta _{+}(p/q)$ Result is :

$\theta _{-}(p/q,r/s)=\theta _{-}(1/3,1/2)=0.({\color {Red}010}\ {\color {Red}010}\ {\color {Blue}001}\ {\color {Red}010})$ $\theta _{+}(p/q,r/s)=\theta _{+}(1/3,1/2)=0.({\color {Red}010}\ {\color {Red}010}\ {\color {Red}010}\ {\color {Blue}001})$ One can check it in program Mandel by Wolf Jung :

The angle  1162/4095  or  p010010001010
has  preperiod = 0  and  period = 12.
The conjugate angle is  1169/4095  or  p010010010001 .
The kneading sequence is  AABAABAABAA*  and
the internal address is  1-3-12 .
The corresponding parameter rays are landing
at the root of a satellite component of period 12.
It is bifurcating from period 3.
Do you want to draw the rays and to shift c
to the corresponding center?


### (1/4, 1/5)

Input is :

$(p/q,r/s)=(1/4,1/5)$ First compute external angles for p/q and r/s wakes :

$\theta _{-}(r/s)=\theta _{-}(1/5)=0.(00001)$ $\theta _{+}(r/s)=\theta _{+}(1/5)=0.(00010)$ $\theta _{-}(p/q)=\theta _{-}(1/4)=0.({\color {Blue}0001})$ $\theta _{+}(p/q)=\theta _{+}(1/4)=0.({\color {Red}0010})$ then in $\theta (r/s)$ replace :

• digit 0 by block of length q from $\theta _{-}(p/q)$ • digit 1 by block of length q from $\theta _{+}(p/q)$ Result is :

$\theta _{-}(p/q,r/s)=\theta _{-}(1/4,1/5)=0.({\color {Blue}0001}\ {\color {Blue}0001}\ {\color {Blue}0001}\ {\color {Blue}0001}\ {\color {Red}0010})$ $\theta _{+}(p/q,r/s)=\theta _{+}(1/4,1/5)=0.({\color {Blue}0001}\ {\color {Blue}0001}\ {\color {Blue}0001}\ {\color {Red}0010}\ {\color {Blue}0001})$ One can check it using program Mandel by Wolf Jung :

The angle  69906/1048575  or  p00010001000100010010
has  preperiod = 0  and  period = 20.
The conjugate angle is  69921/1048575  or  p00010001000100100001 .
The kneading sequence is  AAABAAABAAABAAABAAA*  and
the internal address is  1-4-20 .
The corresponding parameter rays are landing
at the root of a satellite component of period 20.
It is bifurcating from period 4.
Do you want to draw the rays and to shift c
to the corresponding center?


## 3 angles

### (1/2, 1/3, 1/4)

We go thru the list of angles from right to left

First compute (1/3,1/4) wake which will be used as a a new r/s wake :

 $\theta _{-}(1/3,1/4)=0.(001001001010)=\theta _{-}(r/s)$ $\theta _{+}(1/3,1/4)=0.(001001010001)=\theta _{+}(r/s)$ After that compute 1/2 wake ( most left), which will be used as a p/q wake :

 $\theta _{-}(p/q)=\theta _{-}(1/2)=0.({\color {Blue}01})$ $\theta _{+}(p/q)=\theta _{+}(1/2)=0.({\color {Red}10})$ then in $\theta (r/s)$ replace :

• digit 0 by repeating block (of length q, color blue) from $\theta _{-}(p/q)$ • digit 1 by repeating block (of length q, color red) from $\theta _{+}(p/q)$ Result is :

$\theta _{-}(1/2,1/3,1/4)=0.({\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01})$ $\theta _{+}(1/2,1/3,1/4)=0.({\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10})$ in plain text format ( for copy ) :

 theta_minus(1/2, 1/3, 1/4) = 0.(010110010110010110011001)
theta_plus( 1/2, 1/3, 1/4) = 0.(010110010110010110010110)


One can check this wake in program Mandel by Wolf Jung using ray to point command ( Ctrl+e) :

The angle  5858713/16777215  or  p010110010110010110011001
has  preperiod = 0  and  period = 24.
The conjugate angle is  5858902/16777215  or  p010110010110011001010110 .
The kneading sequence is  ABABAAABABAAABABAAABABA*  and
the internal address is  1-2-6-24 .
The corresponding parameter rays are landing
at the root of a satellite component of period 24.
It is bifurcating from period 6.
Do you want to draw the rays and to shift c
to the corresponding center?


### (1/3, 1/4, 1/5)

Input is a list :

(1/3, 1/4, 1/5)


We go thru the list of angles from right to left and divide list into 2 sublists :

$p/q=1/3$ $r/s=(1/4,1/5)$ First compute (1/4,1/5) wake which will be used as a a new r/s wake :

$\theta _{-}(1/4,1/5)=0.(00010001000100010010)=\theta _{-}(r/s)$ $\theta _{+}(1/4,1/5)=0.(00010001000100100001)=\theta _{+}(r/s)$ After that compute 1/3 wake ( most left), which will be used as a p/q wake :

 $\theta _{-}(p/q)=\theta _{-}(1/3)=0.({\color {Blue}001})$ $\theta _{+}(p/q)=\theta _{+}(1/3)=0.({\color {Red}010})$ then in $\theta (r/s)$ replace :

• digit 0 by repeating block (of length q, color blue) from $\theta _{-}(p/q)$ • digit 1 by repeating block (of length q, color red) from $\theta _{+}(p/q)$ Result is :

$\theta _{-}(1/3,1/4,1/5)=0.({\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Red}010}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Red}010}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Red}010}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Red}010}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Red}010}\ {\color {Blue}001})$ $\theta _{+}(1/3,1/4,1/5)=0.({\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Red}010}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Red}010}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Red}010}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Red}010}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Blue}001}\ {\color {Red}010})$ One can check it using program Mandel by Wolf Jung :

The angle  164984615799661137/1152921504606846975  or  p001001001010001001001010001001001010001001001010001001010001
has  preperiod = 0  and  period = 60.
The conjugate angle is  164984615799689802/1152921504606846975  or  p001001001010001001001010001001001010001001010001001001001010 .
The kneading sequence is  AABAABAABAAAAABAABAABAAAAABAABAABAAAAABAABAABAAAAABAABAABAA*  and
the internal address is  1-3-12-60 .
The corresponding parameter rays are landing
at the root of a satellite component of period 60.
It is bifurcating from period 12.
Do you want to draw the rays and to shift c
to the corresponding center?


## 4 angles list

### (1/2, 1/3, 1/4, 1/5)

Input is a list :

(1/2, 1/3, 1/4, 1/5)


so the internal addres should be :

1-2-6-24-120


One can not check it using program Mandel because it is limited to period 64.

We go thru the list of input angles from right to left and divide list into 2 sublists :

$p/q=1/2$ $r/s=(1/3,1/4,1/5)$ First compute (1/3, 1/4, 1/5) wake which will be used as a a new r/s wake :

$\theta _{-}(1/3,1/4,1/5)=0.(001001001010001001001010001001001010001001001010001001010001)=\theta _{-}(r/s)$ $\theta _{+}(1/3,1/4,1/5)=0.(001001001010001001001010001001001010001001010001001001001010)=\theta _{+}(r/s)$ After that compute 1/2 wake ( most left), which will be used as a p/q wake :

 $\theta _{-}(p/q)=\theta _{-}(1/2)=0.({\color {Blue}01})$ $\theta _{+}(p/q)=\theta _{+}(1/2)=0.({\color {Red}10})$ then in $\theta (r/s)$ replace :

• digit 0 by repeating block (of length q, color blue) from $\theta _{-}(p/q)$ • digit 1 by repeating block (of length q, color red) from $\theta _{+}(p/q)$ Result is ( to check !!!!) :

$\theta _{-}(1/2,1/3,1/4,1/5)=0.({\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10})$ $\theta _{+}(1/2,1/3,1/4,1/5)=0.({\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01}\ {\color {Red}10}\ {\color {Blue}01})$ theta_minus(1/2, 1/3, 1/4, 1/5) = 0.(010110010110010110011001010110010110010110011001010110010110010110011001010110010110010110011001010110010110011001010110)
theta_plus(1/2, 1/3, 1/4, 1/5)  = 0.(010110010110010110011001010110010110010110011001010110010110010110011001010110010110011001010110010110010110010110011001)


One can check it visually using book program by Claude Heiland-Allen

size 640 360
view 53 -1.113644126576409e+00 2.5205986428803329e-01 3.9234950282896473e-04
ray_in 2000 .(010110010110010110011001010110010110010110011001010110010110010110011001010110010110011001010110010110010110010110011001)
ray_in 2000 .(010110010110010110011001010110010110010110011001010110010110010110011001010110010110010110011001010110010110011001010110)
text 53 -1.1152327443471231e+00 2.5276283972645397e-01 1/4
text 53 -1.1136201098499858e+00 2.5201617701965662e-01 1/5
text 53 -1.1152327443471231e+00 2.5276283972645397e-01 1/4
text 53 -1.1138472738947567e+00 2.5348331923684125e-01 24


# Code

/*

------------ git --------------------
https://gitlab.com/adammajewski/c-string-replaceing

cd existing_folder
git init
git remote add origin git@gitlab.com:adammajewski/c-string-replace.git
git add .
git commit
git push -u origin master

-------------- asprintf --------------------------------------
Using asprintf instead of sprintf or snprintf by james
http://www.stev.org/post/2012/02/10/Using-saprintf-instead-of-sprintf-or-snprintf.aspx

http://ubuntuforums.org/showthread.php?t=279801

gcc c.c -D_GNU_SOURCE -Wall // without #define _GNU_SOURCE

----------- run ----------------------

gcc c.c -Wall

*/

#define _GNU_SOURCE // asprintf
#include <stdio.h>
#include <stdlib.h>
#include <string.h> // strlen

int main() {
// output
char *sOut  = ""; // in plaint text format
char *sOutf = ""; // formatted for wikipedia math formula
// input
char *sIn = "001001001010001001001010001001001010001001001010001001010001";

// strings which will replace 0 and 1 digit in the input
char *sR0 = "01";
char *sR1 = "10";

int iMax; // length of the input string
int i;

iMax = (int) strlen(sIn);

for (i=0; i<iMax; i++){

// printf("i = %d, sIn[i] = %c = %d\n", i, sIn[i],  sIn[i] - '0');
// create sOut by replaceing digit (0 or 1) from aIn by a block of digits :  sR0 or sR1
if (((int) sIn[i] -'0') == 0 ) // http://stackoverflow.com/questions/868496/how-to-convert-char-to-integer-in-c
{asprintf(&sOut, "%s%s", sOut, sR0);
asprintf(&sOutf, "%s\\ {\\color{Blue}%s}", sOutf, sR0); }

else // if sIn[i]==1
{asprintf(&sOut, "%s%s", sOut, sR1);
asprintf(&sOutf, "%s\\ {\\color{Red}%s}", sOutf, sR1);}
}

printf("Input Length = %d\n", iMax);
printf("Output Length = %d\n",  (int) strlen(sOut));
printf("sOut = 0.(%s)\n", sOut);
printf("sOutf = 0.(%s)\n", sOutf);

free(sOut);
free(sOutf);
return 0;
}