Section 2.1 Operations with Matrices

Post on 22-Feb-2016

47 views 0 download

description

Section 2.1 Operations with Matrices. Notation: If A is a matrix with m rows and n columns, then we say A is an m x n matrix and we can write: A = [ a ij ]. Terminology: Column matrix (column vector) – A matrix with just one column. - PowerPoint PPT Presentation

Transcript of Section 2.1 Operations with Matrices

Section 2.1Operations with Matrices

Notation:

If A is a matrix with m rows and n columns, then we say A is an mxn matrix and we can write: A = [ aij ]

Terminology:

Column matrix (column vector) – A matrix with just one column.

Row matrix (row vector) – A matrix with just one row.

21 3 4 6 9

2100

1164

77

9 4 8

Equality of MatricesTwo matrices A and B are said to be equal if aij = bij for all possible i and j.

Addition/Subtraction of Matrices, Scalar Multiplication

Ex. Let 

(a) 2A =

(b) A + B =

(c) A – 2B =

1 213 5

A

10 17 4

B

Addition/Subtraction of Matrices, Scalar Multiplication

Ex.4 0 50

1 3 15 101 2 3

5 6 7 26 2 12

Let

You might think that AB =

Actually, AB =

1 3 5 3, .

2 2 1 0A B

5 9,

2 0

2 38 6

Matrix Multiplication

Dot Products

= a1b1 + a2b2 + a3b3 + . . . + anbn

1

2

1 2 3 3n

n

bb

a a a a b

b

Matrix Multiplication

Dot Products

= a1b1 + a2b2 + a3b3 + . . . + anbn

Note: In a dot product the row matrix must come first and the column matrix must come second.

1

2

1 2 3 3n

n

bb

a a a a b

b

Matrix Multiplication

Examples:

=

=

21

3 1 4 257

1

2 1 5 23

(3)(2) + (1)(1) + (–4)(5) + (2)(7) = 1

(2)(1) + (1)(2) + (5)(3) = 19

Matrix Multiplication

Matrix Multiplication

Some dot products don't make sense.

= 2

3 1 4 2 15

(3)(2) + (1)(1) + (–4)(5) + (2)( )

To compute AB, we must multiply each row in A with each column in B.

If A is an mxn matrix and B is an nxp matrix, then C = AB is an mxp matrix and

cij = ai1b1j + ai2b2j + ai3b3j + . . . + ainbnj

1

n

ik kjk

a b

Matrix Multiplication

Matrix Multiplication

5 41 6

1 32 7

2 223 50

A B

Matrix Multiplication

1 2 51 1 10 3 1

2 3 41 2 11 1 0

9 –62 4

A B63

4 –7 3

55 66 77 88 991 3 4 7 3 2 1 6 83 0 11 9 7 10 5 4 9

21 12 90 7 4

Ex. Determine if the following matrix multiplications can be done. If they can, give the dimensions of the resulting matrix. But do not actually perform the multiplication.

(a)

Matrix Multiplication

Ex. Determine if the following matrix multiplications can be done. If they can, give the dimensions of the resulting matrix. But do not actually perform the multiplication.

(b)

1 344 5

1 3 4 78 7

3 0 11 910 4

1 0

Matrix Multiplication

Ex. Determine if the following matrix multiplications can be done. If they can, give the dimensions of the resulting matrix. But do not actually perform the multiplication.

(c) 1 344 5

1 3 4 78 7

3 0 11 910 4

1 0

Matrix Multiplication

Ex. Determine if the following matrix multiplications can be done. If they can, give the dimensions of the resulting matrix. But do not actually perform the multiplication.

(d) 8 8 4

1 25 1 113

3 49 2 4

Matrix Multiplication

Ex. Determine if the following matrix multiplications can be done. If they can, give the dimensions of the resulting matrix. But do not actually perform the multiplication.

(e)

1 344 5

3 0 11 98 7

10 4

Matrix Multiplication

Ex. Use a calculator to perform the following matrix multiplication.

3 11 12 10 21 4 5 1 7

17 2 20 5 9

Matrix Multiplication

Ex. Let and . Compute AB and then compute BA.

