Matrices-Unit12.mws

MATRICES AND MATRIX OPERATIONS: Unit 12

Dr. Wlodzislaw Kostecki

The Papua New Guinea University of Technology (PNGUT)

Department of Electrical and Communication Engineering

Lae, Morobe Province

Papua New Guinea

Copyright © 2000 by Wlodzislaw Kostecki

All rights reserved

-------------------------------------------------------------------

(12) The minor and cofactor of a matrix element

OBJECTIVES :

To define the minor and cofactor of a matrix element.

To provide alternative methods of computing the minor and cofactor.

To introduce the Laplace expansion theorem and show its application.

To introduce further functions from Maple s main library that are useful in matrix computations.

> restart : with(linalg, coldim, delcols, delrows, det, minor, rowdim) :

Both the minor and cofactor of a matrix element are defined only for square matrices.

Consider a ( 3 × 3 ) matrix [ A ] given as

> A := matrix(3, 3, [a[11], a[12], a[13], a[21], a[22], a[23], a[31], a[32], a[33]]) : A = matrix(A) ;

A = matrix([[a[11], a[12], a[13]], [a[21], a[22], a...

A. The minor of a matrix element

The minor of an element a[ij] in an ( n × n ) matrix is defined as the matrix of order ( n-1 ) × ( n-1 ) obtained by the deletion of row i and column j .

For example, choose the element a[12] in the row i = 1 and column j = 2 of the matrix [ A ] and obtain the minor of this element. This operation may be performed using either of the following alternative methods.

Method 1 . Using the delrows and delcols functions:

> `minor(a12)` := delcols(delrows(A, 1..1), 2..2) : Minor(a[12]) = matrix(`minor(a12)`) ;

Minor(a[12]) = matrix([[a[21], a[23]], [a[31], a[33...

Method 2 . Using the minor function:

> i := 1 : j := 2 : `minor(a12)` := minor(A, i, j) : Minor(a[12]) = matrix(`minor(a12)`) ;

Minor(a[12]) = matrix([[a[21], a[23]], [a[31], a[33...

The determinant of the minor of the element a[12] is

> `det(minor(a12))` := det(`minor(a12)`) : Det(Minor(a[12])) = `det(minor(a12))` ;

Det(Minor(a[12])) = a[21]*a[33]-a[23]*a[31]

B. The cofactor of a matrix element

The cofactor or signed minor of an element a[ij] in an ( n × n ) matrix is defined as the product of the determinant of the minor of this element and scalar (-1)^(i+j) .

For example, the cofactor of the above element a[12] is

> cofactor(a12) := (-1)^(i+j) * `det(minor(a12))` : Cofactor(a[12]) = cofactor(a12) ;

Cofactor(a[12]) = -a[21]*a[33]+a[23]*a[31]

Using the cofactors of row or column elements of a matrix enables evaluation of the determinant of the matrix, according to the Laplace expansion theorem, which states:

"The determinant associated with any ( n × n ) matrix [ A ] is obtained by summing the products of the elements and their cofactors in any row or column of the matrix . "

If matrix [ A ] has the general element a[ij] and the corresponding cofactor is Cofactor(a[ij]) , then this theorem may be expressed as follows:

Expansion by elements of a row:

Det(A) = Sum(a[ij]*Cofactor(a[ij]),j = 1 .. n) i = 1, 2, ..., n

Expansion by elements of a column:

Det(A) = Sum(a[ij]*Cofactor(a[ij]),i = 1 .. n) j = 1, 2, ..., n

* * *

N.B. Since the expansion of the determinant of a matrix can be done about any one row or any one column, it is convenient to choose a row or a column with as many zeros as possible.

* * *

Choosing the first row ( i = 1 ) of the above matrix [ A ] results in the following expansion of the determinant of [ A ] displayed in "like-in-a-book" form:

> i:=1 : for j to coldim(A) do `det(minor(A,i,j))`[i, j] := Det(minor(A, i, j)) : a[i, j] := a[cat(i, j)] : od :

> j := 'j' : `det(A)` := sum((-1)^(i+j)*a[i, j]*`det(minor(A,i,j))`[i, j], j=1..coldim(A)) : Det(A)=`det(A)` ;

Det(A) = a[`11`]*Det(matrix([[a[22], a[23]], [a[32]...

The cat function is used above to c onc at enate together the indices of the elements a[ij] into a string expression. The sum function performs the sum mation of the expressions under this function .

Evaluation of the determinant of matrix [ A ] yields the following expression:

> for j to coldim(A) do `det(minor(A,i,j))`[i, j] := det(minor(A, i, j)) : od :

> j := 'j' : `det(A)` := sum((-1)^(i+j)*a[i, j]*`det(minor(A,i,j))`[i, j], j=1..coldim(A)) : Det(A) = `det(A)` ;

Det(A) = a[`11`]*(a[22]*a[33]-a[23]*a[32])-a[`12`]*...

Application of the normal , simplify , or expand function to the above result expands it to the following expression:

> `det(A)` := normal(`det(A)`) : Det(A) = `det(A)` ; a[1,2] := 'a[1,2]' :

Det(A) = a[`11`]*a[22]*a[33]-a[`11`]*a[23]*a[32]-a[...

* * *

N.B. Evaluation of the determinant of the matrix [ A ] can be done in Maple directly by applying the det function to the matrix [ A ], i.e.

> `det(A)` := sort(det(A)) : Det(A) = `det(A)` ;

Det(A) = -a[11]*a[32]*a[23]+a[11]*a[22]*a[33]+a[13]...

The sorting function sort is used above to obtain a strict correspondence of the product terms in both results.

* * *

N.B. It follows from the Laplace expansion theorem that the sum of the products of the elements of any row (or column) of a square matrix with the cofactors corresponding to the elements of a different row (or column) is zero .

Exemplarily, consider a ( 3 × 3 ) matrix [ A ] given as

> A := matrix(3, 3, [1, 3, 2, 4, 1, 2, 3, 1, 3]) : A = matrix(A) ;

A = matrix([[1, 3, 2], [4, 1, 2], [3, 1, 3]])

and verify that the sum of the products of the elements of column 1 with the corresponding cofactors of the elements of column 2 is zero .

(a) The cofactors of the elements of column 2 are

> j := 2 : for i to rowdim(A) do cofactor(a[i, j]) := (-1)^(i+j)*det(minor(A, i, j)) : print(Cofactor(a[i, j]) = cofactor(a[i, j])) : od : i := 'i' :

Cofactor(a[1,2]) = -6

Cofactor(a[2,2]) = -3

Cofactor(a[3,2]) = 6

(b) The sum of the products of the elements of column 1 with the corresponding cofactors of the elements of column 2 is

> `sum(A[i,1] cofactor(a[i,j])` := sum(A[i, 1] * cofactor(a[i, j]), i=1..rowdim(A)) :

> Sum(a[i, 1] * Cofactor(a[i, j]), i=1..rowdim(A)) = `sum(A[i,1] cofactor(a[i,j])` ;

Sum(a[i,1]*Cofactor(a[i,2]),i = 1 .. 3) = 0

* * *

Proceed to Unit (13) for " The adjoint of a matrix ".

-------------------------------------------------------------------