Classic Iterated Function Systems

Larry Riddle, Agnes Scott College

Sierpinski Carpet

Description


Picture of Sierpinski
Wacław Sierpinski

 

Construction
Animation

Start with a solid (filled) square $C_0$. Divide this into 9 smaller congruent squares and remove the center square to get $C_1$ (since the edges of the surrounding squares remain, this is equivalent to removing the interior of the center square.) Now subdivide each of the eight remaining solid squares into 9 congruent squares and remove the center square from each to obtain $C_2$. Continue to repeat the construction to obtain a decreasing sequence of sets

$$ C_0 \supset C_1 \supset C_2 \supset C_3 \supset \cdots $$

The Sierpinski carpet is \(\displaystyle \bigcap_{n=0}^\infty C_n\), the intersection of all the sets in this sequence, that is, the set of points that remain after this construction is repeated infinitely often. The figures below show the first four iterations. The squares in red denote some of the smaller congruent squares used in the construction.

First four iterations of the carpet

Iterated
Function
System

 
 
 

Sierpinski
Converges
to his
Carpet

The original square is scaled by a factor $r=1/3$. This is done 8 times followed by the necessary translations to arrange the eight squares as depicted for $C_1$. If we take the original square to be a unit square with opposite corners at (0,0) and (1,1), then the IFS would be given by the following functions.

\[ \begin{align} f_1 ({\bf{x}}) &= \left[ {\begin{array}{*{20}c} {1/3} & 0 \\ 0 & {1/3} \\ \end{array}} \right]{\bf{x}} \\ f_2 ({\bf{x}}) &= \left[ {\begin{array}{*{20}c} {1/3} & 0 \\ 0 & {1/3} \\ \end{array}} \right]{\bf{x}} + \left[ {\begin{array}{*{20}c} 0 \\ {1/3} \\ \end{array}} \right] \\ f_3 ({\bf{x}}) &= \left[ {\begin{array}{*{20}c} {1/3} & 0 \\ 0 & {1/3} \\ \end{array}} \right]{\bf{x}} + \left[ {\begin{array}{*{20}c} 0 \\ {2/3} \\ \end{array}} \right] \\ f_4 ({\bf{x}}) &= \left[ {\begin{array}{*{20}c} {1/3} & 0 \\ 0 & {1/3} \\ \end{array}} \right]{\bf{x}} + \left[ {\begin{array}{*{20}c} {1/3} \\ 0 \\ \end{array}} \right] \\ f_5 ({\bf{x}}) &= \left[ {\begin{array}{*{20}c} {1/3} & 0 \\ 0 & {1/3} \\ \end{array}} \right]{\bf{x}} + \left[ {\begin{array}{*{20}c} {1/3} \\ {2/3} \\ \end{array}} \right] \\ f_6 ({\bf{x}}) &= \left[ {\begin{array}{*{20}c} {1/3} & 0 \\ 0 & {1/3} \\ \end{array}} \right]{\bf{x}} + \left[ {\begin{array}{*{20}c} {2/3} \\ {0} \\ \end{array}} \right] \\ f_7 ({\bf{x}}) &= \left[ {\begin{array}{*{20}c} {1/3} & 0 \\ 0 & {1/3} \\ \end{array}} \right]{\bf{x}} + \left[ {\begin{array}{*{20}c} {2/3} \\ {1/3} \\ \end{array}} \right] \\ f_8 ({\bf{x}}) &= \left[ {\begin{array}{*{20}c} {1/3} & 0 \\ 0 & {1/3} \\ \end{array}} \right]{\bf{x}} + \left[ {\begin{array}{*{20}c} {2/3} \\ {2/3} \\ \end{array}} \right] \\ \end{align} \]

The Sierpinski carpet consists of eight self-similar pieces corresponding to the eight functions in the iterated function system.

Carpet showing the 8 self-similar pieces in different colors
[Enlarge]

L-System


 

L-system
Animation

 
 

L-system
Animation
Angle 90
Axiom F
F —> F+F−F−F−G+F+F+F−F
G —> GGG

This will produce the Sierpinski carpet rotated by 45°. In addition, there will be lines through the square "holes" (see first animation). If you want to avoid those lines, you can modify the L-system to lift the pen by using

F —> F+F−F−F−UGD+F+F+F−F

where U means the pen goes up and D means the pen goes down. You can see the effect in the second animation.

L-system with lines through holes L-system without lines through holes


Similarity
Dimension

The Sierpinski carpet is self-similar with 8 non-overlapping copies of itself, each scaled by the factor $r \lt 1$. Therefore the similarity dimension, $d$, of the unique attractor of the IFS is the solution to

$$\sum\limits_{k = 1}^8 {{r^d}} = 1\quad \Rightarrow \quad d = \frac{{\log (1/8)}}{{\log (r)}} = \frac{{\log (1/8)}}{{\log (1/3)}} = \frac{{\log (8)}}{{\log (3)}} = 1.89279$$

Special
Properties