Matrix Multiplication

1 23 4

A

1 23 4

B

A system of many linear equations can be handled by one matrix equation: AX = B.

3x – y – z = 5 4x + 2y + 6z = –2 → 5x + 3y – 8z = 7  

Matrix Multiplication

3 1 1 54 2 6 25 3 8 7

xyz

Solve AX = B for X.

Matrix Multiplication

Ex. Solve I + X = A for X, where I = and A = 1 00 1

3 710 9

A system of linear equations can be written as a linear combination of column vectors.

Ex. Write the following system as a linear combination of column vectors:3x – 2y + z = 3–x + 3y + 2z = 4 x – y = 3

Section 2.2Properties of Matrix Operations

Def. The transpose of an mxn matrix A, denoted AT, is an nxm matrix defined by the following: If A = [ aij ] then AT = [ aji ].

Ex. Compute the transpose of the following matrices.

1 2 3 45 6 7 8

A

3 820 5

B

1 3 53 7 85 8 6

C

Def. A matrix A is symmetric if A = AT.

Recall that for matrices A and B, it is not always true that AB = BA.

Another property which is not always true for matrices (but we’d like to be true):If AC = BC then A = B.

Ex. Let , , and .

Compute AC and BC. Verify that AC = BC, but A ≠ B.

1 35 9

A

1 413 5

B

1 22 4

C

Properties

Let A, B, and C be matrices and let s and t be scalars.

1. A + B = B + A

2. A + (B + C) = (A + B) + C

3. s(tA) = (st)A

4. s(A + B) = sA + sB

5. (s + t)A = sA + tA

6. A(BC) = (AB)C

7. A(B + C) = AB + AC

8. (A + B)C = AC + BC

The zero matrix - O

The identity matrix - I

Properties

Let A, B, and C be matrices and let s and t be scalars.

9. A + O = A

10. A + (-A) = O

11. If sA = O then either s = 0 or A = O

12. AI = A

13. IA = A

Ex. Verify number 12 and 13 above for 1 2 34 5 67 8 9

A

Another property which is not always true for matrices:

If AB = O (the zero matrix) then A = O or B = O.

Ex. Let and

Verify that AB = O, but A ≠ O and B ≠ O

1 22 4

A

2 61 3

B

Powers of a (square) matrix.

Ak = A·A·A·····A (k factors of A multiplied together).

Ex. Let

A2 =

A3 =

A39 =  

1 23 4

A

Ex. Let

A0 = (guess)

A-1 = (guess)

1 23 4

A

Section 2.3The Inverse of a Matrix

For scalars, a-1 = 1/a .

The actual definition of a-1 is:

If a ≠ 0 then there is a unique number denoted a-1 so that a · a-1 = 1 and a-1 · a = 1.

For scalars, a-1 = 1/a .

The actual definition of a-1 is:

If a ≠ 0 then there is a unique number denoted a-1 so that a · a-1 = 1 and a-1 · a = 1.

If A is a square matrix with ____ , then there is a unique matrix denoted A-1 so thatA · A-1 = I and A-1 · A = I.

Terminology

If A-1 exists, then we say that A is invertible (non-singular).

If no such A-1 exists then we say that A is singular (non-invertible).

Ex. Let and . Show that B = A-1.1 21 1

A

1 21 1

B

Solve each of the following systems of equations, then do so all at once.

2x – 4y = –6 2x – 4y = 10 3x + y = 5 3x + y = 8

2 4 63 1 5

2 4 103 1 8

1 2 33 1 5

1 2 53 1 8

1 2 30 7 14

1 2 50 7 7

1 2 30 1 2

1 2 50 1 1

1 0 10 1 2

1 0 30 1 1

R2 –3R1→R2

1/2 R1→R1 1/2 R1→R1

R2 –3R1→R2

1/7 R2→R2 1/7 R2→R2

R1 +2R2→R1 R1 +2R2→R1

(1, 2) (3, 1)

Solving both at once: Solving each separately:

2 4 6 103 1 5 8

1 2 3 53 1 5 8

1 2 3 50 7 14 7

1 2 3 50 1 2 1

1 0 1 30 1 2 1

