can you explain binomial coefficients to me? i missed one class. ONe and now I'm so lost ;u;;;
Binomial coefficients are pretty great, and there are essentially 3 ways of thinking about them? Which because this is math are all Equally Valid and which one you want to think about depends on what is the most useful situation!
1. The One That Makes Sense Why That’s The Name:
We’re going to refer to the binomial coefficients as BC(n,k). For this, we want n and k to be integers with n>=k>=0.
So a polynomial is just any expression in powers of ‘x’, right? like 5x^2+7x+1 or 3x^27-x^6. Blah blah blah. And bi means 2, because as you’re going to see we’re going to expand (x+1) and those are two things. And the coefficient is the number in front of the power of x. And this all very conveniently comes together to give you:
(x+1)^n=BC(n,n)x^n+BC(n,n-1)x^(n-1)+….+BC(n,1)x+BC(n,0)
so for example, if you know all the binomial coefficients when n=4 (which happen to be 1,4,6,4,1) without having to annoyingly foil something three times you just. immediately know that
(x+1)^4=x^4+4x^3+6x^2+4x+1
You can also do with with (x+y)^n, in which case your terms are going to be BC(n,k)x^(n-k)y^k. But that doesn’t look quite as pretty as using 1, and binomial coefficients are usually introduced with 1, the ‘y’ is just a generalization. but it also doesn’t have to be a variable – maybe you want to calculate (x+3)^4 – well, you do it like you’d be doing the (x+1)^4 above but make sure to multiply the coefficients by 1,3,9,27, and 81 respectively.
Super neat, right? FAST MATH.
2. Fuck It Just Give Me The Formula:
So the binomial coefficient (n,k) is calculated using factorials – which is when you multiply the number times all of the numbers smaller than it. Very specifically, the binomial coefficient BC(n,k) is just n!/k!(n-k)!. Note that 0!=1, by definition. Plug and chug. In our previous example, we knew that the binomial coefficients for n=4, well, we could have worked it out like this:
BC(4,4)=4!/4!(4-4)!=4!/4!=1BC(4,3)=4!/3!(4-3)!=(4*3*2*1)/(3*2*1*1)=4BC(4,2)=4!/2!(4-2)!=(4*3*2*1)/(2*1*2*1)=6BC(4,1)=4!/1!(4-1)!=(4*3*2*1)/(1*3*2*1)=4BC(4,0)=4!/0!(4-0)!=4!/4!=1
These actually come up a lot in probability, because let’s be real, how many times are you expanding (x+1)^4? The binary coefficient BC(n,k) is usually called n choose k. And it’s important because n choose k is the number of different ways you can pick k elements, order not mattering, from a list of n distinct elements. So basically let’s say there’s a class of 30 people and the professor is assigning a group project with groups of 3 pulled randomly. What are all of the possible potential groups that could be pulled randomly, at least for the first group? Well, 30 possibilities for the first person, 29 possibilities for the second, and 28 for the third, so the total possibilities are 30*29*28 – which is 30!/(30-3)!. But you only care about the members of the group, not what order they were pulled in. The set (1,2,3) has 3!=6 possible permutations: (1,2,3),(1,3,2),(2,1,3),(2,3,1),(3,1,2),(3,2,1). In general a set with k numbers has k! permutations. So we need to divide out by all the possibilities of the same three people having been pulled in a different order – which gives us 30!/3!(30-3)!. This turns out to be pretty big – 4060, actually. So the probability that you and your two best friends will all end up in the same group and that group will be pulled first out of all of the possible groups that can be pulled first is 1/4060, or approximately a 0.025% chance.
But you can see how in general, the question of “how many possible sets of k can I pull from a set of n” is hella useful? And it just. Is the binomial coefficient. And the explanation above is why. Honestly, I recommend memorizing the formula and memorizing what it’s used for, it comes up so much in combinatorics and just. Everything.
So you know Pascal’s Triangle? That fun thing where you start with 1 // 1,1, and then each subsequent row you make by adding the two numbers immediately above it?
the rows are the binomial coefficients.
(honestly when I have to calculate smaller ones I usually just draw the triangle because maybe it’s not quicker than using the formula but just. it’s so satisfying.)