Sierpinski Carpet
Last updated at August 14, 2026 by Teachoo
Transcript
Pattern of Squares & Holes in Sierpinski Carpet We can figure the Math behind the pattern. We use two variables to track what is happening at any given step (๐ ): ๐น_๐ : The number of Remaining squares. ๐ฏ_๐ : The number of Holes created. Finding ๐น_๐ (Remaining Squares) Every time you move to the next step, you take one square and turn it into eight smaller squares (because you removed the 9th one in the middle). Step 0: 1 square ( ๐ _0=1 ) Step 1: 1 ร 8=8 squares ( ๐ _1=8 ) Step 2: 8 ร 8=64 squares ( ๐ _2=8^2 ) General Formula: ๐น_๐=๐^๐ Finding ๐ฏ_๐ (Holes) Every remaining square from the previous step generates exactly one new hole in the current step. And of course, you keep all the old holes you already made. Step 0: 0 holes ( ๐ป_0=0 ) Step 1: The 1 square from Step 0 creates 1 hole. ( ๐ป_1=1 ) Step 2: The 8 squares from Step 1 create 8 new holes. Add the 1 old hole. ( ๐ป_2=1+8 ) Step 3: The 64 squares from Step 2 create 64 new holes. Add the older holes. ( ๐ป_3=1+8+8^2 ) Step 3: We have 9 holes from Step 2. And, there are 82 new holes being created because of 82 empty squares. ( ๐ป_3=9+8^2 ) Thus, we can get a formula of number of holes like this ๐ฏ_(๐+๐)=๐_๐ง+๐_๐ Here is the logic behind why that formula works: Old holes stay (๐ป_๐): As the highlighted text points out, all the holes from the current step remain in the next step. New holes are made (๐ _๐): Look at the solid squares from the current step (๐ _๐). In the next step, every single one of those solid squares will have its middle cut out. That means the number of new holes you make is exactly equal to the number of solid squares you just had!