What is a Matrix?
• A matrix is a set of elements, organized into rows and columns
1110
0100
aa
aa
n columns
m rows
m×n matrix is a matrix of m rows and n columns with an order (mxn).
Basic Operations
• Addition and Subtraction
hdgc
fbea
hg
fe
dc
ba
hdgc
fbea
hg
fe
dc
ba
Just add elements
Just subtract elements
A
Matrix arithmetic (operations)Matrix arithmetic (operations)
Matrix addition.Matrix addition. A Ammnn and B and Bmmnn
• must have the same numbers of rows and must have the same numbers of rows and columnscolumns• add corresponding entries add corresponding entries
AAmmnn + B + Bmmnn = C = Cmmn n = [a= [ai,ji,j + b + bi,ji,j]]
31
20
11
2,3A
32
61
54
2,3B
03
81
65
2,32,3 BA
Matrix subtractionMatrix subtraction is done similarly is done similarly
Matrix Addition/Subtraction
Basic Operations
• Multiplication
dhcfdgce
bhafbgae
hg
fe
dc
baMultiply each row by each column
An m×n can be multiplied by an n×p matrix to yield an m×p result
Matrix arithmetic (operations)Matrix arithmetic (operations)ExampleExample
143410211,33,11,22,11,11,11,1 bababac
220013112401
3,4A
031142
2,3B
2813798414
2,4CAB
40410412,33,12,22,12,11,12,1 bababac
83111221,33,21,22,21,11,21,2 bababac
Matrix Multiplication
Basic Operations
• Transpose: Swap rows with columns
ihg
fed
cba
M
ifc
heb
gda
M T
z
y
x
V zyxV T
Square Matrices
• A Square matrix has same number of rows and columns.
Square Matrices
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”)
10
01
Identity matrix: Square matrix with 1’s on the diagonal and zeros everywhere else
2 x 2 identity matrix
100
010
001
3 x 3 identity matrix
The identity matrix is to matrix multiplication as ___ is to regular multiplication!!!!1
Identity Matrix
Multiply:
10
01
43
25=
43
25
10
01
43
25=
43
25
So, the identity matrix multiplied by any matrix lets the “any” matrix keep its identity!
Mathematically, IA = A and AI = A !!
• The 2×2 matrix,
`
has determinant
Determinant
45
23
Notice the different symbol:
the straight lines tell you to
find the determinant!!
(3 * 4) - (-5 * 2)
12 - (-10) 22
=45
23
=
=
Example of 2 X 2 matrix
1 1 1
2 2 2
3 3 3
a b c
a b c
a b c
= – +2 2
13 3
b ca
b c1 1
23 3
b ca
b c1 1
32 2
b ca
b c
= 1 2 3 3 2a b c b c – + 2 1 3 3 1a b c b c 3 1 2 2 1a b c b c
= 1 2 3 3 2a b c b c + + 2 1 3 3 1( 1)a b c b c 3 1 2 2 1a b c b c
= 1 1a A + +2 2a A 3 3a A
Example of 3X3 matrix
2 35
1 4
5 1 2
3 2 3
8 1 4
=
2 35
1 4
5 1 2
3 2 3
8 1 4
=1 2
( 3)1 4
–
2 35
1 4
5 1 2
3 2 3
8 1 4
=1 2
( 3)1 4
1 2
82 3
– +
2 35
1 4
5 1 2
3 2 3
8 1 4
=1 2
( 3)1 4
1 2
82 3
– +
= 5 8 ( 3) – ( 3) 4 2 + 8 3 ( 4)
2 35
1 4
5 1 2
3 2 3
8 1 4
=1 2
( 3)1 4
1 2
82 3
– +
= 5 8 ( 3) – ( 3) 4 2 + 8 3 ( 4)
= 55 – ( 6) + 56
2 35
1 4
5 1 2
3 2 3
8 1 4
=1 2
( 3)1 4
1 2
82 3
– +
= 5 8 ( 3) – ( 3) 4 2 + 8 3 ( 4)
= 55 – ( 6) + 56
= 117
Example-
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 .
Cramer’s Rule
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 lbsy = pkgs between 5 and 10 lbsz = pkgs 10 lbs or more
x + y + z = 3002.9x + 5.2y + 8z = 1508x = .5z which changes to x - .5z = 0
D determinant| 1.......1......1 ||2.9....5.2....8 || 1.......0.... -.5|