Title: Matrices
1Matrices
2Outline
- Introduction
- Matrix Arithmetic
- Sum, Product
- Transposes and Powers of Matrices
- Identity matrix, Transpose, Symmetric matrices
- Zero-one Matrices
- Join, Meet, Boolean product
- Exercise 2.6
3Introduction
Definition A matrix is a rectangular array of
numbers.
element in ith row, jth column
Also written as A?aij?
m rows
m?n matrix
n columns
When mn, A is called a square matrix.
4Matrix Equality
- Definition Let A and B be two matrices.
- AB if they have the same number of rows and
columns, and every element at each position in A
equals element at corresponding position in B.
5Matrix Addition, Subtraction
Let A ?aij? , B ?bij? be m?n matrices.
Then A B ?aij bij?, and A - B ?aij -
bij?
6Matrix Multiplication
Let A be a m?k matrix, and B be a k?n matrix,
7Matching Dimensions
To multiply two matrices, inner numbers must
match
Otherwise, not defined.
2?3 3?4
2?4 matrix
have to be equal
2?4
2?3
3?4
8Multiplicative Properties
Note that just because AB is defined, BA may not
be. Example If A is 3?4, B is 4?6, then AB3?6,
but BA is not defined (4?6 . 3?4). Even if both
AB and BA are defined, they may not have the same
size. Even if they do, matrices do not commute.
9Efficiency of Multiplication
3?4
2?3
- a11b12 a12b22 a13b32 c12
- Takes 3 multiplications, and 2 additions for each
element. - This has to be done 2?4 (8) times (since product
matrix is 2?4). So 2?4?3 multiplications are
needed. - (m?k) (k?n) matrix product requires m.k.n
multiplications.
10Best Order?
Let A be a 20?30 matrix, B 30?40, C 40?10. (AB)C
or A(BC)?
(20?30 30?40) 40?10
32000
20?30 (30?40 40?10)
18000
So, A(BC) is best in this case.
11Identity Matrix
The identity matrix has 1s down the diagonal,
e.g.
For a m?n matrix A, Im A A In
m?m m?n m?n n?n
12Inverse Matrix
- Let A and B be n?n matrices.
- If ABBAIn then B is called the inverse of A,
denoted BA-1. - Not all square matrices are invertible.
13Use of Inverse to Solve Equations
Please note that a-1j is NOT necessarily (aj)-1.
14Transposes of Matrices
Flip across diagonal
Transposes are used frequently in various
algorithms.
15Symmetric Matrix
A is called symmetric.
is symmetric. Note, for A to be symmetric, is has
to be square.
is trivially symmetric...
16Examples
17Power Matrix
- For a n?n square matrix A, the power matrix is
defined as - Ar A ? A ? ? A
- r times
- A0 is defined as In.
18Zero-one Matrices
- All entries are 0 or 1.
- Operations are ? and ?.
- Boolean product is defined using
- ? for multiplication, and
- ? for addition.
19Boolean Operations
Terminology is from Boolean Algebra.Think join
is put together, like union, and meet is
where they meet, or intersect.
20Boolean Product
(Should be a dot)
Since this is ord, you can stop when you
find a 1
21Boolean Product Properties
- In general, A ? B ? B ? A
- Example
22Boolean Power
- A Boolean power matrix can be defined in exactly
the same way as a power matrix. For a n?n square
matrix A, the power matrix is defined as - Ar A ? A ? ? A
- r times
- A0 is defined as In.
23Exercise 2.6