Monday, August 31, 2026

Hydras

Adapted from here, which provides an elegant algebraic solution.

There is a room for every integer, and initially every room is empty except for room $0$, which contains a hydra. At any time either a hydra in room $i$ splits into two, one to room $i-1$ and one to $i+1$, or reversely a hydra in room $i-1$ and $i+1$, if they both exist, merge into one in room $i$.

Find all possible values of $(R, D)$ s.t. after finitely many steps we end up with $D$ hydras in room $R$ and nowhere else.












===================================================

$$\boxed{(R,D)=(6k,1),k\in\mathbb{Z}}$$

Clearly $D>0$. Let $$d_i:=\text{# merge operations centered at room }i-\text{# split opeartions centered at room }i.$$ We then have $$d_i-d_{i-1}-d_{i+1}=D\cdot\mathbb{1}(i=R)-\mathbb{1}(i=0).$$

Say the leftmost room that ever contained a hydra is room $L\le0$, then $d_L=0$. We can then write down every $d_i$. 

$R=0$:

$$(d_i)_{i\ge0}=(0,1-D,1-D,0,D-1,D-1,0,1-D,\dots)$$

$R=1$:

$$(d_i)_{i\ge0}=(0,1,1-D,-D,-1,D-1,D,1,1-D,\dots)$$

$R=2$:

$$(d_i)_{i\ge0}=(0,1,1,-D,-D-1,-1,D,D+1,1,-D,\dots)$$

$R=3$:

$$(d_i)_{i\ge0}=(0,1,1,0,-D-1,-D-1,0,D+1,D+1,0,-D-1,\dots)$$

$R=4$:

$$(d_i)_{i\ge0}=(0,1,1,0,-1,-D-1,-D,1,1+D,D,-1,-D-1,\dots)$$

$R=5$:

$$(d_i)_{i\ge0}=(0,1,1,0,-1,-1,-D,1-D,1,D,D-1,-1,-D,\dots)$$

$R=6$:

$$(d_i)_{i\ge0}=(0,1,1,0,-1,-1,0,1-D,1-D,0,D-1,D-1,0,1-D,\dots)$$

The sequence above is finite only for $D=1$ with $R\in\{0,6\}$. It is not hard to find the actual corresponding sequences.

No comments: