Mathematical Game Simulator

Hydra Game Explorer

Cut heads from a mathematical Hydra and watch its branches change. Experiment with rooted trees, different head-selection strategies, and regrowth rules inspired by the mathematics of Hydra games.

Start simulation

What is the Hydra game?

The Hydra game is a mathematical game played on a finite rooted tree. The tree is imagined as a Hydra: its root is the body, its branches are necks, and its terminal vertices are heads.

Hercules repeatedly cuts off one head. In some versions, the Hydra responds by growing new branches. This means that cutting off one head can make the tree larger instead of smaller.

Cut a head → Apply the regrowth rule → Repeat

The exact regrowth rule determines the mathematical game.

Hydra game simulator

Configure an initial rooted tree and choose a simulation rule. The simulator will show the successive cuts and tree statistics.

Simulation limits: The simulator allows up to 5,000 nodes and 100 turns. These limits protect server resources.

Simulation results

Hydra defeated

The Hydra has been completely defeated.

Initial nodes 15
Final nodes 0
Turns recorded 51
Final leaves 0

Selected rules

Variant: Depth-descending regrowth

Head selection: Deepest head first

Initial structure: Height 3, branching factor 2.

Initial Hydra tree

Each node is identified by a number. The root is node 1. Indentation and connector lines show the parent-child structure.

● 1 ├─ ● 2 └─ ● 3 ├─ │ ├─ ● 4 ├─ │ └─ ● 5 └─ ├─ ● 6 └─ └─ ● 7 ├─ │ ├─ │ ├─ ● 8 ├─ │ ├─ │ └─ ● 9 ├─ │ └─ ├─ ● 10 ├─ │ └─ └─ ● 11 └─ ├─ │ ├─ ● 12 └─ ├─ │ └─ ● 13 └─ └─ ├─ ● 14 └─ └─ └─ ● 15

Turn-by-turn history

The table records which head was cut, its depth, how many new heads were created, and the resulting tree size.

Turn Head cut Depth Regrowth Nodes remaining Leaves remaining Maximum depth
0 — — Initial tree 15 8 3
1 Node 8 3 2 new leaf/leaves at depth 2 16 9 3
2 Node 9 3 2 new leaf/leaves at depth 2 17 11 3
3 Node 10 3 2 new leaf/leaves at depth 2 18 12 3
4 Node 11 3 2 new leaf/leaves at depth 2 19 14 3
5 Node 12 3 2 new leaf/leaves at depth 2 20 15 3
6 Node 13 3 2 new leaf/leaves at depth 2 21 17 3
7 Node 14 3 2 new leaf/leaves at depth 2 22 18 3
8 Node 15 3 2 new leaf/leaves at depth 2 23 20 2
9 Node 4 2 1 new leaf/leaves at depth 1 23 20 2
10 Node 5 2 1 new leaf/leaves at depth 1 23 20 2
11 Node 6 2 1 new leaf/leaves at depth 1 23 20 2
12 Node 7 2 1 new leaf/leaves at depth 1 23 20 2
13 Node 16 2 1 new leaf/leaves at depth 1 23 20 2
14 Node 17 2 1 new leaf/leaves at depth 1 23 20 2
15 Node 18 2 1 new leaf/leaves at depth 1 23 20 2
16 Node 19 2 1 new leaf/leaves at depth 1 23 20 2
17 Node 20 2 1 new leaf/leaves at depth 1 23 20 2
18 Node 21 2 1 new leaf/leaves at depth 1 23 20 2
19 Node 22 2 1 new leaf/leaves at depth 1 23 20 2
20 Node 23 2 1 new leaf/leaves at depth 1 23 21 2
21 Node 24 2 1 new leaf/leaves at depth 1 23 21 2
22 Node 25 2 1 new leaf/leaves at depth 1 23 21 2
23 Node 26 2 1 new leaf/leaves at depth 1 23 21 2
24 Node 27 2 1 new leaf/leaves at depth 1 23 21 2
25 Node 28 2 1 new leaf/leaves at depth 1 23 21 2
26 Node 29 2 1 new leaf/leaves at depth 1 23 21 2
27 Node 30 2 1 new leaf/leaves at depth 1 23 21 2
28 Node 31 2 1 new leaf/leaves at depth 1 23 22 1
29 Node 2 1 No regrowth 22 21 1
30 Node 3 1 No regrowth 21 20 1
31 Node 32 1 No regrowth 20 19 1
32 Node 33 1 No regrowth 19 18 1
33 Node 34 1 No regrowth 18 17 1
34 Node 35 1 No regrowth 17 16 1
35 Node 36 1 No regrowth 16 15 1
36 Node 37 1 No regrowth 15 14 1
37 Node 38 1 No regrowth 14 13 1
38 Node 39 1 No regrowth 13 12 1
39 Node 40 1 No regrowth 12 11 1
40 Node 41 1 No regrowth 11 10 1
41 Node 42 1 No regrowth 10 9 1
42 Node 43 1 No regrowth 9 8 1
43 Node 44 1 No regrowth 8 7 1
44 Node 45 1 No regrowth 7 6 1
45 Node 46 1 No regrowth 6 5 1
46 Node 47 1 No regrowth 5 4 1
47 Node 48 1 No regrowth 4 3 1
48 Node 49 1 No regrowth 3 2 1
49 Node 50 1 No regrowth 2 1 1
50 Node 51 1 No regrowth 1 1 0
51 Node 1 0 No regrowth 0 0 0

