Pascal's Triangle
Binomial Coefficients
List the coefficients of (a+b)^n from row n.
Row 5 of Pascal's triangle is 1 5 10 10 5 1. Its entries add up to 2^5 = 32. binomial(5) uses the row as the coefficients of (a + b)^5.
Each inside entry is the sum of the two entries above it. The ends of every row are 1. That recurrence is why the triangle can be built without computing a large factorial.
Equation
binomial(5)
Where the coefficients come from
Pascal's triangle stores binomial coefficients. The entry in row n, position k, is the number of ways to choose k items from n, and the row sums to 2ⁿ. DGS builds each entry from the multiplicative recurrence, so the numbers stay exact integers.
The triangle picture stops at row 20 so the drawing stays readable, but the coefficients themselves are still computed up to row 100. An expression (a+b)ⁿ uses the same row as its coefficients. That is why the algebra example and the triangle example belong together.
Reading the input
binomial(5)— This is a command. The name selects the routine, and the items inside the parentheses are its arguments.
Try a change
- Edit one number in the field, then use Generate Graph. The studio opens on the homepage with the edited text and runs it.
- Use Open in DGS Studio when you want the expression loaded but not run yet.
Generate Graph draws the triangle or the requested row in the graph pane. The coefficients are exact integers from the recurrence.