Meet 8 Intro To Matrices

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 11

Intro to Matrices

Don’t be scared…
What is a matrix?

A Matrix is just rectangular arrays of items


A typical matrix is a rectangular array of numbers
arranged in rows and columns.

 21 62 33 93
 
A   44 95 66 13 
3x4
77 38 79 33
Sizing a matrix

By convention matrices are “sized” using the


number of rows (m) by number of columns (n).
 21 62 33 93 7 3 2 
A   44 95 66 13  B  8 4 1 
3x4 3x3
77 38 79 33  6 5 9 
11 4 
14 7 
C   D  17 
4x2 16 8  1 x1
 
 22 3 
“Special” Matrices

Square matrix: a square matrix is an mxn matrix in


which m = n.
7 3 2 
B  8 4 1 
3x3
 6 5 9 
Vector: a vector is an mxn matrix where either m
OR n = 1 (but not both). 12 
9
X   Y  7 22 14
4 x1  4  1x 3
 
0
“Special” Matrices

Scalar: a scalar is an mxn matrix where BOTH m


and n = 1.
D  17 
1 x1 0 0 
Zero matrix: an mxn matrix of zeros. 0  0 0 
3x 2
0 0 
Identity Matrix: a square (mxm) matrix with 1s on
the diagonal and zeros everywhere else.
1 0 0 
I  0 1 0 
3x3
0 0 1 
Matrix Rank

Matrix Rank: the rank of a matrix is the maximum


number of linearly independent vectors (either row
or column) in a matrix
Full Rank: A matrix is considered full rank when all
vectors are linearly independent
Transposing a Matrix

Matrix Transpose: is the mxn matrix obtained by


interchanging the rows and columns of a matrix
(converting it to an nxm matrix)
12 
9
X   X '  12 9 4 0 
4 x1  4  1x 4
 
0
 21 44 77 
 21 62 33 93  62 95 38 
A   44 95 66 13  A'  
3x4 4 x3  33 66 79 
77 38 79 33  
 93 13 33 
Matrix Addition

Matrices can be added (or subtracted) as long as


the 2 matrices are the same size
Simply add or subtract the corresponding components of
each matrix.
1 2 3 5 6 7
A   B 
2 x3
7 8 9  2 x3
3 4 5 
1 2 3 5 6 7  1  5 2  6 3  7   6 8 10 
A B      
7 8 9 3 4 5  7  3 8  4 9  5  10 12 14 
 

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

Multiplying a matrix by a scalar: each element in


the matrix is multiplied by the scalar.

1 2 3
A   and x = 5; then
2 x3
7 8 9 1 x1

 5*1 5* 2 5*3  5 10 15 
xA   
5*7 5*8 5*9  35 40 45

Matrix Multiplication

Multiplying a matrix by a matrix:


the product of matrices A and B (AB) is defined if the
number of columns in A equals the number of rows in B.
Assuming A has ixj dimensions and B has jxk
dimensions, the resulting matrix, C, will have dimensions
ixk
In other words, in order to multiply them the inner
dimensions must match and the result is the outer
dimensions.
Each element in C can by computed by:
Cik   j Aij B jk
Matrix Multiplication

Multiplying a matrix by a matrix:


5 3
1 2 3
A   B '   6 4 
2 x3
7 8 9 3x2
 7 5 
c c12  Matching inner dimensions!!
A B '  C   11
2 x3 3x 2 2 x2
c21 c22  Resulting matrix has outer dimensions!!!

c11   A1 j B j1  1*5    2*6   3*7   38


c12   A1 j B j 2  1*3   2* 4   3*5   26
c21   A2 j B j1   7 *5   8*6   9*7   155
c22   A2 j B j 2   7 *3  8* 4   9*5   98
 38 26 
A B'  C   
2 x3 3x 2 2 x2
155 98 

You might also like