Docsity

Lecture Notes on Matrix Algebra - Linear Algebra | MATH 206, Study notes of Linear Algebra

Toggle sidebar
bg1
Fall Semester ’07-’08
Akila Weerapana
LECTURE 6: MATRIX ALGEBRA
I. INTRODUCTION
•The first few lectures in the class reviewed material that you had already covered, even
though the applications may have been new. Starting with this lecture, we start covering
new material, at least for some of you, drawn from linear algebra and differential equations.
•Since Math 206 is at least a co-requisite for the course you should already have started
covering basic matrix operations such as addition, multiplication, inversion etc, so we will
move quickly through that section. If you have taken Math 206 already, this material will be
extremely basic.
•Today’s class will cover the most basic features of linear algebra: what matrices are, elemen-
tary operations such as transposition, addition, multiplication and determinants of matrices.
We will also define the inverse of a matrix and how to calculate it.
II. WHAT IS A MATRIX
Matrix
•Most mathematics textbooks define a matrix as a “rectangular array” containing numbers
or variables. Although hard to describe in words, a matrix can be visualized extremely easily.
The following are all matrices.
4 5 6 8
1 3 5 7
4 5
1 3
5 7
x1x2
x3x41 4 3
x
y
z
•A matrix is typically described in terms of its dimensions. An m×n(pronounced m by n)
matrix is a matrix with m×nentries represented in m rows and n columns. So the 5 matrices
above are 2 ×4, 3 ×2, 2 ×2, 1 ×3 and 3 ×1 matrices respectively.
•The entries of a matrix are usually referenced according to their location within the matrix.
So in general if we have an m×nmatrix known as X, we will refer to the element in row i
and column j of X as Xij . The elements that lie on the diagonal line between the first and
the last entries, i.e. those elements for which i=jare known as the diagonal elements and
the others as the off-diagonal elements.
•A matrix in which the number of rows equals the number of columns is called a square
matrix.
Identity Matrix
•The identity matrix, denoted I, is a special matrix. It is a square matrix with with each
diagonal entry being 1 and each non-diagonal entry being 0.
pf3
pf4
pf5
pf8

Partial preview of the text

Download Lecture Notes on Matrix Algebra - Linear Algebra | MATH 206 and more Study notes Linear Algebra in PDF only on Docsity!

Fall Semester ’07-’ Akila Weerapana

LECTURE 6: MATRIX ALGEBRA

I. INTRODUCTION

  • The first few lectures in the class reviewed material that you had already covered, even though the applications may have been new. Starting with this lecture, we start covering new material, at least for some of you, drawn from linear algebra and differential equations.
  • Since Math 206 is at least a co-requisite for the course you should already have started covering basic matrix operations such as addition, multiplication, inversion etc, so we will move quickly through that section. If you have taken Math 206 already, this material will be extremely basic.
  • Today’s class will cover the most basic features of linear algebra: what matrices are, elemen- tary operations such as transposition, addition, multiplication and determinants of matrices. We will also define the inverse of a matrix and how to calculate it.

II. WHAT IS A MATRIX

Matrix

  • Most mathematics textbooks define a matrix as a “rectangular array” containing numbers or variables. Although hard to describe in words, a matrix can be visualized extremely easily. The following are all matrices.

[ 4 5 6 8 1 3 5 7

]

[

x 1 x 2 x 3 x 4

] [

]

x y z

  • A matrix is typically described in terms of its dimensions. An m × n (pronounced m by n) matrix is a matrix with m × n entries represented in m rows and n columns. So the 5 matrices above are 2 × 4, 3 × 2, 2 × 2, 1 × 3 and 3 × 1 matrices respectively.
  • The entries of a matrix are usually referenced according to their location within the matrix. So in general if we have an m × n matrix known as X, we will refer to the element in row i and column j of X as Xij. The elements that lie on the diagonal line between the first and the last entries, i.e. those elements for which i = j are known as the diagonal elements and the others as the off-diagonal elements.
  • A matrix in which the number of rows equals the number of columns is called a square matrix.

