Tool
Cantor set playground
Pick how much of each interval to remove at every step. The standard Cantor set removes the middle third; varying the fraction gives a whole family of generalised Cantor sets with continuously varying Hausdorff dimension.
Construction rule
step 0: [0, 1]
step n: for each surviving interval [a, b]:
let len = b − a, removed = 0.333 · len (centered)
keep [a, a + (1 − r) · len / 2] and [b − (1 − r) · len / 2, b]
IFS form:
f_1(x) = 0.333 · x
f_2(x) = 0.333 · x + 0.667At r = 1/3 you recover the standard middle-thirds Cantor set.
At this setting
Intervals at depth 8: 28 = 256
Each interval length: 1.52e-4 of original
Total length: 3.90e-2
Hausdorff dimension
d = log 2 / log(2 / (1 − r)) = 0.6309
At r = 1/3 you recover Cantor’s log 2 / log 3 ≈ 0.6309.
Background reading at /fractals/cantor-set.
FAQ