0% found this document useful (0 votes)
8 views

Lecture 2. Matrices

Uploaded by

Jhan Cleofas
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Lecture 2. Matrices

Uploaded by

Jhan Cleofas
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

MATRICES 2

I
E
N
ADVANCED G
MATHEMATICS FOR
IE 7
0

LECTURE 2

0
MATRICES 2
A matrix is a collection of numbers (called elements) ordered by m rows and n
columns. It is usual to enclose the elements of a matrix in parentheses, brackets, or
braces. For example, the following is a matrix:

−4 1 3
𝐀=[ ]
−1 2 5

This matrix, matrix A, has two rows and three columns so it is referred to as a “2 x
3” matrix. The elements of a matrix are numbered in the following way:

A A12 A13
A = [ 11 ]
A21 A22 A23

Remember that the first subscript in a matrix refers to the row and the second
subscript refers to the column (Aij where i = row number and j = column number).

A vector is a special type of matrix that has only one row (called a row vector) or
one column (called a column vector). Below, a is a column vector while b is a row
vector.

7
𝐚 = [2]
3

𝐛 = [−2 7 4]

A scalar is a matrix with only one row and one column.

𝑠=[8]

Note: It is customary to denote scalars by italicized, lower case letters (e.g., s), to
denote vectors by bold, lower case letters (e.g., a, b), and to denote matrices with
more than one row and one column by bold, upper case letters (e.g., X).

A zero, or null matrix, is one where every element is zero.

0 0
𝐙=[ ]
0 0

A square matrix has as many rows as it has columns (e.g., 2 x 2, 3 x 3, 4 x 4, etc.).


Matric C is square but matrix D is not square:

1 6
𝐂=[ ]
3 2

1 9
𝐃 = [0 3 ]
7 −2

1
MATRICES 2
A symmetric matrix is a square matrix in which Xij = Xji for all i and j. Matrix F is
symmetric while G is not symmetric.

9 1 5
𝐅 = [1 6 2]
5 2 7

9 1 5
𝐆 = [2 6 2]
5 1 7

A diagonal matrix is a symmetric matrix where all the off diagonal elements are
zero (0). Matrix H is a diagonal matrix.

9 0 0
𝐇 = [0 6 0]
0 0 7

An identity matrix is a diagonal matrix with 1s and only 1s on the diagonal. The
identity matrix is almost always denoted as I.

1 0 0
𝐈 = [0 1 0]
0 0 1

Two matrices are considered to be equal if they are of the same order, and if all
their corresponding elements are equal.

The transpose of a matrix is denoted by a prime (J’) or a superscript t or T (Jt or


JT).The first row of a matrix becomes the first column of the transpose matrix, the
second row of the matrix becomes the second column of the transpose, etc.
Transposing a matrix means “flipping” the rows and columns. Thus,

1 4
1 2 3
𝐉=[ ] and 𝐉′ = [2 5]
4 5 6
3 6

The transpose of a row vector will be a column vector, and the transpose of a
column vector will be a row vector. The transpose of a symmetric matrix is simply the
original matrix.

In matrix algebra, the inverse of a matrix is that matrix which, when multiplied by
the original matrix, gives an identity matrix. The inverse of a matrix is denoted by the
superscript “-1”. Hence,

𝐀∗𝐀−𝟏 = 𝐀−𝟏 ∗ 𝐀 = 𝐈

A matrix must be square to have an inverse, but not all square matrices have an
inverse. In some cases, the inverse does not exist.

2
MATRICES 2

Matrix Addition and Subtraction

It is only possible to add two matrices if they are of the same order (same number
of rows and columns). If we add matrices J and K to give a result L, then each element
of L is simply the sum of the two corresponding elements of J and K.

If
1 2 3
𝐉=[ ]
4 5 6

0 −1 0
𝐊=[ ]
1 0 1

And

𝐉+𝐊=𝐋

Then,

1 2 3 0 −1 0 1 1 3
[ ]+[ ]=[ ]
4 5 6 1 0 1 5 5 7

1 1 3
𝐋=[ ]
5 5 7

Since matrix addition is performed simply by adding the individual elements,


clearly you will get the same result whatever order you add the matrices in. Operation
is both commutative and associative.

𝐀+ 𝐁 = 𝐁 + 𝐀

(𝐀 + 𝐁) + 𝐂 = 𝐀 + (𝐁 + 𝐂)

Subtraction of two matrices is analogous with addition. For example using the
same J and K matrices to get the difference matrix M,

If

1 2 3
𝐉=[ ]
4 5 6

0 −1 0
𝐊=[ ]
1 0 1

And

𝐉−𝐊=𝐌

Then,

1 2 3 0 −1 0 1 3 3
[ ]−[ ]=[ ]
4 5 6 1 0 1 3 5 5

3
MATRICES 2
1 3 3
𝐌=[ ]
3 5 5

Matrix Multiplication

