This image is made from one simple rule.
Yet it can continue forever.

How can something endless come from something finite?

Do you see smaller copies of the whole image inside it?

If each small triangle looks like the whole,
could we build the large one by repeatedly building smaller ones?

Then maybe we don't draw the big triangle directly.
Maybe we only know how to draw a small one —
and repeat.

Which rule actually explains how this image grows?

If we keep subdividing triangles forever… what happens?

If triangles keep getting smaller and smaller,
what must eventually happen in a real program?

A structure built by defining a large thing
in terms of smaller copies of itself,
together with a stopping condition,
is called recursion.

Why doesn't this feel like a circle?

Recursion is not circular.
It is convergent.
Each step moves toward something simpler.

// 01 — The paradox

Can something describe itself?

Sounds circular. If a definition refers to itself, doesn't it go on forever? Sometimes — yes. But sometimes self-reference is exactly the right description.

Think about a folder on your computer. It contains files. But it can also contain other folders — which contain files, and other folders, and so on. The only honest way to describe what's in a folder is: "files, plus whatever's in each sub-folder." That sentence refers to itself. That's recursion.

// 02 — The two rules

Every recursive thing needs exactly two ingredients.

A base case — the simplest version of the problem, which you can answer directly without recursing. Without this, the function calls itself forever and crashes.

A recursive case — the rule that reduces the problem to a slightly simpler version of itself, then trusts that the simpler version is already solved. The leap of faith: assume it works for n − 1, use that to solve n.

// 03 — What you're looking at

The Sierpinski triangle is defined by one recursive rule.

Start with a triangle. Find the midpoint of each edge and connect them — this divides it into four smaller triangles. Remove the middle one. That's the rule.

Now apply it to each triangle that remains. And again. And again. The same rule, applied to itself, produces every level of detail you saw above. Look at any corner — it is the whole triangle, shrunk down. That's what recursion does: it describes a thing in terms of a smaller version of itself.

// Coming next

The call stack — and why it matters for ray tracing.

When a ray of light hits a mirror, it spawns a reflected ray. That reflected ray might hit another mirror, spawning another ray. This continues until the ray hits nothing, or we've gone deep enough. Ray tracing is recursion — and understanding the call stack is what makes it click.