Identity Matrix

  • The identity matrix, denoted I, is a special matrix. It is a square matrix with with each diagonal entry being 1 and each non-diagonal entry being 0.
  • We use the notation In to refer to the dimension of the matrix (since number of rows= number of columns in a square matrix, we only need 1 number to know its dimensions.

Example

I 3 =

 I 2 =

[

]

Symmetric Matrix

  • A symmetric matrix is another special matrix. A matrix A is said to be symmetric if Aij = Aji ∀i, j In other words when we transpose the rows and columns of A, the resulting matrix, denoted A′^ is equivalent to A.
  • Given the definition we can see that a matrix that is symmetric must also be square. The converse is not true, not all square matrices are symmetric.

Example

A =

 (^) is symmetric since A′^ =

but B =

[

]

is NOT symmetric since B′^ =

[

]

Vector

  • A matrix with a single row or column is sometimes referred to as a vector. A matrix with a single column is called a column vector and a matrix with a single row is called a row vector. A 1 × 1 matrix, i.e. a matrix with only 1 entry is called a scalar.

III. BASIC MATRIX OPERATIONS

Transposition

  • The transpose of an m × n matrix is an n × m matrix constructed by switching rows and columns of the original matrix. That is to say, elements that were on the first column of the original matrix now make up the first row of the transposed matrix. The transpose of a given matrix X is denoted as X′.

Example

Matrix Multiplication

  • Matrix multiplication is by far the most complicated of the basic operations. When we multiply matrix A by matrix B (denoted AB) to obtain matrix C, a given element is obtained by multiplying the ith row of A by the jth column of B. Therefore, multiplication of two matrices is legal only when the ith row of the first matrix has the same number of elements as the jth column of the second matrix: in other words the number of columns in A has to equal the number of rows in B.
  • More generally an m × n matrix A can be multiplied by an n × p matrix B where p is any positive integer. The resulting matrix C is of dimension m × p with elements defined as follows: Cij =

∑n k=1 (Aik^ ×^ Bkj^ ) for^ i^ = 1^ · · ·^ m,^ j^ = 1^ · · ·^ p.

  • A simple example illustrates the procedure much more clearly than the notation. Suppose we have a 3×2 matrix, A, and a 2×3 matrix, B. Note that according to the rules of multiplication we can do either AB (which will be a 3 × 3 matrix) or BA (which will be a 2 × 2 matrix) in this case. (Note: If B was a 2 × 5 matrix, for example, only AB would be defined. BA would not be defined since the number of columns in B (5) is greater than the number of rows in A (3)).

Example

Suppose A=

 (^) and B =

[

]

. Then

AB =

[

]

BA =

[

]

[

]

  • Rules of Multiplication (where A is m × n, D is n × p and E is p × q)

AB 6 = BA (AD)E = A(DE) AIn = A ImA = A (AD)′^ = D′A′

  • Rules of Vector Multiplication If x is an n × 1 column vector then a) x′x is a scalar equal

∑n k=1 x 2 k 1

b) xx′^ is a symmetric matrix of dimension n xx′^ =

x^211 x 12 x 21 · · · x 1 nxn 1 x 21 x 12 x^222 · · · x 2 nxn 2 .. .

xn 1 x 1 n xn 2 x 2 n · · · xnnn

Determinant

  • The determinant of a square matrix is a unique number associated with that matrix. The determinant of a matrix is usually denoted by writing the name of the matrix surrounded by two vertical bars: e.g. the determinant of A is |A|.
  • How is the determinant of a matrix calculated. For a 1 × 1 matrix, a 2 × 2 matrix or a 3 × 3 matrix, the process is fairly simple. For higher dimension matrices, the calculation is more involved.
  • The determinant of a 1 × 1 matrix (a scalar) is the scalar itself.
  • The determinant of a 2 × 2 matrix of the form A =

[

a b c d

]

is |A| = (ad − bc)

  • The determinant of a 3 × 3 matrix of the form A =

a b c d e f g h i

 (^) is

