🧮 Brain Teaser

The Cantor Function Is Uniformly Continuous but Carries No Mass Where It Grows

Let f:[0,1][0,1]f: [0,1] \to [0,1] be the Cantor–Lebesgue function (the "devil's staircase"): ff is continuous, non-decreasing, f(0)=0f(0)=0, f(1)=1f(1)=1, and ff is constant on each interval removed in the construction of the Cantor set CC.

Question: Compute 01f(x)dx\displaystyle\int_0^1 f(x)\, dx.

(Hint: No explicit formula for ff is needed.)

Cantor functiondevil's staircasesymmetry argumentLebesgue integrationself-similarity

Answer: Integral of the Cantor Function via Symmetry

Key Idea / Intuition

The Cantor function has a beautiful self-similar symmetry: the graph of ff on [0,1][0,1] is symmetric about the point (12,12)(\tfrac{1}{2}, \tfrac{1}{2}). More precisely, f(x)+f(1x)=1f(x) + f(1-x) = 1 for all x[0,1]x \in [0,1]. This single symmetry immediately pins down the integral without any calculation involving the Cantor set's fractal structure.


Formal Proof / Solution

Step 1: Establish the symmetry f(x)+f(1x)=1f(x) + f(1-x) = 1.

The Cantor set and the Cantor function are built symmetrically: at each stage of the construction, the removed middle-third intervals are placed symmetrically about 12\tfrac{1}{2}, and the function values are assigned symmetrically (the left half gets values in [0,12][0,\tfrac{1}{2}], the right half in [12,1][\tfrac{1}{2},1], mirrored). A formal induction shows that for all xx, f(x)+f(1x)=1.f(x) + f(1-x) = 1.

Step 2: Use the symmetry to evaluate the integral.

Let I=01f(x)dxI = \displaystyle\int_0^1 f(x)\, dx. Substitute x1xx \mapsto 1-x: I=01f(1x)dx.I = \int_0^1 f(1-x)\, dx.

Add the two expressions: 2I=01[f(x)+f(1x)]dx=011dx=1.2I = \int_0^1 \bigl[f(x) + f(1-x)\bigr]\, dx = \int_0^1 1\, dx = 1.

Therefore, I=12.\boxed{I = \dfrac{1}{2}.}

Why this is surprising.

The function ff is constant on the complement of the Cantor set, which has measure 11. So ff is "flat" almost everywhere — it does all its rising on a set of measure zero. Yet the integral comes out exactly 12\tfrac{1}{2}, just as it would for the identity function g(x)=xg(x)=x! The symmetry argument bypasses the fractal complexity entirely and gives the answer in two lines.

Remark on integration theory.

One can also see this via integration by parts (Lebesgue–Stieltjes): 01fdx=[xf(x)]0101xdf(x)=101xdf(x).\int_0^1 f\, dx = \bigl[x f(x)\bigr]_0^1 - \int_0^1 x\, df(x) = 1 - \int_0^1 x\, df(x). By the same symmetry argument applied to 01xdf(x)\int_0^1 x\, df(x) (substituting x1xx\mapsto 1-x and using df(1x)=df(x)df(1-x) = df(x) by symmetry), one again gets 01xdf(x)=12\int_0^1 x\,df(x) = \tfrac{1}{2}, confirming I=12I = \tfrac{1}{2}.

Type: analysisEdit on GitHub ↗