The Binomial expansion


So, we’re going to start using some of the combinatorics we’ve just learned to answer some questions which without these techniques would seem completely infeasible.

What is (x+y)^{34}? This seems like an almost impossible task; you’d have to write out (x+y)(x+y)(x+y)..., 34 times, then multiply them all out and it would become incredibly messy. However, everything we’ve done in the last section will allow us to see precisely what this, and any other expression of this form, is given by. Let’s start with a simpler example:

How about (x+y)^4? This is a simpler example and one that we could think of doing by hand, but we will show that there is a very general way to get any expression of this form. We start by writing this out in long form:




We are now going to label the x‘s and y‘s, though the labels (which will be indices) will just be dummy labels and we will remove them in the end. We write out the above expression as:


Now let’s start to expand this and see what it looks like:


x_1x_2 x_3 x_4
+x_1 x_2 x_3 y_4+x_1 x_2 y_3 x_4+x_1 y_2 x_3 x_4+y_1 x_2 x_3 x_4
+x_1 x_2 y_3 y_4+x_1 y_2 x_3 y_4+x_1 y_2 y_3 x_4+y_1 x_2 x_3 y_4+y_1 x_2 y_3 x_4+y_1 y_2 x_3 x_4
x_1 y_2 y_3 y_4+y_1 x_2 y_3 y_4+y_1 y_2 x_3 y_4+y_1 y_2 y_3 x_4
+y_1 y_2 y_3 y_4


This looks pretty horrible, but of course the indices that we put on the x‘s and y‘s were dummy indices and we can remove them. When we remove them we find that the first line in the equation above is just x^4, the second line gives something times x^3y, the third gives something times x^2y^2, the fourth gives something times x y^3 and the fifth gives y^4. In fact it gives precisely:




But how did we get these numbers 1, 4, 6, 4 and 1, the coefficients in front of each term? Let’s look at the third line in the formula above. We see that there are terms of the form x_1 x_2 y_3 y_4, etc. What we have here are all the different ways of choosing 2 x‘s from the four possible ones. We can choose 1 and 2, 1 and 3, 1 and 4, 2 and 3, 2 and 4 or 3 and 4. In fact we know how to calculate the number of ways of doing this and it is _4C_2=6. For the second line as well, we have all the ways of choosing a single x from the four x‘s, so this number is _4C_1=4. In fact, we can write the above expression as:


_4C_4x^4+_4C_3x^3y+{_4C_2}x^2y^2+{_4C_1}xy^3+_4C_0y^4=\sum_{r=0}^4 {_4C_r} x^r y^{4-r}


Check it, but note that on the left hand side we are starting at r=4 and working backwards to r=0 whereas on the right hand side we sum the other way around. This doesn’t matter because a+b+c+d=d+c+b+a.

In fact we have, by constructing the expression in this way, found a much more general result. This is called the Binomial Theorem and it tells us that:


(x+y)^n=\sum_{r=0}^n {_nC_r} x^r y^{n-r}


The _nC_r are called the binomial coefficients. This is a very powerful result and allows us to calculate otherwise very complicated expressions. We can also note that because Pascal’s triangle is made up precisely of the numbers of the form _nC_r we can use it to find the coefficients of the binomial expansion. You don’t need to calculate all of the _4C_r terms to find (x+y)^4. Just look at the (4+1)^{th} row of Pascal’s triangle: (1,4,6,4,1) and these are the coefficients of x^4\, ,x^3 y\, , x^2 y^2\, ,x y^3\, , y^4. Let’s look at some more examples:


(x+y)^6=\sum_{r=0}^6{_6C_r}x^r y^{6-r}=x^6+6x^5y+15 x^4 y^2+20x^3 y^3+15 x^2 y^4+6 xy^5+y^6


Note that we could take the numbers (1,6,15,20,15,6,1) from the 7^{th} layer of Pascal’s triangle.

It is also important to note that it doesn’t matter whether we write x^r y^{n-r} or x^{n-r}y^r because _nC_r=_nC_{n-r}.

