The Laplace Expansion Theorem: Computing the Determinants and Inverses of Matrices

Similar documents
MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

Unit 18 Determinants

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

Matrices 2. Solving Square Systems of Linear Equations; Inverse Matrices

Notes on Determinant

The Characteristic Polynomial

Row Echelon Form and Reduced Row Echelon Form

Operation Count; Numerical Linear Algebra

13 MATH FACTS a = The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.

Typical Linear Equation Set and Corresponding Matrices

Linear Algebra Notes

7.4. The Inverse of a Matrix. Introduction. Prerequisites. Learning Style. Learning Outcomes

1 Determinants and the Solvability of Linear Systems

Solving Systems of Linear Equations Using Matrices

MATHEMATICS FOR ENGINEERS BASIC MATRIX THEORY TUTORIAL 2

Name: Section Registered In:

Applied Linear Algebra I Review page 1

Using row reduction to calculate the inverse and the determinant of a square matrix

8 Square matrices continued: Determinants

Systems of Linear Equations

Similarity and Diagonalization. Similar Matrices

SECOND DERIVATIVE TEST FOR CONSTRAINED EXTREMA

Linear Algebra Notes for Marsden and Tromba Vector Calculus

Linearly Independent Sets and Linearly Dependent Sets

Lecture 2 Matrix Operations

CITY UNIVERSITY LONDON. BEng Degree in Computer Systems Engineering Part II BSc Degree in Computer Systems Engineering Part III PART 2 EXAMINATION

Matrix algebra for beginners, Part I matrices, determinants, inverses

An Introduction to Hill Ciphers Using Linear Algebra

December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS

LINEAR ALGEBRA. September 23, 2010

How To Understand And Solve Algebraic Equations

Question 2: How do you solve a matrix equation using the matrix inverse?

Computing Orthonormal Sets in 2D, 3D, and 4D

Chapter 2 Determinants, and Linear Independence

n 2 + 4n + 3. The answer in decimal form (for the Blitz): 0, 75. Solution. (n + 1)(n + 3) = n lim m 2 1

Matrix Algebra. Some Basic Matrix Laws. Before reading the text or the following notes glance at the following list of basic matrix algebra laws.

Lecture 5 Principal Minors and the Hessian

Introduction to Matrices for Engineers

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1.

Lecture 4: Partitioned Matrices and Determinants

Linear Equations ! $ & " % & " 11,750 12,750 13,750% MATHEMATICS LEARNING SERVICE Centre for Learning and Professional Development

The Determinant: a Means to Calculate Volume

#1-12: Write the first 4 terms of the sequence. (Assume n begins with 1.)

5.5. Solving linear systems by the elimination method

9.2 Summation Notation

Notes on Linear Algebra. Peter J. Cameron

2x + y = 3. Since the second equation is precisely the same as the first equation, it is enough to find x and y satisfying the system

Modélisation et résolutions numérique et symbolique

A note on companion matrices

Chapter 17. Orthogonal Matrices and Symmetries of Space

8.2. Solution by Inverse Matrix Method. Introduction. Prerequisites. Learning Outcomes

5.3 SOLVING TRIGONOMETRIC EQUATIONS. Copyright Cengage Learning. All rights reserved.

Tom wants to find two real numbers, a and b, that have a sum of 10 and have a product of 10. He makes this table.

Recall that two vectors in are perpendicular or orthogonal provided that their dot

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

26. Determinants I. 1. Prehistory

DETERMINANTS IN THE KRONECKER PRODUCT OF MATRICES: THE INCIDENCE MATRIX OF A COMPLETE GRAPH

Properties of Real Numbers

Arithmetic and Algebra of Matrices

Solving simultaneous equations using the inverse matrix

3 Orthogonal Vectors and Matrices

Excel supplement: Chapter 7 Matrix and vector algebra

MATH 304 Linear Algebra Lecture 9: Subspaces of vector spaces (continued). Span. Spanning set.

Department of Chemical Engineering ChE-101: Approaches to Chemical Engineering Problem Solving MATLAB Tutorial VI

Here are some examples of combining elements and the operations used:

1 Sets and Set Notation.

MATH2210 Notebook 1 Fall Semester 2016/ MATH2210 Notebook Solving Systems of Linear Equations... 3

Au = = = 3u. Aw = = = 2w. so the action of A on u and w is very easy to picture: it simply amounts to a stretching by 3 and 2, respectively.

Toothpick Squares: An Introduction to Formulas

Alabama Department of Postsecondary Education

Similar matrices and Jordan form

