Difference between revisions of "Determinant of a matrix"

From Robotics
Jump to: navigation, search
 
(48 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Navigation|before=[[Minors and cofactors]]|overview=[[Matrices]]|next=[[Matrix inversion]]}}
+
__NOTOC__
 +
{{Navigation|before=[[Multiplication of matrices]]|overview=[[Matrices]]|next=[[Minors and cofactors]]}}
 +
{{Exercise|Selftest: The determinant of a matrix}}
  
 
The determinant can be computed for an n-by-n square matrix. In the context of matrices the determinant of a matrix is a special function that assigns a scalar value to the matrix. It is denoted with <math>\det(\mathbf{A})</math> or in matrix structure with vertical lines:<br/>
 
The determinant can be computed for an n-by-n square matrix. In the context of matrices the determinant of a matrix is a special function that assigns a scalar value to the matrix. It is denoted with <math>\det(\mathbf{A})</math> or in matrix structure with vertical lines:<br/>
 
:<math>
 
:<math>
 
\det(\mathbf{A})=
 
\det(\mathbf{A})=
\left|\begin{array}{ccc}
+
\begin{array}{|ccc|}
 
a_{11} & \dots & a_{1n}\\
 
a_{11} & \dots & a_{1n}\\
 
\vdots & \ddots & \vdots\\
 
\vdots & \ddots & \vdots\\
 
a_{n1} & \dots & a_{nn}
 
a_{n1} & \dots & a_{nn}
\end{array}\right|
+
\end{array}</math>
 +
 
 +
Considering a matrix as a linear system the determinant provides information about its solvability. If the determinant is nonzero the linear system is clearly solvable. This feature is also important for [[Matrix inversion|matrix inversion]].
 +
 
 +
===Properties===
 +
The determinant is a ''multiplicative mapping'', such that
 +
:<math>
 +
\det(\mathbf{A}\cdot\mathbf{B})=\det(\mathbf{A})\cdot\det(\mathbf{B})
 
</math>
 
</math>
 +
for all n-by-n square matrices <math>\mathbf{A}</math> and <math>\mathbf{B}</math>.<br/><br/>
 +
 +
It holds for all n-by-n square matrices <math>\mathbf{A}</math> and all ''scalar values'' <math>r</math>:
 +
:<math>
 +
\det(r\mathbf{A})=r^n\det(\mathbf{A})
 +
</math><br/><br/>
  
Considering a matrix as a linear system the determinant provides information about its solvability. If the determinant is nonzero the linear system is clearly solvable. This feature is also important for [[Matrix inversion|matrix inversion]].
+
A matrix <math>\mathbf{A}</math> and its ''transposed'' have the same determinant:
 +
:<math>
 +
\det(\mathbf{A})=\det(\mathbf{A}^T)
 +
</math><br/><br/>
 +
 
 +
The determinant of an ''identity matrix'' is always 1:
 +
:<math>
 +
\det(\mathbf{I})=1
 +
</math>
  
 
===2-by-2 matrices===
 
===2-by-2 matrices===
Line 23: Line 46:
 
\end{array}\right|=a_{11}a_{22}-a_{21}a_{12}
 
\end{array}\right|=a_{11}a_{22}-a_{21}a_{12}
 
</math>
 
</math>
<br/>
 
  
 
{{Example
 
{{Example
Line 29: Line 51:
 
|Contents=<br/>
 
|Contents=<br/>
 
<math>
 
<math>
 +
\det(\mathbf{A}_2)=
 
\det
 
\det
 
\left[\begin{array}{cc}
 
\left[\begin{array}{cc}
1 & 3\\
+
2&3\\
2 & 2
+
1&2
 
\end{array}\right] =  
 
\end{array}\right] =  
 
\left|\begin{array}{cc}
 
\left|\begin{array}{cc}
1 & 3\\
+
2&3\\
2 & 2
+
1&2
 
\end{array}\right|=
 
\end{array}\right|=
1\cdot 2-3\cdot 2=
+
2\cdot 2-3\cdot 1=
2-6=-4
+
4-3=1
 
</math>
 
</math>
 
}}
 
}}
<br/>
 
  
 
===3-by-3 matrices===
 
===3-by-3 matrices===
  
For 3-by-3 matrices there is a formula to compute the determinant using cramer's rule. The Khan Academy<ref>[https://www.khanacademy.org/ ''https://www.khanacademy.org/''] Khan Academy</ref> provides a good [https://www.khanacademy.org/math/algebra2/algebra-matrices/inverting_matrices/v/finding-the-determinant-of-a-3x3-matrix-method-1 video] where this formula is explained. Please watch the video for further information about the computation of the determinant of a 3-by-3 matrix.
+
For 3-by-3 matrices there is a formula called Rule of Sarrus to compute the determinant. The first two columns of the matrix are noted anew on the right of matrix. Then six diagonals are formed that describe the arithmetic operations to be performed:
 +
