Explore the Sierpinski Carpet
The Sierpinski Carpet: A Mathematical Carpet That Keeps Getting Hollowed Out
If you start with a solid square carpet:
□
And then repeatedly perform a very simple action: divide it into nine identical smaller squares, remove the one in the very center, and apply the same process to each of the remaining squares. Do this once, twice, ten times, or even infinitely. In the end, what you get is no longer an ordinary carpet, but a wondrous fractal—riddled with holes, featuring nested layers, and revealing new structures no matter how much you zoom in: the Sierpinski Carpet.
It All Starts with a Square
The starting point of the Sierpinski carpet is very simple: just a single, solid square. In the language of fractal construction, this is the initial starting shape. At this stage, there are no complex structures, no holes, no textures, and no fractal patterns—just a complete 'mathematical carpet'.
Step 1: Remove the center square
Next, divide this square into a 3 × 3 grid of nine identical smaller squares, much like a tic-tac-toe board.
┌───┬───┬───┐
│ │ │ │
├───┼───┼───┤
│ │ │ │
├───┼───┼───┤
│ │ │ │
└───┴───┴───┘
Now, remove the small square in the very center. This creates a small, square-shaped hole.
┌───┬───┬───┐
│ █ │ █ │ █ │
├───┼───┼───┤
│ █ │ │ █ │
├───┼───┼───┤
│ █ │ █ │ █ │
└───┴───┴───┘
This is the first step of the Sierpinski carpet.
Second iteration: Keep removing
Now we have 8 small squares. So, repeat the previous operation for each of these 8 squares: divide each square into 9 parts and remove the center one. Thus, 1 square becomes 8, meaning the 8 squares turn into a total of 64 squares. In the next step, the 64 squares become 512. Continuing on, they become 4,096...
This Is Recursion
The core concept behind the Sierpinski carpet is recursion.
The idea is actually quite simple: take the action you just performed and repeat it on the new objects.
In the first step, you cut a hole in the entire square. In the second step, you cut holes in each of the remaining eight smaller squares. In the third step, you continue by cutting holes in each of the remaining sixty-four even smaller squares... and so on. The rule remains unchanged throughout the process: divide the shape into nine parts and remove the center one.
Let's calculate the number of holes that appear at each stage.
In the first step, there is one hole. In the second step, eight new holes appear, bringing the total to nine. In the third step, sixty-four new holes appear, making the total seventy-three. In the fourth step, five hundred and twelve new holes appear, resulting in a total of five hundred and eighty-five. Consequently, the number of holes visible in the image increases very rapidly.
After iterating the pattern a few times, it resembles a carpet riddled with holes. These holes do not appear randomly; while they vary in size, their arrangement follows a strict pattern. Large holes contain smaller holes, which in turn contain even smaller ones. It looks like a mathematical carpet with infinite layers—which is precisely how the Sierpinski carpet got its name.
If you look at the entire pattern, you see a massive carpet. However, if you zoom in on any of the remaining small squares, you see a miniature version of the carpet. Zoom in further, and you see it again. Zoom in again, and it is still there. Theoretically, this process can continue infinitely. This is known as self-similarity.
What does 'self-similarity' mean?
It is actually quite simple to understand: the whole looks like the parts.
The Sierpinski carpet is a classic example. The entire carpet is composed of eight smaller carpet structures, and each of those smaller carpets is made up of eight even smaller ones. Whether you view it at a large scale or a small scale, you can observe similar structures.
Some interesting things
How does the area of the Sierpinski carpet change?
This is a fascinating mathematical property of the Sierpinski carpet. Initially, the area is 100%. In the first step, we divide the square into nine smaller squares and remove one, leaving 8/9 (approximately 89%) of the area. In the second step, we retain 8/9 of the remaining area, so the total area becomes (8/9)² (approximately 79%). In the third step, it becomes (8/9)³ (approximately 70%), and so on. After *n* iterations, the remaining area is (8/9)ⁿ. As *n* increases, this value decreases. Therefore, if the process is repeated infinitely, the area of the Sierpinski carpet approaches zero.
But it clearly looks so 'large'?
That is precisely what makes fractals so interesting. You see a massive, highly complex pattern on your screen, yet in terms of mathematical limits, its area approaches zero. In other words, a structure that appears incredibly 'rich' and intricate can actually have an area approaching zero. It is a highly counterintuitive mathematical phenomenon.
But it doesn't just turn into 'a bunch of dots'
Although its area approaches zero, the Sierpinski carpet doesn't simply collapse into a few isolated points. It retains an infinitely layered structure. You can zoom in—again and again—and still discover new geometric relationships. Thus, area and structural complexity are two different things. A shape can decrease in area while simultaneously becoming more structurally complex.
If you'd like to delve a bit deeper into the math, the fractal dimension of the Sierpinski carpet is log(8) / log(3) ≈ 1.893. Why? Because at each step, a square is scaled down to one-third of its original size, and we retain eight of these smaller squares. Therefore, 8 = 3ᴰ, which means D = log(8) / log(3)—approximately 1.893. This number tells us that the Sierpinski carpet is far more complex than an ordinary line, yet it doesn't 'fill space' quite like a solid two-dimensional plane.
If you simply want to appreciate the pattern, there is no need to understand this number. However, it beautifully illustrates how fractals can possess geometric structures that exist between integer dimensions (such as a one-dimensional line, a two-dimensional plane, or three-dimensional space).
A Very Simple 'Mathematical Machine'
The Sierpinski carpet is not created by punching holes at random. If someone were to randomly punch numerous holes in a square, the resulting pattern might well be complex, but it would not be a Sierpinski carpet. Every hole in the Sierpinski carpet has a specific location, size, and hierarchical level. They all originate from the same rule: divide into a 3×3 grid, remove the center, and recurse. Thus, although the Sierpinski carpet appears complex, it possesses a profound sense of order.
You can visualize the Sierpinski carpet as a machine. The machine takes a square and executes these operations: divide it into nine parts and remove the center; next, take the remaining eight parts, divide each into nine, and remove their centers; then, continue, continue, and continue...
From start to finish, the machine never changes its rule; yet, after a sufficient number of iterations, it produces an incredibly complex pattern.
This is the most fascinating aspect of fractals. The Sierpinski carpet does not rely on a complex 'blueprint'; no one instructs the computer to 'draw a large hole here,' 'draw a small hole there,' or 'draw an even smaller hole here.' All these details emerge from the recursive rule itself. We simply need to tell it: 'Divide into nine parts each time and remove the center one,' and leave the rest to mathematics.
What is the difference between a Sierpinski carpet and an ordinary carpet?
An ordinary carpet is a solid, continuous two-dimensional area.
In contrast, a Sierpinski carpet continuously has its interior hollowed out. First, a hole is cut out. Then, more holes are cut into the remaining areas. This process repeats... As a result, the number of holes increases and the structure becomes increasingly complex, yet there is only ever a single rule governing the process.
How does it differ from the Sierpinski triangle?
If you have seen the Sierpinski triangle, you will certainly notice that the two shapes are very similar. They share a common process: simple shape → subdivision → removal of a part → repetition on the remaining parts → infinite recursion. However, they begin with different shapes.
The Sierpinski triangle starts with a triangle; in each step, it is divided into four smaller triangles, and the central one is removed, leaving three. The progression follows the sequence 1 → 3 → 9 → 27 → ….
The Sierpinski carpet starts with a square; in each step, it is divided into nine smaller squares, and the central one is removed, leaving eight. The progression follows the sequence 1 → 8 → 64 → 512 → ….
To put it simply: the Sierpinski triangle involves cutting triangles out of a triangle, whereas the Sierpinski carpet involves cutting squares out of a square. They employ very similar recursive principles, but because the starting shapes and subdivision methods differ, they result in completely different fractal worlds.
How does it differ from the Koch snowflake?
They offer a very interesting contrast.
The core idea behind the Sierpinski carpet is continuous removal. Start with a square → cut out the center → keep cutting → more and more holes appear.
In contrast, the core idea behind the Koch snowflake is continuous addition. Start with a line segment → add new segments outward → keep adding → the edges become increasingly complex.
So, you can think of it this way: the Sierpinski carpet involves carving inward, while the Koch snowflake grows outward. Although they are generated differently, both ultimately create infinitely complex geometric structures through simple, repetitive rules.
From a Square to an Infinite World
If you visualize the entire process as working on a real carpet, it feels as though you are constantly cutting out holes. You cut one, then eight, then sixty-four, then five hundred and twelve...
The holes multiply and shrink in size, and the carpet's surface area steadily diminishes. Yet, you can never truly complete the final step—because there is no final step. As long as the process continues, there is always another layer to follow. This is the most fascinating aspect of the Sierpinski carpet: it is a carpet that can never be fully hollowed out.
It begins simply: □, just an ordinary square.
Then, it is divided into nine parts, and the center one is removed. Next, the same operation is applied to the remaining eight squares. And then again. And again...
Ultimately, a simple square transforms into a fractal world of infinite layers.
It teaches us that complexity does not necessarily arise from intricate designs; sometimes, all it takes is a very simple rule repeated enough times.
Continue Exploring the World of Fractals
The Sierpinski carpet is a classic structure in the world of fractals.
If you enjoy the pattern of simple rules → continuous recursion → infinite complexity, you can also explore the Sierpinski triangle to see how the same concept of 'repeatedly cutting out holes'—applied to a triangle instead of a square—results in a completely different geometric structure. Or check out the Koch snowflake to see how a simple edge accumulates new details to form an infinitely complex mathematical snowflake. You might also look at the Lévy C curve to see how an ordinary straight line undergoes recursion and folding via a simple generator to become a complex fractal curve. Finally, there is the Dragon curve, which shows how a simple line can be folded repeatedly to create a mysterious, dragon-like structure.
Each follows different rules—some involve addition, others subtraction, folding, or tiling. Yet, they all reveal one of the most fascinating secrets of the fractal world: a very simple rule, when repeated enough times, can create complex structures that far exceed our imagination.
You can also explore more amazing mathematical shapes or visit See more about the Sierpinski carpet on Wikipedia.