Factorials, binomial coefficients and triangle inequality¶
Part 1 · Numbers and logic · Chapter 9 · lecture notes by Fabio Furini · Chapter PDF
1. Factorials¶
Definition 1: factorial of \(n\)
The factorial of \(n\) is the product of the first \(n\) positive integers. It is denoted by \(n!\) and is read “\(n\) factorial”. In formulas:
By definition, we set \(0! = 1\).
-
The number \(n!\) grows very rapidly as \(n\) increases. The first values are:
n 0 1 2 3 4 5 6 7 8 9 10 n! 1 1 2 6 24 120 720 5.040 40.320 362.880 3.628.800 -
Some properties of the factorial, which are immediate to verify, are:
\[ n! = n \cdot (n-1)! \]\[\begin{equation} \label{MM} \frac{n!}{(n-k)!} = n \cdot (n-1) \cdot (n-2) \cdot {\rm} \dots {\rm} \cdot (n-k+1), {\rm ~~with~~} k\ge 1 \end{equation}\]With \(k\ge 1\), it becomes the product of \(k\) factors, starting from \(n\) and decreasing by one unit at a time.
Example 1: Computing the factorial
\[ \frac{100!}{95!}= \frac{100!}{(100-5)!}=100 \cdot 99 \cdot 98 \cdot 97 \cdot 96 = 9.034.502.400 \]It is always convenient to simplify expressions containing the factorial as much as possible, before computing them!
2. Binomial coefficients¶
Definition 2: binomial coefficient
The binomial coefficient is defined as the number:
The binomial coefficient \(c_{n,k}\) is usually denoted by the symbol: \({{n}\choose{k}}\) which is read “\(n\) choose \(k\)”.
-
Given rule \(\eqref{MM}\), we have:
\[\begin{equation} c_{n,k} = \frac{n \cdot (n-1) \cdot (n-2) \cdot {\rm} \dots {\rm} \cdot (n-k+1)}{k!} \label{CB2} \end{equation}\]with \(k\ge 1\), an expression that is more convenient for computing the binomial coefficient.
We have:
Since:
We have:
Since:
It also follows that:
2.1 Newton's formula¶
The \(n\)-th power of a binomial \((a + b)\) can be computed with the following formula (from which the name binomial coefficient derives):
Remark 1: Newton's formula
For every integer \(n \ge 0\), with \(a, b \in \R\), we have:
Proof
By induction on \(n\).
-
Base case of the induction
Let \(n = 0\). Then the statement becomes: \((a+b)^0 = {{0}\choose{0}} \; a^{0} \; b^0\) i.e. \(1 = 1\) which is clearly true.
-
Inductive step
Suppose it is true for \(n\), and let us prove it for \((n + 1)\). By the inductive hypothesis, we have: \((a+b)^n = \sum_{k=0}^{n} ~~{{n}\choose{k}} ~~\; a^{n-k} \; b^k\). Then:
\[\begin{align*} (a+b)^{n+1} &= (a+b) \cdot (a+b)^{n} = (a+b) \: \sum_{k=0}^{n} ~~{{n}\choose{k}} ~~\; a^{n-k} \; b^k\\[2.5ex] &= \sum_{k=0}^{n} ~~{{n}\choose{k}} ~~\; a^{n-k+1} \; b^{k} + \underbrace{\sum_{k=0}^{n} ~~{{n}\choose{k}} ~~\; a^{n-k} \; b^{k+1}}_{\displaystyle = \sum_{k=1}^{n+1} ~~{{n}\choose{k-1}} ~~\; a^{n-k+1} \; b^{k}}\\[2ex] &= a^{n+1} + \sum_{k=1}^{n} ~~{{n}\choose{k}} ~~\; a^{n-k+1} \; b^{k} + b^{n+1} + \sum_{k=1}^{n} ~~{{n}\choose{k-1}} ~~\; a^{n-k+1} \; b^{k}\\[4ex] & = a^{n+1} + b^{n+1} + \sum_{k=1}^{n} ~~ \underbrace{ \left(~~ {{n}\choose{k}} + {{n}\choose{k-1}} ~~\right)}_{\displaystyle ={{n+1}\choose{k}}} ~~\; a^{n-k+1} \; b^{k}\\[1ex] &= \sum_{k=0}^{n+1} ~~ {{n+1}\choose{k}} ~~\; a^{n+1-k} \; b^{k} \end{align*}\]which is exactly the desired statement, for \(n + 1\).
□
Remark 2
For every integer \(n \ge 0\) and integer \(k\) such that \(0\le k \le n\), we have:
Proof
We write:
We now apply Newton's formula \(\eqref{NEWTON}\):
□
2.2 Recursive computation of binomial coefficients¶
Relation \(\eqref{TT}\) allows us to compute the binomial coefficients \({{n}\choose{k}}\) by means of the so-called Pascal's triangle (or Tartaglia's triangle).
The rules for building the triangle are:
-
At the top of the triangle we place the number \({{0}\choose{0}}=1\) (by definition).
-
On the sides we place the numbers \({{n}\choose{0}} = {{n}\choose{n}} = 1\) for every \(n \ge 1\).
-
For \(0 < k < n\), the number \({{n}\choose{k}}\) is written at the intersection of the \(n\)-th row and the \(k\)-th column.
-
The number \({{n}\choose{k}}\) is the sum of the two numbers located in the previous row, the one in the same column and the one in the previous column.
Example 2: Pascal's triangle (or Tartaglia's triangle)
Pascal's triangle with \(n \le 10\) and \(k \le 10\) is:
| \(k=0\) | \(k=1\) | \(k=2\) | \(k=3\) | \(k=4\) | \(k=5\) | \(k=6\) | \(k=7\) | \(k=8\) | \(k=9\) | \(k=10\) | |
| \(n=0\) | 1 | ||||||||||
| \(n=1\) | 1 | 1 | |||||||||
| \(n=2\) | 1 | 2 | 1 | ||||||||
| \(n=3\) | 1 | 3 | 3 | 1 | |||||||
| \(n=4\) | 1 | 4 | 6 | 4 | 1 | ||||||
| \(n=5\) | 1 | 5 | 10 | 10 | 5 | 1 | |||||
| \(n=6\) | 1 | 6 | 15 | 20 | 15 | 6 | 1 | ||||
| \(n=7\) | 1 | 7 | 21 | 35 | 35 | 21 | 7 | 1 | |||
| \(n=8\) | 1 | 8 | 28 | 56 | 70 | 56 | 28 | 8 | 1 | ||
| \(n=9\) | 1 | 9 | 36 | 84 | 126 | 126 | 84 | 36 | 9 | 1 | |
| \(n=10\) | 1 | 10 | 45 | 120 | 210 | 252 | 210 | 120 | 45 | 10 | 1 |
To compute the binomial coefficient \({{5}\choose{3}}\), corresponding to the blue cell, we can use relation \(\eqref{TT}\) and add the two binomial coefficients \({{4}\choose{2}}\) and \({{4}\choose{3}}\), corresponding to the red cells:
Example 3: computing the power of a binomial using Pascal's triangle
Thanks to the previous Pascal's triangle and to Newton's formula \(\eqref{NEWTON}\) we can compute:
3. Absolute value¶
Definition 3: absolute value
The absolute value of a real number \(a \in \mathbb{R}\) (or modulus of \(a\)) is the non-negative number defined as follows:
From the definition of absolute value it immediately follows that:
3.1 Triangle inequality in \(\R\)¶
Remark 3: triangle inequality in \(\R\)
Proof
We write the two relations:
and add them side by side:
Hence, by \(\eqref{ass_2}\), with \(\varepsilon=|b|+|c|\ge 0\) and \(a=b+c\), \(\eqref{ass_3}\) follows. □
-
The triangle inequality is also used in the following form:
\[\begin{equation} |d - e| \le |d-f| + |e-f| \qquad \forall d,e,f \in \mathbb{R} \label{ass_4} \end{equation}\]To obtain it, it suffices to set in \(\eqref{ass_3}\):
\[ b = d - f, \quad c = f-e \]we obtain:
\[ |d - f +f-e|=|d -e| \le |d - f| + |f-e| = |d - f| + |e-f| \]since:
\[ |f - e| = |e-f| \qquad \forall e,f \in \mathbb{R} \] -
Moreover, the triangle inequality can also be written in the following form:
\[\begin{equation} |g| \le |g-h| + |h| {\rm ~~~~~i.e.~~~~~} |g| - |h| \le |g-h| \qquad \forall g,h \in \mathbb{R} \label{ass_AA} \end{equation}\]To obtain it, it suffices to set in \(\eqref{ass_3}\):
\[ b = g - h, \quad c = h \]
Remark 4: reverse triangle inequality in \(\R\)
Proof
From \(\eqref{ass_AA}\) we have
Similarly, swapping \(g\) and \(h\) in \(\eqref{ass_AA}\) we obtain:
hence we have
Hence, by \(\eqref{ass_2}\), with \(\varepsilon = |g-h| \ge 0\) and \(a= |g| - |h|\), the reverse triangle inequality follows. □
-
Inequality \(\eqref{ass_3}\) can easily be extended to the case of \(k\) terms:
\[\begin{equation} \left| \sum_{i=1}^k b_i \right| \le \sum_{i=1}^k |b_i|. \label{ass_6} \end{equation}\] -
The following immediate properties also hold:
\[\begin{equation} |b\:c| = |b| \: |c|, \qquad \left| \frac{b}{c}\right|= \frac{|b|}{|c|}, \qquad |-b|=|b| \qquad \forall b,c \in \mathbb{R}. \label{ass_7} \end{equation}\]