Chapter 6. Orthogonality

x = + x 2 + x


1 Introduction to Matrices

v w is orthogonal to both v and w. the three vectors v, w and v w form a right-handed set of vectors.

Linear Codes. Chapter Basics

160 CHAPTER 4. VECTOR SPACES

( ) which must be a vector

10.2 ITERATIVE METHODS FOR SOLVING LINEAR SYSTEMS. The Jacobi Method

Math 115A HW4 Solutions University of California, Los Angeles. 5 2i 6 + 4i. (5 2i)7i (6 + 4i)( 3 + i) = 35i + 14 ( 22 6i) = i.

1 VECTOR SPACES AND SUBSPACES

University of Lille I PC first year list of exercises n 7. Review

Recall the basic property of the transpose (for any A): v A t Aw = v w, v, w R n.

A vector is a directed line segment used to represent a vector quantity.

α = u v. In other words, Orthogonal Projection

is in plane V. However, it may be more convenient to introduce a plane coordinate system in V.

MAT188H1S Lec0101 Burbulla

Adding vectors We can do arithmetic with vectors. We ll start with vector addition and related operations. Suppose you have two vectors

Continued Fractions and the Euclidean Algorithm

x1 x 2 x 3 y 1 y 2 y 3 x 1 y 2 x 2 y 1 0.

SOLVING LINEAR SYSTEMS

Orthogonal Diagonalization of Symmetric Matrices

Lecture 1: Systems of Linear Equations

Linear Algebra Review. Vectors

How To Understand And Solve A Linear Programming Problem

SCHWEITZER ENGINEERING LABORATORIES, COMERCIAL LTDA.

ISOMETRIES OF R n KEITH CONRAD

DETERMINANTS TERRY A. LORING

Solution of Linear Systems

Transcription:

The Laplace Expansion Theorem: Computing the Determinants and Inverses of Matrices David Eberly Geometric Tools, LLC http://www.geometrictools.com/ Copyright c 1998-2016. All Rights Reserved. Created: August 25, 2007 Last Modified: August 6, 2008 Contents 1 Determinants and Inverses of 2 2 Matrices 2 2 Determinants and Inverses of 3 3 Matrices 3 3 The Laplace Expansion Theorem 4 4 Determinants and Inverses of 4 4 Matrices 6 1

A standard method for symbolically computing the determinant of an n n matrix involves cofactors and expanding by a row or by a column. This document describes the standard formulas for computing the determinants of 2 2 and 3 3 matrices, mentions the general form of Laplace Expansion Theorem for which the standard determinant formulas are special cases, and shows how to compute the determinant of a 4 4 matrix using (1) expansion by a row or column and (2) expansion by 2 2 submatrices. Method (2) involves fewer arithmetic operations than does method (1). 1 Determinants and Inverses of 2 2 Matrices The prototypical example is for a 2 2 matrix, A = [a rc ], where the row index satisfies 0 r 1 and the column index satisfies 0 c 1. The matrix is Expanding by the first row, A = a 00 a 01 a 10 a 11 det(a) = +a 00 det[a 11 ] a 01 det[a 10 ] = a 00 a 11 a 01 a 10 (1) where the determinant of a 1 1 matrix is just the single entry of that matrix. The terms in the determinant formula for a 2 2 matrix involve the matrix entries in the first row, an alternating sign for these entries, and determinants of 1 1 submatrices. For example, the first term in the formula uses row entry a 00, sign +1, and submatrix [a 11 ]. The row entry a 00 has row index 0 and column index 0. The submatrix [a 11 ] is obtained from A by deleting row 0 and column 0. The second term in the formula uses row entry a 01, sign 1, and submatrix [a 10 ]. The row entry a 01 has row index 0 and column index 1. The submatrix [a 10 ] is obtained from A by deleting row 0 and column 1. Similarly, you may expand by the second row: det(a) = a 10 det[a 01 ] + a 11 det[a 00 ] = a 10 a 01 + a 11 a 00 (2) The first term in the formula uses row entry a 10, sign 1, and submatrix [a 01 ]. The row entry a 10 has row index 1 and column index 0. The submatrix [a 01 ] is obtained from A by deleting row 1 and column 0. The second term in the formula uses row entry a 11, sign +1, and submatrix [a 00 ]. The row entry a 11 has row index 1 and column index 1. The submatrix [a 00 ] is obtained from A by deleting row 1 and column 1. Expansions by column are also possible. Expanding by the first column leads to and expanding by the second column leads to det(a) = +a 00 det[a 11 ] a 10 det[a 01 ] = a 00 a 11 a 10 a 01 (3) det(a) = a 01 det[a 10 ] + a 11 det[a 00 ] = a 01 a 10 + a 11 a 00 (4) The four determinant formulas, Equations (1) through (4), are examples of the Laplace Expansion Theorem. The sign associated with an entry a rc is ( 1) r+c. For example, in expansion by the first row, the sign associated with a 00 is ( 1) 0+0 = 1 and the sign associated with a 01 is ( 1) 0+1 = 1. A determinant of a submatrix [a rc ] is called a minor. The combination of the sign and minor in a term of the determinant 2