R2 –3R1→R2

1/2 R1→R1

1/7 R2→R2

R1 +2R2→R1

(1, 2) and (3, 1)

2 4 63 1 5

1 2 33 1 5

1 2 30 7 14

1 2 30 1 2

1 0 10 1 2

R2 –3R1→R2

1/2 R1→R1

1/7 R2→R2

R1 +2R2→R1

(1, 2)

2 4 103 1 8

1 2 53 1 8

1 2 50 7 7

1 2 50 1 1

1 0 30 1 1

(3, 1)

Now back to computing A-1.

Let's compute A-1 if we have

Let Our job is to determine the values of a, b, c, d.

Now,

Multiply the two matrices on the left to get:

Since the two matrices are equal, the corresponding components of these two matrices must be equal. This gives us four equations in four unknowns:

2a + c = 13a + 2c = 02b + d = 03b + 2d = 1

We can separate this into two sets of two equations with two unknowns:

2 13 2

A

1 .a b

Ac d

2 1 1 03 2 0 1

a bc d

2 2 1 03 2 3 2 0 1

a c b da c b d

2a + c = 1 2b + d = 03a + 2c = 0 3b + 2d = 1

Let's compute A-1 if we have

2a + c = 1 2b + d = 03a + 2c = 0 3b + 2d = 1

We could solve these two systems separately and determine a, b, c, d that way. But since the coefficient matrix of each is the same

(each system has a coefficient matrix of ) we can solve them

both at the same time with one augmented matrix: This reduces to

Therefore a = 2, b = – 1, c = – 3, d = 2.

And finally,

2 13 2

A

2 13 2

2 1 1 03 2 0 1

1 0 2 1

0 1 3 2

1 2 13 2

a bA

c d

To generalize what we have just done:

To find A-1, form the augmented matrix [ A | I ] and place it into reduced row echelon form to get [ I | A-1 ].

Ex. Use an augmented matrix to find the inverse matrix for each of the following:

1 1 01 0 16 2 3

B

1 2 03 1 22 3 2

C

Properties:

1. (A-1)-1 = A

2. (AB)-1 = B-1A-1

Ex. Show that (AB)-1 = B-1A-1.

More properties.

(Recall that it is not always true that if AC = BC then A = B.)If C is invertible then whenever AC = BC it is always true that A = B.

Ex. Show that if C is invertible then AC = BC implies that A = B.

Recall that a system of linear equations can be written as AX = B. We can now solve this matrix equation.

Ex. Solve the following system by first writing it as a matrix equation, then use an inverse matrix to solve this equation.2x + 3y + z = -13x + 3y + z = 12x + 4y + z = -2

Ex. Solve the following system by first writing it as a matrix equation, then use an inverse matrix to solve this equation. x + y – 5z = 3 x – 2z = 12x – y – z = 0

Section 2.5Applications of Matrix Operations

Cryptography – encoding and decoding messages. 

0=_ 5=E 10=J 15=O 20=T 25=Y1=A 6=F 11=K 16=P 21=U 26=Z2=B 7=G 12=L 17=Q 22=V3=C 8=H 13=M 18=R 23=W4=D 9=I 14=N 19=S 24=X

Ex. Use matrices of size 1x3 to write an encoded message for “Meet me Monday”.

Ex. Use matrix multiplication with the following matrix to encode “Meet me Monday”.

1 2 21 1 3

1 1 4A

We decipher a coded message by applying an inverse matrix to the row matrices containing the coded message.

Ex. The encrypted message 89 -35 -36 -15 7 8 106 -27 -59 -30 5 25was encoded using the matrix . Decipher the message. 1 1 0

1 0 16 2 3

Ex. The following encrypted message was encoded with a 2x2 matrix.67 30 63 7 55 77 100 53 14 -21 109 141 48 -14 50 -75 25 -23 47 2We know the last four characters of the original text are JAKE. What is the original text?

Ex. The following encrypted message was encoded with a 2x2 matrix.67 30 63 7 55 77 100 53 14 -21 109 141 48 -14 50 -75 25 -23 47 2We know the last four characters of the original text are JAKE. What is the original text?