100% found this document useful (1 vote)
463 views41 pages

Matrix 1

Matrix algebra allows calculations on arrays of numbers and makes mathematical expressions and computations easier. A matrix is a collection of numbers ordered by rows and columns. Matrix operations include addition, subtraction, multiplication, and transposition. For matrices to be multiplied, their dimensions must be compatible. Common matrix types include square, triangular, diagonal, and identity matrices. Matrix multiplication is not always commutative.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
463 views41 pages

Matrix 1

Matrix algebra allows calculations on arrays of numbers and makes mathematical expressions and computations easier. A matrix is a collection of numbers ordered by rows and columns. Matrix operations include addition, subtraction, multiplication, and transposition. For matrices to be multiplied, their dimensions must be compatible. Common matrix types include square, triangular, diagonal, and identity matrices. Matrix multiplication is not always commutative.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

UNIT 2

Matrix Algebra
Matrix algebra is a means of making calculations upon arrays of numbers

(or data).

Most data sets are matrix-type

Matrix algebra makes mathematical expression and computation easier.

It allows you to get rid of cumbersome notation, concentrate on the

concepts involved and understand where your results come from.


Definitions - vector
Vector: a single row or column of numbers
• denoted with bold small letters

• row vector

a= 1 2 3 4 5
• column vector

b=
1 
 2
 3
 4
5
Introduction
Definitions: A matrix is a collection of numbers ordered by rows and columns.

It is customary to enclose the elements of a matrix in parentheses, brackets, or

braces.

For example, the following is a matrix:

5 6 9
X=
7 6 3
This matrix has two rows and three columns, so it is referred to as a “2 by 3”

matrix. The elements of a matrix are numbered in the following way:

X11 X12 X13


X=
X21 X22 X23

That is, the first subscript in a matrix refers to the row and the second

subscript refers to the column. It is important to remember this convention

when matrix algebra is performed.


Definitions
A square matrix is a matrix that has the same number
of rows and columns (n  n)

Two matrices are equal if and only if


• they both have the same number of rows and the same number of
columns

• their corresponding elements are equal


Types of matrices
 Square

 Null

 Triangular

 Diagonal

 Scalar

 Identity

 Symmetric

 Skew-symmetric
Square Matrix: A matrix with same number of rows and columns

3 8 9

8 6 4

5 2 1

Null Matrix: A matrix with all elements ‘0’.

0 0 0

0 0 0

0 0 0
Upper triangular matrix. A square matrix in which all the elements below
the diagonal are zero i.e. a matrix of type:

5 5 8
0 5 8
0 0 4

Lower triangular matrix. A square matrix in which all the elements above the
diagonal are zero i.e. a matrix of type

5 0 0
4 5 0
5 4 8
Diagonal matrix. A square matrix in which all of the elements are zero
except for the diagonal elements i.e. a matrix of type

5 0 0

0 9 0

0 0 7

It is often written as D = diag(a11, a22, a33, ... , ann)


Scalar matrix. A diagonal matrix in which all of the diagonal elements are
equal to some constant “k” i.e. a matrix of type

5 0 0
0 5 0
0 0 5

Identity matrix. A diagonal matrix in which all of the diagonal elements are
equal to “1" i.e. a matrix of type

1 0 0
0 1 0
0 0 1
An identity matrix of order nxn is denoted by In .
Symmetric matrix. A square matrix in which corresponding elements with respect to the diagonal are
equal; a matrix in which aij = aji where aij is the element in the i-th row and j-th column; a matrix which is
equal to its transpose; a square matrix in which a flip about the diagonal leaves it unchanged.

Example: 8 5 6

5 4 8

6 8 3

Skew-symmetric matrix. A square matrix in which corresponding elements with respect to the diagonal are
negatives of each other; a matrix in which aij = -aji where aij is the element in the i-th row and j-th column;
a matrix which is equal to the negative of its transpose. The diagonal elements are always zeros.

Example: 0 5 6

-5 0 8

-6 -8 0
Equality of Matrices
Two matrices, say A and B are said to be equal if

• They are of the same order

• The elements in the corresponding position of the two are same.

Thus, two matrices A m*n and B m*n can be equal if

aij = bij

For all values of i=1 to m and j=1 to n

A= 8 9 0 B= 8 9 0

5 4 6 5 4 6

8 4 5 8 4 5
Matrix Operations
Addition and Subtraction

Multiplication

Inversion

Transposition
Addition and Subtraction
Two matrices may be added (or subtracted) if they are the same order.

Simply add (or subtract) the corresponding elements. So, A + B = C yields


Addition and Subtraction (cont.)

a11 a12  b11 b12  c11 c12 


a a   b b   c c 
 21 22   21 22   21 22 
a31 a32  b31 b32  c31 c32 

Where
a11  b11  c11
a12  b12  c12
a21  b21  c 21
a22  b22  c 22
a31  b31  c31
a32  b32  c32
Matrix Multiplication
To multiply a scalar times a matrix, simply multiply each element of the
matrix by the scalar quantity

 a11 a12   ka11 ka12 


k 
a21 a22  ka21 ka22 

To multiply a matrix times a matrix, we write

• AB (A times B)
This is pre-multiplying B by A, or post-multiplying A by B.
To multiply matrices A and B look at
their dimensions
m n n p
MUST BE SAME

SIZE OF PRODUCT

If the number of columns of A does not equal


the number of rows of B then the product AB
is undefined.
Matrix Multiplication (cont.)
In order to multiply matrices, they must be

CONFORMABLE

that is, the number of columns in A must equal the number of rows in B

So,

A  B = C

(m  n)  (n  p) = (m  p)