We can also ask about just a particular term in an expansion. In an expansion of the form (a+b)^n, the coefficient of the term a^rb^{n-r} will be _nC_r. For example:


(x+3y)^6=\sum_{r=0}^6{_6C_r} x^r(3y)^{n-r}


The coefficient of the term x^4 y^2 will come with a factor _6C_4 but we have to be careful because it will also come with a factor 3^2. So it will be \frac{6!}{4!2!}3^2=135

How about a much more complicated looking example:




What is the term with the 163^{rd} power of x? We know that:




so the term that goes like x^{163} is _{322}C_{322-163}(76y)^{322-163}(35x)^{163}=\frac{322!}{163!159!}(76y)^{159}(35x)^{163}. You wouldn’t be expected to calculate 322! but you would be expected to be able to work out the above expression for this term.

How about looking at an expression of the form:




We can use the binomial theorem to write this as:




If we were asked to find the coefficient of the x^4 term we would have to work out for which r does this go like x^4, so we write out the above as:




The power of x is 4 when r=7, so we have to work out _{10}C_7=120. So the term that goes like x^4 is 120 x^4.



The multinomial expansion

We will just touch on it here, but it is possible to write out the expansion of something with multiple terms (more than 2) using the same machinery as above. For instance, what is the expansion of (a+b+c)^n?. We start by writing it as (a+(b+c))^n and using the binomial expansion:




but then the second part of this is just a binomial expression and so we can write that out too:


(b+c)^{n-r}=\sum_{s=0}^{n-r}{_{n-r}C_s b^sc^{n-r-s}}


and so the whole expression becomes:


(a+b+c)^n=\sum_{r=0}^n{_nC_r}a^r\sum_{s=0}^{n-r}{_{n-r}C_s b^sc^{n-r-s}}


If needed, you could work this out using the binomial coefficients, _nC_r, as normal.



A taster of a polynomial approximation of a function

Let’s look at an example like the expansion of (1+x)^{5}. We now know that we can write this as:


(1+x)^5=\sum_{r=0}^{5} {_5C_r} x^r=1+5 x+10x^2+10x^3+5 x^4+x^5


This expression is exact. If we were to plot the left hand side, and the right hand side, they would be exactly the same, of course. Can we say anything about the right hand side though if, for instance, x was very small? Clearly if x is much less than 1, then x^2 is going to be much much less than 1, and x^3 is even smaller. The terms are going to get smaller and smaller, the higher the power of x. So maybe, as an approximation we can say that for x close to zero:


(1+x)^5\sim1+5 x


Actually, for very small x, even the first term, 1, isn’t a bad approximation. We can say that for small x, we can approximate the function (1+x)^5 by the first terms in the polynomial. Including more terms will lead to a better approximation of the function, and similarly, smaller x will mean that the approximation is better. For instance, if we take the first 2 terms as above and plug in x=10^{-2}. The value of (1+10^{-2})^5=1.05101 and the value of the approximation: 1+5x=1.05, so we can see that the approximation is not bad. In fact, we can see something interesting when we plot the different levels of the approximation. This is shown in the figure here:


Here the dashed black line is the function (1+x)^5. The blue line is the first approximation of this function, just taking the first term in the polynomial expansion, ie. 1. We see that this line is a pretty bad approximation of the whole function, but it’s close when x=0. Next the red line, 1+5x can be seen not only to approximate the value of the function close to x=0 but also the gradient of this function is the same as the gradient of the full function (1+x)^5 when x=0. Thus the red line is the tangent line to the function. Next the green line includes the quadratic part, ie. is 1+5x+10 x^2. Again, it’s even a slightly better fit still to the curve, and gets the second derivative right at x=0. Next the purple line includes the cubic part – is 1+5x+10 x^2+10 x^3. We’re getting a better and better approximation to the curve as we take more points – but we can see that even for this curve, close to x=0 we have a very good approximation to the function. The brown curve is again, even better still, and the yellow curve, is the one when we include all terms in the expansion and because the expansion is exact, this matches the function precisely.

How clear is this post?