Antihydra: Difference between revisions

From BusyBeaverWiki
Jump to navigation Jump to search
(Add visualization of the evolution of the Antihydra's "a" variable in binary representation)
No edit summary
Line 1: Line 1:
{{machine|1RB1RA_0LC1LE_1LD1LC_1LA0LB_1LF1RE_---0RA}}{{unsolved|Does Antihydra run forever?}}
{{machine|1RB1RA_0LC1LE_1LD1LC_1LA0LB_1LF1RE_---0RA}}{{unsolved|Does Antihydra run forever?}}{{TM|1RB1RA_0LC1LE_1LD1LC_1LA0LB_1LF1RE_---0RA|undecided}}
[[File:Antihydra-depiction.png|right|thumb|Artistic depiction of Antihydra by Jadeix]]
[[File:Antihydra-depiction.png|right|thumb|200px|Artistic depiction of Antihydra by Jadeix]]
'''Antihydra''' ({{TM|1RB1RA_0LC1LE_1LD1LC_1LA0LB_1LF1RE_---0RA|undecided}}) is a [[probviously]] nonhalting [[BB(6)]] [[Collatz-like]] [[Cryptid]]. In fact, it was the first identified BB(6) Cryptid. It is closely related to [[Hydra]].
'''Antihydra''' is the first [[BB(6)]] [[Cryptid]] to be identified. It operates by repeatedly applying the function <math display="inline">H(n)=\Big\lfloor\frac{3}{2}n\Big\rfloor</math>, starting with <math>n=8</math>. Determining whether this [[Turing machine]] halts requires solving a [[Collatz-like ]] mathematical problem. Specifically, one must establish a significant result regarding the frequency of odd versus even numbers generated throughout the sequence. While probabilistic arguments based on random walks suggest Antihydra [[probviously]] runs indefinitely, proving this remains challenging. The difficulty stems from both the lack of an exploitable pattern in the sequence’s parities and the inherent complexity of Collatz-like problems.
 
== Description ==
It simulates iterations of the Collatz-like [[Hydra function]]:
[[File:Hydra TransitionTable.png|right|200px|thumb|The transition table of Antihydra.]]
 
Antihydra basically repeatedly modifies the integer ordered pair <math>(x,y)</math> starting at <math>(0,4)</math>, which is represented on the tape as <math>x</math> consecutive <math>1</math>s and <math>y</math> consecutive <math>1</math>s, separated by a single <math>0</math>. It does this by "borrowing" a <math>0</math> from the right side and, through a series of back-and-forth head movements, "moves" this <math>0</math> toward the one separating <math>x</math> and <math>y</math>, two units at a time. As this happens, the head visits new cells on the right, which has the effect of there being about <math display="inline">\frac{3}{2}</math> times as many <math>1</math>s on the tape when the distance has been closed. After that, <math>x</math> and <math>y</math> are updated. If the previous value of <math>x</math> was even, then <math>y</math> becomes <math>y+2</math>. Otherwise, <math>y</math> becomes <math>y-1</math> or Antihydra halts if <math>y</math> was 0.
<math display="block">H(n) = \left\lfloor \frac{3n}{2} \right\rfloor = \begin{cases}
  \frac{3n}{2}    & \text{if } n \text{ even} \\
  \frac{3n-1}{2}  & \text{if } n \text{ odd} \\
\end{cases}</math>starting from 8:
 
<math display="block">8 \to 12 \to 18 \to 27 \to 40 \to 60 \to 90 \to 135 \to 202 \cdots</math>
 
Antihydra halts if and only if the cumulative number of odd values in this sequence is ever more than twice the cumulative number of even values.
 
If we treat the parity of successive values in this sequence as independent random coin flips, then this is a biased random walk and has a miniscule chance of ever halting, thus we say that this TM "probviously" does not halt. But proving this would require solving a Collatz-like problem.
 
== Turing Machine ==
Antihydra is the TM {{TM|1RB1RA_0LC1LE_1LD1LC_1LA0LB_1LF1RE_---0RA|undecided}}
{| class="wikitable"
|+Antihydra
!
!0
!1
|-
!'''A'''
|1RB
|1RA
|-
!'''B'''
|0LC
|1LE
|-
!'''C'''
|1LD
|1LC
|-
!'''D'''
|1LA
|0LB
|-
!'''E'''
|1LF
|1RE
|-
!'''F'''
| ---
|0RA
|}
It was discovered by @mxdys on 28 Jun 2024 and shared on Discord<ref>[https://discord.com/channels/960643023006490684/1026577255754903572/1256223215206924318 Discord message], accessed 30 June 2024.</ref> and Racheline discovered that it iterates the Hydra function.


To resolve the halting problem for Antihydra, one must determine if, given the function <math display="inline">H(n)=\Big\lfloor\frac{3}{2}n\Big\rfloor</math>, the sequence of iterates <math>(8,H(8),H^2(8),H^3(8),H^4(8),\cdots)</math> could ever produce a cumulative quantity of odd numbers that is more than twice that of the even numbers.
=== Attributions ===
Antihydra and its pseudo-random behaviour were reported [https://discord.com/channels/960643023006490684/1026577255754903572/1256223215206924318 on Discord] by mxdys on 28 June 2024, and Racheline discovered the high-level rules soon after, where it was found to be closely related to [[Hydra]].
== Analysis ==
== Analysis ==
[[File:Antihydra increasing value.png|thumb|Binary representation of the first 1000 steps of the evolution of the exponentially increasing variable of the Antihydra iteration (a = a + a//2), the colored background indicating whether the value is even (blue) or odd (red)]]
Let <math>A(a,b):=0^\infty\;1^a\;0\;1^b\;\textrm{E>}\;0^\infty</math>. Then,<ref name="bl">S. Ligocki, "[https://www.sligocki.com/2024/07/06/bb-6-2-is-hard.html BB(6) is Hard (Antihydra)]" (2024). Accessed 22 July 2024.</ref>
Let <math>A(a+4, b) = 0^\infty \; 1^b \; 0 \; 1^a \; E> \; 0^\infty</math>, then<ref>S. Ligocki, "[https://www.sligocki.com/2024/07/06/bb-6-2-is-hard.html BB(6) is Hard (Antihydra)]" (2024). Accessed 22 July 2024.</ref>
<math display="block">\begin{array}{|lll|}\hline
 
A(a,2b)& \xrightarrow{2a+3b^2+12b+11}& A(a+2,3b+2),\\
<math display="block">\begin{array}{l}
A(0,2b+1)&\xrightarrow{3b^2+9b-1}& 0^\infty\;\textrm{<F}\;110\;1^{3b}\;0^\infty,\\
  \text{Start}&& \to & A(8,   & 0) \\
A(a+1,2b+1)&\xrightarrow{3b^2+12b+5}& A(a,3b+3).\\\hline
  A(2a,   & b) & \to & A(3a,   & b+2) \\
\end{array}</math>
  A(2a+1, & b) & \to & A(3a+1, & b-1) & \text{if} & b>0 \\
<div class="toccolours mw-collapsible mw-collapsed">'''Proof'''<div class="mw-collapsible-content">
  A(2a+1, & 0) & \to & \text{HALT}
Consider the partial configuration <math>P(m,n):=0\;1^m\;\textrm{E>}\;0\;1^n\;0^\infty</math>. The configuration after two steps is <math>0\;1^{m-1}\;0\;\textrm{A>}\;1^{n+1}\;0^\infty</math>. We note the following shift rule:
\end{array}</math>At each iteration, <math>a \mapsto H(a)</math> and
<math display="block">\begin{array}{|c|}\hline\textrm{A>}\;1^s\xrightarrow{s}1^s\;\textrm{A>}\\\hline\end{array}</math>
 
As a result, we get <math>0\;1^{m-1}\;0\;1^{n+1}\;\textrm{A>}\;0^\infty</math> after <math>n+1</math> steps. Advancing two steps produces <math>0\;1^{m-1}\;0\;1^{n+2}\;\textrm{<C}\;0^\infty</math>. A second shift rule is useful here:
<math display="block">b \mapsto \begin{cases}
<math display="block">\begin{array}{|c|}\hline1^s\;\textrm{<C}\xrightarrow{s}\textrm{<C}\;1^s\\\hline\end{array}</math>
  b+2   & \text{if } a \text{ is even} \\
This allows us to reach <math>0\;1^{m-1}\;0\;\textrm{<C}\;1^{n+2}\;0^\infty</math> in <math>n+2</math> steps. Moving five more steps gets us to <math>0\;1^{m-2}\;\textrm{E>}\;0\;1^{n+3}\;0^\infty</math>, which is the same configuration as <math>P(m-2,n+3)</math>. Accounting for the head movement creates the condition that <math>m\ge 4</math>. In summary:
  b-1   & \text{if } a \text{ is odd} \\
<math display="block">\begin{array}{|c|}\hline P(m,n)\xrightarrow{2n+12}P(m-2,n+3)\text{ if }m\ge 4.\\\hline\end{array}</math>
\end{cases}</math>
With <math>A(a,b)</math> we have <math>P(b,0)</math>. As a result, we can apply this rule <math display="inline>\big\lfloor\frac{1}{2}b\big\rfloor-1</math> times (assuming <math>b\ge 4</math>), which creates two possible scenarios:
 
#If <math>b\equiv0\ (\operatorname{mod}2)</math>, then in <math>\sum_{i=0}^{(b/2)-2}(2\times 3i+12)=\textstyle\frac{3}{4}b^2+\frac{3}{2}b-6</math> steps we arrive at <math display="inline">P\Big(2,\frac{3}{2}b-3\Big)</math>. The matching complete configuration is <math>0^\infty\;1^a\;011\;\textrm{E>}\;0\;1^{(3b)/2-3}\;0^\infty</math>. After <math>3b+4</math> steps this becomes <math>0^\infty\;1^a\;\textrm{<C}\;00\;1^{(3b)/2}\;0^\infty</math>, which then leads to <math>0^\infty\;\textrm{<C}\;1^a\;00\;1^{(3b)/2}\;0^\infty</math> in <math>a</math> steps. After five more steps, we reach <math>0^\infty\;1\;\textrm{E>}\;1^{a+2}\;00\;1^{(3b)/2}\;0^\infty</math>, from which another shift rule must be applied:<math display="block">\begin{array}{|c|}\hline\textrm{E>}\;1^s\xrightarrow{s}1^s\;\textrm{E>}\\\hline\end{array}</math>Doing so allows us to get the configuration <math>0^\infty\;1^{a+3}\;\textrm{E>}\;00\;1^{(3b)/2}\;0^\infty</math> in <math>a+2</math> steps. In six steps we have <math>0^\infty\;1^{a+2}\;011\;\textrm{E>}\;1^{(3b)/2}\;0^\infty</math>, so we use the shift rule again, ending at <math>0^\infty\;1^{a+2}\;0\;1^{(3b)/2+2}\;\textrm{E>}\;0^\infty</math>, equal to <math display="inline">A\Big(a+2,\frac{3}{2}b+2\Big)</math>, <math display="inline">\frac{3}{2}b</math> steps later. This gives a total of <math display="inline">2a+\frac{3}{4}b^2+6b+11</math> steps.
halting iff b ever reaches -1.
#If <math>b\equiv1\ (\operatorname{mod}2)</math>, then in <math display="inline">\frac{3}{4}b^2-\frac{27}{4}</math> steps we arrive at <math display="inline">P\Big(3,\frac{3b-9}{2}\Big)</math>. The matching complete configuration is <math>0^\infty\;1^a\;0111\;\textrm{E>}\;0\;1^{(3b-9)/2}\;0^\infty</math>. After <math>3b+2</math> steps this becomes <math>0^\infty\;1^a\;\textrm{<F}\;110\;1^{(3b-3)/2}\;0^\infty</math>. If <math>a=0</math> then we have reached the undefined <code>F0</code> transition with a total of <math display="inline">\frac{3}{4}b^2+3b-\frac{19}{4}</math> steps. Otherwise, continuing for six steps gives us <math>0^\infty\;1^{a-1}\;0111\;\textrm{E>}\;1^{(3b-3)/2}\;0^\infty</math>. We conclude with the configuration <math>0^\infty\;1^{a-1}\;0\;1^{(3b+3)/2}\;\textrm{E>}\;0^\infty</math>, equal to <math display="inline">A\Big(a-1,\frac{3b+3}{2}\Big)</math>, in <math display="inline">\frac{3b-3}{2}</math> steps. This gives a total of <math display="inline">\frac{3}{4}b^2+\frac{9}{2}b-\frac{1}{4}</math> steps.
 
The information above can be summarized as
== Biased Random Walk ==
<math display="block">A(a,b)\rightarrow\begin{cases}A\Big(a+2,\frac{3}{2}b+2\Big)&\text{if }b\ge 2,b\equiv0\pmod{2};\\0^\infty\;\textrm{<F}\;110\;1^{(3b-3)/2}\;0^\infty&\text{if }b\ge3,b\equiv1\pmod{2},\text{ and }a=0;\\A\Big(a-1,\frac{3b+3}{2}\Big)&\text{if }b\ge3,b\equiv1\pmod{2},\text{ and }a>0.\end{cases}</math>
If we consider the sequence of parities of <math>a</math> to be independent random coin flips, then the movement of <math>b</math> is a biased random walk (50% chance of +2, 50% of -1). Starting from <math>b = n</math>, the chance of such a random walk ever reaching <math>b = -1</math> is <math>\left(\frac{1}{\phi}\right)^{n+1}</math> and the expected value of b after k steps is <math>\frac{k}{2}</math>.
Substituting <math>b\leftarrow 2b</math> for the first case and <math>b\leftarrow 2b+1</math> for the other two yields the final result.
 
</div></div>
== Simulation ==
== Trajectory ==
@mxdys has simulated this iteration out to <math>2^{31} = 2\,147\,483\,648</math> steps at which point <math>b = 1\,073\,720\,884</math> ([https://discord.com/channels/960643023006490684/1026577255754903572/1258509066196746351 Discord link]), this is 20940 (0.002%) below the expected value if this were a random walk. If this was a random walk, the chance of ever halting from this point is
11 steps are required to enter the configuration <math>A(0, 4)</math> before the rules are repeatedly applied. So far, Antihydra has been simulated to <math>2^{31}</math> rule steps, at which point <math>b=1073720884</math>. Here are the first few:
 
<math display="block">\begin{array}{|c|}\hline A(0,4)\xrightarrow{47}A(2,8)\xrightarrow{111}A(4,14)\xrightarrow{250}A(6,23)\xrightarrow{500}A(5,36)\xrightarrow{1209}A(7,56)\xrightarrow{2713}A(9,86)\rightarrow\cdots\\\hline\end{array}</math>
<math display="block">\left(\frac{1}{\phi}\right)^{1\,073\,720\,885} < \left(\frac{1}{2}\right)^{500\,000\,000}</math>
===A heuristic nonhalting argument===
 
[[File:Antihydra increasing value.png|thumb|200px|A binary representation of the first 1000 steps of the evolution of the exponentially increasing variable of the Antihydra iteration (a = a + a//2). The colored background indicates whether the value is even or odd with blue and red, respectively.]]
an extremely miniscule chance.
The trajectory of <math>b</math> values can be approximated by a random walk in which the walker can only move in step sizes +2 or -1 with equal probability, starting at position 0. If <math>P(n)</math> is the probability that the walker will reach position -1 from position <math>n</math>, then it can be seen that <math display="inline">P(n)=\frac{1}{2}P(n-1)+\frac{1}{2}P(n+2)</math>. Solutions to this recurrence relation come in the form <math display="inline"> P(n)=c_0{\left(\frac{\sqrt{5}-1}{2}\right)}^n+c_1+c_2{\left(-\frac{1+\sqrt{5}}{2}\right)}^n</math>, which after applying the appropriate boundary conditions reduces to <math display="inline">P(n)={\left(\frac{\sqrt{5}-1}{2}\right)}^{n+1}</math>. This means that if walker were to get to position 1073720884 then the probability of it ever reaching position -1 is <math display="inline">{\left(\frac{\sqrt{5}-1}{2}\right)}^{1073720885}\approx 4.841\times 10^{-224394395}</math>. This combined with the fact that the expected position of the walker after <math>k</math> steps is <math display="inline">\frac{1}{2}k</math> strongly suggests Antihydra will not halt.
 
==Sources==
<references />
 


''To view an animation of the blank tape becoming <math>A(6,23)</math> in 419 steps, click [https://wiki.bbchallenge.org/w/images/3/36/AHydra_0-419.gif here].''
==References==
[[Category:Individual machines]]
[[Category:Individual machines]]
[[Category:Cryptids]]
[[Category:Cryptids]]

Revision as of 22:35, 3 March 2025

Unsolved problem:
Does Antihydra run forever?

1RB1RA_0LC1LE_1LD1LC_1LA0LB_1LF1RE_---0RA (bbch)

Artistic depiction of Antihydra by Jadeix

Antihydra is the first BB(6) Cryptid to be identified. It operates by repeatedly applying the function , starting with . Determining whether this Turing machine halts requires solving a Collatz-like mathematical problem. Specifically, one must establish a significant result regarding the frequency of odd versus even numbers generated throughout the sequence. While probabilistic arguments based on random walks suggest Antihydra probviously runs indefinitely, proving this remains challenging. The difficulty stems from both the lack of an exploitable pattern in the sequence’s parities and the inherent complexity of Collatz-like problems.

Description

The transition table of Antihydra.

Antihydra basically repeatedly modifies the integer ordered pair starting at , which is represented on the tape as consecutive s and consecutive s, separated by a single . It does this by "borrowing" a from the right side and, through a series of back-and-forth head movements, "moves" this toward the one separating and , two units at a time. As this happens, the head visits new cells on the right, which has the effect of there being about times as many s on the tape when the distance has been closed. After that, and are updated. If the previous value of was even, then becomes . Otherwise, becomes or Antihydra halts if was 0.

To resolve the halting problem for Antihydra, one must determine if, given the function , the sequence of iterates could ever produce a cumulative quantity of odd numbers that is more than twice that of the even numbers.

Attributions

Antihydra and its pseudo-random behaviour were reported on Discord by mxdys on 28 June 2024, and Racheline discovered the high-level rules soon after, where it was found to be closely related to Hydra.

Analysis

Let . Then,[1]

Proof

Consider the partial configuration . The configuration after two steps is . We note the following shift rule:

As a result, we get after steps. Advancing two steps produces . A second shift rule is useful here:
This allows us to reach in steps. Moving five more steps gets us to , which is the same configuration as . Accounting for the head movement creates the condition that . In summary:
With we have . As a result, we can apply this rule times (assuming ), which creates two possible scenarios:

  1. If , then in steps we arrive at . The matching complete configuration is . After steps this becomes , which then leads to in steps. After five more steps, we reach , from which another shift rule must be applied:
    Doing so allows us to get the configuration in steps. In six steps we have , so we use the shift rule again, ending at , equal to , steps later. This gives a total of steps.
  2. If , then in steps we arrive at . The matching complete configuration is . After steps this becomes . If then we have reached the undefined F0 transition with a total of steps. Otherwise, continuing for six steps gives us . We conclude with the configuration , equal to , in steps. This gives a total of steps.

The information above can be summarized as

Substituting for the first case and for the other two yields the final result.

Trajectory

11 steps are required to enter the configuration before the rules are repeatedly applied. So far, Antihydra has been simulated to rule steps, at which point . Here are the first few:

A heuristic nonhalting argument

A binary representation of the first 1000 steps of the evolution of the exponentially increasing variable of the Antihydra iteration (a = a + a//2). The colored background indicates whether the value is even or odd with blue and red, respectively.

The trajectory of values can be approximated by a random walk in which the walker can only move in step sizes +2 or -1 with equal probability, starting at position 0. If is the probability that the walker will reach position -1 from position , then it can be seen that . Solutions to this recurrence relation come in the form , which after applying the appropriate boundary conditions reduces to . This means that if walker were to get to position 1073720884 then the probability of it ever reaching position -1 is . This combined with the fact that the expected position of the walker after steps is strongly suggests Antihydra will not halt.

To view an animation of the blank tape becoming in 419 steps, click here.

References

  1. S. Ligocki, "BB(6) is Hard (Antihydra)" (2024). Accessed 22 July 2024.