Path will appear here
Calculation will appear here

Pythagorean Tree

Big idea

A Pythagorean tree turns out to be a visual form of Pascal's triangle: squares naturally group into equal-size families, and the number of squares in each family is given by Pascal's triangle.


Pythagoras = Pascal

How the tree is built

Each square gives rise to two new squares by placing a right triangle on its top edge and then attaching squares to the triangle's two legs.

The shape of the triangle is fixed once and for all by the chosen triangle ratio, so at every step:

  • going left rescales the square by one fixed factor,
  • going right rescales it by another fixed factor.
  • Only these two scale factors ever appear, and they are the same at every generation.

    Why equal sizes appear

    After several steps, a square's size depends only on how many times each scaling factor was applied, not on the order in which left and right branches were chosen.

    Because multiplication is commutative, all paths with the same number of left and right choices produce squares of exactly the same size.

    Hover the mouse over a square and it's LR-path that leads to it from the base square will be displayed.

    Why Pascal's triangle appears

    At a given generation n, the number of paths with exactly k right choices is the corresponding Pascal entry.

    That is why:

    • clicking a Pascal entry highlights squares of one common size, and
    • the number of highlighted squares matches that Pascal entry exactly.

    Super triples

    What changes

    In super-triple mode the triangle is chosen from a Pythagorean triple. This makes sure that each rescaling factor is a rational number.

    Why all side lengths can be integers

    Although each step rescales by a rational factor, we can choose the base square side length so that it contains exactly the right factors to cancel all denominators introduced by the branching up to a fixed generation.

    With this choice:

    • every square in the tree up to that fixed generation ends up with an integer side length, and
    • the factored display shows precisely where those factors come from.

    Why super triple

    The triangles shown in super triple mode generalise Pythagorean triples in that any two adjacent squares in a row add to the square below. Very pretty!

    Historically, this connection between Pythagorean trees, Pascal's triangle and Super triples was uncovered in the opposite order to how it is presented here.

    Daniel Kaplan first explored super triples as a generalisation of Pythagorean triples and discovered the general construction based on Pythagorean triples. When Daniel later suggested this idea to me as a possible Mathologer video, I realised that the same structure appears naturally inside Pythagorean trees.