Binomial Coefficients
Last updated
Last updated
How many ways are there to pick five out of seventeen different toppings for your pizza? But it has to be exactly five, because you haven't eaten all day.
Well, you have seventeen ways to choose the first topping, right? And then you have sixteen ways to choose the second topping and so on, until the last topping you choose, for which you have thirteen choices, so it seems that the answer should be , but that's not quite the case.
Why isn't it? Because we overcounted. Say instead of five toppings we didn't choose five, but just two toppings. The first is pepperoni because all pizzas deserve meat, and the second is pineapples because no one is going to tell you what to do! However, what if you ask for the pineapple first and the pepperoni second? Huh? In this case you would get the same pizza, which means we counted pepperoni-pineapple pizza twice, on account of our failure to realize that a pepperoni-pineapple pizza and a pineapple-pepperoni pizza is the same thing.
Fortunately, we counted each kind of pizza the same amount of times. And how much is that? The number of different ways we can any given list of five toppings and shuffle it around.
So how many ways are there to arrange a list of five toppings? Well, we have five ways to choose the first one, four ways to choose the second, you see where this is going. There are ways to shuffle around the list of topping, which means that this is the number of times we counted each possible pizza. The upshot is that there is a total of different pizzas you can put together.
Going abstract we can now consider choosing out of toppings for some . To do so, we will introduce a nice notation: given a number , the number factorial is denoted and defined as
So the number of ways to shuffle toppings would be , but what about the number of ways to choose them? Well, as before there are possible ways to choose the first, possible ways to choose the second, and so on. When we choose the th and final topping, we have already picked toppings, so there are choices remaining. How can we write this nicely? We do a trick, and write the total number of combinations with overcounting as:
and now we just divide out the overcounting to get that the number of ways to choose out of toppings is .
This expression is so useful that it has a name and a notation, it is denoted which is pronounced " choose ". These numbers, are also called the binomial coefficients.
Note that this expression has a nice symmetry to it between and , and that makes sense because choosing toppings to put on your pizza is exactly the same as choosing topping not to put on your pizza. An observation easily stated and verified as the equation .
Binomial coefficients come up everywhere, and have very nice properties to them.
We can keep going, following this pattern, the next few lines will look like this:
A three dimensional cube has eight vertices (corners), twelve edges, and six faces. In mathematese, we call these all faces. The vertices are just points, so they are the zero dimensional faces, the edges are one-dimensional lines, so we call them the one-dimensional faces, and what we used to call faces we will now call two-dimensional faces. Following this logic, a cube has a single three-dimensional face: the cube itself.
In this terminology, a two-dimensional cube is just a square. It has four zero-dimensional faces, four one-dimensional faces, and one two-dimentsonal face. Cool? Cool.
To do this, we will need a better way to encode what "a cube" and "a face" is, one that can easily encode the information we need without forcing us to imagine shapes in more than three dimensions.
Consider a three dimensional cube. Each corner can be represented by three numbers, each being either 0 or 1. The first number represents if we are "left or right", the second if we are "back or front", and the third if we are "up or down".
This allows us to comfortably encode the corners. Note that two corners are connected if and only iff they differ in exactly one coordinate. So this gives as an indication of what a one-dimensional face, and edge, looks like: two coordinates are locked, and we are only allowed to move in the third. The "free coordinate" tells us where we can move along the edge. For example, a "back to front" edge will have the second coordinate free, since this coordinate represents "back to front":
We can do the same for edges:
Exercise: Show that if then . Hint: you don't really need math to solve this, you just need to tell yourself the right story.
There is actually a really cool way to represent the binomial coefficients called Pascal's triangle. To draw the triangle, follow these rules. First, write the number at the middle of the top line of the paper, and then write it again twice, like so:
In the next line we write three numbers. The first and last would be , and the middle number will be the sum of two numbers above it:
What does this have to do with everything? Well, remarkably, if we number the lines, starting with zero, then the th number if the th line is exactly .
Exercise: Assuming that Pascal's triangle satisfy this property, prove that for any it holds that .
So how many eight-dimensional faces does a seventeen-dimensional cube have? Turns out we can compute this using binomial coefficients! We will actually find a formula for the number of -dimensional edges in an -dimensional cube for all !
Considering the corners of the marked edge we see that in both of them the first coordinate is to indicate that the edge is on the right, and the third coordinate is to indicate that the edge is on the bottom, but the second coordinate varies between them, to indicate that the edge goes "from back to front", namely, one of it's vertices, , is in the front while the other is in the back.
Here we see that only one coordinate is fixed. The third coordinate is set to in all edges, indicating that the edge is on top. Other than that, all coordinates can be set either way. It makes sense that a two dimensional shape, like the face of a cube, will have two degrees of freedom. Even without knowing exactly what two-dimensional means formally, it makes sense that a two dimensional shape would have exactly two directions to move around.
Note that the three dimensional cube drawn above has exactly eight corners, corresponding to the eight different strings of three bits. This is the property we extend to higher dimension. When thinking of an -dimensional cube, we just think of all sequences of bits (zeros and ones) of length . We think of each coordinate as "a direction" (though unfortunately, in more than three dimensions these directions don't have common names like "width", "depth" and "height", so we just call them "the first coordinate", "the second coordinate", etc.), and of its value as either being "close" or "far" in that direction from the point .
So how would we define a -dimensional face of this -dimensional hypercube? Well, we said that a -dimensional face must have free dimensions. The way to form such a face is hence to choose the free directions and fix the remaining coordinates. For example, when we consider all the possible one-dimensional faces (edges) of a two-dimensional cube (square), we choose one free dimension, and fix the other dimension. Say we choose the free dimension to be the first one, and fix the second dimension to , then we get the two corners and corresponding to the left edge:
There are two ways to choose the free direction (either first coordinate or second coordinate), and then two possible values to fix in the remaining direction (either or ), so in total we have options, which checks out as a square indeed has four edges!
Extending this logic, when considering a -dimensional face of an -dimensional cube, we first choose the free coordinates. There are of course ways to do so. We then fix the remaining coordinates. We set each of them to either or , so there is a total of ways to fix the coordinates. We have proved:
Theorem: an -dimensional cube has exactly -dimensional edges.
So for example, for the cube we have , and indeed the number of -dimensional faces is exactly , and the number of -dimensional faces is exactly . And as for the question above? In a seventeen-dimensional cube, the number of eight dimensional edges is .
Exercise: Prove that the number of -dimensional faces of an dimensional cube is