Vous êtes sur la page 1sur 25

GMTH 141B

Set 6:
MATRICES AND THEIR OPERATIONS

GMTH 141B DR. NEMA SALEM FALL 2018 1


1. Matrices
Matrix: is a rectangular array of numbers
written within brackets.
If a matrix has m rows and n columns it is
called an “m x n” matrix .
The expression “m x n” is called the size of
the matrix.

GMTH 141B DR. NEMA SALEM FALL 2018 2


Examples: find the size of the
following Matrices.
1 −3 7 3 2
1. 4. −1 −1
5 0 4
0 3
−5 4 11
Diagonal Matrix and Identity matrix
2. 0 1 6 A matrix that has only one row is called Row Matrix
−2 12 8 A Matrix that has only one Column is called Column
−3 0 −1 Matrix

3 3
0 2 6 10 −7 6 6
3. −3 −8 9 19 22 6. −5 7. −5
1 0 33 2 0 5. 1 −2 7 2 2
0 0
GMTH 141B DR. NEMA SALEM FALL 2018 3
1. Matrices Continue
A matrix that has the same number of row as the number of
columns is called Square Matrix, they are called nth order
matrices, where n is the number of rows and columns.

2 × 2: 3 × 3:

18 −3 4
2 4
6 −20 14
1 −2 10 25 −15

GMTH 141B DR. NEMA SALEM FALL 2018 4


2. Addition of Matrices
Matrix addition: To add two matrices, they need to have
the same size (m x n):

2 3 4 1 2+4 3+1
+ =
−3 0 −2 7 −3 − 2 0+7

6 4
=
−5 7
GMTH 141B DR. NEMA SALEM FALL 2018 5
Examples: Perform Matrix addition
2 −3 0 3 1 2
1. +
1 2 −5 −3 2 5

0 2
2 1 4
2. + −3 5
3 2 −3
−1 4

3 2 −2 3
3. −1 −1 + 1 −1
0 3 2 −2
4. 1 −2 7 + −2 4 3 −1
GMTH 141B DR. NEMA SALEM FALL 2018 6
Zero Matrix
The zero matrix has all its elements equal to zero.
0 0 0 0 0
0 0
0 0 0 0 0
0 0
0 0 0 0 0

Adding any matrix to the zero matrix gives the same matrix.
2 3 0 0 2 3
+ =
−3 0 0 0 −3 0

GMTH 141B DR. NEMA SALEM FALL 2018 7


3. Subtraction of Matrices: Examples
2 3 5 −1 2−5 3+1 −3 4
− = =
−3 0 2 −4 −3 − 2 0+4 −5 4
2 −3 0 3 1 2
1. −
1 2 −5 −3 2 5
0 2
2 1 4
2. − −3 5
3 2 −3
−1 4
3 2 −2 3
3. −1 −1 − 1 −1
0 3 2 −2
4. 1 −2 7 − −2 4 3 −1
GMTH 141B DR. NEMA SALEM FALL 2018 8
Exercise

GMTH 141B DR. NEMA SALEM FALL 2018 9


Exercise

1. What are the dimensions of A?

2. What is entry D12?

Evaluate if possible.

3. 2A — C 4. C + 2D 5. 10(2B + D)

GMTH 141B DR. NEMA SALEM FALL 2018 10


4. Multiplication of Matrices:
Example
Multiplying a matrix by a number: each element in the Matrix is
multiplied by that number.

−4 1 −1 −4 4 1 4 −1 4
4 3 7 0 = 3 4 7 4 0 4
−3 −1 8 −3 4 −1 4 8 4

−16 4 −4
= 12 28 0
−12 −4 32
GMTH 141B DR. NEMA SALEM FALL 2018 11
Example

4 0 −1 5
A= and B =
−6 3 7 8

Find 3B − 2A

GMTH 141B DR. NEMA SALEM FALL 2018 12


4. Product of Two Matrices
The product of an m x n matrix A and an n x r matrix B is
an m x r matrix AB. The ijth element of AB is the sum of
products of the corresponding elements in the ith row of A
and the jth column of B.