Latest tree structure

(empty tree)

Supported Hydra variants

1. Cut-only Hydra

In this simple version, Hercules removes one leaf at each turn. No new nodes are created. The tree therefore becomes smaller until it disappears.

Tree after move = Tree before move − one leaf

This is a basic tree-pruning exercise, not the famous regrowing Hydra game.

2. Depth-descending regrowth Hydra

This custom educational variant uses the depth of the cut head to determine regrowth.

  • Cut a leaf at depth d.
  • If d = 1, no regrowth occurs.
  • If d is at least 2, create d − 1 new leaves.
  • Attach the new leaves to the grandparent of the removed leaf.
  • The new leaves are one level closer to the root than the cut head.
New leaves = d − 1

The regrowth depth decreases as the game progresses through newly created heads.

What is the Kirby–Paris Hydra?

The Kirby–Paris Hydra is a famous mathematical game involving finite rooted trees. Its rules allow the Hydra to regrow after Hercules cuts off a head. The regrowth is defined using copies of parts of the tree, with the exact behavior depending on the head's position and the particular formal version of the game.

The remarkable result is that Hercules eventually wins: every finite initial Hydra is eventually defeated under the standard game rules. Some strategies can nevertheless require an extraordinarily large number of moves.

Important distinction: The simulator above does not implement the standard Kirby–Paris copying rule. Its depth-descending variant is deliberately simpler and should not be used to estimate the move count of a standard Hydra game.

Why are Hydra games connected to large numbers?

Certain formal Hydra games have extremely long termination times. Even relatively small starting trees can produce huge numbers of moves under their standard regrowth rules.

Their termination proofs are connected to ordinal notation and well-founded mathematical structures. This makes Hydra games an important example in proof theory and the study of fast-growing functions.

The key lesson is that a process can be guaranteed to terminate mathematically while still requiring far more steps than practical computation can simulate.

Frequently asked questions

What is the Hydra game?

The Hydra game is a mathematical game played on a finite rooted tree. A player repeatedly cuts off a head, represented by a leaf. Depending on the chosen Hydra rules, the remaining tree may grow new branches after a cut.

What is a Hydra in mathematics?

A mathematical Hydra is a rooted tree. The root represents the body, branches represent necks, and terminal vertices represent heads. The game changes the tree according to a specified cutting and regrowth rule.

Does every standard Kirby–Paris Hydra eventually die?

Yes. The Kirby–Paris Hydra theorem establishes that Hercules eventually defeats the Hydra under the standard rules, regardless of the initial finite Hydra and the allowed head-cutting choices.

Does this page implement the standard Kirby–Paris rules?

No. The page offers a cut-only variant and a custom depth-descending regrowth variant. The latter is designed for an accessible simulation and is not the standard Kirby–Paris rule.

What is a leaf in a rooted tree?

A leaf is a vertex with no children. In the Hydra game, a leaf represents a head that can be cut.

What does the depth of a head mean?

The depth is the number of edges between the root and the leaf. A head directly attached to the root has depth one.

Why can a Hydra grow after a head is cut?

Some Hydra rules specify that removing a head triggers regrowth elsewhere in the tree. This can create more heads even though Hercules has successfully cut one.

Can the Hydra game have more heads after a move?

Yes. In regrowth variants, a single cut can produce multiple new heads. The total number of nodes or leaves may increase temporarily.

Does a large number of moves mean the Hydra is infinite?

No. A finite Hydra can require an extremely large number of moves under certain rules. A long game does not mean the tree or the number of moves is infinite.

Why does the simulator stop at a limit?

The simulator uses maximum turn and node limits to protect server resources. Reaching a limit means the simulation stopped, not that the Hydra is mathematically impossible to defeat.

Explore more mathematical tools

Continue exploring recursive sequences, enormous functions, and mathematical systems with surprising growth.