lecture4.3.html
10/27/08 11:29 AM
Section 4.3
Computation of determinants and Cramer's Rule
>
>
Introduction
- To compute the determinant of a n x n matrix using the cofactor expansion requires roughly n! operations.
(n! = 1 * 2 * 3 . . . * n).
- Consider a 25 x 25 matrix. This would require 25! operations or roughly
operations.
- Suppose you have a super computer that can do 1 trillion operations per second. This calculation
would require 500,000 years!!
How do you find the determinant of 25 x 25 matrix?
Computation of a Determinant
********************************************************************
Computation of a determinant of a n x n matrix A:
1.) Reduce A to an echelon form, using only row additions and row interchanges.
2.) If any of the matrices appearing in the reduction contains a row of zeros, then det(A) = 0.
3.) Otherwise,
det(A) =
(Product of pivots)
where r is the number of row interchanges performed.
**********************************************************************
ROW OPERATIONS
*******************************************************
Property 2 : If two different rows of a square matrix A are interchanged,
http://www.math.uri.edu/~jbaglama/classes/2003-2004/spring/math215/lecture13/lecture4.31.html
Page 1 of 11
lecture4.3.html
10/27/08 11:29 AM
the determinant of the resulting matrix is -det(A).
*******************************************************
*******************************************************
Property 4 : If a single row of a square matrix A is multiplied by a scalar r,
the determinant of the resulting matrix is r* det(A).
*******************************************************
*******************************************************
Property 5 : If the product of one row of a square matrix A by a scalar is
added to a different row of A, the determinant of the resulting
matrix is the same as the det(A).
*******************************************************
Example 1:
>
>
A := matrix([[2,5,7],[6,4,2],[8,4,1]]);
>
A := addrow(A,1,2,-A[2,1]/A[1,1]);
>
A := addrow(A,1,3,-A[3,1]/A[1,1]);
>
A := addrow(A,2,3,-A[3,2]/A[2,2]);
http://www.math.uri.edu/~jbaglama/classes/2003-2004/spring/math215/lecture13/lecture4.31.html
Page 2 of 11
lecture4.3.html
>
10/27/08 11:29 AM
`det(A)` = A[1,1]*A[2,2]*A[3,3];
>
Example 2:
>
>
A := matrix([[1,-3,1,-2],[2,-5,-1,-2],[0,-4,5,1],[-3,10,-6,5]]);
>
Row reducing and then computing the determinant requires roughly
Consider a 25 x 25 matrix. This would require
operations.
= 10,500 operations. Less than
1 second to compute.
Cramer's Rule
Cramer's Rule for solving Systems of Linear Equations
Cramer's rule is a method, based on determinants, for solving a system of linear equations.
The system must be a square system and the coefficient matrix must be nonsingular;
http://www.math.uri.edu/~jbaglama/classes/2003-2004/spring/math215/lecture13/lecture4.31.html
Page 3 of 11
lecture4.3.html
10/27/08 11:29 AM
that is; its determinant is nonzero.
Example 3: Consider the system
>
x-3*y+4*z=2;
-x-4*y+3*z=-2;
2*x-5*y+6*z= 5;
>
>
The coefficient matrix is:
>
C:=matrix([[1,-3,4],[-1,-4,3],[2,-5,6]]);
>
Right hand side is,
>
b := matrix([[2],[-2],[5]]);
>
>
evalm(C) * matrix(3,1,[x,y,z]) = evalm(b);
http://www.math.uri.edu/~jbaglama/classes/2003-2004/spring/math215/lecture13/lecture4.31.html
Page 4 of 11
lecture4.3.html
Construct the matrix
10/27/08 11:29 AM
obtained from matrix C by replacing the first column of C
with the right side of the system:
>
A1:=matrix([[2,-3,4],[-2,-4,3],[5,-5,6]]);
Find the value of x
>
x=det(A1)/det(C);
Construct the matrix
obtained from matrix C by replacing the second column of C
with the right side of the system:
>
A2:=matrix([[1,2,4],[-1,-2,3],[2,5,6]]);
Find the value of y
>
y=det(A2)/det(C);
Construct the matrix
obtained from matrix C by replacing the third column of C
with the right side of the system:
>
A3:=matrix([[1,-3,2],[-1,-4,-2],[2,-5,5]]);
http://www.math.uri.edu/~jbaglama/classes/2003-2004/spring/math215/lecture13/lecture4.31.html
Page 5 of 11
lecture4.3.html
10/27/08 11:29 AM
Find the value of z
>
z=det(A3)/det(C);
Note that the solution coincides with the solution obtained using
solve({x-3*y+4*z=2,-x-4*y+3*z=-2,
2*x-5*y+6*z= 5},{x,y,z});
>
>
Adjoint matrix
***********************************************************************
The steps for finding the adjoint matrix of A.
1. Find the cofactor of each entry of the matrix A. The cofactor of an entry
=
*det(
where the submatrix
is defined as:
)
is the minor of the entry
.
2. Replace each entry of matrix A by its cofactor to get a new matrix C. This matrix is
called the cofactor matrix .
3. The transpose of matrix C is called the adjoint matrix of A and is denoted by Adj(A).
***********************************************************************
Example 4: Find the adjoint of the matrix
>
A:=matrix([[1,3,5],[5,3,6],[8,4,2]]);
The minors of all of the entries are respectively given by
http://www.math.uri.edu/~jbaglama/classes/2003-2004/spring/math215/lecture13/lecture4.31.html
Page 6 of 11
lecture4.3.html
10/27/08 11:29 AM
C11:=(-1)^2*det(M11);
C12:=(-1)^3*det(M12);
C13:=(-1)^4*det(M13);
>
C21:=(-1)^3*det(M21);
C22:=(-1)^4*det(M22);
C23:=(-1)^5*det(M23);
>
C31:=(-1)^4*det(M31);
C32:=(-1)^5*det(M32);
C33:=(-1)^6*det(M33);
>
The cofactor matrix is,
>
>
C := matrix([[C11,C12,C13],[C21,C22,C23],[C31,C32,C33]]);
>
The adjoint of A is
>
>
`Adj(A)` = transpose(C);
http://www.math.uri.edu/~jbaglama/classes/2003-2004/spring/math215/lecture13/lecture4.31.html
Page 8 of 11
lecture4.3.html
10/27/08 11:29 AM
>
*****************************************************
Result:
Let A=[
cofactor for
] be an n x n matrix. If
=
*det(
) denotes the
then
+...+
= det(A) if k = i
= 0 if
*****************************************************
Example 5:
>
>
A:=matrix([[a11,a12,a13],[a21,a22,a23],[a31,a32,a33]]);
>
The minors of entries
are respectively given by
M11:=minor(A,1,1);
M12:=minor(A,1,2);
M13:=minor(A,1,3);
>
>
http://www.math.uri.edu/~jbaglama/classes/2003-2004/spring/math215/lecture13/lecture4.31.html
Page 9 of 11
lecture4.3.html
The cofactor
10/27/08 11:29 AM
of the entry
is
*det(
);
C11:=(-1)^2*det(M11);
C12:=(-1)^3*det(M12);
C13:=(-1)^4*det(M13);
>
The determinant of A.
>
`det(A)` = a11*C11 +a12*C12+a13*C13;
Value should be zero.
>
simplify(a21*C11 +a22*C12+a23*C13);
******************************************************************
Let A be an nxn nonsingular matrix. Then the inverse of A is given by:
*******************************************************************
Example 6 Find the inverse of the following matrix
http://www.math.uri.edu/~jbaglama/classes/2003-2004/spring/math215/lecture13/lecture4.31.html
Page 10 of 11
lecture4.3.html
10/27/08 11:29 AM
>
>
A:=matrix([[1,3,5],[5,3,6],[8,4,2]]);
>
Adjoint(A):=matrix([[-18,14,3],[38,-38,19],[-4,20,-12]]);
The product of A with its adjoint is the matrix
>
multiply(A,Adjoint(A));
>
This is the identity matrix multiplied by the determinant of the matrix A.
>
det(A);
>
`A^-1` = Adjoint(A)/det(A);
>
Exercises
1, 3, 5, 7, 9, 15, 17, 19, 21, 22, 25, 27, 29.
http://www.math.uri.edu/~jbaglama/classes/2003-2004/spring/math215/lecture13/lecture4.31.html
Page 11 of 11
© Copyright 2026 Paperzz