What points are in the Sierpinski carpet? This is an exercise in base-3 (ternary) arithmetic! If we take the initial square in the construction of the Sierpinski carpet to be the unit square in the plane, then the carpet is the set of all pairs \((x,y)\) in the unit square that have a ternary expansion in which at least one of the corresponding ternary digits of \(x\) and \(y\) in each position is not the number 1 [Ternary Details.] You can try this yourself using an online Sierpinski Carpet Membership Calculator.

The Sierpinski carpet is uncountable. [Uncountability Details]

The interior of the Sierpinski carpet is empty. Let \(P = (x,y)\) be a point in the Sierpinski carpet and let \(\varepsilon > 0\). Choose an integer \(k\) satisfying \(\frac{\sqrt{2}}{3^k} \lt \varepsilon\). Write the infinite ternary expansions of \(x\) and \(y\) as $$x = x_1x_2x_3x_4\ldots{}_{\small 3}, \quad y = y_1y_2y_3y_4\ldots{}_{\small 3}$$ where an infinite string of 0's is used if either expansion terminates. Define a new point \(P' = (x',y')\) whose coordinates have the same ternary expansion as \(x\) and \(y\) except that \(x'_k =1\) and \(y'_k=1\). Then \(P \ne P'\) and \(P'\) is not in the Sierpinski carpet.

