How to use the pascal's triangle generator
- Enter how many rows of Pascal's triangle to build, from 1 to 60. Row 0 is the single 1 at the top.
- Open the advanced options to choose an exponent n between 0 and 59 if you also want the expansion of (a + b) to that power.
- Read the last row in the headline, then the full table with each row and its sum.
- Export the table as CSV, copy it, or print it.
Formula
C(n, k) = n! / (k! (n - k)!)
each entry = the two entries above it added together
row n adds up to 2^n
(a + b)^n = sum of C(n, k) a^(n-k) b^k
The rows are built from the product rule C(n, k+1) = C(n, k) x (n - k) / (k + 1), using exact whole numbers, so even row 59 has every digit correct.
Ten rows and (a + b)^5
Row 9 is 1, 9, 36, 84, 126, 126, 84, 36, 9, 1. Each middle number is the sum of the two above it in row 8: 36 = 8 + 28, 84 = 28 + 56 and 126 = 56 + 70. The row adds up to 512 = 2^9.
Row 5 is 1, 5, 10, 10, 5, 1, so (a + b)^5 = a^5 + 5a^4b + 10a^3b^2 + 10a^2b^3 + 5ab^4 + b^5. At 60 rows the largest number in the last row is C(59, 29) = 59,132,290,782,430,712.
Patterns hidden in the triangle
Row n lists the number of ways to choose k items out of n, so the triangle is a table of combinations. The outer diagonals are all 1s, the next diagonal counts 1, 2, 3, 4, and the one after it holds the triangular numbers. Adding the numbers along the shallow diagonals gives the Fibonacci sequence, which you can explore with the Fibonacci calculator.
Odd numbers form a pattern of triangles within triangles, the Sierpinski triangle, which appears if you color every odd entry.
Using coefficients
The numbers in row n are the coefficients when (a + b) is multiplied by itself n times. They also give the counts in a binomial distribution, where each probability multiplies a coefficient by a chance of success raised to a power. For one coefficient at a time, use the combinations and permutations calculator, and for probabilities the binomial probability calculator.
Assumptions and limits
- The first row is row 0, so the row with n numbers in it is row n - 1.
- The table is limited to 60 rows and the expansion to exponent 59, to keep the page quick.
- Numbers are shown with commas in the table. Digits are exact; nothing is rounded or shown in scientific notation.
- The expansion shows coefficients in terms of the letters a and b only, not other expressions.
Frequently asked questions
How do you make Pascal's triangle?
Start with a 1 at the top. Each number below is the sum of the two numbers above it, with 1s at the ends of every row. The generator builds each row directly from the combination formula, which gives the same numbers.
What is the sum of a row?
Row n adds up to 2 to the power n. Row 5 adds to 32 and row 9 to 512. The last column of the table shows the sum for every row so you can see the doubling.
How does the triangle help expand brackets?
The numbers in row n are the coefficients of (a + b) to the power n, from the highest power of a down to the highest power of b. For n = 5 they are 1, 5, 10, 10, 5, 1.
Why does the first row start at 0?
Row numbers follow the combination formula, where row n holds C(n, 0) through C(n, n). Starting at 0 means the row number is the exponent in the expansion of (a + b).