Pascal's triangle and the expansion · Mathematics Class… | StemPy Lab
Course 7.1·Lesson 1 of 3
Pascal's triangle and the expansion
The expansion of (a+b)n has n+1
Lesson 1 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
expand a small power of a sum with Pascal's triangle, and any power with the binomial theorem;
say why the coefficient of an−rbr is nCr;
expand (a−b)n and (1+x)n, and count the terms;
add up the coefficients of an expansion without writing it out.
Squares and cubes of a sum
You know that (a+b)2=a2+2ab+b2. Multiply by a+b once more and you get the cube:
(a+b)3=a3+3a2b+3ab2+b3.
One more multiplication gives
(a+b)4=a4+4a3b+6a2b2+4ab3+b4.
Look at the pattern in these expansions.
The power of a goes down by one in each term, and the power of b goes up by one.
In every term the two powers add up to n.
There are n+1 terms.
The numbers in front are called coefficients. They are 1,2,1 for n=2, then 1,3,3,1, then 1,4,6,4,1.
Pascal's triangle
Write the coefficients as rows, one row for each power. The rows form a triangle named after the French mathematician Blaise Pascal.
Pascal's triangle, rows 0 to 6, each number in a circle. Row 0 is 1. Row 1 is 1, 1. Row 2 is 1, 2, 1. Row 3 is 1, 3, 3, 1. Row 4 is 1, 4, 6, 4, 1. Row 5 is 1, 5, 10, 10, 5, 1. Row 6 is 1, 6, 15, 20, 15, 6, 1. The two 10s of row 5 are orange, with red arrows down to the 20 of row 6, which is red. The caption says 10 plus 10 equals 20. A note says row n holds the coefficients of a plus b to the power n.
Each number is the sum of the two numbers just above it. Row 6 is 1,6,15,20,15,6,1, because 5+10=15 and 10+10=20. Every row starts and ends with 1, and every row reads the same forwards and backwards.
Rows are counted from n=0, which is the single number 1, because (a+b)0=1. So row n holds the coefficients of (a+b)n. For example, row 5 gives
(a+b)5=a5+5a4b+10a3b2+10a2b3+5ab4+b5.
Pascal's triangle is quick for small powers. For (a+b)20 you would need twenty rows. We need a formula that gives any coefficient at once.
Why the coefficient is a choice
Think of (a+b)3 as three brackets multiplied together:
(a+b)(a+b)(a+b).
To make one product you take either a or b from each bracket. That gives 2×2×2=8 products, such as aab and bab.
Four columns of boxes show the eight products from three brackets, each product written as three letters. The first column has aaa, with no b, and the label 1 way. The second has baa, aba and aab, with one b, and the label 3 ways. The third has bba, bab and abb, with two b's, and the label 3 ways. The fourth has bbb, with three b's, and the label 1 way. A line below says the ways are 3C0 = 1, 3C1 = 3, 3C2 = 3 and 3C3 = 1, so a plus b cubed equals a cubed plus 3 a squared b plus 3 a b squared plus b cubed.
Group the products by the number of b's. A product with two b's comes from choosing which two of the three brackets give a b. That can be done in 3C2=3 ways, so the term ab2 has coefficient 3.
The same idea works for every n. In (a+b)n, a product with r letters b and n−r letters a comes from choosing r of the n brackets for the b. There are nCr ways, so the coefficient of an−rbr is nCr.
The binomial theorem
The binomial theorem says that for every whole number n,
(a+b)n=nC0an+nC1an−1b+nC2an−2b2+⋯+nCnbn.
In sigma notation this is r=0∑nnCran−rbr. Row n of Pascal's triangle is nC0,nC1,…,nCn. Since nCr=nCn−r, each row reads the same in both directions.
Three versions are used all the time.
A difference. Replace b by −b to get (a−b)n=r=0∑n(−1)rnCran−rbr. The signs alternate: +,−,+,−,…
A power of 1+x. Put a=1 and b=x to get (1+x)n=r=0∑nnCrxr.
The sum of a row. Put a=1 and b=1 to get nC0+nC1+⋯+nCn=2n.
A worked example
Expand (x−2y)5, and check the answer by adding the coefficients.
Choose a and b. Take a=x and b=−2y. The term with r copies of b is 5Crx5−r(−2y)r.
Read row 5. The coefficients are 1,5,10,10,5,1.
Write each term.x5, then 5x4(−2y)=−10x4y, then 10x3(4y2)=40x3y2, then 10x2(−8y3)=−80x2y3, then 5x(16y4)=80xy4, and last −32y5.
Check. Put x=1 and y=1 in (x−2y)5. The result is (1−2)5=−1. The coefficients add up to 1−10+40−80+80−32=−1.
Practise with new numbers
Try it in Python
The program multiplies out (1+x)6 one bracket at a time. After each bracket it prints the list of coefficients. Then it compares the last list with the formula.
Common mistakes
Forgetting the numbers inside the brackets. In (2x+3)n the coefficient of each term is nCr2n−r3r, not just nCr.
Losing the signs in (a−b)n. Every odd power of b carries a minus sign.
Counting n terms. There are n+1 terms, one for each r from 0 to n.
Reading the wrong row. Row 0 is (a+b)0, so (a+b)n is row n, not row n+1.
Remember these
(a+b)n=r=0∑nnCran−rbr, with n+1 terms.
The coefficients are row n of Pascal's triangle. Each number is the sum of the two above it.
nCr counts the ways to choose which r of the n brackets give a b.
For (a−b)n the signs alternate. Each row adds up to 2n.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
How many terms does the expansion of (a+b)12 have?
Find the coefficient of a2b4 in the expansion of (a+b)6.
Expand (1−2x)3.
What is the sum of the coefficients in the expansion of (3x−1)4?
What do the numbers in row 7 of Pascal's triangle add up to?
Enroll free in Pascal's Triangle and the Binomial Expansion
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.