Digital Garden
Maths
Common Functions
Binomial Coefficient

Binomial Coefficient

The binomial coefficient is a function that often appears in various areas of maths but especially in combinatorics and probability theory.

The formula for a binomial coefficient, or simply a binom, is defined as:

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

Where nn and kk are non-negative integers and n!n! is the factorial of nn.

When kk is 00 the binomial coefficient resolves to 11:

(n0)=n!0!(n0)!=n!n!=1\binom{n}{0} = \frac{n!}{0!(n-0)!} = \frac{n!}{n!} = 1

When kk is equal to nn the binomial coefficient also resolves to 11:

(nn)=n!n!(nn)!=n!n!=1\binom{n}{n} = \frac{n!}{n!(n-n)!} = \frac{n!}{n!} = 1

When calculating binomials by hand, it is often helpful to simplify the calculation by canceling out terms in the factorials.

Example (52)=5!2!(52)!=5432121321=5421=10(125)=12!5!(125)!=792(71)=7!1!(71)!=7\begin{align*} \binom{5}{2} &= \frac{5!}{2!(5-2)!} = \frac{5*4*3*2*1}{2*1*3*2*1} = \frac{5*4}{2*1} = 10 \\ \binom{12}{5} &= \frac{12!}{5!(12-5)!} = 792 \\ \binom{7}{1} &= \frac{7!}{1!(7-1)!} = 7 \end{align*}

For Probability

Todo

This will link to combinatorics

In probability theory, a binomial indicates how many ways you can choose kk objects from a set of nn different objects (without replacement and without regard to order). Formally, the binomial coefficient is the number of kk-element subsets of an nn-element set.

On calculators, you often find the English abbreviation "nCr", which stands for "n choose r" and corresponds to the binomial.

For Binomial Terms

A binomial term has the following form:

(x+y)n,nN(x + y)^n , n \in \mathbb{N}

The binomial coefficients give the coefficients of the expansion of a binomial term. This is done using the following formula:

(x+y)n=k=0n(nk)xnkyk(x + y)^n = \sum_{k=0}^{n}{\binom{n}{k}x^{n-k}y^k}
Example (x+y)3=(30)x3+(31)x2y+(32)xy2+(33)y3=x3+3x2y+3xy2+y3\begin{align*} (x+y)^3 &= \binom{3}{0} x^{3} + \binom{3}{1} x^{2}y + \binom{3}{2} xy^{2} + \binom{3}{3} y^{3} \\ &=x^3+3x^2y+3xy^2+y^3 \end{align*}

Pascal's Triangle

The Pascal's triangle is a graphical representation of binomial coefficients, which also simplifies calculation. Here, a triangle is drawn where the upper variable nn of the binomial coefficient corresponds to the row index and the lower variable kk corresponds to the column index.

Pascal's Triangle, left the binoms, right the values.

The calculation of the values is then very simple. First, for all elements at the edge of the triangle, you set a 1, because a binom with 0 or n as the lower variable resolves to 1. Then, every other value is the sum of the values directly above it.

Animation of how Pascal's Triangle is built up.

This derivation comes from the equation:

(n+1k+1)=(nk)+(nk+1)\binom{n+1}{k+1}=\binom{n}{k} + \binom{n}{k+1}
Example of Pascal's Triangle derivation

We will take the value in the middle of the third row of the image above.

(21)=(10)+(11)2!1!(21)!=1!0!(10)!+1!1!(11)!21!1!=11!+11!0!21=11+112=1+1\begin{align*} \binom{2}{1} &= \binom{1}{0} + \binom{1}{1} \\ \frac{2!}{1!(2-1)!} &= \frac{1!}{0!(1-0)!} + \frac{1!}{1!(1-1)!} \\ \frac{2}{1!1!} &= \frac{1}{1!} + \frac{1}{1!0!} \\ \frac{2}{1} &= \frac{1}{1} + \frac{1}{1} \\ 2 &= 1 + 1 \end{align*}