Вы находитесь на странице: 1из 8

Math 415 - Lecture 4

Matrix operations

Thursday June 15th 2017

Textbook: Chapter 1.3, 1.4

Suggested Practice Exercise: Chapter 1.4 Exercise 1, 2, 10, 12, 13, 21, 30, 34, 45,

Khan Academy Video: Matrix multiplication (part I)

Matrices
Two ways to denote m n matrix A (m rows, n column).

In terms of the columns of A:


 
A= a1 a2 an

In terms of the entries of A:



a11 a12 a1n
a21 a22 a2n
A = ..

.. .. ..
. . . .
am1 am2 amn

aij is in the ith row and jth 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



Definition. Let A1 , . . . , Ak be m n-matrix and r1 , . . . , rk numbers, then

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
= .

Lets look at few other operations.


(a) Which linear operation corresponds to changing the brightness of a grayscale
picture?

(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.

It is important to realize that Ax is a linear combination of the columns of A


that uses the corresponding entries in x as weights.

The product Ax is only defined if the number of entries of x is equal to the


number of columns of A.

Example 3. Consider

  1 2  
2 0 2
A= , B = 0 1 , x=
1 1 3
3 5

Determine Ax and Bx.

Solution.

Example 4. Consider the following vector equation


     
1 3 0
x1 + x2 = .
2 4 2

Is there a matrix 2 2 matrix A such that x1 , x2 is a solution to the above equation


if and only if    
x 0
A 1 = ?
x2 2

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

(x1 , x2 , . . . , xn ) is a solution of the vector equation x1 a1 + x2 a2 + + xn an = b



x1
..
. is a solution to the matrix equation Ax = b.
xn

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?

Input: n-component vector x Rn .

Output: m-component vector b = Ax Rm .

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

Question. This composition only works for some k, l, m, n. For which?

Solution.

Example 7. Let A, B be as in the previous two examples. Is A(Bx) = B(Ax)?

Solution.

7
Linearity
The most important property of the machine corresponding to a matrix A is that it
plays nice with linear combinations.

Theorem 3. Let A be a matrix, a, b vectors and c, d scalars. If the input vector is a


linear combination then also the output vector is a linear combination:

A(ca + db) = cAa + dAb.

Example 8. Consider a matrix equation Ax = b. Suppose z1 and z2 are two distinct


solutions. Why are there infinitely many solutions?

Solution.

Вам также может понравиться