There are several rules for matrix multiplication. The first concerns the
multiplication between a matrix and a scalar. Scalar multiplication, i.e. multiplying a
matrix by a number is simply a matter of multiplying each element of the matrix by the
number.

1 2 3
For example: Find 3J, where 𝐉 = [ ]
4 5 6

1 2 3 3 6 9
𝟑𝐉 = 3 ∗ [ ]=[ ]
4 5 6 12 15 18

It should be clear from the example above that scalar multiplication is


commutative, i.e.,

𝟑 ∗ 𝐀 = 𝐀 ∗ 𝟑

And also that scalar multiplication is distributive over addition and


subtraction, i.e.,

𝟑 ∗ (𝐀 + 𝐁) = 𝟑 ∗ 𝐀 + 𝟑 ∗ 𝐁

The next rule involves the multiplication of a row vector by a column vector. To
perform this, the row vector must have as many columns as the column vector has
rows.

RULE: Number of columns of the first matrix SHOULD BE EQUAL to the number of rows of
the second matrix.

For example,

2
[1 7 5] [4]
1

is legal since the number of columns of the row vector (3) is equal to the number of
rows of the column vector (3). However,

2
[1 7 5] [4]
1
6

is not legal because the row vector (first matrix) has three columns, while the column
vector (second matrix) has four rows.

4
MATRICES 2
The product of a row vector multiplied by a column vector will be a scalar. This
scalar is simply the sum of the first row vector element multiplied by the first column
vector element, plus the second row vector element multiplied by the second column
vector element, plus the product of the third elements, etc. Thus,

All other types of matrix multiplication involve the multiplication of a row vector
and a column vector.

Example:

1 7
2 8 −1
Find 𝐑 = 𝐍 ∗ 𝐏 where 𝐍 = [ ] and 𝐏 = [9 −2]
3 6 4
6 3

This is possible since matrix 𝐍 has three columns which is equal to the number of
rows of matrix 𝐏.

The resulting matrix, 𝐑, will have as many rows as the first matrix and as many
columns as the second matrix. Because N has two rows and P has two columns, R will
have two rows and two columns. We can multiply a 2 x 3 matrix and a 3 x 2 matrix,
resulting in a 2 x 2 matrix.

R R12
𝐑 = [ 11 ]
R 21 R 22

1
R11 = [2 8 −1] [9] = (2 ∗ 1) + (8 ∗ 9) + (−1 ∗ 6) = 68
6

7
R12 = [2 8 −1] [−2] = (2 ∗ 7) + (8 ∗ −2) + (−1 ∗ 3) = −5
3

1
R 21 = [3 6 4] [9] = (3 ∗ 1) + (6 ∗ 9) + (4 ∗ 6) = 81
6

7
R 22 = [3 6 4] [−2] = (3 ∗ 7) + (6 ∗ −2) + (4 ∗ 3) = 21
3

Hence,

1 7
2 8 −1 68 −5
𝐑=𝐍∗𝐏 [ ] [9 −2] = [ ]
3 6 4 81 21
6 3

5
MATRICES 2
Notice what happens if we change the order of these two matrices 𝐍 and 𝐏. This
time we are multiplying a 3 x 2 matrix with a 2 x 3 matrix, resulting to a 3 x 3 matrix which
is quite different from the previous result.

1 7
2 8 −1
Find 𝐑 = 𝐏 ∗ 𝐍 where 𝐏 = [9 −2] and 𝐍 = [ ]
3 6 4
6 3

R11 R12 R13


𝐑 = [R 21 R 22 R 23 ]
R 31 R 32 R 33

2
R11 = [1 7] [ ] = (1 ∗ 2) + (7 ∗ 3) = 23
3

8
R12 = [1 7] [ ] = (1 ∗ 8) + (7 ∗ 6) = 50
6

−1
R 13 = [1 7] [ ] = (1 ∗ −1) + (7 ∗ 4) = 27
4

2
R 21 = [9 −2] [ ] = (9 ∗ 2) + (−2 ∗ 3) = 12
3

8
R 22 = [9 −2] [ ] = (9 ∗ 8) + (−2 ∗ 6) = 60
6

−1
R 23 = [9 −2] [ ] = (9 ∗ −1) + (−2 ∗ 4) = −17
4

2
R 31 = [6 3] [ ] = (6 ∗ 2) + (3 ∗ 3) = 21
3

8
R 32 = [6 3] [ ] = (6 ∗ 8) + (3 ∗ 6) = 66
6

−1
R 33 = [6 3] [ ] = (6 ∗ −1) + (3 ∗ 4) = 6
4

23 50 27
𝐑 = [12 60 −17]
21 66 6

Because of these requirements, matrix multiplication is usually not commutative.


That is, usually AB ≠ BA. And if AB is a legal operation, there is no guarantee that BA will
also be legal. For example we are given these two matrices,

−3
[ 4 ] [8 2]
7

