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

LECTURE 2 - Matrices

This lecture discusses types and operations of matrices: - A matrix is a rectangular array of numbers with rows and columns. Common types include column/row matrices, rectangular/square matrices, diagonal/identity/null matrices, and triangular/scalar matrices. - Matrix operations include addition, subtraction, and scalar multiplication. For addition and subtraction, matrices must be the same size. Scalar multiplication multiplies each element by the scalar. - Key properties of matrices are their dimensions defined by the number of rows and columns. Individual elements are denoted by their row and column position (i,j). Common substructures are rows, columns, and submatrices.

Uploaded by

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

LECTURE 2 - Matrices

This lecture discusses types and operations of matrices: - A matrix is a rectangular array of numbers with rows and columns. Common types include column/row matrices, rectangular/square matrices, diagonal/identity/null matrices, and triangular/scalar matrices. - Matrix operations include addition, subtraction, and scalar multiplication. For addition and subtraction, matrices must be the same size. Scalar multiplication multiplies each element by the scalar. - Key properties of matrices are their dimensions defined by the number of rows and columns. Individual elements are denoted by their row and column position (i,j). Common substructures are rows, columns, and submatrices.

Uploaded by

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

LECTURE 2

Chapter 2
Matrices

2.0 Type of Matrices


2.1 Operations with Matrices
( Addition, scalar multiplication and
subtraction)
MATRICES

Definition
• A matrix is a rectangular array of numbers.
• The numbers in the array are called the elements of the
matrix.

Matrices
gements
w
 7 1 3 5 6 
 2 3  4
A  B   0 5 C  0  2 5 
 7 5  1  8 3 8 9 12 
am
L

3/30
Row and Column 2 3  4 2Rows
A  3Columns
7 5  1

 2 3   4
2 3  4 7 5  1 7 5   1
     
row 1 row 2 column 1 column 2 column 3

Submatrix Hiss
submatri
submatrics
1 7 4   1 7 7 
1 4
A  2 3 0  P  2 3 
Q   3 R 
5  2 
5 1  2  5 1 1
matrix A submatrice s of A

4/30
Size and Type
 2 5 7 8 
 1 0 3  9 0 1   3
 2 4 5   4 3 8 5  
    3 5 8  2
39 mns 3Row columns fowflu.mn columns
Size : 2  3 3  3 matrix 1 4 matrix 3  1 matrix
a square matrix a row matrix Ra column matrix
Location 681s iwis
 2 3  4 The element aij is in row i , column j
A  a13  4, a21  7 The element in location (1,3) is 4
 7 5  1
Identity Matrices 923 1
diagonal size
Identitymatrices 1 0 0
I2   1 0  I 3  0 1 0 
0 1
0 0 1
5/30
Properties:
•A specified number of rows and a specified number of
columns
•Two numbers (rows x columns) describe the dimensions
or size of the matrix.
2
Examples:
3x3 matrix
3 3
1 2 4  2 43 1 2
2x4 matrix
4  1 5 1 1
  
 3
 1  1
1x2 matrix 3 3 3 0 0 3 2 

6/30
A matrix is denoted by a bold capital letter and the elements
within the matrix are denoted by lower case letters
e.g. matrix [A] with elements aij
pelements
ATAX
Amxn=
 a11 a12 ... aij ain 
a a22 ... aij 
a2 n 
 21
n
mA

     
 
am1 am 2 aij amn 
i goes from 1 to m
j goes from 1 to n 7/30
TYPES OF MATRICES

1. Column matrix or vector:


The number of rows may be any integer but the number of
columns is always 1

1   a11 
4 1  a21 
   3  
 2     
am1 

8/30
TYPES OF MATRICES

2. Row matrix or vector


Any number of columns but only one row

1 1 6 0 3 5 2

a11 a12 a13  a1n 

9/30
TYPES OF MATRICES

3. Rectangular matrix
Contains more than one element and number of rows is not
equal to the number of columns

1 1 
3 7  1 1 1 0 0 
   2 0 3 3 0
7  7   
 
7 6 
mn
10/30
TYPES OF MATRICES

4. Square matrix
The number of rows is equal to the number of columns
(a square matrix A has an order of m)
mxm

1 1 1 Amorder in
1911 1
9 9 0
3 
0  
 6 6 1
922
11 1
The principal or main diagonal of a square matrix is composed of all
elements aij for which i=j

I 11/30
na
TYPES OF MATRICES

misms
5. Diagonal matrix
maindiagnole11 156
A square matrix where all the elements are zero except those on
the main diagonal

3 0 0 0
1 0 0 0 
0 2 0   3 0 0
  0 0 5 0
0 0 1  
0 0 0 9
i.e. aij =0 for all i = j
aij = 0 for some or all i = j

12/30
TYPES OF MATRICES

6. Unit or Identity matrix - I


A diagonal matrix with ones on the main diagonal

1 0 0 0 is
0 1 0 
0 www.a
 aij 0
0 0 1 0 1 0 
  0 1  0 
aij 
0 0 0 1   

i.e. aij =0 for all i = j


aij = 1 for some or all i = j
13/30
TYPES OF MATRICES

7. Null (zero) matrix - 0


All elements in the matrix are zero

0  0 0 0 
0  0 0 0 
   
0  0 0 0

aij  0 For all i,j

