📘 CodingMarble Learn

Fractals and the Sierpinski Triangle

A fractal is a pattern made by repeating the same rule again and again, so a small part looks like the whole. This is called self-similarity. In the Sierpinski triangle, each step removes the middle of every triangle: the number of triangles goes 1, 3, 9, 27 … (3ⁿ) and the area left is multiplied by 3/4 each time.

🎬 Step-by-step story

  1. Start with one big solid triangle. This is level 0. We count 1 triangle.
  2. Join the midpoints of the three sides. Take out the middle triangle. Now 3 smaller triangles are left.
  3. Do the same thing to each small triangle. 3 × 3 = 9 triangles.
  4. Do it again. 9 × 3 = 27 triangles. Each time the count is multiplied by 3, and a quarter of the area goes.
  5. Zoom into one corner. The small corner looks just like the whole shape. This is self-similarity.
  6. Your turn: move the slider to choose a level. Watch the count and the area left.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Why do we remove the middle triangle and not a corner?

Joining midpoints makes 4 equal triangles. The middle one is upside down. Removing it leaves 3 triangles pointing the same way as the big one, so each can be treated exactly like the original.

Why does the count multiply by 3 and not add 3?

Every shaded triangle is split into 3 shaded ones. If you have 9 triangles, each of the 9 becomes 3, so 27.

Where is the self-similarity?

Zoom into one corner: it is the same pattern at half the size.

Does the area ever become exactly zero?

Not at any level you can draw. It is multiplied by 3/4 each time, so it gets very small. Move the slider to level 5: only about 24% is left.

Is any repeating pattern a fractal?

No. A row of tiles repeats side by side at the same size. A fractal repeats inside itself, at smaller and smaller sizes.

What is a fractal?

A fractal is a shape made by using one rule over and over. Each time, the rule is used on smaller and smaller pieces. So when you zoom in, you see the same pattern again.

This property has a name: self-similarity. It means a part looks like the whole. A real fractal in maths goes on forever. On paper, we can only draw a few levels.

Self-similar patterns in nature and art

Nature stops after a few levels, so these are fractal-like, not perfect fractals.

How to build the Sierpinski triangle

  1. Draw an equilateral triangle and shade it. This is level 0.
  2. Find the midpoint of each side. Join the three midpoints. This makes 4 smaller triangles.
  3. Remove (unshade) the middle one. You have 3 shaded triangles: level 1.
  4. Repeat steps 2–3 on every shaded triangle.

The pattern is named after the Polish mathematician Wacław Sierpiński, who described it in 1915.

Counting patterns: triangles, side and area

At each level, every shaded triangle becomes 3 shaded triangles. So:

Level n01234
Shaded triangles (3ⁿ)1392781
Side of each (×½)11/21/41/81/16
Area left ((3/4)ⁿ)13/49/1627/6481/256

Each new level removes one quarter of what is left. If we went on forever, the shaded area would get closer and closer to 0, while the number of triangles grows without end.

Other famous fractals

Koch snowflake: on every straight side, replace the middle third with two sides of a small triangle that points outward. The edge gets longer every time.

Fractal tree: draw a line, then two shorter branches at its end, then two shorter branches on each of those.

Sierpinski carpet: cut a square into 9, remove the middle one, repeat on the other 8.

Key formulas and definitions

Worked examples

1. How many shaded triangles are there at level 2 of the Sierpinski triangle?

Level 0: 1. Level 1: 1 × 3 = 3. Level 2: 3 × 3 = 9. So 9 triangles (3² = 9).

2. The level-0 triangle has side 32 cm. What is the side of one small triangle at level 3?

Each level halves the side. 32 → 16 → 8 → 4. So 4 cm (32 × (1/2)³ = 4).

3. The level-0 triangle has area 64 cm². Find the shaded area at level 2.

Each level keeps 3/4 of the area. Level 1: 64 × 3/4 = 48 cm². Level 2: 48 × 3/4 = 36 cm².

4. At which level are there 243 shaded triangles?

Keep multiplying by 3: 1, 3, 9, 27, 81, 243. That is level 5 (3⁵ = 243).

5. How many triangles in total have been removed after level 3?

New holes at levels 1, 2, 3 are 1, 3 and 9. Total = 1 + 3 + 9 = 13.

6. Is a fern leaf a perfect fractal? Explain.

No. Each leaflet looks like the whole leaf, so it is self-similar, but the copying stops after about 3–4 levels. A maths fractal goes on forever. So a fern is fractal-like.

Common mistakes

Practice quiz

1. Self-similarity means:
2. Number of shaded triangles at level 3 of the Sierpinski triangle:
3. In each step of the Sierpinski triangle we remove:
4. What fraction of the area is left after one step?
5. Which is a fractal-like pattern in nature?

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is a fractal in simple words?

A pattern made by repeating one rule on smaller and smaller pieces, so a part looks like the whole.

How many triangles are in a Sierpinski triangle?

At level n there are 3ⁿ shaded triangles: 1, 3, 9, 27, 81 and so on.

Where do we see fractals in real life?

In ferns, trees, cauliflower, rivers, lightning, coastlines and many computer graphics of mountains and clouds.

Where this is taught

CBSE (India)Class 8Exploring Some Geometric Themes

Learn first

Learn next

Related lessons

All Maths lessons