User Rating 0.0 ā˜…ā˜…ā˜…ā˜…ā˜…
Total Usage 0 times
Is this tool helpful?

Your feedback helps us improve.

ā˜… ā˜… ā˜… ā˜… ā˜…

About

The Cantor set is constructed by iteratively deleting the open middle third of every remaining line segment, starting from the unit interval [0, 1]. After n iterations the set's indicator string has length 3n, where 1 marks retained segments and 0 marks removed gaps. The resulting object is a nowhere-dense, uncountable set of Lebesgue measure zero. Miscounting iterations or misunderstanding the recursion leads to incorrect fractal dimension estimates; the Hausdorff dimension is exactly log 2log 30.6309. This tool generates the precise binary indicator string and renders each stage so you can inspect the fractal structure directly.

The generator caps at n = 10 iterations (59,049 characters). This limit is practical, not theoretical. The substitution rule is exact: every 1 → 101, every 0 → 000. No approximation is involved.

cantor set fractal ternary string math generator recursive set middle third fractal visualization

Formulas

The Cantor string is built by a substitution system applied to an initial axiom. The axiom is the single character 1. At each iteration, two production rules fire simultaneously across the entire string:

1 → 101
0 → 000

After n iterations the string length is 3n and the count of 1s is 2n. The remaining measure (fraction of 1s) at iteration n is:

M(n) = 2n3n = (23)n

As n → āˆž, M → 0. The Hausdorff dimension of the limiting Cantor set is:

dH = log 2log 3 0.6309

Where dH is the Hausdorff dimension, 2 is the number of self-similar pieces per iteration, and 3 is the scaling factor (each piece is 13 the size of its parent).

Reference Data

Iteration nString Length 3nFilled Segments (2n)Removed GapsMeasure RemainingString Preview
011011
132123101
294549101000101
327819827101000101000000000101000101
48116651681(81 chars)
52433221132243(243 chars)
67296466564729(729 chars)
72,1871282,0591282187(2,187 chars)
86,5612566,3052566561(6,561 chars)
919,68351219,17151219683(19,683 chars)
1059,0491,02458,025102459049(59,049 chars)

Frequently Asked Questions

At iteration n the total length of retained segments is (2/3)^n, which tends to 0. So the Lebesgue measure is zero. However, the set's points correspond bijectively to all base-3 expansions using only digits 0 and 2 - this set has the cardinality of the continuum, hence is uncountable. Measure and cardinality are independent concepts.
Each position in the string at iteration n corresponds to a sub-interval of width 3^(āˆ’n). A "1" at position k means the interval's base-3 address contains only digits 0 and 2 (no 1s). A "0" means at least one digit is 1, so the interval was removed. The substitution 1→101 encodes that the left and right thirds stay while the middle third is deleted.
The Hausdorff dimension measures fractal complexity. The Cantor set breaks into 2 self-similar copies, each scaled by factor 1/3. By the similarity dimension formula d = log(N)/log(1/r), we get d = log(2)/log(3) ā‰ˆ 0.6309. This is strictly between 0 (a finite point set) and 1 (a line segment), confirming its fractal nature.
Technically yes, but the string at n = 11 has 177,147 characters and at n = 12 has 531,441. The tool caps at 10 (59,049 characters) to keep the browser responsive. The Canvas visualization also becomes visually indistinguishable past n = 8. For mathematical analysis beyond n = 10, work with the recursive definition rather than explicit strings.
The string is simply "1" - the entire unit interval is filled with no removals. This is the base case. The first removal happens at iteration 1, producing "101". Every subsequent iteration triples the string length and removes the middle third of each surviving segment.
No. The Cantor string is not periodic for any n > 0. It is self-similar: the string at iteration n contains two copies of the string at iteration nāˆ’1 separated by a block of 3^(nāˆ’1) zeros. This recursive, non-repeating structure is characteristic of fractal objects and L-system outputs.