Minkowski ?-Function

The devil's staircase: continuous, strictly increasing, yet derivative zero almost everywhere. Maps quadratic irrationals ↔ rationals by translating continued fractions into binary.

Explore a Value

Input x:
?(x):
CF [a₀; a₁, a₂, ...]:
Binary encoding:
Type:

How It Works

The ?-function encodes continued fractions as binary strings via run-length encoding. For x = [0; a₁, a₂, a₃, ...], write a₁ zeros, then a₂ ones, then a₃ zeros, alternating. Read the result as a binary fraction: that's ?(x).

?(x) = Σ (-1)^(k+1) · 2^(-(a₁+...+aₖ))

The Devil's Staircase

Why "Devil's Staircase"?

?(x) is strictly increasing and continuous, yet its derivative equals 0 at almost every point. The function gains all its height on a set of measure zero—a fractal dust of quadratic irrationals and their limits.

Quadratic Irrationals ↔ Rationals

The ?-function's deepest property: it maps quadratic irrationals (solutions to ax² + bx + c = 0) bijectively to rational numbers. This works because quadratic irrationals have periodic continued fractions, which become periodic binary expansions—i.e., rationals.

- 1
Quadratic:
CF (periodic):
?(quadratic):
Binary (periodic):

Self-Similarity & PSL(2,ℤ)

The ?-function exhibits fractal self-similarity generated by two operations:

S: Shrink to bottom-left

S(x, y) = (x/(1+x), y/2)

?(x/(1+x)) = ?(x)/2

R: Point reflection

R(x, y) = (1-x, 1-y)

?(1-x) = 1 - ?(x)

Combining S and R generates a monoid isomorphic to a subset of PSL(2,ℤ), the modular group. Each element corresponds to a rational via continued fractions, and describes a self-similarity of the devil's staircase.