Skip to content
Part IA Lent Term

The Inverse Ackermann Bound

The Ackermann Function

The Ackermann function Ak(j)A_k(j) is defined recursively:

A0(j)=j+1A_0(j) = j + 1

Ak(j)=Ak1(j+1)(j)for k1A_k(j) = A_{k-1}^{(j+1)}(j) \quad \text{for } k \ge 1

where f(m)(x)f^{(m)}(x) denotes the mm-fold iterated application of ff. That is:

f(0)(x)=x,f(m+1)(x)=f(f(m)(x))f^{(0)}(x) = x, \quad f^{(m+1)}(x) = f(f^{(m)}(x))

Concrete Values

kkAk(1)A_k(1)Growth
0A0(1)=2A_0(1) = 2Linear
1A1(1)=A0(2)(1)=A0(A0(1))=A0(2)=3A_1(1) = A_0^{(2)}(1) = A_0(A_0(1)) = A_0(2) = 3Small
2A2(1)=A1(2)(1)=A1(A1(1))=A1(3)A_2(1) = A_1^{(2)}(1) = A_1(A_1(1)) = A_1(3)Growing
A1(3)=A0(4)(3)=3+4=7A_1(3) = A_0^{(4)}(3) = 3+4 = 7, so A2(1)=7A_2(1) = 7
3A3(1)=A2(2)(1)=A2(A2(1))=A2(7)A_3(1) = A_2^{(2)}(1) = A_2(A_2(1)) = A_2(7)Exploding
A2(7)=27+33=1021A_2(7) = 2^{7+3} - 3 = 1021, so A3(1)=2047A_3(1) = 2047
4A4(1)22265536A_4(1) \approx 2^{2^{2^{65536}}}Astronomically large

The function grows incomprehensibly fast. A4(1)A_4(1) is already far larger than the number of atoms in the observable universe.

The Inverse Ackermann Function

The inverse Ackermann function α(n)\alpha(n) is defined as:

α(n)=min{kAk(1)n}\alpha(n) = \min \{ k \mid A_k(1) \ge n \}

In words: the smallest kk such that the Ackermann function with parameter kk and argument 1 reaches or exceeds nn.

Values of α(n)\alpha(n)

nnα(n)\alpha(n)
0,1,20, 1, 200
3311
474 \ldots 722
820478 \ldots 204733
2048A4(1)12048 \ldots A_4(1)-144

For any nn that could ever arise in practice (even n=1080n = 10^{80}, the estimated number of atoms in the universe), α(n)4\alpha(n) \le 4. The function grows so slowly that it is effectively constant.

The Union-Find Complexity Result

Theorem (Tarjan, 1975): A sequence of mm MakeSet, Union, and Find operations, of which nn are MakeSet, on a disjoint-set forest with union by rank and path compression takes O(mα(n))O(m \cdot \alpha(n)) time in the worst case.

Since α(n)4\alpha(n) \le 4 for all practical nn, this is effectively O(m)O(m) — linear time.

Proof Sketch (Beyond Exam Scope)

The full proof partitions ranks into blocks based on how many times log\log^* must be applied to bring the rank below a threshold. Each node is assigned a “level” in this hierarchy. Path compression is charged to nodes moving between levels, and the potential function captures that each node can only move a bounded number of levels (at most α(n)\alpha(n) times). The full argument appears in CLRS Chapter 21.

What You Need to Know for the Exam

  1. The result: mm operations on nn elements take O(mα(n))O(m \cdot \alpha(n)) time with union by rank and path compression.
  2. The definition: α(n)=min{k:Ak(1)n}\alpha(n) = \min\{k : A_k(1) \ge n\}.
  3. The practical bound: α(n)4\alpha(n) \le 4 for any nn less than A4(1)A_4(1), which covers all realistic input sizes.
  4. The two heuristic names: Union by rank and path compression.
  5. How Kruskal uses it: Sorting dominates; the union-find operations contribute O(Eα(V))O(E \cdot \alpha(V)), so overall O(ElogV)O(E \log V).

You are NOT expected to reproduce the full Tarjan proof. You should be able to state the result, define α(n)\alpha(n), compute small values, and explain why the bound is effectively constant.

Worked Example: α(n)\alpha(n) Computation

Compute α(100)\alpha(100):

  • A0(1)=2A_0(1) = 2, not 100\ge 100
  • A1(1)=3A_1(1) = 3, not 100\ge 100
  • A2(1)=7A_2(1) = 7, not 100\ge 100
  • A3(1)=2047100A_3(1) = 2047 \ge 100

Smallest kk is 3, so α(100)=3\alpha(100) = 3.

Compute α(106)\alpha(10^6):

  • A3(1)=2047A_3(1) = 2047, not 106\ge 10^6
  • A4(1)A_4(1) is enormous, 106\ge 10^6

So α(106)=4\alpha(10^6) = 4.

Summary

ConceptDetail
Ackermann functionA0(j)=j+1A_0(j) = j+1, Ak(j)=Ak1(j+1)(j)A_k(j) = A_{k-1}^{(j+1)}(j)
Inverse Ackermannα(n)=min{k:Ak(1)n}\alpha(n) = \min\{k : A_k(1) \ge n\}
α(n)\alpha(n) valuesn20n \le 2 \Rightarrow 0, n=31n=3 \Rightarrow 1, n=4..72n=4..7 \Rightarrow 2, n=8..20473n=8..2047 \Rightarrow 3, n20484n \ge 2048 \Rightarrow 4
Union-find boundO(mα(n))O(m \cdot \alpha(n)) with both heuristics
Practical constantα(n)4\alpha(n) \le 4 for all realistic nn
Exam scopeResult + definition + small values; not full proof
Past questionsEx. sheet 6 q.13; Tripos questions on Kruskal analysis