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.)