Definition 6.2: Row and Column Vectors from a Matrix The $i$:th row vector of an $r \times c$ matrix, $\mx{A}$, is denoted by $\vc{a}_{i,}^\T$, and it has
$c$ scalar elements in it.
The $i$:th column vector of $\mx{A}$ is denoted by $\vc{a}_{,i}$, which has $r$ scalar elements in it.
Using vectors, a matrix can thus be written in the following two ways,
\begin{equation}
\mx{A} = \bigl(\vc{a}_{,1} \,\,\, \vc{a}_{,2} \,\,\,\dots\,\,\, \vc{a}_{,c}\bigr)
= \left(
\begin{array}{c}
\vc{a}_{1,}^\T\\
\vc{a}_{2,}^\T\\
\vdots \\
\vc{a}_{r,}^\T\\
\end{array}
\right).
\end{equation}
Theorem 7.3: The determinant of an $n \times n$ matrix $\mx{A}$ is
\begin{equation}
\det(\mx{A}) = \sum_p \sigma(p) a_{p(1),1} a_{p(2),2} \ldots a_{p(n),n} ,
\end{equation}
where the sum is taken over all permutations $p$ and $\sigma(p)$ denotes the signature of the permutation $p$.
Theorem 7.2: Properties of the signature
For permutations we have
\begin{equation}
\begin{array}{llr}
(i) & \sigma(p) = \sigma(p^{-1}) & \\
(ii) & \sigma(p \circ q) = \sigma(p) \sigma(q)& \\
(iii) & \sigma(p) = -1 & \spc\text{(if $p$ is a transposition)}
\end{array}
\end{equation}
Theorem 7.5: The determinant of a matrix product is a product of corresponding determinants, i.e.,
\begin{equation}
\det(\mx{A} \mx{B}) = \det(\mx{A}) \det(\mx{B}).
\end{equation}
Theorem 7.6: The determinant of the inverse of a matrix is the inverse of the determinant, i.e.,
\begin{equation}
\det(\mx{A}^{-1}) = \frac{1}{\det(\mx{A})}.
\end{equation}
Theorem 7.7: Expansion Along a Row/Column The determinant of an $n \times n$ matrix $\mx{A}$ can be computed using expansion by row $i$ according to
\begin{equation}
\det(\mx{A}) = \sum_j (-1)^{i+j} a_{ij} D_{ij} .
\end{equation}
The determinant can also be computed using expansion by column $j$ according to
\begin{equation}
\det(\mx{A}) = \sum_i (-1)^{i+j} a_{ij} D_{ij} .
\end{equation}
Theorem 7.8: If $\mx{A}$ is a square matrix and $\adj(\mx{A})$ is its adjoint matrix, then
\begin{equation}
\mx{A} (\adj(\mx{A})) = (\adj(\mx{A})) \mx{A} = \det(\mx{A}) \mx{I} .
\end{equation}
If $\det(\mx{A}) \neq 0$ then $\mx{A}$ is invertible and the inverse is given by
\begin{equation}
\mx{A}^{-1} = \frac{1}{\det \mx{A}} \adj \mx{A} .
\end{equation}
Theorem 6.3: Two-Dimensional Matrix Inverse For a $2\times 2$ matrix, $\mx{A}$, the inverse is
\begin{equation}
\mx{A}^{-1} =
\begin{pmatrix}
a_{11} & a_{12} \\
a_{21} & a_{22}
\end{pmatrix}
^{-1}
=
\frac{1}{a_{11}a_{22} - a_{12}a_{21}}
\begin{pmatrix}
\hid{-}a_{22} & -a_{12} \\
-a_{21} & \hid{-}a_{11}
\end{pmatrix}
,
\end{equation}
if $a_{11}a_{22} - a_{12}a_{21} \neq 0$, otherwise, the inverse does not exist.
Theorem 6.9: Let $\mx{A}$ be a square matrix. Then the following statements are equivalent:
The column vectors of the matrix $\mx{A}$ span $\R^p$.
The row vectors of the matrix $\mx{A}$ span $\R^p$.
The equation $\mx{A} \vc{x} = \vc{y}$ has a solution for every $\vc{y}$.
The column vectors of the matrix $\mx{A}$ are linearly independent.
The row vectors of the matrix $\mx{A}$ are linearly independent.
The equation $\mx{A} \vc{x} = \vc{0}$ has only the solution $\vc{x}=\vc{0}$.
The matrix $\mx{A}$ is invertible.
Theorem 7.10: The following equivalence holds for all square matrices $\mx{A}$,
\begin{equation}
\begin{array}{ll}
(i) & \spc\text{The column vectors of}\spc \mx{A} \spc\text{is a basis} \\
(ii) & \spc\text{The row vectors of}\spc \mx{A} \spc\text{is a basis} \\
(iii) & \spc\text{The matrix equation} \spc \mx{A} \vc{x} = 0 \spc\text{has only one solution} \spc \vc{x}=0 \\
(iv) & \spc\text{The matrix equation}\spc \mx{A} \vc{x} = \vc{y} \spc\text{has a solution for every} \spc \vc{y} \\
(v) & \spc\text{The matrix} \spc \mx{A} \spc\text{is invertible} \\
(vi) & \spc\det \mx{A} \neq 0 \\
\end{array}
\end{equation}
In this chapter, we will introduce the determinant, which is a number associated with a square matrix.
The determinant has many important uses. One such use is that the system of $n$ linear equations $\mx{A}\vc{x}=\vc{b}$ in $n$ unknowns, has one and only one solution if and only if the determinant of $\mx{A}$ is nonzero.
There are many other uses and interpretations of the determinant as we will see later on in the chapter.
Example 7.1:The Fundamental Matrix
In Interactive Illustration 5.2, we saw a 3D reconstruction of a number of so called feature points from a set of images.
The problem of calculating both 3D points and at the same time calculating how the camera has moved between images is an interesting problem. A first step of solving this involves understanding how to solve the problem for just two images. One technique involves the so called fundamental matrix that relates corresponding points in two images. The determinant is used to derive this constraint. Assume that two different images of the same scene are given. A point in the left image with coordinates $(x_1,y_1)$ and a point in the right image with coordinates $(x_2,y_2)$ can only be in correspondence if
and $\mx{F}$ is a $3 \times 3$ matrix related to the relative motion between the two camera positions.
In the example figure, $\mx{F}= \left(\begin{array}{ccc} 1.055 & 58.10 & -58.96 \\ 58.60 & -0.044 & -336.0 \\ -55.52 & 228.3 & 110.5 \end{array}\right)$.
Interactive Illustration 7.1:
A point in the left image with coordinates $(x_1,y_1)$ and a point in the right image with coordinates $(x_2,y_2)$ could be in correspondence only if $\vc{u}_1^\T \mx{F} \vc{u}_2 = 0$. Here $u_1 = (x_1,y_1,1)$ and $u_2 = (x_2,y_2,1)$. Try moving the image points to get them in correspondence. Images courtesy of Carl Olsson at Lund University.
Interactive Illustration 7.1:
The epipolar line corresponds to all the points in the other image for which $\vc{u}_1^\T \mx{F} \vc{u}_2 = 0$. It therefore contains the true corresponding point. Move the point in one image to see how the epipolar line moves in the other image. Notice how the line always intersects the corresponding point.
Interactive Illustration 7.1:
These are the points that were used to calculate the fundamental matrix $\mx{F}$.
Interactive Illustration 7.1:
A point in the left image with coordinates $\hid{(x_1,y_1)}$ and a point in the right image with coordinates $\hid{(x_2,y_2)}$ could be in correspondence only if $\hid{\vc{u}_1^\T \mx{F} \vc{u}_2 = 0}$. Here $\hid{u_1 = (x_1,y_1,1)}$ and $\hid{u_2 = (x_2,y_2,1)}$. Try moving the image points to get them in correspondence. Images courtesy of Carl Olsson at Lund University.
The determinant is a function from a matrix $\mx{A}$ to a value $\det(\mx{A})$. We will later see that the determinant can be defined using three simple properties. However, before delving into the details we will first look at explicit expressions for the determinant in dimensions one, two and three.
For $1 \times 1$ matrices
\begin{equation}
\mx{A} = \left(
\begin{array}{r}
a
\end{array}
\right)
\end{equation}
(7.3)
the determinant is simply $\det(\mx{A}) = a$.
This is the length, with sign, of the vector
\begin{equation}
\vc{a} = \left(
\begin{array}{r}
a
\end{array}
\right) .
\end{equation}
(7.4)
Here it is straightforward to see that the equation $ \mx{A} \vc{x} = \vc{b} $ has a unique solution when $\det(\mx{A}) = a \neq 0$.
When the determinant is zero, there could be no solutions, if $\vc{b} \neq \vc{0}$.
As an example for $1\times 1$ matrices, i.e., where the equation reduces to $ax=b$, assume that $a x = 3$ has no solutions if $a=0$.
If $b = 0 $, there are infinitely many solutions $x$ since the equation now reads $0 x = 0$.
the determinant is $\det(\mx{A}) = a_{11} a_{22} - a_{12} a_{21}$.
The determinant is sometimes written with a single straight line as left and right brackets, thus we would write the above as
then the determinant is the area (with sign) of the parallelogram spanned by $\vc{a}_{,1}$ and $\vc{a}_{,2}$.
Recall the notation of column and row vectors from Definition 6.2.
This is visualized in Interactive Illustration 7.2.
The sign of the determinant is positive (negative) if the two vectors are positively (negatively) oriented. This is illustrated with a green (red) parallelogram in the illustration. Try changing the sign of the determinant in the illustration.
Interactive Illustration 7.2:
In this interactive illustration, we visualize a $2\times 2$ matrix, $\mx{A}$,
as the two column vectors, $\vc{a}_{,1}$ and $\vc{a}_{,2}$, that it consists of, i.e.,
$\mx{A} = \bigl(\textcolor{#aa0000}{\vc{a}_{,1}}\,\, \textcolor{#00aa00}{\vc{a}_{,2}} \bigr)$.
Note that the column vectors can be moved in this illustration.
Interactive Illustration 7.2:
In this interactive illustration, we visualize a $\hid{2\times 2}$ matrix, $\hid{\mx{A}}$,
as the two column vectors, $\hid{\vc{a}_{,1}}$ and $\hid{\vc{a}_{,2}}$, that it consists of, i.e.,
$\hid{\mx{A} = \bigl(\textcolor{#aa0000}{\vc{a}_{,1}}\,\, \textcolor{#00aa00}{\vc{a}_{,2}} \bigr)}$.
Note that the column vectors can be moved in this illustration.
the determinant is $\det(\mx{A}) = a_{11} a_{22} a_{33} + a_{12} a_{23} a_{31} + a_{13} a_{21} a_{32} - a_{11} a_{23} a_{32} - a_{12} a_{21} a_{33} - a_{13} a_{22} a_{31}$.
If we think of the three columns as the coordinates of three vectors in space, i.e.,
then the determinant is the volume of the parallelepiped spanned by $\vc{a}_1$, $\vc{a}_2$, and $\vc{a}_3$.
In Interactive Illustration 7.3, the volume of the
parallelepiped spanned by $\vc{a}_{,1}$, $\vc{a}_{,2}$, and $\vc{a}_{,3}$ is visualized.
Interactive Illustration 7.3:
Here, we visualize the three column vectors, $\textcolor{#aa0000}{\vc{a}_{,1}}$,
$\textcolor{#00aa00}{\vc{a}_{,2}}$,
and $\textcolor{#0000aa}{\vc{a}_{,3}}$ of a $3\times 3$ matrix, $\mx{A}$.
Note that the gray, dashed lines are only in this illustration to help reveal
the three-dimensional locations of the vectors.
Again, as an exercise, it may be useful to attempt to move the vectors so that they
form the identity matrix,
$\Bigl( \begin{smallmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{smallmatrix} \Bigr)$, for example.
Recall that you can change the viewpoint by right-clicking, pressing and moving the mouse,
or slide with two fingers pressed on a tablet. It is difficult to percieve the volume of the parallelepiped from a single viewpoint. Try changing the vectors so that the determinant is zero without making any of the vectors to be of zero length. Then rotate the viewpoint. Does it look like the vectors are in a plane?
Interactive Illustration 7.3:
Here, we visualize the three column vectors, $\hid{\textcolor{#aa0000}{\vc{a}_{,1}}}$,
$\hid{\textcolor{#00aa00}{\vc{a}_{,2}}}$,
and $\hid{\textcolor{#0000aa}{\vc{a}_{,3}}}$ of a $\hid{3\times 3}$ matrix, $\hid{\mx{A}}$.
Note that the gray, dashed lines are only in this illustration to help reveal
the three-dimensional locations of the vectors.
Again, as an exercise, it may be useful to attempt to move the vectors so that they
form the identity matrix,
$\hid{\Bigl( \begin{smallmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{smallmatrix} \Bigr)}$, for example.
Recall that you can change the viewpoint by right-clicking, pressing and moving the mouse,
or slide with two fingers pressed on a tablet. It is difficult to percieve the volume of the parallelepiped from a single viewpoint. Try changing the vectors so that the determinant is zero without making any of the vectors to be of zero length. Then rotate the viewpoint. Does it look like the vectors are in a plane?
In the following, we relax our notation a little so that a column vector $\vc{a}_{,i}$ of a matrix $\mx{A}$ also can be denoted $\vc{a}_i$.
There are several different ways one could define the determinant.
What definitions one use is a technicality and the end result is the same.
Here we define the determinant for a general $n \times n$ matrix $\mx{A}$ using three basic properties according to the following definition.
Definition 7.1:Determinant
The determinant $\det$ is a scalar function of a square matrix $\mx{A}$ fulfilling the following three properties:
\begin{equation}
\begin{array}{llr}
(i) & \det( \mx{I}) = 1 & \spc\text{(determinant of unit matrix)} \\
(ii) & \begin{vmatrix} \ldots & \vc{a}_i & \ldots & \vc{a}_i & \ldots \end{vmatrix} = 0
& \spc\text{(zero if two columns are equal)} \\
(iii) & \begin{vmatrix} \ldots & \lambda_1 \vc{a}_1 + \lambda_2 \vc{a}_2 & \ldots \end{vmatrix} =
\lambda_1 \begin{vmatrix} \ldots & \vc{a}_1 & \ldots \end{vmatrix} +
\lambda_2 \begin{vmatrix} \ldots & \vc{a}_2 & \ldots \end{vmatrix}
& \spc\text{(linear in each column)} \\
\end{array}
\end{equation}
(7.10)
It turns out that there is one and only one function that fulfills these three properties.
The proof of the existence and uniqueness of the determinant is a bit
technical and is of less importance than the properties of the determinant.
In order not to obscure the view we leave these proofs for Section 7.3.
From these three basic properties follow many other useful properties which we
summarize in the Theorem 7.1.
which proves the statement.
We leave the proofs of statements $(vii)$, $(viii)$ and $(ix)$ for later.
$\square$
On the surface, statement $(vi)$ can seem counterintuitive since the determinant is connected to the area or volume spanned by the column vectors, and adding something to a column vector will make it longer. How come the area stays the same even though one of the vectors become longer? The reason is illustrated in Interactive Illustration 7.4.
Interactive Illustration 7.4:
In this interactive illustration, we visualize what happens to the area spanned by the column vectors when we add a multiple of one column vector to the other column vector. In step one we have the matrix $\mx{A} = \bigl(\textcolor{#0000aa}{\vc{a}_{,1}}\,\, \textcolor{#00aa00}{\vc{a}_{,2}} \bigr)$ that consists of the two column vectors $\textcolor{#0000aa}{\vc{a}_{,1}}$ and $\textcolor{#00aa00}{\vc{a}_{,2}}$. The area spanned by the two column vectors is marked with blue.
Interactive Illustration 7.4:
In the second matrix $\mx{A'} = \bigl(\textcolor{#aa0000}{\vc{a}_{,1} + \lambda \vc{a}_{,2}}\,\, \textcolor{#00aa00}{\vc{a}_{,2}} \bigr)$, the first column is the old column plus a multiple $\lambda$ times the second column. The second column is left unchanged. The area spanned by the columns of $\mx{A'}$ is marked with pink (and purple where the areas overlap). Note that when increasing $\lambda$ (using the slider), the vector $\textcolor{#aa0000}{\vc{a}_{,1} + \lambda \vc{a}_{,2}}$ becomes longer, but the parallelogram shears increasingly, couteracting the length increase, and the area stays the same. Note how the pink triangle where there is no overlap matches exactly the blue triangle.
Interactive Illustration 7.4:
In the second matrix $\hid{\mx{A'} = \bigl(\textcolor{#aa0000}{\vc{a}_{,1} + \lambda \vc{a}_{,2}}\,\, \textcolor{#00aa00}{\vc{a}_{,2}} \bigr)}$, the first column is the old column plus a multiple $\hid{\lambda}$ times the second column. The second column is left unchanged. The area spanned by the columns of $\hid{\mx{A'}}$ is marked with pink (and purple where the areas overlap). Note that when increasing $\hid{\lambda}$ (using the slider), the vector $\hid{\textcolor{#aa0000}{\vc{a}_{,1} + \lambda \vc{a}_{,2}}}$ becomes longer, but the parallelogram shears increasingly, couteracting the length increase, and the area stays the same. Note how the pink triangle where there is no overlap matches exactly the blue triangle.
This subsection contains the proof that there actually is a function that is fulfilling the properties in
Definition 7.1, that there is only one such function, and also a
formula for calculating the determinant. To complete this proof we need to introduce the notion of
a permutation of $n$ numbers.
The main idea of permutations is really quite simple and is best exemplified by
using properties $(i)-(vi)$ on a general $2 \times 2 $ matrix.
Example 7.3: We study the determinant of a general $2 \times 2$ matrix
In the above equation, the first and the last determinants are zero because they have two identical columns.
The second determinant is $1$ according to property (i) of the definition. The third determinant is $-1$ since
In this example we calculated a $2 \times 2$ determinant by expanding each column.
By doing this for a general $n \times n$ matrix, one obtains an explicit expression for the determinant.
This expression is best expressed using the concept of a permutation of $n$ numbers.
Definition 7.2:
A permutation $p$ of $n$ elements is a bijection from the set $\{ 1, 2, \ldots, n \}$ to itself.
A permutation $p$ is specified by how it acts on the set, i.e., by the numbers $p(1), p(2), \ldots, p(n)$.
Since $p$ is a bijection, each number $\{ 1, 2, \ldots, n \}$ occurs precisely once in the list $p(1), p(2), \ldots, p(n)$.
In other words the numbers are re-arranged or permuted. Sometimes the notation $p = [p(1), p(2), \ldots, p(n)] $ is used.
Definition 7.3:
A transposition is a permutation where two elements change places and the other elements are fixed.
Example 7.4: The permutation $p = [1 2 4 3]$ is a transposition, since the elements $3$ and $4$ change place and the other elements, i.e., $1$ and $2$ are fixed.
Definition 7.4:
The inverse $p^{-1}$ of a permutation is defined as the inverse of the corresponding function.
Example 7.5: Let $p = [2 3 4 1]$ be a permutation of $4$ numbers. This means that $p = [p(1) p(2) p(3) p(4)] = [2 3 4 1]$. What is the inverse $p^{-1}$. Since $p(1)=2$, then $p^{-1}(2) = 1$. Thus $p^{-1} = [? 1 ? ?]$. Since $p(2)=3$, then $p^{-1}(3)=2$. Thus $p^{-1} = [? 1 2 ?]$. Similarily, $p(3)=4$ and $p(4)=1$ gives $p^{-1}(4)=3$ and $p^{-1}(1)=4$. This gives
$p^{-1} = [4 1 2 3]$.
If $p$ is a permutation of $n$ elements, there are ${n \choose 2}$ pairs of numbers $(p(i),p(j))$. Some of these are in the correct order, i.e., $((p(i),p(j))$ are in the same order as $(i,j)$. If on the other hand $(p(i),p(j))$ are in the wrong order as compared to $(i,j)$, then the pair is called an inversion.
Definition 7.5:
Here ${n \choose 2}$ is the binomial coefficient, ${n \choose k} = \frac{n!}{k! (n-k)!}$. One of the many interesting properties of the binomial coefficient is that there are ${n \choose k}$ ways to choose $k$ out of a set of $n$ elements.
Definition 7.6:
A permutation is called even if the number of inversions are even and called odd if the number of inversions are odd.
Definition 7.7:
The signature $\sigma$ of a permutation $p$, here denoted $\sigma(p)$ is
\begin{equation}
\sigma(p) = \begin{cases} +1 &\mbox{if $n$ is an even permutation} \\
-1 &\mbox{if $n$ is an odd permutation} . \end{cases}
\end{equation}
(7.27)
Theorem 7.2:Properties of the signature
For permutations we have
Here $\circ$ is used to denote composition, i.e., $p \circ q$ is the permutation that is the result of first permuting according to $q$ and then permuting according to $p$. (More generally composition is used for combining two functions. The composed function $f = g \circ h$ is such that $f(x) = g(h(x))$, i.e., first using function $h$ and then using $g$ on the result.)
A permutation $p$ of $n$ elements can be represented as an $n \times n$ matrix $\mx{E}_p$, so that $\mx{E}_p$ is zeroes except for the elements $(p(1),1), (p(2),2) \ldots, (p(n),n)$. These elements are set to one. The determinant of $\mx{E}_p$ is particularly simple to calculate. We have $\det(\mx{E}_p) = \sigma(p)$.
We are now ready to state a theorem, that gives an explicit formula for the determinant in general dimensions.
Theorem 7.3:
The determinant of an $n \times n$ matrix $\mx{A}$ is
If we carried out the same expansion as in Example 7.3 for a general $n \times n$ matrix, then each time we expand a column, we would obtain $n$ times as many terms. After expanding all $n$ columns we would get the determinant as a sum of $n^n$ terms. Some of these terms vanish because the determinant have equal columns. In the example the first and the last of the four terms vanished. After removing these we
get
where the sum is taken over $n!$ permutations $p$ of the $n$ numbers.
So if there exists a function fulfilling the three criteria $(i)$, $(ii)$, and $(iii)$, it can be calculated as
To complete the proof, we need to show that the expression above fulfills the three criteria $(i)$, $(ii)$, and $(iii)$.
The expression above is linear in each column, $(i)$, since it is a sum, where each term is linear in each column. The expression is one for the identity matrix $\mx{I}$, $(ii)$. What remains to be shown is $(iii)$ that the function is zero if two columns are equal.
Without loss of generality, we can assume that the two columns in question are columns $1$ and $2$. For every permutation
$p = [p(1), p(2), p(3), \ldots, p(n)] $, there is another permutation $q = [p(2), p(1), p(3), \ldots, p(n)] $, where the values of the two first elements are transposed. Here we have $\sigma(p) = -\sigma(q)$. The expression is a sum of double terms of type
This concludes the proof that there exists one and only one function fulfilling properties $(i)$, $(ii)$, and $(iii)$ and
that this function $\det$ follows Equation (7.29).
$\square$
Thus the determinants of orders $1$, $2$, and $3$ consists of $1$, $2$, and $6$ terms in accordance
with the previous example.
There are relatively easy patterns that one can use to remember the $2 \times 2$ determinant. Write the matrix and think about a cross. The elements on the diagonal should be multiplied and then subtract the product of the other diagonal according to the following illustration.
i.e., $a_{11} a_{22} - a_{21} a_{12}$.
For $3 \times 3$ matrices, there is also a pattern that can be used to remember the determinant. Put the columns of the matrix, $\vc{a}_1$, $\vc{a}_2$, and $\vc{a}_3$ twice,
according to the following pattern,
i.e., $+a_{11}a_{22}a_{33} +a_{12}a_{23}a_{31} +a_{13}a_{21}a_{32} -a_{11}a_{23}a_{32} -a_{12}a_{21}a_{33} -a_{13}a_{22}a_{31}.$
Note, however, that there is no similar simple pattern for calculating the determinant of a larger matrix, for example, there is no simple pattern for calculating the determinant of a $4 \times 4$ matrix.
Note also that the number of terms grows quickly, e.g., $24$ terms for matrices
of size $4 \times 4$ and $120$ terms for a $5 \times 5$ matrix.
Each term can be reordered so that
$a_{1,p(1)} a_{2,p(2)} \ldots a_{n,p(n)} = a_{q(1),1} a_{q(2),2} \ldots a_{q(n),n}$, where
$q = p^{-1}$.
Since $\sigma(p) = \sigma(p^{-1}) = \sigma(q)$ according to Theorem 7.2, we get
where $\vc{b}_j$ is column $j$ of matrix $\mx{B}$.
Now study each column $\mx{A} \vc{b}_j$ of the product $\mx{A} \mx{B}$. Each such column $\mx{A} \vc{b}_j$ is a linear
combination of columns $\vc{a}_i$ of $\mx{A}$,
The determinant in the sum is zero if two of the columns are equal. Thus the terms are only relevant for permutations $p$. After rearrangements of the columns we get
In Interactive Illustration 7.5, Theorem 7.6 is shown for $2\times 2$ matrices.
For example, if you make the area of the parallelogram
of $\mx{A}$ smaller, then the area of the parallelogram of $\mx{A}^{-1}$ becomes larger and vice versa.
Interactive Illustration 7.5:
In this interactive illustration, we visualize a $2\times 2$ matrix, $\mx{A}$,
as the two column vectors, $\vc{a}_{,1}$ and $\vc{a}_{,2}$, that it consists of, i.e.,
$\mx{A} = \bigl(\textcolor{#aa0000}{\vc{a}_{,1}}\,\, \textcolor{#00aa00}{\vc{a}_{,2}} \bigr)$.
Both $\textcolor{#aa0000}{\vc{a}_{,1}}$ and $\textcolor{#00aa00}{\vc{a}_{,2}}$
can be moved in this illustration.
Recall that the area of the parallelogram is essentially the determinant of the matrix (without sign),
and due to Theorem 7.6, the parallelogram of the inverse becomes
smaller if the parallelogram of $\mx{A}$ becomes bigger and vice versa.
Interactive Illustration 7.5:
In this interactive illustration, we visualize a $\hid{2\times 2}$ matrix, $\hid{\mx{A}}$,
as the two column vectors, $\hid{\vc{a}_{,1}}$ and $\hid{\vc{a}_{,2}}$, that it consists of, i.e.,
$\hid{\mx{A} = \bigl(\textcolor{#aa0000}{\vc{a}_{,1}}\,\, \textcolor{#00aa00}{\vc{a}_{,2}} \bigr)}$.
Both $\hid{\textcolor{#aa0000}{\vc{a}_{,1}}}$ and $\hid{\textcolor{#00aa00}{\vc{a}_{,2}}}$
can be moved in this illustration.
Recall that the area of the parallelogram is essentially the determinant of the matrix (without sign),
and due to \linkref{Theorem}{theo_determinant_inverse}, the parallelogram of the inverse becomes
smaller if the parallelogram of $\hid{\mx{A}}$ becomes bigger and vice versa.
We start this section with the definition of minor, which is a scalar value that can be computed from a square matrix.
Definition 7.8:Minor
Assume that $\mx{A}$ is an $n \times n$ matrix. The minor, denoted $D_{ij}$, is the determinant of the $(n-1) \times (n-1)$
matrix that you obtain after removing row $i$ and column $j$ in $\mx{A}.$
These determinants are often called minors or first minors of the matrix.
of the canonical basis $\vc{i}_1, \ldots, \vc{i}_n$, where $\vc{i}_j$ is all zeroes except in the $j$:th element which is a one.
Using the linearity of the determinant (property $(iii)$ in Theorem 7.1),
the determinant can be written as
where $\mx{B}_i$ is a matrix which is identical to $\mx{A}$ except that column $j$ has been exchanged with $\vc{i}_i$.
After $i-1$ swaps of rows and $j-1$ swaps of of columns we get
$\det(\mx{B}_i) = (-1)^{i+j} \det(\mx{C}_i)$,
where
Expansion along a row or column is particularily useful if there are a lot of zeros in that row or column. This is illustrated in the following example
Example 7.9:The determinant of a triangular matrix
The determinant of a triangular matrix is the product of the diagonal elements.
This is easy to see using expansion along rows or columns. For example, what is the determinant of
Thus the determinant is the product of the diagonal elements.
Example 7.10:Adding one column to another
Adding (or subtracting) a multiple of one column to another column does not change the determinant according to property (vi). This can sometimes be useful to simplify the calculations.
Here is an example
In the first step we subtracted column 2 from column 3. Then we subtracted column 1 from the new column 2. In the final step we used the fact that the determinant of a triangular matrix is the product of the diagonal elements
(see Example 7.9).
In this section, we will introduce the adjoint matrix $\adj( \mx{A} )$ to a square matrix $\mx{A}$.
Definition 7.9:Adjoint matrix
The adjoint matrix $\adj( \mx{A} )$ is a matrix whose elements at position $(i,j)$ is
$(-1)^{i+j} D_{ji}$, where similar to the previous section $D_{ij}$ is the determinant of the matrix $A$ after removing row $i$ and column $j$.
Notice that we used $D_{ji}$ and not $D_{ij}$ in the definition.
Example 7.11: When calculating the adjoint of a $2 \times 2$ matrix
we first need to calculate the determinants $D_{ij}$.
Here $D_{11}$ is the determinant of the matrix obtained when removing row $1$ and column $1$. This
gives $D_{11}=a_{22}$. In the same way $D_{12} = a_{21}$, $D_{21} = a_{12}$ and $D_{22} = a_{11}$.
Thus the adjoint is
Here for example $\adj(\mx{A})_{12} = -D_{21} = -a_{12}$.
Notice that the two elements on the diagonal changed place and that the two elements on the off diagonal (i.e., not on
the main diagonal) changed sign.
The adjoint matrix is closely related to the inverse, through the following theorem.
Theorem 7.8:
If $\mx{A}$ is a square matrix and $\adj(\mx{A})$ is its adjoint matrix, then
where $(\adj \mx{A})_{ji}$ is the element (scalar value) of the adjoint of $\mx{A}$ at row $j$ and column $i$, and $a_{ij}$
is the element of $\mx{A}$ at row $i$ and column $j$ as usual.
Here the last equation comes from Theorem 7.7, concerning expansion of the determinant.
For the off diagonal elements $b_{ij}$ with $i\neq j$, we have
Here the last equality comes from the fact that $\sum_i (-1)^{i+k} D_{ij} a_{ki} a_{kj}$ is
the expression for calculating the determinant of the matrix $\mx{A}$ where column $j$ is replaced by column $i$. Since $i \neq j$ there are two equal columns in this modified matrix and therefore the determinant is zero.
$\square$
Example 7.12: The inverse of a $2 \times 2$ matrix is particularly easy to calculate using Theorem 7.8.
We saw in Example 7.11 that for a general $2 \times 2$ matrix
In this section, Cramer's rule will be introducted. It is useful when you want the solution $\vc{x}$ to
$\mx{A}\vc{x}=\vc{y}$ without needing to know the inverse matrix of $\mx{A}$.
Theorem 7.9:
If $\mx{A}$ is a square matrix and $\det \mx{A} \neq 0$ then the solution $\vc{x}$ to the matrix equation $\mx{A}\vc{x} = \vc{y}$ has
In other words by exchanging column $i$ in $\mx{A}$ with the right hand side $\vc{y}$, and then calculating the determinant of this matrix and dividing by the determinant of $\mx{A}$, we directly obtain coordinate $i$ of the solution vector $\vc{x}$.
It almost seems too easy.
In the sum above, whenever $j \neq i$, then the determinant is zero, because there are two identical columns. But for $j=i$ we get the end result $x_i \det \mx{A}$. This concludes the proof
In Interactive Illustration 7.6, we solve for $\vc{z}$ in a system of
equations $\mx{A}\vc{z}=\vc{b}$ using Cramer's rule.
Interactive Illustration 7.6:
In this interactive illustration, we visualize a $2\times 2$ matrix, $\mx{A}$,
as the two column vectors, $\vc{a}_{,1}$ and $\vc{a}_{,2}$, that it consists of, i.e.,
$\mx{A} = \bigl(\textcolor{#aa0000}{\vc{a}_{,1}}\,\, \textcolor{#00aa00}{\vc{a}_{,2}} \bigr)$.
We want to solve $\mx{A}\vc{z} = \vc{b}$ and this is being done as $\vc{z} = \mx{A}^{-1}\vc{b}$.
To make it clearer in the figure, we use $\vc{z}=(x,y)$.
Note that the column vectors can be moved in this illustration and that $\vc{b}$ is the black arrow.
The solution $\vc{z}=(x,y)$ is solved by using Cramer's rule.
Interactive Illustration 7.6:
In this interactive illustration, we visualize a $\hid{2\times 2}$ matrix, $\hid{\mx{A}}$,
as the two column vectors, $\hid{\vc{a}_{,1}}$ and $\hid{\vc{a}_{,2}}$, that it consists of, i.e.,
$\hid{\mx{A} = \bigl(\textcolor{#aa0000}{\vc{a}_{,1}}\,\, \textcolor{#00aa00}{\vc{a}_{,2}} \bigr)}$.
We want to solve $\hid{\mx{A}\vc{z} = \vc{b}}$ and this is being done as $\hid{\vc{z} = \mx{A}^{-1}\vc{b}}$.
To make it clearer in the figure, we use $\hid{\vc{z}=(x,y)}$.
Note that the column vectors can be moved in this illustration and that $\hid{\vc{b}}$ is the black arrow.
The solution $\hid{\vc{z}=(x,y)}$ is solved by using Cramer's rule.
From Theorem 6.9 we know that $(i), (ii), (iii), (iv),(v)$ are equivalent. Here we only need to prove that these are also equivalent to $(vi)$.
If $\det \mx{A} \neq 0$ then the matrix is invertible due to Theorem 7.8.
On the other hand if the matrix $\mx{A}$ is invertible then we know from Theorem 7.8 that $\det \mx{A} \det \mx{A}^{-1} = 1$ that both $\det \mx{A} \neq 0$ and $\det \mx{A}^{-1} \neq 0$.
$\square$
Example 7.14:Three points on a line
Use the determinant to derive a constraint to check that three points $(x_1,y_1)$, $(x_2,y_2)$ and $(x_3,y_3)$ are co-linear, i.e. that they lie on a line.
If the three points are co-linear, then there exists a line, say $ax+by+c = 0$ such that the three points all lie on that line. In other words we have
\begin{equation}
a x_1+b y_1+c = 0 \\
a x_2+b y_2+c = 0 \\
a x_3+b y_3+c = 0 .
\end{equation}
This is an equation of type $\mx{A}\vc{s}=0$, where $\vc{s} = (a, b, c)$.
According to Theorem 7.10 this has only the solution $a=b=c=0$ if $\det{\mx{A}} \neq 0$, which means that the points do not lie on a line. If on the other hand $\det{\mx{A}} = 0$, then is at least one non-zero solution to the problem. Each solution $\vc{x}$ corresponds to a line. Notice, however, that rescaling a solution
$\lambda \vc{s}$ corresponds to the same line as $\vc{s}$.
Example 7.15:The Fundamental Matrix
In Interactive Illustration 5.2, we saw that the position of a 2D point in the first image is constrained by the position of the corresponding 2D point in the other image. The reason is that these 2D points are both projections of the same 3D point.
There is a relatively simple model for the projection of a 3D point with coordinates $(u_1,u_2,u_3)$ onto the 2D image point $\vc{v} = (v_1,v_2)$. The model becomes simpler by using so called homogeneous coordinates. Points are then represented as column vectors with an additional coordinate set to one. In this representation the 3D point is represented as
using matrix and vector notation.
In this model equation, $\mx{P}$ is the so called camera matrix . It contains the parameters of the position and orientation of the camera and $\lambda$ is a scalar. Because of the $\lambda$ in the equation, the model is non-linear. Nevertheless methods from linear algebra are crucial for the analysis and understanding of the problem.
Assume that two images are given, where $\mx{P}_L$ is the camera matrix corresponding to the first image and $\mx{P}_R$ is the camera matrix for the second image. Assume that one 3D point with homogeneous coordinate vector $\vc{u}$ is seen in both images. In the first image, the homogeneous coordinate vector is $\vc{v}_L$ and in the other image the vector is $\vc{v}_R$.
The camera matrix equations for these two images are
Notice that the matrices and vectors are made out of blocks of other matrices or vectors. One often talks of block matrices.
The matrix equation is of type $\mx{A} \vc{x} = \vc{0}$. Here $\mx{A}$ is a square matrix of size $6 \times 6$. Notice that the matrix equation has a solution $\begin{pmatrix}\vc{u}\\-\lambda_L \\-\lambda_R \end{pmatrix}$ that is not the zero vector. According to Theorem 7.10, this means that
$\det \mx{A} = 0$.
If we expand the determinant first along the fifth column and then along the sixth column we obtain
Here the elements of $\mx{F}$ are determinants of $4\times 4$ matrices involving the elements of the two camera matrices.
Popup-help:
A basis (bases in plural) is a set of linearly independent (basis) vectors, such that each vector in the space
can be described as a linear combination of the basis vectors.
If the basis is $\{\vc{e}_1,\vc{e}_2,\vc{e}_3\}$, then any vector $\vc{v}$ in the space can be described by
three numbers $(x,y,z)$ such that $\vc{v} = x\vc{e}_1 +y\vc{e}_2 +z\vc{e}_3$. Often the basis is implicit,
in which case we write $\vc{v} = (x,y,z)$, or to make it possible to distinguish between vector elements from
one vector $\vc{v}$ to another $\vc{u}$, we may use $\vc{v}=(v_x,v_y,v_z)$ and $\vc{u}=(u_x,u_y,u_z)$ as notation.
Popup-help:
An $n$-dimensional column vector, $\vc{v}$, is represented with respect to a basis and consists of a column of $n$ scalar values.
The vector elements are sometimes denoted $v_1$, $v_2$,..., $v_n$. For two- and three-dimensional vectors, we sometimes
also use $v_x$, $v_y$, and $v_z$.
The notation is
where $\vc{u} = u_x \vc{e}_1$, $\vc{v} = v_x \vc{e}_1 + v_y \vc{e}_2$,
and $\vc{w} = w_x \vc{e}_1 + w_y \vc{e}_2 + w_z \vc{e}_3$.
Note that $\vc{e}_i$ are the basis vectors.
In our text, we also use the shorthand notation $\vc{w} = \bigl(w_1,w_2,w_3\bigr)$, which means the same as above
(notice the commas between the vector elements).
A row vector does not have any commas between, though.
Popup-help:
A homogeneous system of equations is one such that $\mx{A}\vc{x}=\vc{0}$.
Popup-help:
On parameterized form, a line is defined by a starting point, $S$, and a line direction $\vc{d}$, and a scalar
parameter, $t$, such that any point on the line can be obtained from the line equation, i.e.,
$P(t) = S + t\vc{d}$. This representation works in any dimension.
On implicit form, a line is defined by a starting point, $S$, and a normal vector, $\vc{n}$. For any point, $P$,
on the line, it holds that $\vc{n}\cdot (P-S) = 0$. This representation works only in two dimensions.
Popup-help:
A systems of equations is called linear if it only contains polynomial terms of the zero:th and first order,
that is, either constants or first-order terms, such as $9x$, $-2y$, and $0.5z$.
Popup-help:
The vector, $\vc{u}$, is a linear combination of the vectors, $\vc{v}_1,\dots,\vc{v}_n$ if
$\vc{u}$ is expressed as $\vc{u} = k_1\vc{v}_1 + k_2\vc{v}_2 + \dots + k_n \vc{v}_n$.
Popup-help:
Assume that $\mx{A}$ is an $n \times n$ matrix. The minor, denoted $D_{ij}$, is the determinant of the $(n-1) \times (n-1)$
matrix that you obtain after removing row $i$ and column $j$ in $\mx{A}$.
Popup-help:
A mapping $F$ is non-linear if it violates one or both of these rules:
Popup-help:
In two dimensions, positive orientation is the same as anti-clockwise order, while negative orientation is clock-wise order.
Two vectors $\vc{u}$ and $\vc{v}$ in a plane are positively oriented if $\vc{u}$ can be rotated in positive orientation so
that the smallest angle $[\vc{u},\vc{v}]$ becomes zero.
For three-dimensional vectors, assume that $\vc{u}$, $\vc{v}$, and $\vc{w}$ are all starting at a common origin.
The vectors, $\vc{u}$, $\vc{v}$, and $\vc{w}$, are said to be positively oriented if you imagine
that you are sitting at the tip of $\vc{w}$, and looking towards the origin, and if $\vc{u}$ and $\vc{v}$
are positively oriented as seen from that position. The same is true for a set of negatively oriented
vectors, except that $\vc{u}$ and $\vc{v}$ must be negatively oriented as seen from that position.
Popup-help:
A parallelepiped is a three-dimensional figure whose six faces all are parallelograms. It suffices with three vectors
to define a parallelepiped. The signed volume, $V$, of a parallelepiped is the scalar triple product of those three defining
vectors, e.g., $V_s = (\vc{u} \times \vc{v}) \cdot \vc{w}$
Popup-help:
A parallelogram is a quadrilateral (polygon with four vertices), where the opposite sides are of equal length.
This makes the opposite angles inside the parallelogram equal as well, and the opposite sides are indeed also parallel.
Popup-help:
On parameterized form (also called explicit form), a plane equation is given by $P(t_1, t_2) = S + t_1 \vc{d}_1 + t_2\vc{d}_2$,
where $S$ a point in the plane and $\vc{d}_1$ and $\vc{d}_2$ are two non-parallel non-zero vectors
on the plane. Using the parameters $t_1$ and $t_2$, any point $P(t_1,t_2)$ can be reached.
On implicit form, a plane equation is given by $\vc{n}\cdot(P-S)=0$, where $\vc{n}$ is the normal of
the plane and $S$ is a point on the plane. Only for points, $P$, that lie in the plane is the
formula equal to $0$.
Popup-help:
Projection is a mapping from one set onto a smaller set (i.e., a subset) of that set. For example, if a 3D point
is projected to the closest point on a plane, then starting set was all 3D points which was reduced to
the points in the plane using projection.
Popup-help:
A row vector is column vector that has been transposed so that the column now is a row.
In this book, column vector are the default vectors, and a row vector can thus be produced
from a column vector, $\vc{v}$, simply by transposing, i.e., $\vc{v}^\T$.
A row vector is thus $\vc{v}^\T = \bigl(v_1\ \ v_2 \ \ v_3\bigr)$. Note the spaces between the vector elements.
This is in contrast to a column vector,
$\vc{w} = \begin{pmatrix} w_1 \\ w_2 \\ w_3 \end{pmatrix}$.
Popup-help:
A system of equations with $n$ equations is called triangular if row $i$, where $i\in\{1,\dots,n\}$,
has $n-i+1$ free variables.
Popup-help:
The length of a vector, $\vc{v}$, is denoted $\ln{\vc{v}}$. In an orthonormal basis,
the squared length is $\ln{\vc{v}}^2 = \vc{v}\cdot\vc{v}$, i.e., $\ln{\vc{v}} = \sqrt{\vc{v}\cdot\vc{v}}$.
For a three-dimensional vector, for example, this simplifies to $\ln{\vc{v}} = \sqrt{v_x^2 + v_y^2 + v_z^2}$.
Popup-help:
The zero vector, $\vc{0}$, has length 0, and can be created from one point, $P$, as $\vc{0}=\overrightarrow{PP}.$