6
MATRICES 2
In this case, the matrix multiplication is legal since the first matrix has one column
and the second matrix has one row. The resulting matrix will have as many rows as the
first matrix (3) and as many columns as the second matrix (2). Hence,

−3 −24 −6
[ 4 ] [8 2] = [ 32 8]
7 56 14

However, if we will swap the order of the matrices,

−3
[8 2] [ 4 ]
7

The operation will be illegal since the number of columns in the first matrix
(2) does not match the number of rows in the second matrix (3).

Inverse of a Matrix

The application of elementary row operations is one of the methods on how we


can get the inverse of a matrix. The given matrix will be augmented (placed side by
side) with an identity matrix, row operations will be performed and the goal is to
transform the given matrix into an identity matrix, and the augmented identity matrix
into the corresponding inverse matrix. Thus,

[ 𝐀 | 𝐈 ] → [𝐈|𝐀−𝟏 ]

For example, find the inverse of the given matrix:

2 4 1
𝐕 = [−1 1 −1]
1 4 0

First, augment the given matrix with an identity matrix:

2 4 1 1 0 0
[ 𝐕 | 𝐈 ] → [−1 1 −1 |0 1 0]
1 4 0 0 0 1

Elements on positions V11, V22 and V33 shall be converted to 1, and all other values
to zero (0), thru elementary row operations. Solutions are done column by column
through matrix iterations.

7
MATRICES 2
Iteration 1:

Element V11 (2) needs to have a value of (1). Note that any action that will
be applied on an element will also be applied to all the elements within its row.
Also, operations that are only allowed are addition and/or multiplication and/or
division (no subtraction of element values).
1
2 4 1 1 0 0 ← 2 𝑅1
[ 𝐕 | 𝐈 ] → [−1 1 −1 |0 1 0]
1 4 0 0 0 1

1 1
1 0 0 2
[𝐕|𝐈]→[ 2 |2 ]
−1 1 −1 0 1 0
1 4 0 0 0 1

Now, elements V21 (-1) and V31 (1) should obtain values of zero (0). Multiplying
those values with zero is not advisable since all other elements within their rows
will also become zero. Note that the goal is to transform elements V11, V22 and
V33 to 1.

To do this, values must be multiplied to the new V11 (1) to be added to the
value on V22 (and later on V33), that will eventually turn the original values to zero.

1 1
1 2 0 0
2 2
[ 𝐕 | 𝐈 ] → [−1 1 −1 |0 1 0] ← 𝑅1 + 𝑅2
1 4 0 0 0 1 ← −𝑅1 + 𝑅3

Performing the indicated operations will lead to this matrix:

1 1
1 2 0 0
2 2
1| 1
[𝐕|𝐈]→ 0 3 −2| 1 0
2
1 1
[0 2 −
2

2
0 1]

Iteration 2:

Values in the first column were transformed as required. Next, transform V22
(3) to (1) and other elements in the second column to zero.

1 1
1 2 0 0
2 2
1| 1 1
[𝐕|𝐈]→ 0 3 − | 1 0 ← 𝑅2
2 2 3
1 1
[0 2 −2 −2 0 1]

← −2𝑅2 + 𝑅1

8
MATRICES 2
1 1
1 2 0 0
2 2
1 1 1
[𝐕|𝐈]→ 0 1 − 6 || 0
6 3
1 1
[0 2 − − 0 1] ← −2𝑅2 + 𝑅3
2 2

The resulting matrix after working out with the second column is:

5 1 2
1 0 − 0
6 6 3
1 1 1
[ 𝐕 | 𝐈 ] → 0 1 − 6 || 0
6 3
1 5 2
[0 0 − 6 − 6 − 3 1]

Iteration 3:

Finally, work on column 3.

5 1 2
1 0 −3 0
6 6
1 1 1
[ 𝐕 | 𝐈 ] → 0 1 − 6 || 0
6 3
1 ← −6𝑅3 5 2
[0 0 − 6 − 6 − 3 1]

5 1 2 5
1 0 −3 0 ← − 𝑅3 + 𝑅1
6 6 6
[ 𝐕 | 𝐈 ] → [0 1 − 1 |1 1
0 ] ← 𝑅3 + 𝑅2
1
6 6 3 6
0 0 1 5 4 −6

The final matrix iteration is:

1 0 0 −4 −4 5
[ 𝐈 | 𝐕−𝟏 ] → [0 1 0 | 1 1 −1]
0 0 1 5 4 −6

Thus, the inverse matrix is

−4 −4 5
𝐕 −𝟏 = [ 1 1 −1]
5 4 −6

For checking, it was mentioned that 𝐀 ∗ 𝐀−𝟏 = 𝐀−𝟏 ∗ 𝐀 = 𝐈. Hence,

2 4 1 −4 −4 5
𝐕 ∗ 𝐕 −𝟏 = [−1 1 −1] [ 1 1 −1] = 𝐈
1 4 0 5 4 −6

1 0 0
When multiplied, this should be equal to [0 1 0].
0 0 1

You might also like