Pascal's Triangle Calculator
Generate Pascal's triangle up to n rows
Enter the number of rows
Input how many rows of Pascal's triangle you want to generate. The calculator supports up to 20 rows.
Click Generate
The calculator will build Pascal's triangle row by row, starting with a single 1 at the top.
View and use the results
Each row shows the binomial coefficients. Use these for probability calculations, combinatorics, or algebraic expansions.
| Row (n) | Coefficients | Sum of Row | Binomial Form |
|---|---|---|---|
| 0 | 1 | 1 | (a+b)⁰ |
| 1 | 1 1 | 2 | (a+b)¹ |
| 2 | 1 2 1 | 4 | (a+b)² |
| 3 | 1 3 3 1 | 8 | (a+b)³ |
| 4 | 1 4 6 4 1 | 16 | (a+b)⁴ |
| 5 | 1 5 10 10 5 1 | 32 | (a+b)⁵ |
| 6 | 1 6 15 20 15 6 1 | 64 | (a+b)⁶ |
| 7 | 1 7 21 35 35 21 7 1 | 128 | (a+b)⁷ |
| 8 | 1 8 28 56 70 56 28 8 1 | 256 | (a+b)⁸ |
| 9 | 1 9 36 84 126 126 84 36 9 1 | 512 | (a+b)⁹ |
What Is Pascal's Triangle?
Pascal's triangle is a triangular arrangement of numbers where each number is the sum of the two numbers directly above it. The triangle starts with a single 1 at the top. Each row begins and ends with 1. Despite its name, the pattern was known to mathematicians in Persia, China, and India centuries before Blaise Pascal studied it in the 1600s.
How to Build the Triangle
Start with 1 at the top (row 0). Row 1 has two 1s. For each new row, add adjacent pairs from the row above. If there's no neighbor on one side, treat it as 0. So row 2 becomes: 1, (1+1)=2, 1. Row 3: 1, (1+2)=3, (2+1)=3, 1. This simple rule generates the entire triangle.
Connection to Binomial Expansion
The numbers in row n give the coefficients when expanding (a + b)ⁿ. For example, (a + b)³ = 1a³ + 3a²b + 3ab² + 1b³. The coefficients 1, 3, 3, 1 come directly from row 3 of Pascal's triangle. This makes the triangle invaluable for algebra.
Patterns Hidden in the Triangle
Pascal's triangle contains many surprising patterns. The diagonals give counting numbers, triangular numbers, and tetrahedral numbers. The sum of row n equals 2ⁿ. Shallow diagonals sum to Fibonacci numbers. Color odd numbers one color and even numbers another to reveal the Sierpinski triangle fractal.
Combinatorics
The entry in row n, position k equals "n choose k" — the number of ways to select k items from n items.
Probability Theory
Row n gives the probabilities for n coin flips. Row 4 (1, 4, 6, 4, 1) divided by 16 gives probabilities for 0, 1, 2, 3, 4 heads.
Algebra
Use row n coefficients to expand (x + y)ⁿ without multiplying everything out by hand.
Computer Science
Pascal's triangle appears in algorithms for computing combinations and in understanding recursion patterns.
What is the formula for Pascal's triangle?
Each entry equals the sum of the two entries above it: C(n,k) = C(n-1,k-1) + C(n-1,k). You can also calculate directly using combinations: C(n,k) = n! / (k! × (n-k)!), where n is the row number and k is the position in the row.
Why is row 0 at the top?
Row numbering starts at 0 because it corresponds to (a+b)⁰ = 1. This convention matches the binomial theorem and combinatorics, where "n choose 0" equals 1 for any n. The top single 1 is row 0, the next row with two 1s is row 1, and so on.
What's the sum of row n in Pascal's triangle?
The sum of row n equals 2ⁿ. Row 0 sums to 1 (2⁰). Row 1 sums to 2 (2¹). Row 5 sums to 32 (2⁵). This happens because the sum represents all possible subsets of an n-element set, which equals 2ⁿ.
How does Pascal's triangle relate to combinations?
The kth entry in row n equals "n choose k" — written as C(n,k) or ₙCₖ. This counts how many ways you can choose k items from n items. For example, C(5,2) = 10, which is the third number in row 5.
Who invented Pascal's triangle?
Blaise Pascal didn't invent it — he studied its properties in 1653. Chinese mathematician Jia Xian described it around 1050. Persian mathematician Omar Khayyam studied it in the 11th century. It appears in Indian mathematics even earlier. Different cultures called it by different names.