Hydra function: Difference between revisions

From BusyBeaverWiki
Jump to navigation Jump to search
MrSolis (talk | contribs)
No edit summary
Tag: Manual revert
MrSolis (talk | contribs)
Expanded the article with new information; added an image based on the idea suggested in the talk page
Line 1: Line 1:
The '''Hydra function''' is a [[Collatz-like]] function whose behavior is connected to the the unsolved halting problems for the [[Cryptids]] [[Hydra]] and [[Antihydra]]:
[[File:Hydra-function-bitmap-255iterations.svg|thumb|A bitmap depiction of 255 iterations of the Hydra function, starting with 3 at the top.]]
 
The '''Hydra function''' is a [[Collatz-like]] function whose behavior is connected to the unsolved halting problems for the [[Cryptids]] [[Hydra]] and [[Antihydra]]. It is defined as:
<math display="block">\textstyle H(n)\equiv n+\left\lfloor\frac{1}{2}n\right\rfloor=\Big\lfloor\frac{3}{2}n\Big\rfloor=\begin{cases}
  \frac{3n}{2}    & \text{if } n\equiv0\pmod{2} \\
  \frac{3n-1}{2}  & \text{if } n\equiv1\pmod{2} \\
\end{cases}</math>
which can alternatively be written as
<math display="block">\begin{array}{l}
<math display="block">\begin{array}{l}
   H(2n)  & = & 3n  \\
   H(2n)  & = & 3n  \\
   H(2n+1) & = & 3n+1 \\
   H(2n+1) & = & 3n+1 \\
\end{array}</math>
\end{array}</math>
It has some connections to [[wikipedia:Mahler's_3/2_problem|Mahler's 3/2 problem]].
==Properties==
Here, <math>s</math> and <math>t</math> are positive integers with <math>t</math> odd. Let <math>0\le k\le s</math> be an integer and <math>H^k</math> is the <math>k</math>th iterate of <math>H</math>.
<math display="block">\begin{array}{l}
  H^k(2^s t)  & = & 3^k2^{s-k}t  \\
  H^k(2^s t+1)  & = & 3^k2^{s-k}t+1 \\
\end{array}</math>
==Relationship to Hydra and Antihydra==
Both machines effectively track the progress of two variables; one of them changes depending on its value modulo 2 but roughly multiplies itself by <math>\frac{3}{2}</math>, and the other increases by 2 or decreases by 1 depending on the parity of the first variable.
In particular, Hydra halts if and only if the sequence
<math display="block">a(n+1)=\begin{cases}\frac{3\times a(n)+6}{2}&\text{if }a(n)\equiv0\pmod{2}\\\frac{3\times a(n)+3}{2}&\text{if }a(n)\equiv1\pmod{2}\end{cases}</math>
ever has more even terms than twice the number of odd terms, starting with <math>a(0)=3</math>. Similarly, Antihydra halts if and only if the sequence
<math display="block">a(n+1)=\begin{cases}\frac{3\times a(n)+4}{2}&\text{if }a(n)\equiv0\pmod{2}\\\frac{3\times a(n)+3}{2}&\text{if }a(n)\equiv1\pmod{2}\end{cases}</math>
ever has more odd terms than twice the number of even terms, starting with <math>a(0)=4</math>.


which can alternatively be written as<math display="block">H(n) = \begin{cases}
For Hydra, we can introduce the sequence <math>b(n)=\frac{1}{3}a(n)+2</math> whose terms have the same sequence of parities as <math>a(n)</math>. Then we have:
  \frac{3n}{2}     & \text{if } n \text{ even} \\
<math display="block">\begin{array}{l}
  \frac{3n-1}{2} & \text{if } n \text{ odd} \\
  b(n+1)& = & \frac{1}{3}a(n+1)+2 \\
\end{cases}</math>or simply<math display="block">H(n) = \left\lfloor \frac{3n}{2} \right\rfloor</math>It has some connections to [[wikipedia:Mahler's_3/2_problem|Mahler's 3/2 problem]].
  b(n+1)& = &2+\frac{1}{3}\begin{cases}\frac{3\times a(n)+6}{2}&\text{if }a(n)\equiv0\pmod{2}\\\frac{3\times a(n)+3}{2}&\text{if }a(n)\equiv1\pmod{2}\end{cases}\\
b(n+1)&=&\begin{cases}\frac{a(n)+6}{2}&\text{if }a(n)\equiv0\pmod{2}\\\frac{a(n)+5}{2}&\text{if }a(n)\equiv1\pmod{2}\end{cases}\\
b(n+1)&=&\begin{cases}\frac{3(b(n)-2)+6}{2}&\text{if }3(b(n)-2)\equiv0\pmod{2}\\\frac{3(b(n)-2)+5}{2}&\text{if }3(b(n)-2)\equiv1\pmod{2}\end{cases}\\
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}\\
\end{array}</math>
For Antihydra, we can repeat this but with the sequence <math>b(n)=a(n)+4</math>.

Revision as of 11:38, 23 February 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 whose behavior is connected to the unsolved halting problems for the Cryptids Hydra and Antihydra. It is defined as: H(n)n+12n=32n={3n2if n0(mod2)3n12if n1(mod2) which can alternatively be written as H(2n)=3nH(2n+1)=3n+1 It has some connections to Mahler's 3/2 problem.

Properties

Here, s and t are positive integers with t odd. Let 0ks be an integer and Hk is the kth iterate of H. Hk(2st)=3k2sktHk(2st+1)=3k2skt+1

Relationship to Hydra and Antihydra

Both machines effectively track the progress of two variables; one of them changes depending on its value modulo 2 but roughly multiplies itself by 32, and the other increases by 2 or decreases by 1 depending on the parity of the first variable.

In particular, Hydra halts if and only if the sequence a(n+1)={3×a(n)+62if a(n)0(mod2)3×a(n)+32if a(n)1(mod2) ever has more even terms than twice the number of odd terms, starting with a(0)=3. Similarly, Antihydra halts if and only if the sequence a(n+1)={3×a(n)+42if a(n)0(mod2)3×a(n)+32if a(n)1(mod2) ever has more odd terms than twice the number of even terms, starting with a(0)=4.

For Hydra, we can introduce the sequence b(n)=13a(n)+2 whose terms have the same sequence of parities as a(n). Then we have: b(n+1)=13a(n+1)+2b(n+1)=2+13{3×a(n)+62if a(n)0(mod2)3×a(n)+32if a(n)1(mod2)b(n+1)={a(n)+62if a(n)0(mod2)a(n)+52if a(n)1(mod2)b(n+1)={3(b(n)2)+62if 3(b(n)2)0(mod2)3(b(n)2)+52if 3(b(n)2)1(mod2)b(n+1)={3b(n)2if b(n)0(mod2)3b(n)12if b(n)1(mod2) For Antihydra, we can repeat this but with the sequence b(n)=a(n)+4.