What is a Matrix? 
• A matrix is a set of elements, organized into 
rows and columns 
m×n matrix is a matrix of m rows and n columns with 
an order (mxn). 
ù 
úû 
é 
êë 
n columns 
a a 
00 01 
a a 
10 11 
m rows
Basic Operations 
• Addition and Subtraction 
ù 
úû 
a e b f 
é 
+ + 
êë 
+ + 
ù 
= úû 
é 
+ úû 
êë 
ù 
é 
êë 
c g d h 
e f 
g h 
a b 
c d 
ù 
úû 
a e b f 
é 
- - 
êë 
- - 
ù 
= úû 
êë é 
ù 
- úû 
é 
êë 
c g d h 
e f 
g h 
a b 
c d 
Just add elements 
Just subtract elements 
A
Matrix aarriitthhmmeettiicc ((ooppeerraattiioonnss)) 
Matrix Addition/Subtraction 
MMaattrriixx aaddddiittiioonn.. AAmm´nn aanndd BBmm´nn 
• mmuusstt hhaavvee tthhee ssaammee nnuummbbeerrss ooff rroowwss aanndd 
ccoolluummnnss 
• aadddd ccoorrrreessppoonnddiinngg eennttrriieess 
AAmm´nn ++ BBmm´nn == CCmm´nn == [[aaii,,jj ++ bbii,,jj]] 
ù 
ú ú ú 
û 
1 1 
é 
= 
1 3 
ê ê ê 
ë 
0 2 
3,2 A 
ù 
ú ú ú 
û 
é 
ê ê ê 
ë 
4 5 
1 6 
- 
= - 
2 3 
3,2 B 
ù 
ú ú ú 
û 
é 
ê ê ê 
5 6 
+ = - 
ë 
1 8 
3 0 
3,2 3,2 A B 
MMaattrriixx ssuubbttrraaccttiioonn iiss ddoonnee ssiimmiillaarrllyy
Basic Operations 
• Multiplication 
ù 
úû 
ae bg af bh 
é 
êë 
+ + 
+ + 
ù 
= úû 
é 
êë 
ù 
úû 
a b 
é 
êë 
ce dg cf dh 
e f 
g h 
c d 
Multiply each row 
by each column 
An m×n can be multiplied by an n×p 
matrix to yield an m×p result
Matrix Multiplication 
Matrix aarriitthhmmeettiicc ((ooppeerraattiioonnss)) 
EExxaammppllee 
ù 
ú ú ú 
û 
1 0 4 
é 
= 
0 2 2 
ê ê ê 
2 1 1 
3 1 0 
ë 
4,3 A 
ú úû ù 
2 4 
é 
= 
1 1 
3 0 
ê êë 
3,2 B 
ù 
ú ú ú 
14 4 
8 9 
7 13 
û 
é 
ê ê ê 
ë 
4,2 AB C 
= = 
8 2 
1 2 0 1 4 3 14 1,1 1,1 1,1 1,2 2,1 1,3 3,1 c = a b + a b + a b = × + × + × = 
1 4 0 1 4 0 4 1,2 1,1 1,2 1,2 2,2 1,3 3,2 c = a b + a b + a b = × + × + × = 
2 2 1 1 1 3 8 2,1 2,1 1,1 2,2 2,1 2,3 3,1 c = a b + a b + a b = × + × + × =
Basic Operations 
• Transpose: Swap rows with columns 
ù 
ú ú ú 
û 
a b c 
é 
= 
g h i 
ê ê ê 
ë 
d e f 
M 
ù 
ú ú ú 
û 
a d g 
é 
= 
c f i 
ê ê ê 
ë 
b e h 
MT 
ù 
ú ú ú 
V V T = [x y z] 
û 
x 
é 
= 
z 
ê ê ê 
ë 
y
Square Matrices 
Square Matrices 
• A Square matrix has same number of rows 
and columns. 
This is a 3x3 matrix
Row and Column Matrices 
• A matrix can have single row (a “row 
matrix”) or just a single column(a”column 
matrix”)
Identity Matrix 
Identity matrix: Square matrix with 1’s on the diagonal 
ù 
úû 
é 
0 1 
êë 
1 0 
and zeros everywhere else 
2 x 2 identity matrix 
ù 
ú ú ú 
û 
é 
ê ê ê 
ë 
1 0 0 
0 1 0 
0 0 1 
3 x 3 identity matrix 
The identity matrix is to matrix multiplication as 
__1_ is to regular multiplication!!!!
Multiply: 
ù 
úû 
é 
0 1 
êë 
1 0 
ù 
úû 
5 2 
é - 
3 4 
êë 
ù 
5 2 
é - 
3 4 
= úû 
êë 
úûù 
é 
0 1 
êë 
1 0 
ù 
úû 
5 2 
é - 
3 4 
êë 
ù 
5 2 
é - 
3 4 
= úû 
êë 
So, the identity matrix multiplied by any matrix 
lets the “any” matrix keep its identity! 
Mathematically, IA = A and AI = A !!
Determinant 
• The 2×2 matrix, 
` 
has determinant
Example of 2 X 2 matrix 
3 2 
- 
5 4 
Notice the different symbol: 
the straight lines tell you to 
find the determinant!! 
(3 * 4) - (-5 * 2) 
12 - (-10) 
22 
= 
3 2 
- 
5 4 
= 
=
Example of 3X3 matrix 
a b c 
a b c 
a b c 
1 1 1 
2 2 2 
3 3 3 
b c 
a 
b c 
b c 
= 2 2 
1 
– + 3 3 
1 1 
2 
3 3 
a 
b c 
b c 
1 1 
a 
3 
b c 
2 2 
= a1 ( b2c3 -b3c2 ) – ( ) + 2 1 3 3 1 a b c -b c ( ) 3 1 2 2 1 a b c -b c 
= ( ) 1 2 3 3 2 a b c -b c + ( ) + 2 1 3 3 1 a (-1) b c -b c ( ) 3 1 2 2 1 a b c -b c 
= 1 1 a A + 2 2 + a A 3 3 a A
2 3 
5 
-1 4 
- 
5 1 2 
3 2 3 
8 1 4 
- 
- 
=
2 3 
5 
-1 4 
- 
5 1 2 
3 2 3 
8 1 4 
- 
- 
= 
- 
1 2 
( 3) 
1 4 
- 
– -
2 3 
5 
-1 4 
- 
5 1 2 
3 2 3 
8 1 4 
- 
- 
= 
- 
1 2 
( 3) 
1 4 
- 
- 
- 
1 2 
8 
2 3 
– +
2 3 
5 
-1 4 
- 
5 1 2 
3 2 3 
8 1 4 
- 
- 
= 
- 
1 2 
( 3) 
1 4 
- 
- 
- 
1 2 
8 
2 3 
– + 
= 5( 8 - (-3)) – (-3)( 4 - 2) + 8( 3- (-4))
2 3 
5 
-1 4 
- 
5 1 2 
3 2 3 
8 1 4 
- 
- 
= 
- 
1 2 
( 3) 
1 4 
- 
- 
- 
1 2 
8 
2 3 
– + 
= 5( 8 - (-3)) – (-3)( 4 - 2) + 8( 3- (-4)) 
= 55 – (-6) + 56
Example- 
2 3 
5 
-1 4 
- 
5 1 2 
3 2 3 
8 1 4 
- 
- 
= 
- 
1 2 
( 3) 
1 4 
- 
- 
- 
1 2 
8 
2 3 
– + 
= 5( 8 - (-3)) – (-3)( 4 - 2) + 8( 3- (-4)) 
= 55 – (-6) + 56 
= 117
Cramer’s Rule 
This rule can be used to calculate solutions of 
where A is a square matrix. 
Let A be an n x n matrix. The system of equations 
has a unique solution if and only if .
Let Ak be the matrix obtained by replacing column k of A by 
the column matrix B . Then
Example: 
Solve the following equations:- 
x + 3 y + 3z = 1; 
x + 4y +3 z = 0; 
x + 3y + 4z = 2; 
Ans: x = 1, y = -1, z = 1
Example: 
The ABC shipping company charges $2.90 for all 
packages weighing less than or equal to 5 lbs, $5.20 
for packages weighing more than 5 lbs and less than 
10 lbs, and $8.00 for all packages weighing 10 lbs. or 
more. The number of packages weighing 5 lbs or less 
is 50% of the number of packages weighing 10 lbs or 
more. One day shipping charges for 300 orders was 
$1,508. Find the number of packages in each category.
Sol: 
x = pkgs less or equal to 5 lbs 
y = pkgs between 5 and 10 lbs 
z = pkgs 10 lbs or more 
x + y + z = 300 
2.9x + 5.2y + 8z = 1508 
x = .5z which changes to x - .5z = 0 
D determinant 
| 1.......1......1 | 
|2.9....5.2....8 | 
| 1.......0.... -.5|

Matrices

  • 1.
    What is aMatrix? • A matrix is a set of elements, organized into rows and columns m×n matrix is a matrix of m rows and n columns with an order (mxn). ù úû é êë n columns a a 00 01 a a 10 11 m rows
  • 2.
    Basic Operations •Addition and Subtraction ù úû a e b f é + + êë + + ù = úû é + úû êë ù é êë c g d h e f g h a b c d ù úû a e b f é - - êë - - ù = úû êë é ù - úû é êë c g d h e f g h a b c d Just add elements Just subtract elements A
  • 3.
    Matrix aarriitthhmmeettiicc ((ooppeerraattiioonnss)) Matrix Addition/Subtraction MMaattrriixx aaddddiittiioonn.. AAmm´nn aanndd BBmm´nn • mmuusstt hhaavvee tthhee ssaammee nnuummbbeerrss ooff rroowwss aanndd ccoolluummnnss • aadddd ccoorrrreessppoonnddiinngg eennttrriieess AAmm´nn ++ BBmm´nn == CCmm´nn == [[aaii,,jj ++ bbii,,jj]] ù ú ú ú û 1 1 é = 1 3 ê ê ê ë 0 2 3,2 A ù ú ú ú û é ê ê ê ë 4 5 1 6 - = - 2 3 3,2 B ù ú ú ú û é ê ê ê 5 6 + = - ë 1 8 3 0 3,2 3,2 A B MMaattrriixx ssuubbttrraaccttiioonn iiss ddoonnee ssiimmiillaarrllyy
  • 4.
    Basic Operations •Multiplication ù úû ae bg af bh é êë + + + + ù = úû é êë ù úû a b é êë ce dg cf dh e f g h c d Multiply each row by each column An m×n can be multiplied by an n×p matrix to yield an m×p result
  • 5.
    Matrix Multiplication Matrixaarriitthhmmeettiicc ((ooppeerraattiioonnss)) EExxaammppllee ù ú ú ú û 1 0 4 é = 0 2 2 ê ê ê 2 1 1 3 1 0 ë 4,3 A ú úû ù 2 4 é = 1 1 3 0 ê êë 3,2 B ù ú ú ú 14 4 8 9 7 13 û é ê ê ê ë 4,2 AB C = = 8 2 1 2 0 1 4 3 14 1,1 1,1 1,1 1,2 2,1 1,3 3,1 c = a b + a b + a b = × + × + × = 1 4 0 1 4 0 4 1,2 1,1 1,2 1,2 2,2 1,3 3,2 c = a b + a b + a b = × + × + × = 2 2 1 1 1 3 8 2,1 2,1 1,1 2,2 2,1 2,3 3,1 c = a b + a b + a b = × + × + × =
  • 6.
    Basic Operations •Transpose: Swap rows with columns ù ú ú ú û a b c é = g h i ê ê ê ë d e f M ù ú ú ú û a d g é = c f i ê ê ê ë b e h MT ù ú ú ú V V T = [x y z] û x é = z ê ê ê ë y
  • 7.
    Square Matrices SquareMatrices • A Square matrix has same number of rows and columns. This is a 3x3 matrix
  • 8.
    Row and ColumnMatrices • A matrix can have single row (a “row matrix”) or just a single column(a”column matrix”)
  • 9.
    Identity Matrix Identitymatrix: Square matrix with 1’s on the diagonal ù úû é 0 1 êë 1 0 and zeros everywhere else 2 x 2 identity matrix ù ú ú ú û é ê ê ê ë 1 0 0 0 1 0 0 0 1 3 x 3 identity matrix The identity matrix is to matrix multiplication as __1_ is to regular multiplication!!!!
  • 10.
    Multiply: ù úû é 0 1 êë 1 0 ù úû 5 2 é - 3 4 êë ù 5 2 é - 3 4 = úû êë úûù é 0 1 êë 1 0 ù úû 5 2 é - 3 4 êë ù 5 2 é - 3 4 = úû êë So, the identity matrix multiplied by any matrix lets the “any” matrix keep its identity! Mathematically, IA = A and AI = A !!
  • 11.
    Determinant • The2×2 matrix, ` has determinant
  • 12.
    Example of 2X 2 matrix 3 2 - 5 4 Notice the different symbol: the straight lines tell you to find the determinant!! (3 * 4) - (-5 * 2) 12 - (-10) 22 = 3 2 - 5 4 = =
  • 13.
    Example of 3X3matrix a b c a b c a b c 1 1 1 2 2 2 3 3 3 b c a b c b c = 2 2 1 – + 3 3 1 1 2 3 3 a b c b c 1 1 a 3 b c 2 2 = a1 ( b2c3 -b3c2 ) – ( ) + 2 1 3 3 1 a b c -b c ( ) 3 1 2 2 1 a b c -b c = ( ) 1 2 3 3 2 a b c -b c + ( ) + 2 1 3 3 1 a (-1) b c -b c ( ) 3 1 2 2 1 a b c -b c = 1 1 a A + 2 2 + a A 3 3 a A
  • 14.
    2 3 5 -1 4 - 5 1 2 3 2 3 8 1 4 - - =
  • 15.
    2 3 5 -1 4 - 5 1 2 3 2 3 8 1 4 - - = - 1 2 ( 3) 1 4 - – -
  • 16.
    2 3 5 -1 4 - 5 1 2 3 2 3 8 1 4 - - = - 1 2 ( 3) 1 4 - - - 1 2 8 2 3 – +
  • 17.
    2 3 5 -1 4 - 5 1 2 3 2 3 8 1 4 - - = - 1 2 ( 3) 1 4 - - - 1 2 8 2 3 – + = 5( 8 - (-3)) – (-3)( 4 - 2) + 8( 3- (-4))
  • 18.
    2 3 5 -1 4 - 5 1 2 3 2 3 8 1 4 - - = - 1 2 ( 3) 1 4 - - - 1 2 8 2 3 – + = 5( 8 - (-3)) – (-3)( 4 - 2) + 8( 3- (-4)) = 55 – (-6) + 56
  • 19.
    Example- 2 3 5 -1 4 - 5 1 2 3 2 3 8 1 4 - - = - 1 2 ( 3) 1 4 - - - 1 2 8 2 3 – + = 5( 8 - (-3)) – (-3)( 4 - 2) + 8( 3- (-4)) = 55 – (-6) + 56 = 117
  • 20.
    Cramer’s Rule Thisrule can be used to calculate solutions of where A is a square matrix. Let A be an n x n matrix. The system of equations has a unique solution if and only if .
  • 21.
    Let Ak bethe matrix obtained by replacing column k of A by the column matrix B . Then
  • 22.
    Example: Solve thefollowing equations:- x + 3 y + 3z = 1; x + 4y +3 z = 0; x + 3y + 4z = 2; Ans: x = 1, y = -1, z = 1
  • 23.
    Example: The ABCshipping company charges $2.90 for all packages weighing less than or equal to 5 lbs, $5.20 for packages weighing more than 5 lbs and less than 10 lbs, and $8.00 for all packages weighing 10 lbs. or more. The number of packages weighing 5 lbs or less is 50% of the number of packages weighing 10 lbs or more. One day shipping charges for 300 orders was $1,508. Find the number of packages in each category.
  • 24.
    Sol: x =pkgs less or equal to 5 lbs y = pkgs between 5 and 10 lbs z = pkgs 10 lbs or more x + y + z = 300 2.9x + 5.2y + 8z = 1508 x = .5z which changes to x - .5z = 0 D determinant | 1.......1......1 | |2.9....5.2....8 | | 1.......0.... -.5|