Antihydra halts if and only if there exists any number <math>i</math> for which <math>a_i<0</math>.
Antihydra halts if and only if there exists any number <math>i</math> for which <math>a_i<0</math>.
=== Attributions ===
=== Attributions ===
[[File:Antihydra award.jpg|thumb|Community trophy to be awarded to the first person or group who solves the Antihydra problem]]
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]]; in particular, the roles of even and odd numbers are switched. This is why the machine was named '''Anti'''hydra.<ref>[https://discord.com/channels/960643023006490684/960643023530762341/1257053002859286701 Discord conversation where the machine was named]</ref>
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]]; in particular, the roles of even and odd numbers are switched. This is why the machine was named '''Anti'''hydra.<ref>[https://discord.com/channels/960643023006490684/960643023530762341/1257053002859286701 Discord conversation where the machine was named]</ref>
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 the Collatz-like mathematical problem of whether there eventually exists a step at which has been applied to (strictly) more than twice as many odd as even numbers. Proving a result remains challenging due to the lack of an exploitable pattern in the sequence's parities, although probabilistic arguments based on random walks suggest Antihydra has a minuscule chance of halting.
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.
Let , and and be integer sequences defined below:
Antihydra halts if and only if there exists any number for which .
Attributions
Community trophy to be awarded to the first person or group who solves the Antihydra problem
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; in particular, the roles of even and odd numbers are switched. This is why the machine was named Antihydra.[1]
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:
If , then in steps we arrive at . The matching complete configuration is . After steps this is , 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.
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.
The page Hydra function shows how these rules can be simplified to use that function instead, along with Hydra.
Coding Antihydra's behaviour
Antihydra's relatively simple rules allow one to write a computer program that mimics its behaviour, terminating if and only if Antihydra halts.
Python code
The following Python program is a straightfoward Antihydra simulator using the Hydra function:
# Keeps track of how many odd and even numbers have been encountereda=0# The iterated valueb=8# If a < 0 there have been (strictly) more than twice as many odd as even numbers and the program haltswhilea!=-1:# If b is even, add 2 to a so even numbers count twiceifb%2==0:a+=2else:a-=1# Add the number divided by two (integer division, rounding down) to itselfb+=b//2
Alternative programs
This code can be codegolfed by noting that the change in a is a function of b % 2. Additionally, integer division by two can be replaced with a bitwise logical right shift by one.
a,b=0,8whilea!=-1:a+=2-b%2*3b+=b>>1
Another insight is that numerical value of 0 functions as the Boolean False and all others are True. The initial value of a would have to change for the program to terminate under the same halting conditions as Antihydra.
a,b=1,8whilea:a+=2-b%2*3;b+=b>>1
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 values, each of which is computed from the previous by the iteration b += b>>1. Rows with blue have even values and rows with red have odd values.
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 the 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 probviously runs indefinitely.
To view an animation of the blank tape becoming in 419 steps, click here.