formula is called a cofactor for the matrix entry that occurred in the term. For example, in the second term of Equation (1), the sign is 1, the minor is det[a 10 ], and the cofactor is a 10. This cofactor is associated with the matrix entry a 01. The cofactors may be stored in a matrix called the adjugate of A, This matrix has the property adj(a) = +a 11 a 10 a 01 +a 00 (5) A adj(a) = adj(a) A = det(a) I (6) where I is the 2 2 identity matrix. When det(a) is not zero, the matrix A has an inverse given by A 1 = 1 adj(a) (7) det(a) 2 Determinants and Inverses of 3 3 Matrices Consider a 3 3 matrix A = [a rc ], where the row index satisfies 0 r 2 and the column index satisfies 0 c 2. The matrix is a 00 a 01 a 02 A = a 10 a 11 a 12 a 20 a 21 a 22 Expanding by the first row, det(a) = +a 00 det a 11 a 12 a 21 a 22 a 01 det a 10 a 12 a 20 a 22 + a 02 det a 10 a 11 a 20 a 21 = +a 00 (a 11 a 22 a 12 a 21 ) a 01 (a 10 a 22 a 12 a 20 ) + a 02 (a 10 a 21 a 11 a 20 ) (8) = +a 00 a 11 a 22 + a 01 a 12 a 20 + a 02 a 10 a 21 a 00 a 12 a 21 a 01 a 10 a 22 a 02 a 11 a 20 Each term in the first line of Equation (8) involves a sign, an entry from row 0 of A, and a determinant of a submatrix of A. If a 0c is an entry in row 0, then the sign is ( 1) 0+c and the submatrix is obtained by removing row 0 and column c from A. Five other expansions produce the same determinant formula: by row 1, by row 2, by column 0, by column 1, or by column 2. In all six formulas, each term involves a matrix entry a rc, an associated sign ( 1) r+c, and a submatrix M rc that is obtained from A by removing row r and column c. The cofactor associated with the term is γ rc = ( 1) r+c det M rc The matrix of cofactors is Γ = [γ rc ] for rows 0 r 2 and for columns 0 c 2. The transpose of the matrix of cofactors is called the adjugate matrix, denoted adj(a), and as in the 2 2 case, satisfies Equation (6). When the determinant is not zero, the inverse of A is defined by Equation (7). In the case of the 3 3 3

matrix, the adjugate is adj(a) = +(a 11 a 22 a 12 a 21 ) (a 01 a 22 a 02 a 21 ) +(a 01 a 12 a 02 a 11 ) (a 10 a 22 a 12 a 20 ) +(a 00 a 22 a 02 a 20 ) (a 00 a 12 a 02 a 10 ) +(a 10 a 21 a 11 a 20 ) (a 00 a 21 a 01 a 20 ) +(a 00 a 11 a 01 a 10 ) (9) The first line of Equation (8) may be written also as det(a) = + det[a 00 ] det a 11 a 12 a 21 a 22 det[a 01 ] det a 10 a 12 a 20 a 22 + det[a 02 ] det a 10 a 11 a 20 a 21 (10) which is a sum of products of determinant of submatrices, with alternating signs for the terms. A visual way to look at this is shown in Figure (1). Figure 1. A visualization of the determinant of a 3 3 matrix. Each 3 3 grid represents the matrix entries. The blue-colored cells represent the 1 1 submatrices in the determinant formula and the red-colored cells represent the 2 2 submatrices in the determinant formula. In the left 3 3 grid of the figure, the blue-colored cell represents the submatrix [a 00 ] from the first term in the determinant formula. The red-colored cells are the complementary submatrix of [a 00 ], namely, the 2 2 submatrix that is part of the first term of the formula: the first row has a 11 and a 12 and the second row has a 21 and a 22. The submatrix is obtained from A by removing row 0 and column 0. In the middle 3 3 grid of the figure, the blue-colored cell represents the submatrix [a 01 ] from the second term in the determinant formula. The red-colored cells are the complementary submatrix of [a 01 ], namely, the 2 2 submatrix that is part of the second term of the formula: the first row has a 10 and a 12 and the second row has a 20 and a 22. The submatrix is obtained from A by removing row 0 and column 1. In the right 3 3 grid of the figure, the blue-colored cell represents the submatrix [a 02 ] from the third term in the determinant formula. The red-colored cells are the complementary submatrix of [a 02 ], namely, the 2 2 matrix that is part of the third term of the formula: the first row has a 10 and a 11 and the second row has a 20 and a 21. The submatrix is obtained from A by removing row 0 and column 2. 3 The Laplace Expansion Theorem This theorem is a very general formula for computing the determinant of an n n matrix A. First, some definitions. Let r = (r 1, r 2,..., r k ) be a list of k row indices for A, where 1 k < n and 0 r 1 < 4

