Matrices-Unit10.mws

MATRICES AND MATRIX OPERATIONS: Unit 10

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

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

(10) The transpose of a matrix

OBJECTIVES :

To define the transpose of a matrix and provide examples of transposition operation.

To show the effect of transposition operation on specific types of matrices.

To specify and illustrate general properties of transposition operation.

To stress and show that transposition of a vector with Maple does not yield a column matrix .

To introduce the function equal for testing if matrices are equal.

> restart : with(linalg, diag, equal, multiply, transpose) :

The transpose of a matrix ( or transposed matrix ) is the matrix resulting from interchanging the rows and columns in the given matrix. If the given matrix is of order ( m × n ) , then its transpose is the matrix of order ( n × m ) .

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

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

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

The transpose of the matrix [ A ] is the following ( 2 × 3 ) matrix:

> `transp(A)` := transpose(A) : Transp(A) = matrix(`transp(A)`) ;

Transp(A) = matrix([[a[11], a[21], a[31]], [a[12], ...

This operation may be displayed in "like-in-a-book" form, viz.

> Transp(matrix(A)) = matrix(`transp(A)`) ;

Transp(matrix([[a[11], a[12]], [a[21], a[22]], [a[3...

* * *

N.B. The transpose of a diagonal matrix is the same as the matrix itself.

Exemplarily, the transpose of a ( 4 × 4 ) diagonal matrix [ B ] given as

> B := diag(3, 0, 2, 5) : B = matrix(B) ;

B = matrix([[3, 0, 0, 0], [0, 0, 0, 0], [0, 0, 2, 0...

is the following ( 4 × 4 ) diagonal matrix:

> `transp(B)` := transpose(B) : Transp(B) = matrix(`transp(B)`) ;

Transp(B) = matrix([[3, 0, 0, 0], [0, 0, 0, 0], [0,...

This operation may be displayed in "like-in-a-book" form, viz.

> Transp(matrix(B)) = matrix(`transp(B)`) ;

Transp(matrix([[3, 0, 0, 0], [0, 0, 0, 0], [0, 0, 2...

* * *

N.B. Transposition of a square matrix does not change the determinant of the matrix.

[ For the determinant of a matrix, refer to Unit (11). ]

* * *

N.B. Transposition does not change the s ymmetric matrix.

Exemplarily, the transpose of a ( 3 × 3 ) symmetric matrix [ C ] given as

> C := matrix(3, 3, [1, a, a^2, a, a^2, 1, a^2, 1, a]) : C = matrix(C) ;

C = matrix([[1, a, a^2], [a, a^2, 1], [a^2, 1, a]])...

is the following ( 3 × 3 ) symmetric matrix:

> `transp(C)` := transpose(C) : Transp(C) = matrix(`transp(C)`) ;

Transp(C) = matrix([[1, a, a^2], [a, a^2, 1], [a^2,...

This operation may be displayed in "like-in-a-book" form, viz.

> Transp(matrix(C)) = matrix(`transp(C)`) ;

Transp(matrix([[1, a, a^2], [a, a^2, 1], [a^2, 1, a...

* * *

N.B. Transposition changes sign of a skew-symmetric matrix but the matrix is otherwise unchanged.

Exemplarily, the transpose of a ( 3 × 3 ) skew-symmetric matrix [ E ] given as

> E := matrix(3, 3, [0, a, b, -a, 0, c, -b, -c, 0]) : E = matrix(E) ;

E = matrix([[0, a, b], [-a, 0, c], [-b, -c, 0]])

is the following ( 3 × 3 ) skew-symmetric matrix:

> `transp(E)` := transpose(E) : Transp(E) = matrix(`transp(E)`) ;

Transp(E) = matrix([[0, -a, -b], [a, 0, -c], [b, c,...

This operation may be displayed in "like-in-a-book" form, viz.

> Transp(matrix(E)) = matrix(`transp(E)`) ;

Transp(matrix([[0, a, b], [-a, 0, c], [-b, -c, 0]])...

* * *

N.B. According to the definition of the transpose of a matrix, the transpose of a ( 1 × n ) row matrix is an ( m × 1 ) column matrix , in which m = n .

Exemplarily, the transpose of a ( 1 × 3 ) row matrix [ RM ] given as

> RM := matrix(1, 3, [a, b, c]) : RM = matrix(RM) ;

RM = matrix([[a, b, c]])

is the following ( 3 × 1 ) column matrix:

> `transp(RM)` := transpose(RM) : Transp(RM) = matrix(`transp(RM)`) ;

Transp(RM) = matrix([[a], [b], [c]])

This operation may be displayed in "like-in-a-book" form, viz.

> Transp(matrix(RM)) = matrix(`transp(RM)`) ;

Transp(matrix([[a, b, c]])) = matrix([[a], [b], [c]...

* * *

N.B. In some textbooks, the following 'shortcut notation' is used in relation to a vector

[a, b, c]^T

to mean "convert vector [a, b, c] to a column matrix by transposition".

Let us analyse this operation in Maple .

If the vector [a, b, c] is assigned the name RV, viz.

> RV := array([a, b, c]) : RV = eval(RV) ;

RV = vector([a, b, c])

then, transposition operation of [ RV ] yields

> `transp(RV)` := transpose(RV) : Transp(RV) = transpose(eval(RV)) ;

Transp(RV) = transpose(vector([a, b, c]))

In executing this operation, Maple treats vector [ RV ] as if it were a column vector and, consequently, transposition of [ RV ] yields a row vector . This is evidenced by the following results.

(a) The product [ RV ] (Transp [ RV ] ), which is a ( 3 × 3 ) symmetric matrix:

> `RV transp(RV)` := evalm(RV &* `transp(RV)`) : RV * Transp(RV) = eval(`RV transp(RV)`) ;

RV*Transp(RV) = matrix([[a^2, a*b, a*c], [a*b, b^2,...

This corresponds to the result of multiplication of a column matrix and a row matrix – refer to Section B of Unit (5).

(b) The product (Transp [ RV ] ) [ RV ] , which is a scalar (number):

> `(transp(RV)) RV` := evalm(`transp(RV)` &* RV) : `Transp(RV)` * RV = eval(`(transp(RV)) RV`) ;

`Transp(RV)`*RV = a^2+b^2+c^2

This corresponds to the result of multiplication of a row matrix and a column matrix – refer to Section A of Unit (5).

Thus, transposition of a (row) vector does not yield a column matrix in Maple .

* * *

N.B. According to the definition of the transpose of a matrix, the transpose of an ( m × 1 ) column matrix is a ( 1 × n ) row matrix .

Exemplarily, the transpose of a ( 3 × 1 ) column matrix [ CM ] given as

> CM := matrix(3, 1, [d, e, f]) : CM = matrix(CM) ;

CM = matrix([[d], [e], [f]])

is the following ( 1 × 3 ) row matrix:

> `transp(CM)` := transpose(CM) : Transp(CM) = matrix(`transp(CM)`) ;

Transp(CM) = matrix([[d, e, f]])

This operation may be displayed in "like-in-a-book" form, viz.

> Transp(matrix(CM)) = matrix(`transp(CM)`) ;

Transp(matrix([[d], [e], [f]])) = matrix([[d, e, f]...

* * *

N.B. The transpose of the product of a matrix [ A ] and a scalar k equals the matrix transpose multiplied by the scalar

Transp( k [ A ] ) = k Transp [ A ]

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

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

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

(a) The transpose of the product of the matrix [ A ] and scalar k , Transp( k [ A ] ) , is the following (3 × 2) matrix:

> `transp(kA)` := transpose(k*A) : Transp(k*A) = matrix(`transp(kA)`) ;

Transp(k*A) = matrix([[k*a[11], k*a[21]], [k*a[12],...

(b) The product of the matrix transpose multiplied by the scalar, k Transp [ A ], is the following (3 × 2) matrix:

> `k transp(A)` := evalm(k * transpose(A)) : k * Transp(A) = matrix(`k transp(A)`) ;

k*Transp(A) = matrix([[k*a[11], k*a[21]], [k*a[12],...

The equal function applied to the resultant matrices of (a) and (b), i.e.

> equal(`transp(kA)`, `k transp(A)`) ;

true

returns the Boolean value true , which verifies that both matrices are equal.

* * *

N.B. The product of the transpose of a square matrix [ A ] and the matrix is a symmetric matrix. The product of the same square matrix [ A ] and its transpose is also a symmetric matrix but both resultant matrices are different.

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

> A := matrix(2, 2, [a, b, c, d]) : A = matrix(A) ;

A = matrix([[a, b], [c, d]])

(a) The product (Transp [ A ] ) [ A ] is the following ( 2 × 2 ) symmetric matrix:

> `(transp(A)) A` := evalm(transpose(A) &* A) : Transp(A) * A = matrix(`(transp(A)) A`) ;

Transp(A)*A = matrix([[a^2+c^2, a*b+c*d], [a*b+c*d,...

(b) The product [ A ] (Transp [ A ] ) is the following ( 2 × 2 ) symmetric matrix:

> `A transp(A)` := evalm(A &* transpose(A)) : A * `Transp(A)` = matrix(`A transp(A)`) ;

A*`Transp(A)` = matrix([[a^2+b^2, a*c+b*d], [a*c+b*...

The matrices of (a) and (b) are symmetric but different.

* * *

N.B. The sum of a square matrix and its transpose is a symmetric matrix.

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

> A := matrix(2, 2, [a[11], a[12], a[21], a[22]]) : A = matrix(A) ;

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

The sum [ A ] + Transp [ A ] is the following ( 2 × 2 ) symmetric matrix:

> `A+transp(A)` := evalm(A + transpose(A)) : A + Transp(A) = matrix(`A+transp(A)`) ;

A+Transp(A) = matrix([[2*a[11], a[12]+a[21]], [a[12...

This operation may be displayed in "like-in-a-book" form, viz.

> matrix(A) + Transp(matrix(A)) = matrix(`A+transp(A)`) ;

matrix([[a[11], a[12]], [a[21], a[22]]])+Transp(mat...

* * *

N.B. The difference of a square matrix and its transpose is a skew-symmetric matrix.

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

> A := matrix(2, 2, [a[11], a[12], a[21], a[22]]) : A = matrix(A) ;

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

The difference [ A ] – Transp [ A ] is the following ( 2 × 2 ) skew-symmetric matrix:

> `A-transp(A)` := evalm(A - transpose(A)) : A - Transp(A) = matrix(`A-transp(A)`) ;

A-Transp(A) = matrix([[0, a[12]-a[21]], [a[21]-a[12...

This operation may be displayed in "like-in-a-book" form, viz.

> matrix(A) - Transp(matrix(A)) = matrix(`A-transp(A)`) ;

matrix([[a[11], a[12]], [a[21], a[22]]])-Transp(mat...

* * *

N.B. It follows immediately from the two preceding properties that any square matrix satisfies the formula

[ A ] = 1/2 ( [ A ] + Transp [ A ] ) + 1/2 ( [ A ] Transp [ A ] )

where

term ½ ( [ A ] + Transp [ A ] ) is referred to as the symmetric part of square matrix [ A ],

term ½ ( [ A ] Transp [ A ] ) is referred to as the antisymmetric part of square matrix [ A ].

This formula implies that a square matrix can be expressed as the sum of symmetric and antisymmetric parts of the matrix. The following example supports and illustrates these names.

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

> A := matrix(3, 3, [a, b, c, d, e, f, g, h, i]) : A = matrix(A) ;

A = matrix([[a, b, c], [d, e, f], [g, h, i]])

(a) Compute the symmetric part of [ A ] as ½ ( [ A ] + Transp [ A ] ) :

> sym(A) :=evalm(1/2*(A + transpose(A))) : Sym(A) = matrix(sym(A)) ;

Sym(A) = matrix([[a, 1/2*b+1/2*d, 1/2*c+1/2*g], [1/...

(b) Compute the antisymmetric part of [ A ] as ½ ( [ A ] Transp [ A ] ) :

> antisym(A) := evalm(1/2*(A - transpose(A))) : Antisym(A) = matrix(antisym(A)) ;

Antisym(A) = matrix([[0, 1/2*b-1/2*d, 1/2*c-1/2*g],...

(c) The sum of the two parts of [ A ] yields the matrix

> `sym(A)+antisym(A)` := evalm(sym(A) + antisym(A)) :

> Sym(A) + Antisym(A) = matrix(`sym(A)+antisym(A)`) ;

Sym(A)+Antisym(A) = matrix([[a, b, c], [d, e, f], [...

which is the original square matrix [ A ].

* * *

N.B. Transposition is reflexive , i.e. the transpose of a matrix transpose is the matrix itself

Transp(Transp [ A ] ) = [ A ]

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

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

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

The transpose of the transpose of the matrix, Transp(Transp [ A ] ) , is the following ( 3 × 2 ) matrix:

> `transp(transp(A))` := transpose(transpose(A)) : Transp(Transp(A)) = matrix(`transp(transp(A))`) ;

Transp(Transp(A)) = matrix([[a[11], a[12]], [a[21],...

This operation may be displayed in "like-in-a-book" form, viz.

> Transp(Transp(matrix(A))) = matrix(`transp(transp(A))`) ;

Transp(Transp(matrix([[a[11], a[12]], [a[21], a[22]...

* * *

N.B. The transpose of the sum of two matrices is the sum of the two transposed matrices

Transp( [ A ] + [ B ] ) = Transp [ A ] + Transp [ B ]

Exemplarily, consider ( 2 × 3 ) matrices [ A ] and [ B ] given as

> A := matrix(2, 3, [a[11], a[12], a[13], a[21], a[22], a[23]]) :

> B := matrix(2, 3, [b[11], b[12], b[13], b[21], b[22], b[23]]) :

> A = matrix(A) ; B = matrix(B) ;

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

B = matrix([[b[11], b[12], b[13]], [b[21], b[22], b...

(a) The transpose of the sum of the two matrices, Transp( [ A ] + [ B ] ) , is the following ( 3 × 2 ) matrix:

> `transp(A+B)` := transpose(evalm(A + B)) : Transp(A + B) = matrix(`transp(A+B)`) ;

Transp(A+B) = matrix([[a[11]+b[11], a[21]+b[21]], [...

(b) The sum of the two transposed matrices, Transp [ A ] + Transp [ B ], is the following ( 3 × 2 ) matrix:

> `transp(A)+transp(B)` := evalm(transpose(A) + transpose(B)) :

> Transp(A) + Transp(B) = matrix(`transp(A)+transp(B)`) ;

Transp(A)+Transp(B) = matrix([[a[11]+b[11], a[21]+b...

This operation may be displayed in "like-in-a-book" form, viz.

> Transp(matrix(A) + matrix(B)) = matrix(`transp(A)+transp(B)`) ;

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

* * *

N.B. The transpose of the product of two matrices is the product of the two transposed matrices but in the reverse order

Transp( [ A ] [ B ] ) = Transp [ B ] Transp [ A ]

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

> A := matrix(2, 3, [a[11], a[12], a[13], a[21], a[22], a[23]]) :

> B := matrix(3, 2, [b[11], b[12], b[21], b[22], b[31], b[32]]) :

> A = matrix(A) ; B = matrix(B) ;

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

B = matrix([[b[11], b[12]], [b[21], b[22]], [b[31],...

(a) The transpose of the product of the two matrices, Transp( [ A ] [ B ] ) , is the following ( 2 × 2 ) matrix:

> `transp(AB)` := transpose(multiply(A, B)) : Transp(A * B) = matrix(`transp(AB)`) ;

Transp(A*B) = matrix([[a[11]*b[11]+a[12]*b[21]+a[13...

(b) The product of the two transposed matrices multiplied in the reverse order, Transp [ B ] Transp [ A ], is the following ( 2 × 2 ) matrix:

> `transp(B) transp(A)` := multiply(transpose(B), transpose(A)) :

> Transp(B) * Transp(A) = matrix(`transp(B) transp(A)`) ;

Transp(B)*Transp(A) = matrix([[a[11]*b[11]+a[12]*b[...

This operation may be displayed in "like-in-a-book" form, viz.

> Transp(matrix(A)*matrix(B)) = matrix(`transp(B) transp(A)`) ;

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

* * *

Proceed to Unit (11) for " The determinant of a matrix ".

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