Hydra function: Difference between revisions

From BusyBeaverWiki
Jump to navigation Jump to search
(Reworded content in the page)
(Emphasized simplified rules)
Line 7: Line 7:
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.
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==
== Relationship to Hydra and Antihydra==
Using the Hydra function, we can obtain simplified rules for Hydra and Antihydra:
{|class="wikitable"
! Hydra !! Antihydra
|-align="center"
|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
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}</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
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}</math>
|}
<div class="toccolours mw-collapsible mw-collapsed">'''Proof'''<div class="mw-collapsible-content">
Recall the high-level rules for Hydra and Antihydra:
Recall the high-level rules for Hydra and Antihydra:
{|class="wikitable"
{|class="wikitable"
Line 24: Line 42:
\end{array}</math>
\end{array}</math>
|}
|}
Already, both machines appear to have very similar functions. They have one parameter that increases exponentially with growth factor <math display="inline">\frac{3}{2}</math> and another that effectively takes a pseudo-random walk. This relationship can be strengthened through a modification of the rules. Below, the exponentially increasing variables are described by integer sequences:
Already, both machines appear to have very similar functions. They have one parameter that increases exponentially with growth factor <math display="inline">\frac{3}{2}</math> and another that effectively takes a pseudo-random walk. Below, the exponentially increasing variables are described by integer sequences:
{|class="wikitable"
{|class="wikitable"
! Hydra !! Antihydra
! Hydra !! Antihydra
Line 31: Line 49:
|<math display="block">a_0=4,a_{n+1}=\begin{cases}\frac{3a_n+4}{2}&\text{if }a_n\equiv0\pmod{2}\\\frac{3a_n+3}{2}&\text{if }a_n\equiv1\pmod{2}\end{cases}</math>
|<math display="block">a_0=4,a_{n+1}=\begin{cases}\frac{3a_n+4}{2}&\text{if }a_n\equiv0\pmod{2}\\\frac{3a_n+3}{2}&\text{if }a_n\equiv1\pmod{2}\end{cases}</math>
|}
|}
Doing 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 <math display="inline">b_n=\frac{1}{3}a_n+2</math> and <math>b_n=a_n+4</math> for Hydra and Antihydra respectively. We start by using <math>b_{n+1}</math> instead and substituting <math>a_{n+1}</math> for its recursive formula. By doing so, we get:
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 <math display="inline">b_n=\frac{1}{3}a_n+2</math> and <math>b_n=a_n+4</math> for Hydra and Antihydra respectively. We start by using <math>b_{n+1}</math> instead and substituting <math>a_{n+1}</math> for its recursive formula. By doing so, we get:
{|class="wikitable"
{|class="wikitable"
! Hydra !! Antihydra
! Hydra !! Antihydra
Line 52: Line 70:
|<math display="block">b_0=8,b_{n+1}=\begin{cases}\frac{3b_n}{2}&\text{if }b_n\equiv0\pmod{2}\\\frac{3b_n-1}{2}&\text{if }b_n\equiv1\pmod{2}\end{cases}</math>
|<math display="block">b_0=8,b_{n+1}=\begin{cases}\frac{3b_n}{2}&\text{if }b_n\equiv0\pmod{2}\\\frac{3b_n-1}{2}&\text{if }b_n\equiv1\pmod{2}\end{cases}</math>
|}
|}
Now that we have demonstrated a strong similarity in the behaviour of both Turing machines, we can return to using the high-level rules. Once we do that and update the step counts, the result is:
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.
{|class="wikitable"
</div></div>
! Hydra !! Antihydra
|-align="center"
|Let <math>C(a,b):=0^\infty\;\textrm{<A}\;2\;0^{3(a-2)}\;3^b\;2\;0^\infty</math>:<math display="block">\begin{array}{|lll|}\hline
0^\infty\;\textrm{A>}\;0^\infty&\xrightarrow{20}&C(3,0),\\
C(2a,0)&\xrightarrow{54a^2-48a-2}&0^\infty\;3^{9a-8}\;1\;\textrm{A>}\;2\;0^\infty,\\
C(2a,b+1)&\xrightarrow{54a^2-39a-5}&C(3a,b),\\
C(2a+1,b)&\xrightarrow{4b+54a^2-3a+4}&C(3a+1,b+2).\\\hline
\end{array}</math>
|Let <math>A(a,b):=0^\infty\;1^a\;0\;1^{b-4}\;\textrm{E>}\;0^\infty</math>:<math display="block">\begin{array}{|lll|}\hline
0^\infty\;\textrm{A>}\;0^\infty&\xrightarrow{11}&A(0,8),\\
A(a,2b)& \xrightarrow{2a+3b^2-1}& A(a+2,3b),\\
A(0,2b+1)&\xrightarrow{3b^2-3b-7}& 0^\infty\;\textrm{<F}\;110\;1^{3b-6}\;0^\infty,\\
A(a+1,2b+1)&\xrightarrow{3b^2-7}& A(a,3b+1).\\\hline
\end{array}</math>
|}
==Properties==
==Properties==
The Hydra function can be rewritten as follows:
The Hydra function can be rewritten as follows:

Revision as of 04:50, 5 March 2025

A bitmap depiction of 255 iterations of the Hydra function, starting with 3 at the top.

The Hydra function is a Collatz-like function defined as:

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 :
Let :
Proof

Recall the high-level rules for Hydra and Antihydra:

Hydra Antihydra
Let :
Let :

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

Hydra Antihydra

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 and for Hydra and Antihydra respectively. We start by using instead and substituting for its recursive formula. By doing so, we get:

Hydra Antihydra

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

Hydra Antihydra

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

Hydra Antihydra

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:

From this comes a way to slightly optimize the calculation. Here, and are positive integers with odd. Let be an integer and is the th iterate of .