Pascal’s Triangle
Enter a row number to see Pascal’s triangle from row 0 to that row as a table, the expansion of (a + b)ⁿ and the row’s binomial coefficients. Up to row 30.
- Number of terms (n + 1)6
- Largest coefficient10
- Odd coefficients4
- Diagonal sum (Fibonacci F6)8
Pascal’s triangle (rows 0–5)
How it is calculated
Pascal’s triangle arranges the binomial coefficients in a triangle. Entry k of row n counts the ways to choose k of n items (combinations). Row sums are powers of 2; in the left-aligned triangle the diagonal sums give the Fibonacci numbers (1, 1, 2, 3, 5, 8, …); colouring the odd entries reveals the Sierpiński triangle.
C(n, k) = C(n − 1, k − 1) + C(n − 1, k) · (a + b)ⁿ = Σ C(n, k) aⁿ⁻ᵏ bᵏn: row number (the top row is 0) · k: position in the row, 0 to n. Every row starts and ends with 1.- Row 0 is a single 1.
- Each inner number of a new row is the sum of the two above it; the ends are 1.
- The numbers in row n are the binomial coefficients C(n, 0), C(n, 1), …, C(n, n), the coefficients of (a + b)ⁿ.
- In the expansion the power of a falls from n to 0 while the power of b rises from 0 to n.
Example
Row 4 is 1, 4, 6, 4, 1 (from row 3, 1, 3, 3, 1: 1 + 3 = 4, 3 + 3 = 6). So (a + b)⁴ = a⁴ + 4a³b + 6a²b² + 4ab³ + b⁴. The row adds up to 2⁴ = 16.
Frequently asked questions
How do I expand (a − b)ⁿ?
Use the same coefficients with alternating signs: (a − b)³ = a³ − 3a²b + 3ab² − b³. With coefficients, say (2x + 3)³, multiply C(3, k) by 2³⁻ᵏ and 3ᵏ: 8x³ + 36x² + 54x + 27.
Where are the Fibonacci numbers in Pascal’s triangle?
With the triangle left-aligned, the diagonal that starts at the beginning of row n and goes one row up and one column right each step adds up to F(n + 1). For row 5: 1 + 4 + 3 = 8.
How many odd numbers are in a row?
If n written in binary has m ones, the row has 2ᵐ odd numbers (Lucas’s theorem). 5 = 101₂ has two ones, so row 5 has 4 odd entries: 1, 5, 5, 1.