Pascal’s Triangle Calculator

Each number is the sum of the two above it — and the whole of binomial algebra falls out. Enter how many rows to build, and this calculator generates Pascal’s triangle, with a chosen row read out in full: its entries, its sum, and the expansion it encodes.





One Addition Rule, a Dozen Treasuries

The triangle's construction could not be humbler — ones down the edges, every interior entry the sum of the two above it — and its contents could not be richer: row n holds the binomial coefficients C(n, k) (the multipliers in (a + b)n's expansion), counts every combination (C(n, k) is the number of ways to choose k from n), sums to 2n, hides the triangular and tetrahedral numbers along its diagonals, and secretes the Fibonacci numbers along its shallow diagonals. The calculator generates rows exactly (integer arithmetic via the multiplicative recurrence, no rounding until nature insists past row 20's size) and reads a chosen row out with its sum and its expansion, because a triangle you cannot interrogate is a poster. Interrogate it, then, beyond the assignment: the questions in the FAQs below are the ones two centuries of readers have asked of exactly this grid. The 0–20 field range covers every hand use — coefficients to C(20, 10) = 184,756 — while the theory the FAQs sketch runs to infinity.

Worked Example: Row Five and the Fifth Power

Row 5 reads 1, 5, 10, 10, 5, 1 — sum 32, which is 25 — and it expands the fifth power term by term: (a + b)5 = a5 + 5a4b + 10a3b² + 10a2b³ + 5ab4 + b5. The symmetry (the row reads the same backwards) is the coefficients' palindromic law, C(n, k) = C(n, n − k) — choosing k to take is choosing n − k to leave — and the middle 10s carry the combinations lesson: C(5, 2) = 10 ways to pick a pair from five people, a committee count obtainable from the triangle faster than from the factorial formula. Probability students meet the same rows as the binomial distribution's skeleton (five coin flips land 1-5-10-10-5-1 across the six outcomes) — one artefact, three syllabuses, no extra charge.

Building It by Hand Once

The calculator rewards one manual rite of passage: construct six rows by hand — ones on the edges, each interior entry the sum of the pair above — and the rule's self-propagating charm becomes tactile in a way no rendering matches; errors, too, become instructive, since a single wrong entry poisons its whole descendant cone and the corruption is visible as a kink in the symmetry, teaching the data-structures lesson (garbage propagates downward) in pure arithmetic. Teachers assign the hand build for the same reason pilots train on manual landings: the automated version's output is only trusted by hands that have felt the mechanism. The grid above then serves as the answer key the rite deserves.

The Triangle Across Civilisations

Pascal's name is the West's label, not the fact's origin: the array appears in Pingala's India (prosody counts, the Meru-prastara), in al-Karaji and Omar Khayyam's Persia, in Yang Hui's China (the triangle's common Chinese name) by the 13th century, and in European print before Pascal — his Traité (1654) merely gave the first systematic theory of its uses, probability theory included (his correspondence with Fermat on the row's gambling arithmetic founded that subject too). The calculator is the modern leaf of that long book: the same addition rule, computed in milliseconds, with the read-out fields doing the work tables once did for astronomers and actuaries.

Sierpinski in the Triangle

Colour the triangle's odd entries and a fractal assembles itself: the Sierpinski gasket — self-similar triangles within triangles — emerges by row 8 and is unmistakable by row 16, a consequence of the addition rule modulo 2 (Lucas' theorem governs the pattern, and the odd-count in row n is 2 raised to the number of 1-bits in n — row 5, binary 101, has exactly four odd entries: the two 1s and two 5s, its 10s being even). The calculator's grid is the raw material of the picture; a reader with a pencil and ten minutes owns one of mathematics' prettiest bridges between arithmetic and geometry, drawn from the same numbers that price committees and coin flips.

Related Tools

More from the Math Calculators hub: the Simplify Fractions Calculator — the combinations' arithmetic relies on the reductions it teaches — and the Binary Calculator, for the powers of two the row sums speak.

Frequently Asked Questions

How do I read a combination C(n, k) from the triangle?

