Antihydra
1RB1RA_0LC1LE_1LD1LC_1LA0LB_1LF1RE_---0RA
(bbch)
Antihydra is a BB(6) Cryptid. Its pseudo-random behaviour was first reported on Discord by mxdys on 28 June 2024, and Racheline discovered the high-level rules soon after. It was named after the 2-state, 5-symbol Turing machine called Hydra for sharing many similarities to it.[1]
Antihydra is known to not generate Sturmian words[2] (Corollary 4).
Analysis
Let . Then,[3]
Consider the partial configuration . The configuration after two steps is . We note the following shift rule: Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \begin{array}{|c|}\hline\textrm{A>}\;1^s\xrightarrow{s}1^s\;\textrm{A>}\\\hline\end{array}} As a result, we get Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 0\;1^{m-1}\;0\;1^{n+1}\;\textrm{A>}\;0^\infty} after steps. Advancing two steps produces . A second shift rule is useful here:
- 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
In effect, the halting problem for Antihydra is about whether repeatedly applying the function will at some point produce more odd values of than twice the number of even values.
These rules can be modified to use the function , or the Hydra function, which strengthens Antihydra's similarities to Hydra.
Trajectory
11 steps are required to enter the configuration before the rules are repeatedly applied. So far, Antihydra has been simulated to Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 2^{31}} rule steps, at which point Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle b=1073720884} . Here are the first few: Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \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}} The trajectory of Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle b} values resembles a random walk in which the walker can only move in step sizes +2 or -1 with equal probability, starting at position 0. If Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle P(n)} is the probability that the walker will reach position -1 from position Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle n} , then it can be seen that Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\textstyle P(n)=\frac{1}{2}P(n-1)+\frac{1}{2}P(n+2)} . Solutions to this recurrence relation come in the form Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\textstyle P(n)=c_0{\left(\frac{\sqrt{5}-1}{2}\right)}^n+c_1+c_2{\left(-\frac{1+\sqrt{5}}{2}\right)}^n} , which after applying the appropriate boundary conditions reduces to Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\textstyle P(n)={\left(\frac{\sqrt{5}-1}{2}\right)}^{n+1}} . This means that if the walker were to get to position 1073720884 then the probability of it ever reaching position -1 is Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\textstyle {\left(\frac{\sqrt{5}-1}{2}\right)}^{1073720885}\approx 4.841\times 10^{-224394395}} . This combined with the fact that the expected position of the walker after Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle k} steps is Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\textstyle \frac{1}{2}k} strongly suggests Antihydra probviously runs indefinitely.
Code
The following Python program implements the abstracted behavior of the Antihydra. Proving whether it halts or not would also solve the Antihydra problem:
# Current value of the iterated Hydra function starting with initial value 8
h = 8
# (Collatz-like) condition counter that keeps track of how many odd and even numbers have been encountered
c = 0
# If c equals -1 there have been (strictly) more than twice as many odd as even numbers and the program halts
while c != -1:
# If h is even, add 2 to c so even numbers count twice
if h % 2 == 0:
c += 2
else:
c -= 1
# Add the current hydra value divided by two (integer division, rounding down) to itself (Hydra function)
# Note that integer division by 2 is equivalent to one bit shift to the right (h >> 1)
h += h//2
References
- ↑ Discord conversation where the machine was named
- ↑ DUBICKAS A. ON INTEGER SEQUENCES GENERATED BY LINEAR MAPS. Glasgow Mathematical Journal. 2009;51(2):243-252. doi:10.1017/S0017089508004655
- ↑ S. Ligocki, "BB(6) is Hard (Antihydra)" (2024). Accessed 22 July 2024.