Hydra function: Difference between revisions

From BusyBeaverWiki
Jump to navigation Jump to search
MrSolis (talk | contribs)
Replaced bitmap with spiral image, added material to the Properties section
MrSolis (talk | contribs)
No edit summary
Line 94: Line 94:
|Let <math>C_H(a,b):=0^\infty\;\textrm{<A}\;2\;0^{3(a-2)}\;3^b\;2\;0^\infty</math>:
|Let <math>C_H(a,b):=0^\infty\;\textrm{<A}\;2\;0^{3(a-2)}\;3^b\;2\;0^\infty</math>:
<math display="block">\begin{array}{|lll|}\hline
<math display="block">\begin{array}{|lll|}\hline
C_H(2^st,b+s)&\xrightarrow{f_1(s,t)}&C_H(3^st,b),\\
C_H(2^st,b+s)&\rightarrow&C_H(3^st,b),\\
C_H(2^st+1,b)&\xrightarrow{f_2(s,t,b)}&C_H(3^st+1,b+2s),\\\hline
C_H(2^st+1,b)&\rightarrow&C_H(3^st+1,b+2s),\\\hline
\end{array}</math>
\end{array}</math>
where <math display="inline">f_1(s,t)=\frac{6t(3^s-2^s)(36(3^s+2^s)t-65)}{5}-5s</math> and <math display="inline">f_2(s,t,b)=\frac{6t(3^s-2^s)(36(3^s+2^s)t+175)}{5}+(4b{+}4s{+}51)s</math>.
|Let <math>A_H(a,b):=0^\infty\;1^a\;0\;1^{b-4}\;\textrm{E>}\;0^\infty</math>:<math display="block">\begin{array}{|lll|}\hline
|Let <math>A_H(a,b):=0^\infty\;1^a\;0\;1^{b-4}\;\textrm{E>}\;0^\infty</math>:<math display="block">\begin{array}{|lll|}\hline
A_H(a,2^st)& \xrightarrow{f_3(s,t,a)}& A_H(a+2s,3^st),\\
A_H(a,2^st)& \rightarrow& A_H(a+2s,3^st),\\
A_H(a+s,2^st+1)&\xrightarrow{f_4(s,t)}& A_H(a,3^st+1),\\\hline
A_H(a+s,2^st+1)&\rightarrow& A_H(a,3^st+1),\\\hline
\end{array}</math>
\end{array}</math>
where <math display="inline">f_3(s,t,a)=\frac{12t^2(9^s-4^s)}{5}+(2a-3+2s)s</math> and <math display="inline">f_4(s,t)=\frac{12t(3^s-2^s)((3^s+2^s)t+5)}{5}-4s</math>.
|}
|}

Revision as of 12:09, 7 March 2025

A spiral-like figure that gives the first few terms of the Hydra sequences with initial values 2, 5, 8, 11, and 17.

The Hydra function is a Collatz-like function defined as: H(n)≡n+⌊12n⌋=⌊32n⌋={3n2if n≡0(mod2),3n−12if n≡1(mod2). It is named as such due its connection to the unsolved halting problems for the Cryptids Hydra and Antihydra. Due to its simplicity, simulations for both of these Turing machines utilize this function instead of what can initially be proven.

Relationship to Hydra and Antihydra

Using the Hydra function, we can obtain simplified rules for Hydra and Antihydra:

Hydra Antihydra
Let CH(a,b):=0∞<A203(a−2)3b20∞:0∞A>0∞→20CH(3,0),CH(2a,0)→54a2−48a−20∞39a−81A>20∞,CH(2a,b+1)→54a2−39a−5CH(3a,b),CH(2a+1,b)→4b+54a2−3a+4CH(3a+1,b+2). Let AH(a,b):=0∞1a01b−4E>0∞:0∞A>0∞→11AH(0,8),AH(a,2b)→2a+3b2−1AH(a+2,3b),AH(0,2b+1)→3b2−3b−70∞<F11013b−60∞,AH(a+1,2b+1)→3b2−7AH(a,3b+1).
Proof

Recall the high-level rules for Hydra and Antihydra:

Hydra Antihydra
Let C(a,b):=0∞<A20a3b20∞:0∞A>0∞→20C(3,0),C(2a,0)→6a2+20a+40∞33a+11A>20∞,C(2a,b+1)→6a2+23a+10C(3a+3,b),C(2a+1,b)→4b+6a2+23a+26C(3a+3,b+2). Let A(a,b):=0∞1a01bE>0∞:0∞A>0∞→11A(0,4),A(a,2b)→2a+3b2+12b+11A(a+2,3b+2),A(0,2b+1)→3b2+9b−10∞<F11013b0∞,A(a+1,2b+1)→3b2+12b+5A(a,3b+3).

Already, both machines appear to have very similar functions. They have one parameter that increases exponentially with growth factor 32 and another that effectively takes a pseudo-random walk. Below, the exponentially increasing variables are described by integer sequences:

Hydra Antihydra
a0=3,an+1={3an+62if an≡0(mod2)3an+32if an≡1(mod2) a0=4,an+1={3an+42if an≡0(mod2)3an+32if an≡1(mod2)

This makes illustrating the transformation easier. Now we will define a new integer sequence based on the old one and discover the recursive rules for that sequence. This new sequence is bn=13an+2 and bn=an+4 for Hydra and Antihydra respectively. We start by using bn+1 instead and substituting an+1 for its recursive formula. By doing so, we get:

Hydra Antihydra
b0=3,bn+1={an+62if an≡0(mod2)an+52if an≡1(mod2) b0=8,bn+1={3an+122if an≡0(mod2)3an+112if an≡1(mod2)

After that, we can substitute an for its solution in terms of bn. What results is the following:

Hydra Antihydra
b0=3,bn+1={3(bn−2)+62if 3(bn−2)≡0(mod2)3(bn−2)+52if 3(bn−2)≡1(mod2) b0=8,bn+1={3(bn−4)+122if bn−4≡0(mod2)3(bn−4)+112if bn−4≡1(mod2)

We note that the if statements simplify to checking if bn is even or odd. After simplifying, we are done:

Hydra Antihydra
b0=3,bn+1={3bn2if bn≡0(mod2)3bn−12if bn≡1(mod2) b0=8,bn+1={3bn2if bn≡0(mod2)3bn−12if bn≡1(mod2)

Now that we have demonstrated a strong similarity in the behaviour of both Turing machines, we can return to using the high-level rules. Doing that while accounting for the step counts yields the final result.

Properties

The Hydra function can be rewritten as follows: H(2n)=3n,H(2n+1)=3n+1. Now we will define s and t to be positive integers with t additionally being odd, and substitute n←2s−1t: H(2st)=2s−1×3t,H(2st+1)=2s−1×3t+1. Because 2s−1×3t is also the result of substituting s←s−1 and t←3t, we can iterate the Hydra function many times. Letting Hk(n)=H(⋯(H(H(n)))⋯)⏟k times, this means: Hs(2st)=3st,Hs(2st+1)=3st+1. This optimization can be directly applied to the high-level rules for Hydra and Antihydra, producing this result:

Hydra Antihydra
Let CH(a,b):=0∞<A203(a−2)3b20∞:

CH(2st,b+s)→CH(3st,b),CH(2st+1,b)→CH(3st+1,b+2s),

Let AH(a,b):=0∞1a01b−4E>0∞:AH(a,2st)→AH(a+2s,3st),AH(a+s,2st+1)→AH(a,3st+1),