About the Pascal's Triangle Generator
This Pascal's triangle generator builds the triangle row by row and highlights the binomial coefficient you need. Choose how many rows to print (up to 30), then pick a row n and position k to get C(n, k) — the number in row n, position k, counting both from zero — together with the full row, the row sum 2ⁿ and the binomial expansion of (a + b)ⁿ.
It is useful for students learning the binomial theorem or combinations, teachers who need a printable triangle, and anyone who wants exact large binomial coefficients: rows up to n = 500 are computed with arbitrary-precision integers, so C(100, 50) comes out as all 30 digits rather than a rounded decimal.
Rows and positions start at 0, the usual convention: row 0 is the single 1 at the top, and row 4 is 1 4 6 4 1, so C(4, 2) = 6.
How to use the pascal's triangle generator
- 1Choose how many rows of the triangle to print.
- 2Enter the row n you are interested in (the top row is row 0).
- 3Enter the position k within that row (the first number is position 0).
- 4Read C(n, k), the full row, its sum and the (a + b)ⁿ expansion.
- 5Copy the printed triangle for worksheets or notes.
Formula and method
Every entry of Pascal's triangle is the sum of the two entries directly above it, with 1s along both edges. The entry in row n, position k is the binomial coefficient C(n, k) = n!/(k!(n − k)!), which counts the ways to choose k objects from n and is the coefficient of aⁿ⁻ᵏbᵏ in (a + b)ⁿ by the binomial theorem.
To compute a single row quickly without factorials, this generator uses the multiplicative rule C(n, k) = C(n, k − 1) × (n − k + 1)/k with exact big integers. Each row is symmetric, sums to 2ⁿ, and has its largest value in the middle.
- n
- Row number, starting at 0
- k
- Position in the row, starting at 0
- C(n, k)
- Binomial coefficient "n choose k"
Worked examples
Row 10, position 3
C(10, 3) = 10·9·8 / (3·2·1) = 120. Row 10 is 1 10 45 120 210 252 210 120 45 10 1, it sums to 2¹⁰ = 1024, and the 10 printed rows (rows 0–9) contain 1 + 2 + … + 10 = 55 numbers.
Expanding (a + b)⁵
Row 5 is 1 5 10 10 5 1, so (a + b)⁵ = a⁵ + 5a⁴b + 10a³b² + 10a²b³ + 5ab⁴ + b⁵. The highlighted C(5, 2) = 10 is the coefficient of a³b².
Exact large coefficient C(100, 50)
C(100, 50) has 30 digits — too many for ordinary floating point — but the exact big-integer row gives 100,891,344,545,564,193,334,812,497,256. Row 100 sums to 2¹⁰⁰.
Frequently asked questions
How do you build Pascal's triangle?+
Start with a 1 at the top (row 0). Each new row begins and ends with 1, and every inner number is the sum of the two numbers diagonally above it. Row 4, for example, is 1 4 6 4 1 because 1+3 = 4 and 3+3 = 6.
How is Pascal's triangle related to the binomial theorem?+
Row n lists the coefficients of (a + b)ⁿ. For instance row 3 is 1 3 3 1, so (a + b)³ = a³ + 3a²b + 3ab² + b³. The k-th entry is C(n, k), "n choose k".
What is the sum of a row in Pascal’s triangle?+
Row n sums to 2ⁿ, because setting a = b = 1 in (a + b)ⁿ adds up every coefficient. Row 10, for example, sums to 1,024.
What patterns are hidden in Pascal's triangle?+
The diagonals contain the counting numbers, the triangular numbers and the tetrahedral numbers; shallow diagonals sum to Fibonacci numbers; and colouring odd entries produces the Sierpiński triangle fractal.
Do rows start at 0 or 1?+
By convention both rows and positions start at 0: the single 1 at the top is row 0, and the first entry of each row is position 0. That way row n, position k equals C(n, k).