Академический Документы
Профессиональный Документы
Культура Документы
Matrix operations
Suggested Practice Exercise: Chapter 1.4 Exercise 1, 2, 10, 12, 13, 21, 30, 34, 45,
Matrices
Two ways to denote m n matrix A (m rows, n column).
aj is j th column:
a1j
a2j
aj = ..
.
amj
Main diagonal entries: a11 , a22 , . . ., amm (only care about these when m = n)
1
Even more notation
Zero matrix:
0 0 0
.. .. ..
. . .
0 = 0 0 0
. .. ..
.. . .
0 0 0
Definition. Let A = a1 a2 an , B = b1 b2 bn be m n-matrices
and let r be a scalar. Then
A + B is defined by
A + B = a1 + b1 a2 + b2 . . . an + bn
Moreover, rA is defined as
rA = ra1 ra2 . . . ran
Example 1. Calculate
1 0 2 3
+ =
5 2 3 1
2 3
10 =
3 1
r1 A1 + + rk Ak
is a linear combination of A1 , . . . , Ak .
2
Theorem 1. Let A, B, and C be matrices of the same size, and let r and s be scalars.
A+B =B+A
(A + B) + C = A + (B + C)
A+0=A
r(A + B) = rA + rB
(r + s) A = rA + sA
r (sA) = (rs) A
Example 2. We can think of a grayscale picture consisting of mn many pixels as an
mn matrix (aij )1im,1jn where all the aij s are between 0 and 1. Here the entry aij
of a grayscale picture represents the grayscale value of the pixel at position i, j in this
picture. So the value 1 means the pixel is white and 0 means the pixel is black. The
operations defined correspond to operations your favorite image manipulation software
can carry out. For example, let P1 and P2 be two grayscale pictures. Then taking the
linear combination 12 P1 + 12 P2 is the same as blending the two pictures together. For
example,
1 1
2
+ 2
= .
(b) Let P be a grayscale picture and let B be the m n-matrix all whose entries
are 1. Calculating B P correspond to which function of your favorite image
manipulation software?
Solution.
3
Matrix Multiplication
Definition. Let x be a vector in Rn and A = a1 . . . an an m n-matrix. We
define Ax by
Ax = x1 a1 + x2 a2 + . . . + xn an .
Remark.
Example 3. Consider
1 2
2 0 2
A= , B = 0 1 , x=
1 1 3
3 5
Solution.
4
Solution.
Theorem 2. Let A = a1 . . . an be an m n-matrix and b in Rm . Then the
following are equivalent
(x1 , x2 , . . . , xn ) is a solution of the system with augmented matrix A b
From now on
we will write Ax = b for the system of equations with augmented
matrix A b .
A matrix is a machine
Let A be a m n matrix. So n columns, m rows. How is it a machine?
x Ax
A
5
0 1
Example 5. Consider the matrix A = . What does this machine do?
1 0
Solution.
1 0
Example 6. Consider the matrix B = . What does this machine do?
0 0
Solution.
6
Composition of machines. Let A be an m n matrix and B be an k l matrix.
Now we can compose the two machines:
x Ax B(Ax)
A B
Solution.
Solution.
7
Linearity
The most important property of the machine corresponding to a matrix A is that it
plays nice with linear combinations.
Solution.