r 2 < < r k < n. Let c = (c 1, c 2,..., c k ) be a list of k column indices for A, where 1 k < n and 0 c 1 < c 2 < < c k < n. The submatrix obtained by keeping the entries in the intersection of any row and column that are in the lists is denoted S(A; r, c) (11) The submatrix obtained by removing the entries in the rows and columns that are in the list is denoted and is the complementary submatrix for S(A; r, c). For example, let A be a 3 3 matrix. Let r = (0) and c = (1). Then S(A; r, c) = [a 01 ], S (A; r, c) = S (A; r, c) (12) a 10 a 12 a 20 a 22 In the middle 3 3 grid of Figure 1, S(A; (0), (1)) is formed from the blue-colored cell and S (A; (0), (1)) is formed from the red-colored cells. Laplace Expansion Theorem. Let A be an n n matrix. Let r = (r 1, r 2,..., r k ) be a list of k row indices, where 1 k < n and 0 r 1 < r 2 < r k < n. The determinant of A is det(a) = ( 1) r c ( 1) c det S(A; r, c) det S (A; r, c) (13) where r = r 1 +r 2 + +r k, c = c 1 +c 2 + +c k, and the summation is over all k-tuples c = (c 1, c 2,..., c k ) for which 1 c 1 < c 2 < < c k < n. For example, consider a 3 3 matrix with r = (0) (that is, k = 1). determinant is Then r = 0, c = (c 0 ), and the det(a) = 2 c 0=0 ( 1)c0 det S(A; (0), (c 0 )) det S (A; (0), (c 0 )) = ( 1) 0 det S(A; (0), (0)) det S (A; (0), (0)) + ( 1) 1 det S(A; (0), (1)) det S (A; (0), (1)) + ( 1) 2 det S(A; (0), (2)) det S (A; (0), (2)) = + det[a 00 ] det which is Equation (10). a 11 a 12 a 21 a 22 det[a 01 ] det a 10 a 12 a 20 a 22 + det[a 02 ] det a 10 a 11 a 20 a 21 5

4 Determinants and Inverses of 4 4 Matrices The Laplace Expansion Theorem may be applied to 4 4 matrices in a couple of ways. The first way uses an expansion by a row or by a column, which is what most people are used to doing. The matrix is a 00 a 01 a 02 a 03 a A = 10 a 11 a 12 a 13 a 20 a 21 a 22 a 23 a 30 a 31 a 32 a 33 Using the visualization as motivated by Figure 1, an expansion by row 0 is visualized in Figure 2: Figure 2. A visualization of the expansion by row 0 of a 4 4 matrix in order to compute the determinant. The algebraic equivalent is a 11 a 12 a 13 a 10 a 12 a 13 det(a) = + det[a 00 ] det a 21 a 22 a 23 det[a 01] det a 20 a 22 a 23 a 31 a 32 a 33 a 30 a 32 a 33 a 10 a 11 a 13 a 10 a 11 a 12 + det[a 02 ] det a 20 a 21 a 23 det[a 03] det a 20 a 21 a 22 a 30 a 31 a 33 a 30 a 31 a 32 (14) 6

