.. The Determinant of Matrices .. =========================== .. .. Before anything else, we should note that the determinant is defined for matrices with equal number of rows and columns. The determinant of a matrix with one row and one column is equal to its single entry. .. .. :math:`\begin{equation*} .. |A| = .. \begin{vmatrix} .. 5 .. \end{vmatrix} .. = 5 .. \end{equation*}` .. .. :math:`\begin{equation*} .. |A| = .. \begin{vmatrix} .. 3.3 .. \end{vmatrix} .. = 3.3 .. \end{equation*}` .. .. :math:`\begin{equation*} .. |A| = .. \begin{vmatrix} .. -2 .. \end{vmatrix} .. = -2 .. \end{equation*}` .. .. To calculate the determinant of a matrix, first select a row or a column. For example, select row *i*. The determinant is then equal to the sum of :math:`-1^{i + j} × a_{ij} × \det(B_{ij})` where *j* is a natural number at most equal to the number of columns, :math:`\det(C)` is the determinant of the square matrix *C*, and :math:`B_{ij}` is the matrix obtained by removing row *i* and column *j* from *A*. .. .. :math:`\begin{equation*} .. |A| = .. \begin{vmatrix} .. 5 .. \end{vmatrix} .. = 5 .. \end{equation*}` .. .. :math:`\begin{equation*} .. |A| = .. \begin{vmatrix} .. 5 & 3 \\ .. -2 & 0 .. \end{vmatrix} .. = 6 .. \end{equation*}` .. .. :math:`\begin{equation*} .. |A| = .. \begin{vmatrix} .. 2 & 3 \\ .. 4 & 5 .. \end{vmatrix} .. = -2 .. \end{equation*}` .. .. :math:`\begin{equation*} .. |A| = .. \begin{vmatrix} .. 8 .. \end{vmatrix} .. = 8 .. \end{equation*}` .. .. :math:`\begin{equation*} .. |A| = .. \begin{vmatrix} .. 1 & 0 & 1 \\ .. 0 & 37 & 0 \\ .. 1 & 0 & 1 \\ .. \end{vmatrix} .. = 0 .. \end{equation*}` .. .. :math:`\begin{equation*} .. |A| = .. \begin{vmatrix} .. 2.5 & 4 & 0 \\ .. 5 & 8 & 0 \\ .. -9.056 & 0 & 37 \\ .. \end{vmatrix} .. = 0 .. \end{equation*}` .. .. :math:`\begin{equation*} .. |A| = .. \begin{vmatrix} .. 7 & 0 & 0 \\ .. 0 & 6 & 0 \\ .. 37 & 0 & 2 \\ .. \end{vmatrix} .. = 84 .. \end{equation*}` .. .. :math:`\begin{equation*} .. |A| = .. \begin{vmatrix} .. 5 & 0 & 0 & 0 & 0\\ .. 0 & 4 & 0 & 0 & 0\\ .. 0 & 0 & 3 & 0 & 0 \\ .. 0 & 0 & 0 & 2 & 0 \\ .. 0 & 0 & 0 & 0 & 1 \\ .. \end{vmatrix} .. = 120 .. \end{equation*}` .. .. :math:`\begin{equation*} .. |A| = .. \begin{vmatrix} .. 37 & 1 & 1 & 1 & 1\\ .. 0 & 1 & 1 & 1 & 1\\ .. 0 & 0 & 1 & 1 & 1 \\ .. 0 & 0 & 0 & 1 & 1 \\ .. 0 & 0 & 0 & 0 & 1 \\ .. \end{vmatrix} .. = 37 .. \end{equation*}` .. .. :math:`\begin{equation*} .. |A| = .. \begin{vmatrix} .. 1 & 2 & 3 & 4 & 5\\ .. 1 & 1 & 1 & 1 & 1 \\ .. 1 & 1 & 1 & 1 & 1 \\ .. 1 & 1 & 1 & 1 & 1 \\ .. 1 & 1 & 1 & 1 & 1 \\ .. \end{vmatrix} .. = 0 .. \end{equation*}` .. .. Determinants have many applications in matrix theory. One of their key uses is in **Kirchhoff's theorem**. Kirchhoff's Theorem ------------------------- Suppose we are given a graph and want to calculate the number of its spanning trees. One of the methods to compute this quantity is Kirchhoff's theorem. First, we construct an n × n matrix where :math:`a_{ij}` is equal to the degree of vertex i when i = j, and otherwise, it is equal to the negative of the number of edges between vertices i and j in the graph. The only point to note is that before constructing the matrix, we must remove all loops from the graph. Now, we can remove any row and any column we choose and compute the determinant of the resulting matrix (which has lost one row and one column). This determinant equals the number of spanning trees in the graph.