# Binomial Theorem
**The binomial theorem allows us to easily expand the binomial $(x+y)^n$ by using the Pascal's Triangle**. It links algebra with combinatorics, as it uses [[Combinations]] to express coefficients of the expanded [[Polynomials|polynomial]].
$(x+y)^n = \sum_{k=0}^n \binom n k x^{n-k}y^k = \sum_{k=0}^n \binom n k x^k y^{n-k}$^knv0jb
e.g.
$
\begin{align}
(x+y)^3 &= \binom 3 0 x^3y^0 + \binom 3 1 x^2y^1 + \binom 3 2 x^1y^2 + \binom 3 3 x^0y^3 \\
&=x^3 + 3x^2y + 3xy^2 + y^3 \\
\end{align}
$
$
\begin{align}
(x+y)^4 &= \binom 4 0 x^4y^0 + \binom 4 1 x^3y^1 + \binom 4 2 x^2y^2 + \binom 4 3 x^3y^1 + + \binom 4 4 x^0y^4 \\
&=x^4 + 4x^3y + 6x^2y^2 + 4xy^3 + y^4 \\
\end{align}
$
The binomial coefficient $\binom n k$ is also the value of the $k$-th number of row $n$ of Pascal's Triangle (indexes are 0-based).
## Pascal's Triangle
Is a number triangle with a **single 1 in its 0th row. Each following number created by adding the two numbers above it.**
```
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
```
The numbers are **combinations of ways of transitioning to any given number from the top**, if in each step you have to transition either to the left or to the right of the following row.
This is easy to reason with by looking at the triangle. Take row 4 for instance: 1 4 6 4 1. To get to the first 1, in each step you had to choose to go the left. To get to the first 4, in each step you had to choose to go to the left, except for any one previous row (doesn't matter which).
The ways of getting to the 4 is also the sum of ways of navigating to the 1 above it, plus sum of ways of navigating to the 3 above it. So 1+3.