It is possible, however, to use the Laplace Expansion Theorem in a different manner. Choose r = (0, 1), an expansion by rows 0 and 1, so to speak; then r = 0 + 1 = 1, c = (c 0, c 1 ), and det(a) = (c 0,c 1) ( 1)c0+c1 det S(A; (0, 1), (c 0, c 1 )) det S (A; (0, 1), (c 0, c 1 )) = + det S(A; (0, 1), (0, 1)) det S (A; (0, 1), (0, 1)) det S(A; (0, 1), (0, 2)) det S (A; (0, 1), (0, 2)) + det S(A; (0, 1), (0, 3)) det S (A; (0, 1), (0, 3)) + det S(A; (0, 1), (1, 2)) det S (A; (0, 1), (1, 2)) det S(A; (0, 1), (1, 3)) det S (A; (0, 1), (1, 3)) + det S(A; (0, 1), (2, 3)) det S (A; (0, 1), (2, 3)) = + det a 00 a 01 a 10 a 11 det a 22 a 23 a 32 a 33 det a 00 a 02 a 10 a 12 det a 21 a 23 a 31 a 33 (15) + det + det det + det a 00 a 03 a 10 a 13 a 01 a 02 a 11 a 12 a 01 a 03 a 11 a 13 a 02 a 03 a 12 a 13 det det det det a 21 a 22 a 31 a 32 a 20 a 23 a 30 a 33 a 20 a 22 a 30 a 32 a 20 a 21 a 30 a 31 The visualization for this approach, similar to that of Figure 2, is shown in Figure 3: 7

Figure 3. A visualization of the expansion by rows 0 and 1 of a 4 4 matrix in order to compute the determinant. Computing the determinant of a 2 2 matrix requires 1 multiplication and 1 addition (or subtraction). The operation count is listed as a 2-tuple, the first component the number of multiplications and the second component the number of additions: Θ 2 = (2, 1) Computing the determinant of a 3 3 matrix, when expanded by the first row according to Equation (8), requires the following number of operations Θ 3 = 3Θ 2 + (3, 2) = (9, 5) Using the row expansion of Equation (14) to compute the determinant of a 4 4 matrix, the operation count is Θ 4 = 4Θ 3 + (4, 3) = (40, 23) However, if you use Equation (15) to compute the determinant, the operation count is Θ 4 = 12Θ 2 + (6, 5) = (30, 17) The total number of operations using Equation (14) is 63 and the total number of operation using Equation (15) is 47, so the latter equation is more efficient in terms of operation count. To compute the inverse of a 4 4 matrix A, construct the adjugate matrix, which is the transpose of the matrix of cofactors for A. The cofactors involve 3 3 determinants. For example, the entry in row 0 and column 0 of adj(a) is a 11 a 12 a 13 + det a 21 a 22 a 23 = +a 11 det a 31 a 32 a 33 a 22 a 23 a 32 a 33 a 12 det a 21 a 23 a 31 a 33 + a 13 det a 21 a 22 a 31 a 32 8

This equation involves determinants of 2 2 submatrices that also occur in the equation for the determinant of the 4 4 matrix. This suggests computing all of the entries of adj(a) using only 2 2 submatrices. Specifically, define s 0 = det a 00 a 01 a 10 a 11, c 5 = det a 22 a 23 a 32 a 33 s 1 = det s 2 = det s 3 = det s 4 = det s 5 = det a 00 a 02 a 10 a 12 a 00 a 03 a 10 a 13 a 01 a 02 a 11 a 12 a 01 a 03 a 11 a 13 a 02 a 03 a 12 a 13, c 4 = det, c 3 = det, c 2 = det, c 1 = det, c 0 = det a 21 a 23 a 31 a 33 a 21 a 22 a 31 a 32 a 20 a 23 a 30 a 33 a 20 a 22 a 30 a 32 a 20 a 21 a 30 a 31 Then and det(a) = s 0 c 5 s 1 c 4 + s 2 c 3 + s 3 c 2 s 4 c 1 + s 5 c 0 adj(a) = +a 11c 5 a 12c 4 + a 13c 3 a 01c 5 + a 02c 4 a 03c 3 +a 31s 5 a 32s 4 + a 33s 3 a 21s 5 + a 22s 4 a 23s 3 a 10c 5 + a 12c 2 a 13c 1 +a 00c 5 a 02c 2 + a 03c 1 a 30s 5 + a 32s 2 a 33s 1 +a 20s 5 a 22s 2 + a 23s 1 +a 10c 4 a 11c 2 + a 13c 0 a 00c 4 + a 01c 2 a 03c 0 +a 30s 4 a 31s 2 + a 33s 0 a 20s 4 + a 21s 2 a 23s 0 a 10c 3 + a 11c 1 a 12c 0 +a 00c 3 a 01c 1 + a 02c 0 a 30s 3 + a 31s 1 a 32s 0 +a 20s 3 a 21s 1 + a 22s 0 If the determinant is not zero, then the inverse of A is computed using Equation (7). 9