Antihydra: Difference between revisions

From BusyBeaverWiki
Jump to navigation Jump to search
MrSolis (talk | contribs)
swapped the order of the Code and Trajectory sections and improved the tone of the Code section
Coda (talk | contribs)
Add community trophy photograph
Line 10: Line 10:
a_0=0,&a_{k+1} =  \begin{cases}a_k + 2 & \text{if } b_k\equiv0\pmod{2}\\a_k - 1 & \text{if }b_k\equiv1\pmod{2} \\\end{cases},&b_0=8,&b_{k+1}=H(b_k).\end{array}</math>
a_0=0,&a_{k+1} =  \begin{cases}a_k + 2 & \text{if } b_k\equiv0\pmod{2}\\a_k - 1 & \text{if }b_k\equiv1\pmod{2} \\\end{cases},&b_0=8,&b_{k+1}=H(b_k).\end{array}</math>
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>
== Analysis ==
== Analysis ==

Revision as of 17:57, 3 April 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 H(n)=32n, starting with n=8. Determining whether this Turing machine halts requires solving the Collatz-like mathematical problem of whether there eventually exists a step at which H(n) 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.

Description

The transition table of Antihydra.

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

Let H(n)=32n, and ak and bk be integer sequences defined below: a0=0,ak+1={ak+2if bk0(mod2)ak1if bk1(mod2),b0=8,bk+1=H(bk). Antihydra halts if and only if there exists any number i for which ai<0.

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]

Analysis

Let A(a,b):=01a01bE>0. Then,[2] A(a,2b)2a+3b2+12b+11A(a+2,3b+2),A(0,2b+1)3b2+9b10<F11013b0,A(a+1,2b+1)3b2+12b+5A(a,3b+3).

Proof

Consider the partial configuration P(m,n):=01mE>01n0. The configuration after two steps is 01m10A>1n+10. We note the following shift rule: A>1ss1sA> As a result, we get 01m101n+1A>0 after n+1 steps. Advancing two steps produces 01m101n+2<C0. A second shift rule is useful here: 1s<Cs<C1s This allows us to reach 01m10<C1n+20 in n+2 steps. Moving five more steps gets us to 01m2E>01n+30, which is the same configuration as P(m2,n+3). Accounting for the head movement creates the condition that m4. In summary: P(m,n)2n+12P(m2,n+3) if m4. With A(a,b) we have P(b,0). As a result, we can apply this rule 12b1 times (assuming b4), which creates two possible scenarios:

  1. If b0 (mod2), then in i=0(b/2)2(2×3i+12)=34b2+32b6 steps we arrive at P(2,32b3). The matching complete configuration is 01a011E>01(3b)/230. After 3b+4 steps this is 01a<C001(3b)/20, which then leads to 0<C1a001(3b)/20 in a steps. After five more steps, we reach 01E>1a+2001(3b)/20, from which another shift rule must be applied:E>1ss1sE>Doing so allows us to get the configuration 01a+3E>001(3b)/20 in a+2 steps. In six steps we have 01a+2011E>1(3b)/20, so we use the shift rule again, ending at 01a+201(3b)/2+2E>0, equal to A(a+2,32b+2), 32b steps later. This gives a total of 2a+34b2+6b+11 steps.
  2. If b1 (mod2), then in 34b2274 steps we arrive at P(3,3b92). The matching complete configuration is 01a0111E>01(3b9)/20. After 3b+2 steps this becomes 01a<F1101(3b3)/20. If a=0 then we have reached the undefined F0 transition with a total of 34b2+3b194 steps. Otherwise, continuing for six steps gives us 01a10111E>1(3b3)/20. We conclude with the configuration 01a101(3b+3)/2E>0, equal to A(a1,3b+32), in 3b32 steps. This gives a total of 34b2+92b14 steps.

The information above can be summarized as A(a,b){A(a+2,32b+2)if b2,b0(mod2);0<F1101(3b3)/20if b3,b1(mod2), and a=0;A(a1,3b+32)if b3,b1(mod2), and a>0. Substituting b2b for the first case and b2b+1 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 encountered
a = 0
# The iterated value
b = 8
# If a < 0 there have been (strictly) more than twice as many odd as even numbers and the program halts
while a != -1:
    # If b is even, add 2 to a so even numbers count twice
    if b % 2 == 0:
        a += 2
    else:
        a -= 1
    # Add the number divided by two (integer division, rounding down) to itself
    b += 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,8
while a!=-1:
    a+=2-b%2*3
    b+=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,8
while a:a+=2-b%2*3;b+=b>>1

Trajectory

11 steps are required to enter the configuration A(0,4) before the rules are repeatedly applied. So far, Antihydra has been simulated to 231 rule steps, at which point b=1073720884. Here are the first few: A(0,4)47A(2,8)111A(4,14)250A(6,23)500A(5,36)1209A(7,56)2713A(9,86)

A heuristic nonhalting argument

A binary representation of the first 1000 b 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 b 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 P(n) is the probability that the walker will reach position -1 from position n, then it can be seen that P(n)=12P(n1)+12P(n+2). Solutions to this recurrence relation come in the form P(n)=c0(512)n+c1+c2(1+52)n, which after applying the appropriate boundary conditions reduces to P(n)=(512)n+1. This means that if the walker were to get to position 1073720884 then the probability of it ever reaching position -1 is (512)10737208854.841×10224394395. This combined with the fact that the expected position of the walker after k steps is 12k strongly suggests Antihydra probviously runs indefinitely.

To view an animation of the blank tape becoming A(6,23) in 419 steps, click here.

References