Collatz Automata and Compute Residue Class from Reduced Dynamics by Formula

Citation Author(s):
Wei Ren
Submitted by:
Wei Ren
Last updated:
Thu, 11/08/2018 - 10:34
DOI:
10.21227/7z84-ms87
License:
134 Views
Categories:
Keywords:
0
0 ratings - Please login to submit your rating.

Abstract 

The data set provided source code in C on how to compute Collatz dynamics by automata in terms of residue classes. It also includes algorithms implemented by C codes that can output residue classes by inputting reduced dynamics.  The formular for computing a residue class for a given reduced dynamics is as follows:

 

Function $Invrs(\cdot)$. 

$Invrs: c \rightarrow rs$ takes as input \\

$c=O$ or \\

$c=I^{p_1}O^{q_1}I^{p_2}O^{q_2}...I^{p_n}O^{q_n} \in \{I,O\}^{\geq 2},$ $p_i,q_i\in \mathbb{N}^*, i=1,2,...,n, n \in \mathbb{N}^*$\\

$CntO(c)=\lceil \log_21.5*CntI(c)\rceil,$ \\

$CntO(s)<\lceil \log_21.5*CntI(s)\rceil, s=Substr(c,1,k), k=1,2,...,|c|-1,$ \\

and outputs \\

$rs=[0]_2$ when $c=O$, or\\

$rs=([-\sum_{i=1}^nA_iB_iC_{i-1}]_{2^{|c|}} \cap \{x|x>\Psi*\frac{2^{\sum_{i=1}^n(p_i+q_i)}}{2^{\sum_{i=1}^n(p_i+q_i)}-3^{\sum_{i=1}^np_i}}\})$

when $|c|\geq2,$ where $A_i=3^{p_i}-2^{p_i}$,

$B_i=(3^{\sum_{j=1}^ip_j})^{-1} \mod C_n$,

$C_i=2^{\sum_{j=1}^i(p_j+q_j)}, C_0=1,$\\

$\Psi=\prod_{i=2}^na_ib_1+\prod_{i=3}^na_ib_2+...+\prod_{i=n-1}^na_ib_{n-2}+\prod_{i=n}^na_ib_{n-1}+b_n,$\\

$a_i=\frac{3^{p_i}}{2^{p_i+q_i}},b_i=\frac{3^{p_i}-2^{p_i}}{2^{p_i+q_i}}.$

Instructions: 

txpo20.c

 

//Function: Given U, compute D, and output x such that CODE(x)=I^UO^{D-U}

//Input: U

//Output: x, such that CODE(x)=I^UO^{D-U}

//Usage Example: tpxo20.exe U > txpo20-U

//               txpo20.exe 1 > txpo20-1

// txpo20.exe 2 > txpo20-2

//         txpo20.exe 3 > txpo20-3

//               txpo20.exe 4 > txpo20-4

//Output Example: 

//txpo20-1:

//D=2

//m=3^U=3,s=2^{D-U}=2,t=s mod m=2

//t_inverse=2,A=(m-1)*t_inverse mod m=1,v_min=(m-2^U)/(2^D-m)=1

//A=4>1,x=(s*A+1)*pow(2,U)/m-1=5

 

txpo21.c

 

//Function: Given n, p[1],q[1],p[2],q[2],...,p[n],q[n], 

//          output x such that CODE(x)=I^p[1]O^q[1]I^p[2]O^q[2]...I^p[n]O^q[n]

//Input: n, p[1],q[1],p[2],q[2],...,p[n],q[n], 

//Output: x, such that CODE(x)=I^p[1]O^q[1]I^p[2]O^q[2]...I^p[n]O^q[n]

//Usage Example: tpxo21.exe 2 4 2 2 2 > txpo21-2-4-2-2-2

//               txpo21.exe 3 4 1 1 1 1 2 > txpo21-3-4-1-1-1-1-2

// txpo21.exe 4 4 1 1 1 1 1 1 2 > txpo21-4-4-1-1-1-1-1-1-2

//Output Example: 

//

//txpo21-2-4-2-2-2:

//p[1]=4,q[1]=2

//p[2]=2,q[2]=2

//D=10, L=1024, S[1]=81, m=16

//b=9, b_inverse=9, M=3, H=192

//In If(n==2), Z=65

//S1_inverse=177, x=975

 

txpo22.c

 

//Function: Given p,q, output x such that CODE(x)=I^pO^q

//          This program has the same purpose as program 20, but the method is different 

//          in that U,D replaced by p,q. Indeed, here p equals U in Program 20, q equals D-U in Program 20.

//Input: p,q

//Output: x, such that CODE(x)=I^qO^q

//Usage Example: tpxo22.exe p q > txpo22-p-q

//               txpo22.exe 1 1 > txpo22-1-1

// txpo22.exe 2 2 > txpo22-2-2

//             txpo22.exe 3 2 > txpo22-3-2

//               txpo22.exe 4 3 > txpo22-4-3

//Output Example: 

//txpo22-1-1:

//m=2^{p+q}=4,s=3^p=3,t=s mod m=3

//t_inverse=3, x=2^p*t_inverse mod m=1,v_min=(3^p-2^p)/(2^{p+q}-3^p)=1

//x=5

//

 

txpo23.c

 

//Function: Output CODE(x) by Finite State Automata.

//Input: x

//Output: CODE(x)

//Usage Example: tpxo23.exe 10000003 > txpo23-10000003

//               tpxo23.exe 1055 > txpo23-1055

//     tpxo23.exe 2047 > txpo23-2047

//               tpxo23.exe 103 > txpo23-103

//               tpxo23.exe 27 > txpo23-27

//               tpxo23.exe 155> txpo23-155

//               tpxo23.exe 123 > txpo23-123

//Output Example:

//txpo23-1055

//t in [3]_4, x=5345

//x in [1]_4, x=4009

//x in [1]_4, x=3007

//t in [3]_4, x=15227

//t in [2]_4, x=25697

//x in [1]_4, x=19273

//x in [1]_4, x=14455

//t in [1]_4, x=24394

//x in [0]_2, x=12197

//x in [1]_4, x=9148

//x in [0]_2, x=4574

//x in [0]_2, x=2287

//t in [3]_4, x=11582

//x in [0]_2, x=5791

//t in [3]_4, x=29321

//x in [1]_4, x=21991

//t in [1]_4, x=37111

//t in [1]_4, x=62626

//x in [0]_2, x=31313

//x in [1]_4, x=23485

//x in [1]_4, x=17614

//x in [0]_2, x=8807

//t in [1]_4, x=14863

//t in [3]_4, x=75248

//x in [0]_2, x=37624

//x in [0]_2, x=18812

//x in [0]_2, x=9406

//x in [0]_2, x=4703

//t in [3]_4, x=23813

//x in [1]_4, x=17860

//x in [0]_2, x=8930

//x in [0]_2, x=4465

//x in [1]_4, x=3349

//x in [1]_4, x=2512

//x in [0]_2, x=1256

//x in [0]_2, x=628

//CODE(1055)=-----0-0------0--0-0---00-000----0-----0---0---00-0-00---0----0000-----000-0-000

//u=50, d=80, ratio=(d-u)/u=0.3750000