:[[File:sarrus.png]]
 +
The sum of the diagonal elements then forms the determinant:
 +
:<math>
 +
\det
 +
\begin{bmatrix}
 +
a_{11} & a_{12} & a_{13}\\
 +
a_{21} & a_{22} & a_{23}\\
 +
a_{31} & a_{32} & a_{33}
 +
\end{bmatrix}
 +
=
 +
\begin{vmatrix}
 +
a_{11} & a_{12} & a_{13}\\
 +
a_{21} & a_{22} & a_{23}\\
 +
a_{31} & a_{32} & a_{33}
 +
\end{vmatrix}
 +
=
 +
a_{11} a_{22} a_{33} + a_{12} a_{23} a_{31} + a_{13} a_{21} a_{32} - a_{13} a_{22} a_{31} - a_{11} a_{23} a_{32} - a_{12} a_{21} a_{33}
 +
</math>
 +
The Khan Academy<ref>[https://www.khanacademy.org/ ''https://www.khanacademy.org/''] Khan Academy</ref> provides a good video <ref>[https://www.khanacademy.org/math/algebra2/algebra-matrices/inverting_matrices/v/finding-the-determinant-of-a-3x3-matrix-method-1 ''https://www.khanacademy.org/.../finding-the-determinant-of-a-3x3-matrix-method-1''] Determinant of a 3-by-3 matrix</ref> where this formula is explained. Please watch the video for further information about the computation of the determinant of a 3-by-3 matrix.
 +
 
 +
{{Example
 +
|Title=Determinant of a 3-by-3 matrix
 +
|Contents=<br/>
 +
<math>
 +
\det(\mathbf{A}_3)=
 +
\det
 +
\left[\begin{array}{ccc}
 +
1&0&1\\
 +
3&1&0\\
 +
1&0&2
 +
\end{array}\right] =
 +
\left|\begin{array}{ccc}
 +
1&0&1\\
 +
3&1&0\\
 +
1&0&2
 +
\end{array}\right|=
 +
1\cdot1\cdot2+0\cdot0\cdot1+1\cdot3\cdot0-1\cdot1\cdot1-1\cdot0\cdot0-0\cdot2\cdot3)=2+0+0-1-0-0=1
 +
</math>
 +
}}
  
 
===4-by-4 matrices===
 
===4-by-4 matrices===
  
One possibility to compute the determinant of a 4-by-4 matrix is a formula that uses the [[Minors_and_cofactors|minors and cofactors]] of a matrix. First one row or column has to be choosen. The sum of the four corresponding values of the row or column multiplied by the related cofactors results in the determinant:<br/><br/>
+
One possibility to compute the determinant of a 4-by-4 matrix is a formula that uses the [[Minors_and_cofactors|minors and cofactors]] of a matrix. Please read the article about [[Minors_and_cofactors|minors and cofactors]] before you continue with this article. First one row or column has to be choosen. The sum of the four corresponding values of the row or column multiplied by the related cofactors results in the determinant. If a column <math>j</math> is choosen, it holds:
 +
:<math>
 +
\det(\mathbf{A})=\sum_{i=1}^n a_{ij}\cdot C_{ij} \quad \text{for the choosen column } j
 +
</math>
 +
And if a row <math>i</math> is choosen:
 +
:<math>
 +
\det(\mathbf{A})=\sum_{j=1}^n a_{ij}\cdot C_{ij} \quad \text{for the choosen row } i
 +
</math>
  
