Category: Discrete Math Level: 301
C(n, k) = C(n-1, k-1) + C(n-1, k), row n sums to 2n
Each entry is the sum of the two entries above it. Row n adds up to 2n, and entry k in row n counts the ways to choose k things from n.
Row 0 is a single 1. Every row starts and ends with 1, so the edges of the triangle are all ones.
row 0: 1, row 1: 1 1
Each inside entry is the sum of the two entries just above it. Row 2 gets 1 + 1 = 2 in the middle.
1 + 1 = 2
Rows 3 to 6 follow the same rule. For example, 4 + 6 = 10 in row 5. Two rules, endless rows.
4 + 6 = 10
Add up each row: 1, 2, 4, 8, 16, 32, 64. Every entry is used twice to build the next row, so each row sum doubles.
row n sum = 2n, row 6: 1 + 6 + 15 + 20 + 15 + 6 + 1 = 64
Entry k in row n is C(n, k), the number of ways to choose k things from n. The circled 10 says there are 10 ways to pick 2 toppings from 5. Count k from 0 at the left edge.
C(5, 2) = 5!/(2! ยท 3!) = 10
cd svg-generator python3 -m svgmath render pascals-triangle --out /tmp/pascals-triangle
Source: svgmath/diagrams/counting.py