# Sierpinski Carpet

Sierpinski Carpet – Noon Silk

To build the Sierpinski carpet you take a square, cut it into 9 equal-sized smaller squares, and remove the central smaller square. Then you apply the same procedure to the remaining 8 subsquares, and repeat this ad infinitum. This image by Noon Silk shows the first six stages of the procedure.

The Sierpinski carpet is the set of points in the unit square whose coordinates written in base three do not both have a digit ‘1’ in the same position. It is thus a 2-dimensional analogue of the Cantor set.

The Lebesgue covering dimension of a topological space $X$ is the least natural number $n$ such that every finite open cover of $X$ admits a refinement to a finite open cover in which no point of $X$ is included in more than $n+1$ sets. For example, a smooth curve embedded in $\mathbb{R}^n$ has Lebesgue covering dimension 1. More generally, any compact metric space with Lebesgue dimension 1 is called a curve.

The Sierpinski carpet is a plane curve: that is, a curve homeomorphic to a subspace of the plane. In fact, in 1916 Sierpinski showed that his carpet is a universal plane curve: any plane curve is homeomorphic to a subspaces of the Sierpinksi carpet!

The Menger sponge is also a curve, but not a plane curve:

Menger showed in 1926 that his sponge is a universal curve: any curve is homeomorphic to a subspace of the Menger sponge. For example, the Sierpinski carpet is clearly a subspace of the Menger sponge, since every face of that sponge is a Sierpinski carpet.

The ‘universality properties’ of the Sierpinski carpet and Menger sponge are not universal properties in the sense of category theory: they do not uniquely characterize these spaces up to homeomorphism. For example, the disjoint union of a Sierpinski carpet and a circle is also a universal plane curve.

However, in 1958 Gordon Whyburn uniquely characterized the Sierpinski carpet as follows: any plane curve that is locally connected and has no ‘local cut points’ is homeomorphic to the Sierpinski carpet. Here a local cut point is a point $p$ for which some connected neighborhood $U$ of $p$ has the property that $U – \{p\}$ is not connected. So, for example, any point of the circle is a local cut point.

Whyburn also gave another nice characterization of the Sierpinski carpet. A continuum is a nonempty connected compact metric space. Suppose $X$ is a continuum embedded in the plane. Suppose the complement $\mathbb{R}^2 – X$ has countably many connected components $C_1, C_2, C_3, \dots$, and suppose:

• the diameter of $C_i$ goes to zero as $i \to \infty$;

• the boundary of $C_i$ and the boundary of $C_j$ are disjoint if $i \ne j$;

• the boundary of $C_i$ is a simple closed curve for each $i$;

• the union of the boundaries of $C_i$ is dense in $X$.

Then $X$ is homeomorphic to the Sierpinski carpet!

For more properties of Sierpinski carpet see:

• Janusz J. Charatonik, Pawel Krupski and Pavel Pyrih, Sierpinski carpet.

I had a little contest to create this image, and besides Noon Silk, also Nathan Reed, Chris Greene, Geoffrey Irving created images; Noon Silk merely got the job done a few minutes earlier. Silk used Mathematica code roughly like this:

carpet[n_] :=
Nest[ArrayFlatten[{{#, #, #} , {#, 0, #} , {#, #, #}}] & 1, n];
data = Table[
ArrayPlot[carpet[k],
ColorRules -> {0 -> White, 1 -> RGBColor[66/255, 0, 130/255]}
], {k, 1, 6, 1}
];
Export["anim.gif", data, "DisplayDurations" -> 1,
ImageSize -> {750, 750}];


Greene used Javascript, and Irving used Python, creating a version that goes to the 10th stage. Nathan Reed used Python to create a ‘negative’ version where the holes are purple.

Visual Insight is a place to share striking images that help explain advanced topics in mathematics. I’m always looking for truly beautiful images, so if you know about one, please drop a comment here and let me know!

## 2 thoughts on “Sierpinski Carpet”

1. SqRoot says:

You lost a comma in the Mathematica code.
It should be:
carpet[n_] :=
Nest[ArrayFlatten[{{#, #, #}, {#, 0, #}, {#, #, #}}] &, 1, n];