If \(x_k \ne 1\) and \(y_k \ne 1\), then \(|x-x'| = |y - y'| = \frac{1}{3^k}\). Therefore $$d(P,P') = \sqrt { (x-x')^2 + (y-y')^2} = \frac{\sqrt 2}{3^k}.$$

If either \(x_k = 1\) or \(y_k = 1\) (they both can't equal 1 since \(P\) is in the Sierpinski carpet), then one of \(|x-x'|\) or \(|y-y'|\) is equal to 0 and the other is equal to \(\frac{1}{3^k}\). Therefore $$d(P,P') = \sqrt { (x-x')^2 + (y-y')^2} = \frac{1}{3^k}.$$ In either case, \(d(P,P') \lt \varepsilon\). So no matter how small an open ball you draw around any point in the Sierpinski carpet, that ball will always contain another point that is not in the Sierpinski carpet. This shows that the Sierpinski carpet has an empty interior.

The Sierpinski carpet has area 0. Suppose the area of the original square $C_0$ is equal to 1. To get $C_{k+1}$, we scale $C_k$ by 1/3, which reduces the area by $1/9 = (1/3)^2$. But we make 8 copies of this scaled version to form $C_{k+1}$. Therefore the area of $C_{k+1}$ must be (8/9)th of the area of $C_{k}$. This means that the area of $C_{n}$ is $(8/9)^n$ for all $n$. Notice that these areas go to 0 as $n$ goes to infinity.

Another way to compute the area of the Sierpinski carpet is to compute the area of the holes using self-similarity. Suppose that the initial square covering the carpet has area 1 (as we did with $C_0$ above.) Let \(A\) be the area of the complement of the carpet, that is, all the holes not in the carpet. The area of the square removed at the first iteration is 1/9. The holes remaining in each of the other 8 squares is self-similar to those in the carpet, but scaled by a factor of 1/3. Their total area is therefore scaled by a factor of 1/9. Hence the area of all the holes is \(A = \frac{1}{9}+8\left(\frac{1}{9}A\right)\). Then $$A = \frac{1}{9}+\frac{8}{9}A \Rightarrow \frac{1}{9}A = \frac{1}{9} \Rightarrow A = 1.$$ Thus the holes have the same area as the covering square, whence Sierpinski's carpet has area 0. This means that we have removed "all" of the area of the original square in constructing the Sierpinski carpet. But of course there are many points still left in the carpet since the carpet is uncountable in size. That is one reason why area is not a useful dimension for this set.

Universality. Sierpinski used the carpet to catalogue all compact one-dimensional objects in the plane (from a topological point of view). What this basically means is that the Sierpinski carpet contains a topologically equivalent copy of any compact one-dimensional object in the plane. Thus for any curve contained in the plane, there is a set homeomorphic to the Sierpinski carpet that contains the curve. This is why the carpet is sometimes referred to as the Sierpinski curve. Additional topological characterizations of the Sierpinski carpet/curve can be found in the article by Whyburn [10], the text by Peitgen, Jurgens, and Saupe [8], or the topology text by Engelking and Sieklucki [2].

In an article written in 1916, Sierpinski wrote [1]:

Note that as early as one year ago Mr. Mazurkiewicz found an example of a curve which was simultaneously a Jordan curve and a Cantor curve...Mazurkiewicz forms this curve by dividing the square into nine smaller squares using lines parallel to the sides and removing the interior of the center square, performing the same procedure on each of the remaining eight square, and iterating this procedure ad infinitum.
So the Sierpinski carpet was actually described first by Stefan Mazurkiewicz, who in 1913 wrote his Ph.D. thesis under the supervision of Sierpinski on curves filling a square. But it was Sierpinski who wrote about and popularized the construction leading to it being named after him.

Variations

Box Fractal

Rather than remove the center square at each stop of the iterative construction, keep the center square and the four corner squares but remove the other four middle squares along each edge. The produces the box fractal.

Sierpinski Carpet Relatives

Example of a Sierpinski carpet relative

Start with the square rotated by 45° and divide this into 9 smaller congruent squares as with the Sierpinski carpet. But now choose to remove one or more of the smaller squares, and also possibly rotate some of them by 90°, 180°, or 270°, then iterate that construction. This produces what Robert Fathauer has called a "Square Divided by Nine" gasket. Here they are being viewed as relatives of the Sierpinski carpet similar to the family of Sierpinski triangle relatives.

Right Triangle Divided by Nine

Example of a right triangle divided by nine fractal

Similar to the previous variation, but instead of a square, start with a right triangle and divide that right triangle into nine similar right triangles. Remove from 1 to 7 of the smaller triangles, then iterate. This produces what Robert Fathauer has called a "Right Triangle Divided by Nine" gasket.

Artistic Variations

Rather than remove the center square at each step of the iterative construction, one can replace that square with a scaled copy of some image. Here is an example using an Agnes Scott College logo . Click on the image for a larger view.

The Sierpinski carpet with each removed square replaced by a scaled copy of the Agnes Scott logo
[Enlarge]

For other examples of how the Sierpinski Carpet has been an artistic inspiration, see the pictures of the quilt "Sierpinski Meets Mondrian" designed by Professor Gerda de Vries, University of Alberta; or the quilt "An Infinity of Nine-Patches" by Anabeth Dollins, Penn State University Greater Allegheny Campus; or the Sierpinski Carpet in interlocking crochet by Kate Dudman on Instagram.

Three-dimensional Variation

The three-dimensional generalization of the Sierpinski carpet is known as the Menger sponge, first studied by Karl Menger in 1926. Start with a cube and divide each of the six faces into 9 congruent squares. Remove the smaller cube in the middle of each face, and remove the smaller cube in the very center of the larger cube, leaving 20 smaller cubes. This is a level one Menger sponge. Repeat this process on each of those 20 smaller cubes, and keep repeating the process ad infinitum. The result is an object with zero volume and infinite surface area.

During October and November 2014, twenty primary sites around the world participated in the MegaMenger challenge. As a distributed fractal project, twenty Menger Sponge cubes were built in different cities around the world. In each location, volunteers built 8,000 small cubes out of nearly 50,000 business cards. These were then combined in groups of 20 to create 400 level one Menger Sponges. These were also combined in groups of 20 to make 20 level two sponges, which then formed one massive level three Menger Sponge. The resulting fractal cube would be nearly 5 feet tall. Collectively, these twenty level three sponges could be virtually combined to form a level-4 Menger sponge, perhaps the largest fractal ever built. Here are pictures of the level three Menger sponge built by faculty and students at Agnes Scott College under the guidance of Assistant Professor of Mathematics, Rachel Bayless (with additional contributions from students at several local middle and high schools).

Looking down at the level 3 Menger sponge from above
 
Side view of the level 3 Menger sponge
[Enlarge]

References

  1. Ciesielski, Krzysztof and Zdzislaw Pogoda. "The Beginning of Polish Topology," The Mathematical Intelligencer, 18 (3), 1996, 32-39.
  2. Engelking, R. and K. Sieklucki. Introduction to Topology, Amsterdam: North-Holland, 1994.
  3. Helmberg, Gilbert. Getting Acquainted with Fractals, de Gruyter Publishing, 2007. [See Preview at Google Books]
  4. Jones, Juw. "Fractals Before Mandelbrot-A Selective History," in Fractals and Chaos, Crilly, Earnshaw, and Jones, Editors, Springer-Verlag 1991.
  5. Mandelbrot, Benoit. The Fractal Geometry of Nature, W.H. Freeman and Co. 1983. [Preview available at Google Books]
  6. McWorter Jr., William A. and Jane Morrill Tazelaar. "Creating Fractals," Byte, August 1987, 123-132.
  7. McWorter Jr., William A. Personal correspondence, December 5, 1999
  8. Peitgen, Heinz-Otto, Hartmut Jurgens and Dietmar Saupe. Fractals for the Classroom, Part One: Introduction to Fractals and Chaos, Springer-Verlag New York, Inc. 1990.
  9. Sierpinski, Waclaw. "Sur une courbe cantorienne qui contient une image biunivoque et continue de toute courbe donnée" (On a Cantorian curve which contains a one-to-one and continuous image of any given curve), Comptes Rendus (Paris) 162, 629-632 (1916).
  10. Whyburn, G.T. "Topological characterizations of the Sierpinski curve," Fundamenta Mathematicae, Vol. 45 (1958), 320-324.
  11. Fathauer, Robert. Gasket Fractals, https://mathartfun.com/fractaldiversions/GasketHome.html