<math>
+
{{Example
\det(\mathbf{A})=\sum_{(i,j) \isin \text{ one row or column}}{a_{i,j}C_{i,j}}
+
|Title=determinant of a 4-by-4 matrix
</math>
+
|Contents=
 +
This example describes the computation of the determinant of the transformation matrix <math>^R\mathbf{T}_N</math> that is introduced in the robotics script in chapter 3 on page 3-37 and used on the following pages.
 
<br/><br/>
 
<br/><br/>
 +
:<math>
 +
^R\mathbf{T}_N  =
 +
\left[\begin{array}{cccc}
 +
0 & 1 & 0 & 2a\\
 +
0 & 0 & -1 & 0\\
 +
-1 & 0 & 0 & 0\\
 +
0 & 0 & 0 & 1
 +
\end{array}\right]</math><br/><br/>
 +
It is always useful to choose a row or column with many zero values so that the corresponding products are omitted and the cofactors have not to be computed. For the matrix <math>^R\mathbf{T}_N</math> it is useful to choose row 4 because it contains three zero values and a one as factors:<br/><br/>
 +
<math>\begin{align}
 +
\det(^R\mathbf{T}_N)&=
 +
\left|\begin{array}{cccc}
 +
0 & 1 & 0 & 2a\\
 +
0 & 0 & -1 & 0\\
 +
-1 & 0 & 0 & 0\\
 +
\mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{1}
 +
\end{array}\right| & \quad & \quad & \quad\\
 +
&=
 +
\mathbf{0}\cdot C_{4,1}&+&\mathbf{0}\cdot C_{4,2}&+&\mathbf{0}\cdot C_{4,3}&+&\mathbf{1}\cdot C_{4,4}\\
 +
&=
 +
0\cdot(-1)^{4+1}
 +
\left|\begin{array}{ccc}
 +
1 & 0 & 2a\\
 +
0 & -1 & 0\\
 +
0 & 0 & 0
 +
\end{array}\right|
 +
&+&0\cdot(-1)^{4+2}
 +
\left|\begin{array}{ccc}
 +
0 & 0 & 2a\\
 +
0 & -1 & 0\\
 +
-1 & 0 & 0
 +
\end{array}\right|
 +
&+&0\cdot(-1)^{4+3}
 +
\left|\begin{array}{ccc}
 +
0 & 1 & 2a\\
 +
0 & 0 & 0\\
 +
-1 & 0 & 0
 +
\end{array}\right|
 +
&+&1\cdot(-1)^{4+4}
 +
\left|\begin{array}{ccc}
 +
0 & 1 & 0\\
 +
0 & 0 & -1\\
 +
-1 & 0 & 0
 +
\end{array}\right|\\
 +
&= 0\cdot(-1)\cdot0&+&0\cdot1\cdot(-2a)&+&0\cdot(-1)\cdot0&+&1\cdot1\cdot1\\
 +
&= 0&+&0&+&0&+&1\\
 +
&= 1&\quad&\quad&\quad
 +
\end{align}</math>
 +
}}
  
{{Example
+
<!--{{Example
 
|Title=determinant of a 4-by-4 matrix
 
|Title=determinant of a 4-by-4 matrix
 
|Contents=
 
|Contents=
Line 107: Line 225:
 
&= 1&\quad&\quad&\quad
 
&= 1&\quad&\quad&\quad
 
\end{align}</math>
 
\end{align}</math>
}}
+
}}-->
 +
 
 +
==References==
 +
<references/>
  
 
[[Category:Article]]
 
[[Category:Article]]
 
[[Category:Matrices]]
 
[[Category:Matrices]]

Latest revision as of 18:10, 13 November 2015

← Back: Multiplication of matrices Overview: Matrices Next: Minors and cofactors

Review.png

There are exercises as selftest for this article.


The determinant can be computed for an n-by-n square matrix. In the context of matrices the determinant of a matrix is a special function that assigns a scalar value to the matrix. It is denoted with \det(\mathbf{A}) or in matrix structure with vertical lines:


\det(\mathbf{A})=
\begin{array}{|ccc|}
a_{11} & \dots & a_{1n}\\
\vdots & \ddots & \vdots\\
a_{n1} & \dots & a_{nn}
\end{array}

Considering a matrix as a linear system the determinant provides information about its solvability. If the determinant is nonzero the linear system is clearly solvable. This feature is also important for matrix inversion.

Properties

The determinant is a multiplicative mapping, such that


\det(\mathbf{A}\cdot\mathbf{B})=\det(\mathbf{A})\cdot\det(\mathbf{B})

for all n-by-n square matrices \mathbf{A} and \mathbf{B}.

It holds for all n-by-n square matrices \mathbf{A} and all scalar values r:


\det(r\mathbf{A})=r^n\det(\mathbf{A})

A matrix \mathbf{A} and its transposed have the same determinant:


\det(\mathbf{A})=\det(\mathbf{A}^T)

The determinant of an identity matrix is always 1:


\det(\mathbf{I})=1

2-by-2 matrices

For a 2-by-2 matrix the determinant can easily computed as follows:


\det(\mathbf{A})=
\left|\begin{array}{cc}
a_{11} & a_{12}\\
a_{21} & a_{22}
\end{array}\right|=a_{11}a_{22}-a_{21}a_{12}
Example: Determinant of a 2-by-2 matrix



\det(\mathbf{A}_2)=
\det
\left[\begin{array}{cc}
2&3\\
1&2
\end{array}\right] = 
\left|\begin{array}{cc}
2&3\\
1&2
\end{array}\right|=
2\cdot 2-3\cdot 1=
4-3=1

3-by-3 matrices