(m  n)  (p  n) = cannot be done

(1  n)  (n  1) = a scalar (1x1)


Matrix Multiplication (cont.)
Thus
a11 a12 a13  b11 b12  c11 c12 
a a a  x b b   c c 
 21 22 23   21 22   21 22 
a31 a32 a33  b31 b32  c31 c32 

where
c11  a11b11  a12b21  a13b31
c12  a11b12  a12b22  a13b32
c 21  a21b11  a22b21  a23b31
c 22  a21b12  a22b22  a23b32
c31  a31b11  a32b21  a33b31
c32  a31b12  a32b22  a33b32
Matrix Multiplication- an example
Thus 1 4 7 1 4 c11 c12  30 66 
2 5 8 x 2 5  c c   36 81
     21 22  
3 6 9 3 6 c31 c32  42 96 

where
c1 1  1 * 1  4 * 2  7 * 3  30
c1 2  1 * 4  4 * 5  7 * 6  66
c 2 1  2 * 1  5 * 2  8 * 3  36
c 2 2  2 * 4  5 * 5  8 * 6  81
c 3 1  3 * 1  6 * 2  9 * 3  42
c 3 2  3 * 4  6 * 5  9 * 6  96
Properties
AB does not necessarily equal BA

(BA may even be an impossible operation)

For example,

A  B = C

(2  3)  (3  2) = (2  2)

B  A = D

(3  2)  (2  3) = (3  3)
Properties
Matrix multiplication is Associative

A(BC) = (AB)C

Multiplication and transposition

(AB)' = B'A'
A popular matrix: X'X
1 x11 
1 x12 
X  
  
1 x 
 1n 
1 x11 
   n

1 1  1 1 x12   n  x1i 
X' X         n i 1
n

 x11 x12  x1n      x 2
 
  x1i
1i 
1 x  i 1 i 1
 1n 
Another popular matrix: e'e

 e1 
e 
e   2

 
en 

 e1 
e  n
e' e  e1 e2  en    2  i
e 2
 i 1
 
en 
Identity Matrix
An identity matrix is a diagonal matrix where the diagonal elements all
equal one.

I=

1 0 0 0
AI=A 0 1 0 0

0 0 1 0
 
0 0 0 1
We can use A-1 to solve a system of equations

x  3y  1 To see how, we can re-write a system


of equations as matrices.
2x  5 y  3
Ax  b
coefficient variable constant
matrix matrix matrix

1 3  x 1
2 5  y   
    3
Ax  b left multiply both sides by the
inverse of A

1 1
A Ax  A b
This is just the identity

but the identity times a matrix just


1
Ix  A b gives us back the matrix so we have:

This then gives us a formula for finding the

1
x A b
variable matrix:
Multiply A inverse by the constants.
The Transpose of a Matrix: A'
The transpose of a matrix is a new matrix that is formed by interchanging
the rows and columns.

The transpose of A is denoted by A' or (AT)


Example of a transpose
Thus,

 a11 a12 
 a11 a21 a31 
A  a21 a22  A'  
a a  a12 a22 a32 
 31 32 

If A = A', then A is symmetric


Transpose of a matrix. The matrix resulting from interchanging the rows and columns in
the given matrix. The transpose of

5 6

5 6

4 6 2*3
is

5 5 4

6 6 6 3*2

The first row of A becomes the first column of A T, the second row of A becomes the second
column of A T, etc.. It corresponds to a “flip” of the matrix about the diagonal running down
from the upper left corner.
The Determinant of a Matrix
The determinant of a matrix A is denoted by |A| (or det(A)).

Determinants exist only for square matrices.

They are a matrix characteristic, and they are also difficult to compute
The Determinant for a 2x2 matrix
If A =

a11 a12 
a 
 21 a22 

Then

A  a11a22  a12a21
Properties of Determinates
Determinants have several mathematical properties which
are useful in matrix manipulations.
1. |A|=|A'|.

2. If a row or column of A = 0, then |A|= 0.

3. If every value in a row or column is multiplied by k, then |A| =


k*|A|.

4. If two rows (or columns) are interchanged the sign, but not
value, of |A| changes.
Properties of Determinants
5. If two rows or columns are identical, |A| = 0.

6. If two rows or columns are linear combination of each other,


|A| = 0

7. |A| remains unchanged if each element of a row or each


element multiplied by a constant, is added to any other row.

8. |AB| = |A| |B|

9. Determinant of a diagonal matrix = product of the diagonal


elements
Rank

The rank of a matrix is defined as

rank(A) = number of linearly independent rows

= the number of linearly independent columns.

A set of vectors is said to be linearly dependent if scalars c1, c2, …,


cn (not all zero) can be found such that

c 1a 1 + c 2a 2 + … + c na n = 0
For example,

a = [1 21 12] and b = [1/3 7 4] are linearly dependent

A matrix A of dimension n  p (p < n) is of rank p. Then A


has maximum possible rank and is said to be of full rank.

In general, the maximum possible rank of an n  p


matrix A is min(n, p).
The Inverse of a Matrix (A-1)
For an n  n matrix A, there may be a B such that AB = I
= BA.

The inverse is analogous to a reciprocal

A matrix which has an inverse is nonsingular.

A matrix which does not have an inverse is singular.

An inverse exists only if A 0


Properties of inverse matrices

 AB 

1
 B A-1 -1


 A' 
1
 A 
-1 '

 A 
-1 1
 A
1 3 7
1 3
A  A  
  2  7   2  1

Check this answer by multiplying. We should


get the identity matrix if we’ve found the
inverse.
11 0
AA   
0 1 

You might also like