14/30
TYPES OF MATRICES

8. Triangular matrix
A square matrix whose elements above or below the main
diagonal are all zero

1 0 0  1 0 0  1 8 9
 2 1 0  2 1 0 0 1 6 
     
5 2 3 5 2 3 0 0 3

15/30
TYPES OF MATRICES

186181

III
8a. Upper triangular matrix
A square matrix whose elements below the main
diagonal are all zero
1 7 4 4
aij aij aij  1 8 7 0 
  0 1 8   1 7 4
0 aij aij 
  0
0 0 7 8
 0 aij  0 0 3  
0 0 0 3
i.e. aij = 0 for all i > j

16/30
TYPES OF MATRICES

35
upper
8b. Lower triangular matrix

A square matrix whose elements above the main diagonal are all
zero
5566A
aij 0 0 1 0 0 
   2 1 0
aij aij 0
 
aij aij aij  5 2 3

i.e. aij = 0 for all i < j

17/30
TYPES OF MATRICES

9. Scalar matrix
A diagonal matrix whose main diagonal elements are
equal to the same scalar
A scalar is defined as a single number or constant

its
aij 0 0 1 0 0 6 0 0 0
  0 1 0  0 
 0 aij 0    6 0 0
0 0 aij  0 0 1
 0 0 6 0
 
i.e. aij = 0 for all i = j 0 0 0 6
aij = a for all i = j
18/30
2.1 Operations with Matrices
 Matrix:
 a11 a12 a13  a1n 
a a a  a 
 21 22 23 2n 

Let A  [aij ]   a31 a32 a33  a3n V3  M mn


 
    
am1 am 2 am 3  amn 
mn

(i, j)-th entry: aij

row: m
column: n
size: m×n

19/30
 i-th row vector
ri  ai1 ai 2  ain  row matrix

 j-th column vector


 c1 j 
c 
cj   
2j column matrix
  
c 
 mj 
 Square matrix: m = n

20/30
 Diagonal matrix:
d1 0  0
0 d2  0
A  diag(d1 , d 2 ,, d n )     M nn
   
0 0  d n 

10 00
 Trace:
1
diagnes's
If A  [ aij ]nn 35
Then Tr ( A)  a11  a22    ann
ALL 8169425
Diagnon
matrit
21/30
Example 1: Define the matrix

 1 2 3 1 2 4
  4  1 5
A 4 5 6 B= 
  3
7 8 9 3 3

Find Tr(A) and Tr(B) Tr A 5 9 15


Soplution:
Tr(A) = 1 + 5+ 6 = 12 B f1 3 3
am
g
Tr(B) = 1 + (-1) + 3 = 3

22/30
 Example 2: If
1 2 3  r1 
A   
4 5 6 r2 
 r1  1 2 3, r2  4 5 6

 1 2 3
A   c1 c2 c3 
 4 5 6
1   2  3
 c1   , c2   , c3   
4 5  6 

23/30
www.WI
 Equal matrix: Is
If A  [aij ]mn , B  [bij ]mn
t
Then A  B if andsize
only if aij  bij  1  i  m, 1  j  n

 Example 3: (Equal matrix): Let


1 2 a b 
A  B 
3 4   c d 

If A  B
Then a  1, b  2, c  3, d  4

24/30
Matrix addition

If A  [aij ]mn , B  [bij ]mn


Then A  B  [aij ]mn  [bij ]mn  [aij  bij ]mn

 Example 4: (Matrix addition)


2 2
 1 2  1 3  1  1 2  3  0 5

0808
 0 1   1 2   0  1 1  2   1 3

 1  1
   

 1  1  0o
   o

8
2   3   3 
   
 2  2
0
  3  3   0 
   
 2  2 0
columns

25/30
Scalar multiplication

If A  [aij ]mn , c : scalar

to
Then cA  [caij ]mn

Example 5: (Scalar multiplication)


For the following matrix, find 3A.

Solution:

26/30
Matrix subtraction

A  B  A  (1)B
ii www.W
2 After
 Example 6: (Scalar multiplication and matrix subtraction)
 1 2 4  2 0 0
A   3 0  1 B   1  4 3
   
 2 1 2  1 3 2

Find (a) 3A, (b) –B, (c) 3A – B


00
Its
27/30
Sol:
( a) YE
 1 2 4   31 32 34  3 6 12
3A  3 3 0  1  3 3 30 3 1   9 0  3
     
 2 1 2  32 31 32  6 3 6
(b)
 2 0 0   2 0 0

 B   1 1  4 3     1 4  3
   
 1 3 2  1  3  2 3 3
( c)
6
 3 6 12   2 e0 0  1 6 12
3 A  B   9 0  3   1  4 3   10 4  6
     
 6 3 6  1 3 2  7 0 4

28/30
Exercise 2

Find

(a) A+B (b) A-B (c) 2A (d) 3B

(e) 2A+3B (f) 3B - 2A

29/30
Keywords in Section 2.1:
 row vector: ‫متجه صفي‬
 column vector:)‫(متجه عمودي‬
 diagonal matrix: ‫مصفوفة قطرية‬
 trace: ‫اثر‬
 equality of matrices: ‫تعادل المصفوفات‬
 matrix addition: ‫جمع المصفوفات‬
 scalar multiplication: ‫ضرب بعدد ثابت‬

30/30

You might also like