Wednesday, February 11, 2015

Binomial Coefficients and Factorials

What is a factorial? You might have seen the operator in your math class: the exclamation point... ! But what does the factorial represent? There are plenty of definitions online for what it does, and how to compute a number's factorial, but it is necessary to learn what it actually does and what it tells about a number.
To do this, you must first understand the function of factorials. If you haven't already looked it up, the computation of the factorial is simple. Take the integer (or real number, but we'll get to that later) and multiply it by every smaller natural number. You can even think of it as multiplying every natural number up to a number. The factorial looks something like this.

Ten Factorial can be defined as: $\large10! = 10 \times 9 \times 8 \times ... \times 1$ Alternatively, it can be seen: $\large10! = 1 \times 2 \times 3 \times ... \times 10$

That's not too difficult. Granted, 10! is pretty freaking huge, and as you can start to realize, factorials grow very fast the larger the integer. Let me introduce a new concept to you: binomial coefficients.

Binomial Coefficients
Do not let the name scare you. If you want the drawn out Wikipedia definition, click here. What it basically means is that we have two numbers, (let's stick with integers for now,) and they are stacked one on top of another in the notation. Let's call the top integer $n$ and the bottom integer $k$. The way we read this notation is "n choose k". This represents It is the coefficient of the $x^k$ term in the polynomial expansion of the binomial power $(1 + x)^n$. It is useful when calculating combinations, or sets of possibilities of numbers. When counting combinations, order does not matter. There's something called a permutation, where the order of the combinations do matter. Here is the syntax.

$\large \binom{n}{k}$ $=\large \frac{n!}{k!(n-k)!}$

Using this notation and formula, we already know how to compute it using our definition of factorials. However, you probably are wondering, what does this formula do? Essentially, $n$ choose $k$ says that for the given integer $n$, compute how many groups of $k$ can fit within $n$. In other words, how many combinations of $k$ numbers can you find in $n$? Let's take a look at what this means.


Compute:
(1)
$\large \binom{3}{2}$.

Brute-force it first without the formula. We're finding all groups of $2$ numbers that can fit into $3$. They are:

(2)
$\large \{1,2\}$, $\large \{1,3\}$, $\large \{2,3\}$.
Next, to check our answer, use the formula.

(3)
$\large \frac{3!}{2!(3-2)!} = \frac{6}{2} = 3$


So, based on our definition, the answer is $3$, meaning there are three groups of two unique numbers up to $3$. By doing this kind of math, it makes it easy to find the number of combinations without counting twice. This comes in handy with statistics and sequences and series along with summations, but also will tie into the wrap-around we will do later about the definition of the factorial. let me show you another two examples to help gauge your understanding of this concept. Feel free to get out a pen and paper to follow along.


Compute:
(1)
$\Large \binom{10}{2}$.

Brute-Force:

(2)
$\large \{1,2\}$, $\large \{1,3\}$, $\large \{1,4\}$, $\large \{1,5\}$, $\large \{1,6\}$, $\large \{1,7\}$, $\large \{1,8\}$, $\large \{1,9\}$, $\large \{1,10\}$,
$\large \{2,3\}$, $\large \{2,4\}$, $\large \{2,5\}$, $\large \{2,6\}$, $\large \{2,7\}$, $\large \{2,8\}$, $\large \{2,9\}$, $\large \{2,10\}$,
$\large \{3,4\}$, $\large \{3,5\}$, $\large \{3,6\}$, $\large \{3,7\}$, $\large \{3,8\}$, $\large \{3,9\}$, $\large \{3,10\}$,
$\large \{4,5\}$, $\large \{4,6\}$, $\large \{4,7\}$, $\large \{4,8\}$, $\large \{4,9\}$, $\large \{4,10\}$,
$\large \{5,6\}$, $\large \{5,7\}$, $\large \{5,8\}$, $\large \{5,9\}$, $\large \{5,10\}$,
$\large \{6,7\}$, $\large \{6,8\}$, $\large \{6,9\}$, $\large \{6,10\}$,
$\large \{7,8\}$, $\large \{7,9\}$, $\large \{7,10\}$,
$\large \{8,9\}$, $\large \{8,10\}$,
$\large \{9,10\}$.

Hmmm... looks like a triangle...Pascal had his work cut out for him!

Formula:

(3)
$\large \frac{10!}{2!(10-2)!} = \frac{3628800}{2(8!)} = \frac{3628800}{2(40320)} = 45$


As it turns out, there are forty-five combinations of groups of two integers within ten. Interesting. But it does not always have to be groups of two integers. $k$ can stand for any integer less than $n$. What happens if $n = k$? Well, the result is $1$, because there's only one way to fit $10$ into $10$, for instance. This also implies that if $k > n$, the result will be $0$, which is in fact true. Let's see one more example...


Compute:
(1)
$\large \binom{5}{3}$.

Brute-Force:

(2)
$\large \{1,2,3\}$, $\large \{1,2,4\}$, $\large \{1,2,5\}$, $\large \{1,3,4\}$, $\large \{1,3,5\}$, $\large \{1,4,5\}$,
$\large \{2,3,4\}$, $\large \{2,3,5\}$, $\large \{2,4,5\}$,
$\large \{3,4,5\}$.

Formula:

(3)
$\large \frac{5!}{3!(5-3)!} = \frac{120}{6(2)} = \frac{120}{12} = 10$


There are ten combinations of groups of three integers within five. I'm sure this can come in handy when working with a deck of cards (which seems to be the hot topic of every statistics class these days). You might be asking yourself, "so what?" I will say that I find your boredom inappropriate for such an exciting topic. Old men in suits study this; it's called Abstract Algebra and Number Theory. What is a factorial? You might have seen the operator in your math class: the exclamation point... ! But what does the factorial represent? There are plenty of definitions online for what it does, and how to compute a number's factorial, but it is necessary to learn what it actually does and what it tells about a number.