|A| = (aei + bf g + cdh) − (ceg + bdi + af h) Although this seems hard to remember, there is a simple trick that enables us to calculate the determinant of a 3 × 3 matrix. The trick requires you to write down two copies of the matrix side by side, then add the products of the three leftmost diagonals and subtract the products of the three rightmost diagonals.

  • The determinant of an n×n matrix is found using a procedure known as a ‘Laplace expansion’. The Laplace expansion is a recursive process: i.e. the determinant of an n × n matrix is expressed as a function of determinants of several (n − 1) × (n − 1)) matrices, each of which in turn are expressed as functions of several (n − 2) × (n − 2) matrices etc. Since we know how to calculate the determinant of a 3 × 3 matrix or a 2 × 2 matrix we can always build back up to the top.
  • In order to write down the Laplace expansion formula, we need to define a few other terms. The minor of a matrix is the determinant of a submatrix formed from a given matrix. In particular, the (i,j)th minor of a matrix, denoted as |Mij | is the determinant of a matrix obtained by omitting the ith row and jth column of the original matrix.
  • Consider the following matrix A =

. Some of the minors of this matrix are

|M 11 | =

= 432, |M 23 | =

= 0 and |M 41 | =

  • The cofactor of a matrix is another determinant of a submatrix formed from the original. The (i,j)th cofactor of a matrix is defined as |Cij | = (−1)i+j^ |Mij |, that is to say the co-factor is similar to the minor, except that it may have a different sign. If the sum of i and j is an even number then the sign is positive, if the sum is an odd number, the sign is negative. So |C 11 | = |M 11 |, |C 12 | = − |M 12 |, |C 23 | = − |M 23 |, |C 24 | = |M 24 | etc.
  • Consider the matrix A=

[

]

, the inverse of this matrix is A−^1 =

[

]

since

AA−^1 = A−^1 A = A =

[

]

  • Properties of the Inverse
    • If A−^1 is the inverse of a matrix A, then

A−^1

= A

  • If A−^1 is the inverse of a matrix A, then (A′)−^1 = (A−^1 )′
  • If A and B are both square matrices with inverse matrices A−^1 and B−^1. Then the matrix C = AB has an inverse defined as C−^1 = B−^1 A−^1
  • Calculating the inverse of a matrix is a chore. First, we have to define something called the adjoint of the matrix.
  • The adjoint of an n × n matrix A is another n × n matrix defined as

adj(A) = C′^ where C =

|C 11 | |C 12 | · · · |C 1 n| |C 21 | |C 22 | · · · |C 2 n| .. .

|Cn 1 | |Cn 2 | · · · |Cnn|

  • In other words the adjoint of an n × n matrix A is the transpose of an n × n matrix C whose (i,j)th element is the (i,j)th cofactor of A.
  • Given the adjoint of an n × n matrix A matrix A that is invertible, we can then calculate the inverse as A−^1 =

|A|

adj(A)

Example

  • Suppose A =

. We can calculate |A| = −9 so we know that the inverse exists.

  • The matrix of cofactors of the matrix A can be calculated as

|C 11 | =

∣∣ = 48, |C 12 | = −

∣∣ = − 12 , |C 13 | =

|C 21 | = −

∣ =^ −^31 ,^ |C^22 |^ =

∣ = 7,^ |C^23 |^ =^ −

|C 31 | =

∣ = 50,^ |C^32 |^ =^ −

∣ =^ −^11 ,^ |C^33 |^ =

∣ =^ −^23

  • We can then write down the adjoint of A as the transpose of the above matrix of cofactors

adj(A) =

′

  • Therefore

A−^1 =

|A|

adj(A) =

  • I’ll leave it up to you verify that this is right. In general calculating the inverse of a 3 × 3 matrix is a lot of work and a 4 × 4 matrix is a monumental task to invert. Fortunately, you will rarely have to this by hand. There are plenty of excellent software packages like Mathematica and Matlab, that will calculate the determinant for you, even if the matrix consists of symbolic expressions instead of numbers.