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
+
⌊
1
2
n
⌋
=
⌊
3
2
n
⌋
=
{
3
n
2
if
n
≡
0
(
mod
2
)
,
3
n
−
1
2
if
n
≡
1
(
mod
2
)
.
{\displaystyle \textstyle H(n)\equiv n+\left\lfloor {\frac {1}{2}}n\right\rfloor ={\Big \lfloor }{\frac {3}{2}}n{\Big \rfloor }={\begin{cases}{\frac {3n}{2}}&{\text{if }}n\equiv 0{\pmod {2}},\\{\frac {3n-1}{2}}&{\text{if }}n\equiv 1{\pmod {2}}.\\\end{cases}}}
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
C
H
(
a
,
b
)
:=
0
∞
<A
2
0
3
(
a
−
2
)
3
b
2
0
∞
{\displaystyle C_{H}(a,b):=0^{\infty }\;{\textrm {<A}}\;2\;0^{3(a-2)}\;3^{b}\;2\;0^{\infty }}
:
0
∞
A>
0
∞
→
20
C
H
(
3
,
0
)
,
C
H
(
2
a
,
0
)
→
54
a
2
−
48
a
−
2
0
∞
3
9
a
−
8
1
A>
2
0
∞
,
C
H
(
2
a
,
b
+
1
)
→
54
a
2
−
39
a
−
5
C
H
(
3
a
,
b
)
,
C
H
(
2
a
+
1
,
b
)
→
4
b
+
54
a
2
−
3
a
+
4
C
H
(
3
a
+
1
,
b
+
2
)
.
{\displaystyle {\begin{array}{|lll|}\hline 0^{\infty }\;{\textrm {A>}}\;0^{\infty }&\xrightarrow {20} &C_{H}(3,0),\\C_{H}(2a,0)&\xrightarrow {54a^{2}-48a-2} &0^{\infty }\;3^{9a-8}\;1\;{\textrm {A>}}\;2\;0^{\infty },\\C_{H}(2a,b+1)&\xrightarrow {54a^{2}-39a-5} &C_{H}(3a,b),\\C_{H}(2a+1,b)&\xrightarrow {4b+54a^{2}-3a+4} &C_{H}(3a+1,b+2).\\\hline \end{array}}}
Let
A
H
(
a
,
b
)
:=
0
∞
1
a
0
1
b
−
4
E>
0
∞
{\displaystyle A_{H}(a,b):=0^{\infty }\;1^{a}\;0\;1^{b-4}\;{\textrm {E>}}\;0^{\infty }}
:
0
∞
A>
0
∞
→
11
A
H
(
0
,
8
)
,
A
H
(
a
,
2
b
)
→
2
a
+
3
b
2
−
1
A
H
(
a
+
2
,
3
b
)
,
A
H
(
0
,
2
b
+
1
)
→
3
b
2
−
3
b
−
7
0
∞
<F
110
1
3
b
−
6
0
∞
,
A
H
(
a
+
1
,
2
b
+
1
)
→
3
b
2
−
7
A
H
(
a
,
3
b
+
1
)
.
{\displaystyle {\begin{array}{|lll|}\hline 0^{\infty }\;{\textrm {A>}}\;0^{\infty }&\xrightarrow {11} &A_{H}(0,8),\\A_{H}(a,2b)&\xrightarrow {2a+3b^{2}-1} &A_{H}(a+2,3b),\\A_{H}(0,2b+1)&\xrightarrow {3b^{2}-3b-7} &0^{\infty }\;{\textrm {<F}}\;110\;1^{3b-6}\;0^{\infty },\\A_{H}(a+1,2b+1)&\xrightarrow {3b^{2}-7} &A_{H}(a,3b+1).\\\hline \end{array}}}
Proof
Recall the high-level rules for Hydra and Antihydra:
Hydra
Antihydra
Let
C
(
a
,
b
)
:=
0
∞
<A
2
0
a
3
b
2
0
∞
{\displaystyle C(a,b):=0^{\infty }\;{\textrm {<A}}\;2\;0^{a}\;3^{b}\;2\;0^{\infty }}
:
0
∞
A>
0
∞
→
20
C
(
3
,
0
)
,
C
(
2
a
,
0
)
→
6
a
2
+
20
a
+
4
0
∞
3
3
a
+
1
1
A>
2
0
∞
,
C
(
2
a
,
b
+
1
)
→
6
a
2
+
23
a
+
10
C
(
3
a
+
3
,
b
)
,
C
(
2
a
+
1
,
b
)
→
4
b
+
6
a
2
+
23
a
+
26
C
(
3
a
+
3
,
b
+
2
)
.
{\displaystyle {\begin{array}{|lll|}\hline 0^{\infty }\;{\textrm {A>}}\;0^{\infty }&\xrightarrow {20} &C(3,0),\\C(2a,0)&\xrightarrow {6a^{2}+20a+4} &0^{\infty }\;3^{3a+1}\;1\;{\textrm {A>}}\;2\;0^{\infty },\\C(2a,b+1)&\xrightarrow {6a^{2}+23a+10} &C(3a+3,b),\\C(2a+1,b)&\xrightarrow {4b+6a^{2}+23a+26} &C(3a+3,b+2).\\\hline \end{array}}}
Let
A
(
a
,
b
)
:=
0
∞
1
a
0
1
b
E>
0
∞
{\displaystyle A(a,b):=0^{\infty }\;1^{a}\;0\;1^{b}\;{\textrm {E>}}\;0^{\infty }}
:
0
∞
A>
0
∞
→
11
A
(
0
,
4
)
,
A
(
a
,
2
b
)
→
2
a
+
3
b
2
+
12
b
+
11
A
(
a
+
2
,
3
b
+
2
)
,
A
(
0
,
2
b
+
1
)
→
3
b
2
+
9
b
−
1
0
∞
<F
110
1
3
b
0
∞
,
A
(
a
+
1
,
2
b
+
1
)
→
3
b
2
+
12
b
+
5
A
(
a
,
3
b
+
3
)
.
{\displaystyle {\begin{array}{|lll|}\hline 0^{\infty }\;{\textrm {A>}}\;0^{\infty }&\xrightarrow {11} &A(0,4),\\A(a,2b)&\xrightarrow {2a+3b^{2}+12b+11} &A(a+2,3b+2),\\A(0,2b+1)&\xrightarrow {3b^{2}+9b-1} &0^{\infty }\;{\textrm {<F}}\;110\;1^{3b}\;0^{\infty },\\A(a+1,2b+1)&\xrightarrow {3b^{2}+12b+5} &A(a,3b+3).\\\hline \end{array}}}
Already, both machines appear to have very similar functions. They have one parameter that increases exponentially with growth factor
3
2
{\textstyle {\frac {3}{2}}}
and another that effectively takes a pseudo-random walk. Below, the exponentially increasing variables are described by integer sequences:
Hydra
Antihydra
a
0
=
3
,
a
n
+
1
=
{
3
a
n
+
6
2
if
a
n
≡
0
(
mod
2
)
3
a
n
+
3
2
if
a
n
≡
1
(
mod
2
)
{\displaystyle a_{0}=3,a_{n+1}={\begin{cases}{\frac {3a_{n}+6}{2}}&{\text{if }}a_{n}\equiv 0{\pmod {2}}\\{\frac {3a_{n}+3}{2}}&{\text{if }}a_{n}\equiv 1{\pmod {2}}\end{cases}}}
a
0
=
4
,
a
n
+
1
=
{
3
a
n
+
4
2
if
a
n
≡
0
(
mod
2
)
3
a
n
+
3
2
if
a
n
≡
1
(
mod
2
)
{\displaystyle a_{0}=4,a_{n+1}={\begin{cases}{\frac {3a_{n}+4}{2}}&{\text{if }}a_{n}\equiv 0{\pmod {2}}\\{\frac {3a_{n}+3}{2}}&{\text{if }}a_{n}\equiv 1{\pmod {2}}\end{cases}}}
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
b
n
=
1
3
a
n
+
2
{\textstyle b_{n}={\frac {1}{3}}a_{n}+2}
and
b
n
=
a
n
+
4
{\displaystyle b_{n}=a_{n}+4}
for Hydra and Antihydra respectively. We start by using
b
n
+
1
{\displaystyle b_{n+1}}
instead and substituting
a
n
+
1
{\displaystyle a_{n+1}}
for its recursive formula. By doing so, we get:
Hydra
Antihydra
b
0
=
3
,
b
n
+
1
=
{
a
n
+
6
2
if
a
n
≡
0
(
mod
2
)
a
n
+
5
2
if
a
n
≡
1
(
mod
2
)
{\displaystyle b_{0}=3,b_{n+1}={\begin{cases}{\frac {a_{n}+6}{2}}&{\text{if }}a_{n}\equiv 0{\pmod {2}}\\{\frac {a_{n}+5}{2}}&{\text{if }}a_{n}\equiv 1{\pmod {2}}\end{cases}}}
b
0
=
8
,
b
n
+
1
=
{
3
a
n
+
12
2
if
a
n
≡
0
(
mod
2
)
3
a
n
+
11
2
if
a
n
≡
1
(
mod
2
)
{\displaystyle b_{0}=8,b_{n+1}={\begin{cases}{\frac {3a_{n}+12}{2}}&{\text{if }}a_{n}\equiv 0{\pmod {2}}\\{\frac {3a_{n}+11}{2}}&{\text{if }}a_{n}\equiv 1{\pmod {2}}\end{cases}}}
After that, we can substitute
a
n
{\displaystyle a_{n}}
for its solution in terms of
b
n
{\displaystyle b_{n}}
. What results is the following:
Hydra
Antihydra
b
0
=
3
,
b
n
+
1
=
{
3
(
b
n
−
2
)
+
6
2
if
3
(
b
n
−
2
)
≡
0
(
mod
2
)
3
(
b
n
−
2
)
+
5
2
if
3
(
b
n
−
2
)
≡
1
(
mod
2
)
{\displaystyle b_{0}=3,b_{n+1}={\begin{cases}{\frac {3(b_{n}-2)+6}{2}}&{\text{if }}3(b_{n}-2)\equiv 0{\pmod {2}}\\{\frac {3(b_{n}-2)+5}{2}}&{\text{if }}3(b_{n}-2)\equiv 1{\pmod {2}}\end{cases}}}
b
0
=
8
,
b
n
+
1
=
{
3
(
b
n
−
4
)
+
12
2
if
b
n
−
4
≡
0
(
mod
2
)
3
(
b
n
−
4
)
+
11
2
if
b
n
−
4
≡
1
(
mod
2
)
{\displaystyle b_{0}=8,b_{n+1}={\begin{cases}{\frac {3(b_{n}-4)+12}{2}}&{\text{if }}b_{n}-4\equiv 0{\pmod {2}}\\{\frac {3(b_{n}-4)+11}{2}}&{\text{if }}b_{n}-4\equiv 1{\pmod {2}}\end{cases}}}
We note that the if statements simplify to checking if
b
n
{\displaystyle b_{n}}
is even or odd. After simplifying, we are done:
Hydra
Antihydra
b
0
=
3
,
b
n
+
1
=
{
3
b
n
2
if
b
n
≡
0
(
mod
2
)
3
b
n
−
1
2
if
b
n
≡
1
(
mod
2
)
{\displaystyle b_{0}=3,b_{n+1}={\begin{cases}{\frac {3b_{n}}{2}}&{\text{if }}b_{n}\equiv 0{\pmod {2}}\\{\frac {3b_{n}-1}{2}}&{\text{if }}b_{n}\equiv 1{\pmod {2}}\end{cases}}}
b
0
=
8
,
b
n
+
1
=
{
3
b
n
2
if
b
n
≡
0
(
mod
2
)
3
b
n
−
1
2
if
b
n
≡
1
(
mod
2
)
{\displaystyle b_{0}=8,b_{n+1}={\begin{cases}{\frac {3b_{n}}{2}}&{\text{if }}b_{n}\equiv 0{\pmod {2}}\\{\frac {3b_{n}-1}{2}}&{\text{if }}b_{n}\equiv 1{\pmod {2}}\end{cases}}}
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
(
2
n
)
=
3
n
,
H
(
2
n
+
1
)
=
3
n
+
1.
{\displaystyle {\begin{array}{l}H(2n)&=&3n,\\H(2n+1)&=&3n+1.\\\end{array}}}
Now we will define
s
{\displaystyle s}
and
t
{\displaystyle t}
to be positive integers with
t
{\displaystyle t}
additionally being odd, and substitute
n
←
2
s
−
1
t
{\displaystyle n\leftarrow 2^{s-1}t}
:
H
(
2
s
t
)
=
2
s
−
1
×
3
t
,
H
(
2
s
t
+
1
)
=
2
s
−
1
×
3
t
+
1.
{\displaystyle {\begin{array}{l}H(2^{s}t)&=&2^{s-1}\times 3t,\\H(2^{s}t+1)&=&2^{s-1}\times 3t+1.\\\end{array}}}
Because
2
s
−
1
×
3
t
{\displaystyle 2^{s-1}\times 3t}
is also the result of substituting
s
←
s
−
1
{\displaystyle s\leftarrow s-1}
and
t
←
3
t
{\displaystyle t\leftarrow 3t}
, we can iterate the Hydra function many times. Letting
H
k
(
n
)
=
H
(
⋯
(
H
(
H
(
n
)
)
)
⋯
)
⏟
k
times
{\displaystyle H^{k}(n)=\underbrace {H(\cdots (H(H(n)))\cdots )} _{k{\text{ times}}}}
, this means:
H
s
(
2
s
t
)
=
3
s
t
,
H
s
(
2
s
t
+
1
)
=
3
s
t
+
1.
{\displaystyle {\begin{array}{l}H^{s}(2^{s}t)&=&3^{s}t,\\H^{s}(2^{s}t+1)&=&3^{s}t+1.\\\end{array}}}
This optimization can be directly applied to the high-level rules for Hydra and Antihydra, producing this result:
Hydra
Antihydra
Let
C
H
(
a
,
b
)
:=
0
∞
<A
2
0
3
(
a
−
2
)
3
b
2
0
∞
{\displaystyle C_{H}(a,b):=0^{\infty }\;{\textrm {<A}}\;2\;0^{3(a-2)}\;3^{b}\;2\;0^{\infty }}
:
C
H
(
2
s
t
,
b
+
s
)
→
C
H
(
3
s
t
,
b
)
,
C
H
(
2
s
t
+
1
,
b
)
→
C
H
(
3
s
t
+
1
,
b
+
2
s
)
,
{\displaystyle {\begin{array}{|lll|}\hline C_{H}(2^{s}t,b+s)&\rightarrow &C_{H}(3^{s}t,b),\\C_{H}(2^{s}t+1,b)&\rightarrow &C_{H}(3^{s}t+1,b+2s),\\\hline \end{array}}}
Let
A
H
(
a
,
b
)
:=
0
∞
1
a
0
1
b
−
4
E>
0
∞
{\displaystyle A_{H}(a,b):=0^{\infty }\;1^{a}\;0\;1^{b-4}\;{\textrm {E>}}\;0^{\infty }}
:
A
H
(
a
,
2
s
t
)
→
A
H
(
a
+
2
s
,
3
s
t
)
,
A
H
(
a
+
s
,
2
s
t
+
1
)
→
A
H
(
a
,
3
s
t
+
1
)
,
{\displaystyle {\begin{array}{|lll|}\hline A_{H}(a,2^{s}t)&\rightarrow &A_{H}(a+2s,3^{s}t),\\A_{H}(a+s,2^{s}t+1)&\rightarrow &A_{H}(a,3^{s}t+1),\\\hline \end{array}}}