Condition: The # of columns in the first matrix should


equal the # of rows in the second matrix.

GMTH 141B DR. NEMA SALEM FALL 2018 13


4. Product of Two Matrices: Example
1 2
3 6 1
0 3
1 2 0
5 6

First, test whether the # of columns in the first matrix = # of rows in


the second matrix
3X2 2X3
The condition is verified, then find the product.

GMTH 141B DR. NEMA SALEM FALL 2018 14


Example: Multiply two Matrices

−1 0 1 3 −1 1 + 0 2 −1 3 + 0 6
=
2 3 2 6 2 1 +3 2 2 3 +3 6

−1 + 0 −3 + 0 −1 −3
= =
2+6 6 + 18 8 24

1 2 5 10 1
3 6 1
𝐸𝑥𝑎𝑚𝑝𝑙𝑒 #2: 0 3 = 3 6 0
1 2 0
5 6 21 42 5
GMTH 141B DR. NEMA SALEM FALL 2018 15
Exercise
5 7
𝐴=
−6 1
3 5
𝐵=
−1 8
Find the product, if possible WX.
−6 −1 0
𝐶=
1 4 1
𝐹𝑖𝑛𝑑 5𝐴, 𝐴𝐵, 𝐵𝐶, 𝐶𝐴
GMTH 141B DR. NEMA SALEM FALL 2018 16
5. Determinant of a Matrix
Find the determinant of the following 2 x 2 matrix:
8 4
𝐴 =
7 6
Solution:

𝐴 = 8 6 − 7 4 = 48 − 28 = 20

A matrix whose determinant does not equal zero, has an


inverse.

GMTH 141B DR. NEMA SALEM FALL 2018 17


Examples: Find the determinants

3 4 −4 −1
𝐴= 𝐵=
2 5 0 −1

−6 5
𝐶=
0 −8

GMTH 141B DR. NEMA SALEM FALL 2018 18


Inverse of a Matrix
If the determinant of the matrix 𝐴=
𝑎1
𝑎2
𝑏1
𝑏2
does

not equal zero, then it has an inverse given by the

equation: 1
−1 𝑏2 −𝑏1
𝐴 =
𝐴 −𝑎2 𝑎1

GMTH 141B DR. NEMA SALEM FALL 2018 19


Examples: Find the inverse of the
following matrices

4 2
𝐴=
1 2

2 −3
𝐵=
−2 −2

2 0
𝐶=
2 0
GMTH 141B DR. NEMA SALEM FALL 2018 20
Inverse of a Matrix: Continue
To check the answer; multiply the inverse by the
original matrix, you get a 2 x 2 unit matrix.

−1 1 0
𝐴 𝐴= =𝐼
0 1
Check the matrices in the previous slides.

GMTH 141B DR. NEMA SALEM FALL 2018 21


6. Solving a system of linear equations
Solve 3 x = 27
27
x = =9
3
Solve a system of linear equations:
3x + 2y = 7
5 x – 7 y = −9
Solving a system is finding the x and y values that satisfy the
two equations
Solve a system of linear equations
𝟑𝒙 + 𝟐𝒚 = 𝟕
𝟓 𝒙 – 𝟕 𝒚 = −𝟗 3 2 𝑥 7
Use Matrix equations: 5 −7 𝑦 =
−9
𝐴. 𝑋 = 𝐵
𝐴−1 . 𝐴. 𝑋 = 𝐴−1 . 𝐵
𝐼. 𝑋 = 𝐴−1 . 𝐵
𝑋 = 𝐴−1 . 𝐵
Continue

7 2
1 −7 −2 31 31
𝐴−1 =− =
31 −5 3 5 −3
31 31
𝑋 = 𝐴−1 . 𝐵

𝑥 7Τ31 2Τ31 7 1
𝑦 = 5Τ31 −3Τ31 −9
=
2
Exercise

4𝑥 − 𝑦 = 1 x + 5y = 2
x + 2y = 7 3x − 2y = −41

9x + 3y = 1 5x + 4y = −3
5x + y = 1 −3x − 5y = −24

Vous aimerez peut-être aussi