Go to row n, count entries from 0 at the left edge: the k-th entry is C(n, k) — row 10's entries, for instance, run 1, 10, 45, 120, 210, 252, and back down, so C(10, 3) = 120 committee-ways to choose 3 from 10. The calculator's readout row is chosen for precisely this consultation; the symmetry halves the search (count from whichever edge is nearer). For n beyond 20 the factorial formula C(n, k) = n! ÷ (k!(n − k)!) takes over, with the triangle's role becoming the concept's picture rather than its table.

Why do the rows sum to powers of two?

Because each row is built by doubling: every entry of row n contributes to two entries of row n + 1 (itself below-left and below-right), so the total exactly doubles each generation — 1, 2, 4, 8, 16, 32… — and combinatorially because C(n, 0) + … + C(n, n) counts ALL subsets of an n-set, each element independently in or out: 2n. The calculator prints the sum beside the power on every readout so the identity is witnessed, not asserted; substitute-all-ones into (a + b)n and the same sum falls out of the binomial theorem itself, a third proof for the collection.

Where are the Fibonacci numbers hiding?

Along the shallow diagonals — sum the entries cut by lines rising at half the rows' slope (1; 1; 1 + 1; 1 + 2; 1 + 3 + 1; 1 + 4 + 3…) and the Fibonacci sequence 1, 1, 2, 3, 5, 8… emerges, a consequence of the identity weaving binomial coefficients into the rabbit recurrence. It is the triangle's parlour trick with a theorem's spine, and it makes the calculator a two-for-one instrument: generate to row 12 or so and the shallow sums can be audited by hand against the famous sequence, a parlour audit this page invites in writing.

What are the diagonals, read straight?

The first diagonal is the ones; the second, the counting numbers; the third, the triangular numbers (1, 3, 6, 10, 15… — C(n, 2)'s family, handshake counts); the fourth, the tetrahedral (1, 4, 10, 20, 35… — cannonball-stack counts) — the figurate numbers of Greek geometry lying in formation, each diagonal the partial sums of the one before (the hockey-stick identity: a diagonal's run sums to the entry below its end, the picture every combinatorics course draws first). The calculator's grid exposes them to any reader who reads it tilted — another argument for generating the figure rather than merely the row.

How does the triangle power probability?

Through the binomial distribution: n independent two-way trials (coin flips, success/failure inspections, votes) distribute their outcomes exactly as row n distributes its counts, each entry weighted by the outcomes' probabilities — five fair flips land all-heads once in the row's 32, three-heads in 10 of 32, and so on. The hub's statistics pages spend these counts at scale; the triangle is their mint. Pascal's own first use was precisely this — the division of stakes in an interrupted game, settled by counting the row's futures — making the calculator a direct descendant of probability's founding document.

How is the triangle used in genetics and heredity?

Through the same binomial skeleton: a cross of two heterozygotes distributes offspring genotypes 1:2:1 — row 2 — and two independent traits multiply the triangle's work (3:1 phenotypic ratios squared into 9:3:3:1, which is row-structure compounded). Punnett squares are the triangle drawn as a grid for small cases; population genetics' Hardy-Weinberg proportions (p², 2pq, q²) ARE (p + q)² expanded by row 2's coefficients. The calculator's rows are thus the arithmetic inside every heredity textbook's first chapters, whether or not the textbook names them.

What is the triangle's connection to the normal curve?

Scale a tall row and its silhouette becomes the bell curve: the central coefficients dominate in a shape approaching the Gaussian (the de Moivre–Laplace theorem, probability's first central-limit result), which is why the binomial distribution of the earlier FAQ fattens into the normal distribution the statistics hub spends. Plot row 20's entries from this page's output and the bell is already visible in embryo — the triangle containing, in its middle age, the curve that would organise all of statistics.

Can the entries get too big to print?

Eventually, yes — coefficients grow roughly like 2n ÷ √(πn/2) at the middle, so row 60's centre is an 18-digit integer and row 100's a 29-digit one; the calculator's range stops at 20 to keep every digit exact in the machine's integer arithmetic (and its readout legible). Beyond that, the factorial formula with a scientific-notation answer (this hub's standard-form page) is the honest instrument. Limits stated, tools signposted — the hub's house rule, applied to the triangle as to everything else.