Pascal’s triangle calculator
Any row, any entry, exact — plus the binomial expansion.
What is Pascal’s triangle?
A triangle of numbers that starts with 1 at the top; each row begins and ends with 1, and every other number is the sum of the two numbers above it. Row 4 is 1 4 6 4 1, so row 5 is 1 5 10 10 5 1.
How do I find any number in the triangle?
Entry k of row n (both counted from 0) is the binomial coefficient C(n, k) = n! ÷ (k!(n − k)!). For example, C(5, 3) = 120 ÷ (6 × 2) = 10, and C(9, 2) = C(9, 7) = 36.
How is it used to expand (x + y)ⁿ?
Row n gives the coefficients: (x + y)⁵ = x⁵ + 5x⁴y + 10x³y² + 10x²y³ + 5xy⁴ + y⁵. With other terms, multiply in their powers too — the 10th term of (x + 2y)¹⁶ is C(16, 9) × 2⁹ x⁷y⁹ = 5,857,280x⁷y⁹ (OpenStax).
What do the rows add up to?
Row n adds up to 2ⁿ: 1 + 4 + 6 + 4 + 1 = 16 = 2⁴. That is the number of subsets of n things — each coefficient counts the subsets of one size.
How big do the numbers get?
Fast: the middle of row 30 is 155,117,520 and the middle of row 100 is a 30-digit number. The calculator gives exact values for any row up to 1,000.
Where do the formulas come from?
The binomial coefficient, the Binomial Theorem and the examples above are from OpenStax College Algebra 2e, section 9.6 (Binomial Theorem).
Why is every row symmetric?
Because C(n, k) = C(n, n − k): choosing k items to take is the same as choosing n − k to leave behind. Row 8 reads the same from either end.
How do I expand (x − y)ⁿ?
Use the same row of coefficients and alternate the signs: (x − y)⁴ = x⁴ − 4x³y + 6x²y² − 4xy³ + y⁴. The sign of each term is (−1)ᵏ, where k is the power of y.
The addition rule and a worked row
Every entry equals the sum of the two above it: C(n, k) = C(n − 1, k − 1) + C(n − 1, k). Row 6 is 1 6 15 20 15 6 1, and adding neighbors gives row 7 as 1 7 21 35 35 21 7 1. Row 8 is 1 8 28 56 70 56 28 8 1; its entries add up to 256, which is 2⁸. Counting rows from 0 matters: row 8 is the ninth line down, and the entries in it are numbered k = 0 to 8.
Using a row to expand a binomial with numbers in it
The Binomial Theorem multiplies each coefficient by the powers of both terms. For (x + 3)⁴ take row 4 (1 4 6 4 1) and multiply the coefficient of x^(4−k) by 3ᵏ: the terms are x⁴ + 12x³ + 54x² + 108x + 81. Forgetting to raise the 3 to the matching power, and writing 4x³ · 3 instead of 4 · 3 = 12 for the whole coefficient, are the common slips.
Patterns hiding in the triangle
Rows add to powers of 2. The shallow diagonals add up to the Fibonacci numbers: the first nine sums are 1, 1, 2, 3, 5, 8, 13, 21, 34. The numbers also grow fast: the center of row 20 is C(20, 10) = 184,756, which is why the calculator uses exact big-integer arithmetic instead of floating point. A row of a prime number p has every inner entry divisible by p, a quick check on a computed row.
Sources: OpenStax College Algebra 2e, section 9.6 (Binomial Theorem), for the formula C(n, k), the addition rule and the expansion of binomials. Related: permutation and combination calculator, binomial probability calculator, factorial calculator and Fibonacci calculator.