For 3-by-3 matrices there is a formula called Rule of Sarrus to compute the determinant. The first two columns of the matrix are noted anew on the right of matrix. Then six diagonals are formed that describe the arithmetic operations to be performed:

Sarrus.png

The sum of the diagonal elements then forms the determinant:


\det
\begin{bmatrix}
a_{11} & a_{12} & a_{13}\\
a_{21} & a_{22} & a_{23}\\
a_{31} & a_{32} & a_{33}
\end{bmatrix}
=
\begin{vmatrix}
a_{11} & a_{12} & a_{13}\\
a_{21} & a_{22} & a_{23}\\
a_{31} & a_{32} & a_{33}
\end{vmatrix}
=
a_{11} a_{22} a_{33} + a_{12} a_{23} a_{31} + a_{13} a_{21} a_{32} - a_{13} a_{22} a_{31} - a_{11} a_{23} a_{32} - a_{12} a_{21} a_{33}

The Khan Academy[1] provides a good video [2] where this formula is explained. Please watch the video for further information about the computation of the determinant of a 3-by-3 matrix.

Example: Determinant of a 3-by-3 matrix



\det(\mathbf{A}_3)=
\det
\left[\begin{array}{ccc}
1&0&1\\
3&1&0\\
1&0&2
\end{array}\right] = 
\left|\begin{array}{ccc}
1&0&1\\
3&1&0\\
1&0&2
\end{array}\right|=
1\cdot1\cdot2+0\cdot0\cdot1+1\cdot3\cdot0-1\cdot1\cdot1-1\cdot0\cdot0-0\cdot2\cdot3)=2+0+0-1-0-0=1

4-by-4 matrices

One possibility to compute the determinant of a 4-by-4 matrix is a formula that uses the minors and cofactors of a matrix. Please read the article about minors and cofactors before you continue with this article. First one row or column has to be choosen. The sum of the four corresponding values of the row or column multiplied by the related cofactors results in the determinant. If a column j is choosen, it holds:


\det(\mathbf{A})=\sum_{i=1}^n a_{ij}\cdot C_{ij} \quad \text{for the choosen column } j

And if a row i is choosen:


\det(\mathbf{A})=\sum_{j=1}^n a_{ij}\cdot C_{ij} \quad \text{for the choosen row } i
Example: determinant of a 4-by-4 matrix

This example describes the computation of the determinant of the transformation matrix ^R\mathbf{T}_N that is introduced in the robotics script in chapter 3 on page 3-37 and used on the following pages.


^R\mathbf{T}_N  = 
\left[\begin{array}{cccc}
0 & 1 & 0 & 2a\\
0 & 0 & -1 & 0\\
-1 & 0 & 0 & 0\\
0 & 0 & 0 & 1
\end{array}\right]

It is always useful to choose a row or column with many zero values so that the corresponding products are omitted and the cofactors have not to be computed. For the matrix ^R\mathbf{T}_N it is useful to choose row 4 because it contains three zero values and a one as factors:

\begin{align}
\det(^R\mathbf{T}_N)&=
\left|\begin{array}{cccc}
0 & 1 & 0 & 2a\\
0 & 0 & -1 & 0\\
-1 & 0 & 0 & 0\\
\mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{1}
\end{array}\right| & \quad & \quad & \quad\\
&=
\mathbf{0}\cdot C_{4,1}&+&\mathbf{0}\cdot C_{4,2}&+&\mathbf{0}\cdot C_{4,3}&+&\mathbf{1}\cdot C_{4,4}\\
&=
0\cdot(-1)^{4+1}
\left|\begin{array}{ccc}
1 & 0 & 2a\\
0 & -1 & 0\\
0 & 0 & 0
\end{array}\right|
&+&0\cdot(-1)^{4+2}
\left|\begin{array}{ccc}
0 & 0 & 2a\\
0 & -1 & 0\\
-1 & 0 & 0
\end{array}\right|
&+&0\cdot(-1)^{4+3}
\left|\begin{array}{ccc}
0 & 1 & 2a\\
0 & 0 & 0\\
-1 & 0 & 0
\end{array}\right|
&+&1\cdot(-1)^{4+4}
\left|\begin{array}{ccc}
0 & 1 & 0\\
0 & 0 & -1\\
-1 & 0 & 0
\end{array}\right|\\
&= 0\cdot(-1)\cdot0&+&0\cdot1\cdot(-2a)&+&0\cdot(-1)\cdot0&+&1\cdot1\cdot1\\
&= 0&+&0&+&0&+&1\\
&= 1&\quad&\quad&\quad
\end{align}


References

  1. https://www.khanacademy.org/ Khan Academy
  2. https://www.khanacademy.org/.../finding-the-determinant-of-a-3x3-matrix-method-1 Determinant of a 3-by-3 matrix