Matrices - Center For Teaching &...

Post on 17-May-2019

221 views 0 download

Transcript of Matrices - Center For Teaching &...

1

2

Pre­Calculus

Matrices

www.njctl.org

2015­03­23

3

Table of Content

Introduction to MatricesMatrix Arithmetic

AdditionSubtraction

Scalar Multiplication

MultiplicationSolving Systems of Equations using Matrices

Finding Determinants of 2x2 & 3x3Finding the Inverse of 2x2 & 3x3Representing 2­ and 3­variable systemsSolving Matrix Equations

Circuits

4

CircuitsTable of Content

DefinitionPropertiesEulerMatrix Powers and WalksMarkov Chains

5

Introduction to Matrices

Return to Table of Contents

6

A matrix is an ordered array.

The matrix consists of rows and columns.

Rows

Columns

This matrix has 3 rows and 3 columns, it is said to be 3x3.

7

What are the dimensions of the following matrices?

8

1 How many rows does the following matrix have?

9

2 How many columns does the following matrix have?

10

3 How many rows does the following matrix have?

11

4 How many columns does the following matrix have?

12

5 How many rows does the following matrix have?

13

6 How many columns does the following matrix have?

14

Matrices can be named with a capital letter.

A subscript can be used to tell the dimensions of the matrix

15

How many rows does each matrix have?  How many columns?

16

7 How many rows does the following matrix have?

17

8 How many columns does the following matrix have?

18

9 How many rows does the following matrix have?

19

10 How many columns does the following matrix have?

20

We can find an entry in a certain position of a matrix. 

To find the number in the third row,fourth column of matrix M write m3,4   

21

22

11 Identify the number in the given position.

23

12 Identify the number in the given position.

24

13 Identify the number in the given position.

25

14 Identify the number in the given position.

26

Matrix Arithmetic

Return to Table of Contents

27

Scalar Multiplication

Return to Table of Contents

28

A scalar multiple is when a single number is multiplied to the entire matrix.

To multiply by a scalar, distribute the number to each entry in the matrix.

29

Try These

30

Given: find   6A

Let B = 6A, find b1,2

Answer

31

15 Find the given element.

32

16 Find the given element.

33

17 Find the given element.

34

18 Find the given element.

35

Addition

Return to Table of Contents

36

To add matrices, they must have the same dimensions.

That is, the same number of rows, same number of columns.Given:

State whether the following addition problems are possible or not possible.

37

After checking to see addition is possible,add the corresponding elements.

38

39

19 Add the following matrices and find the given element.

40

20 Add the following matrices and find the given element.

41

21 Add the following matrices and find the given element.

42

22 Add the following matrices and find the given element.

43

Subtraction

Return to Table of Contents

44

To be able to subtract matrices, they must have the same dimensions, like addition.

Method 1: Subtract corresponding elements.

Method 2: Change to addition with a negative scalar.

Note:  Method 2 adds a step but less likely to have a sign error.

45

46

23 Subtract the following matrices and find the given element.

47

24 Subtract the following matrices and find the given element.

48

25 Subtract the following matrices and find the given element.

49

26 Subtract the following matrices and find the given element.

50

51

27 Perform the following operations on the given matrices and find the given element.

52

28 Perform the following operations on the given matrices and find the given element.

53

29 Perform the following operations on the given matrices and find the given element.

54

30 Perform the following operations on the given matrices and find the given element.

55

Multiplication

Return to Table of Contents

56

Multiplication, like addition, not all matrices can be multiplied.

The number of columns in the first matrix has to be the same as the number of rows in the second matrix.

57

State whether each pair of matrices can be multiplied, if so what will the dimensions of the their product be?

Compare the answers from column 1 to column 2: Does AB=BA?  Conclusions?

58

31 Can the given matrices be multiplied and if so,what size will the matrix of their product be?

A yes, 3x3

B yes, 4x4

C yes, 3x4

D they cannot be multiplied

59

32 Can the given matrices be multiplied and if so,what size will the matrix of their product be?

A yes, 3x3

B yes, 4x4

C yes, 3x4

D they cannot be multiplied

60

33 Can the given matrices be multiplied and if so,what size will the matrix of their product be?

A yes, 3x3

B yes, 4x4

C yes, 3x4

D they cannot be multiplied

61

34 Can the given matrices be multiplied and if so,what size will the matrix of their product be?

A yes, 3x3

B yes, 4x4

C yes, 3x4

D they cannot be multiplied

62

To multiply matrices, distribute the rows of first to the columns of the second.  

Add the products.

63

Try These

64

Try These

65

Try These

66

35 Perform the following operations on the given matrices and find the given element.

67

36 Perform the following operations on the given matrices and find the given element.

68

37 Perform the following operations on the given matrices and find the given element.

69

38 Perform the following operations on the given matrices and find the given element.

70

Solving Systems of Equations 

using MatricesReturn to Table of Contents

71

Finding Determinants of 

2x2 & 3x3Return to Table of Contents

72

A determinant is a value assigned to a square matrix.  This value is used as scale factor for transformations of matrices.

The bars for determinant look like absolute value signs but are not.

73

To find the determinant of a 2x2 matrix:The product of the primary diagonal minus the product of the secondary diagonal.

Example:

74

Try These:

75

39 Find the determinant of the following:

76

40 Find the determinant of the following:

77

41 Find the determinant of the following:

78

42 Find the determinant of the following:

79

Finding the Determinant of a 3x3 MatrixUse the first row of the matrix to expand the 3x3 to 3 

2x2 matrices, then use the 2x2 method.

Eliminate the both the row and column the 1 is in.

Eliminate the both the row and column the 2 is in.

Eliminate the both the row and column the 3 is in.

The second number is subtracted.Had 2 been a negative then this would subtracting a negative.

80

81

Eliminate the appropriate row and column in each. Rewrite as 3 2x2 determinants.Solve.

82

Eliminate the appropriate row and column in each. Rewrite as 3 2x2 determinants.Solve.

83

Eliminate the appropriate row and column in each. Rewrite as 3 2x2 determinants.Solve.

84

Begin the expansion by rewriting the determinant 3 times with the first row with the coefficients.Eliminate the appropriate row and column in each. Rewrite as 3 2x2 determinants.Solve.

85

Begin the expansion by rewriting the determinant 3 times with the first row with the coefficients.Eliminate the appropriate row and column in each. Rewrite as 3 2x2 determinants.Solve.

86

43 Find the determinant of the following:

87

44 Find the determinant of the following:

88

45 Find the determinant of the following:

89

46 Find the determinant of the following:

90

Finding the Inverse of 2x2 & 3x3

Return to Table of Contents

91

The Identity Matrix  ( I ) is a square matrix with 1's on its primary diagonal and 0's as the other elements.

2x2 Identity Matrix:

3x3 Identity Matrix:

4x4 Identity Matrix:

92

Property of the IdentityMatrix

93

The inverse of matrix A is matrix A­1.The product of a matrix and its inverse is the identity matrix, I.

example:

94

Note:  Not all matrices have an inverse.• matrix must be square• the determinant of the matrix cannot = 0

95

Finding the inverse of a 2x2 matrix

Example: Find the inverse of matrix M.

96

check:

97

Find the inverse of matrix A

98

Find the inverse of matrix A

99

Find the inverse of matrix A

100

Find the inverse of matrix A

101

Inverse of a 3x3 MatrixThis technique involves creating an Augmented Matrix to start.

Matrix we want the inverse of. Identity Matrix

Note: This technique can be done for any size square matrix.

102

Inverse of a 3x3 MatrixThink of this technique, Row Reduction, as a number puzzle.Goal: Reduce the left hand matrix to the identity matrix.

Rules:• the entire row stays together, what ever is done to an element of a row is done to the entire row

• allowed to switch any row with any other row

• may divide/multiply the entire row by a non­zero number

• adding/subtracting one entire row from another is permitted

Caution: Not all square matrices are invertible, if a row on the left goes to all zeros there is no inverse.

103

Now we know the rules, let's play.

Beginning matrix

Switched rows 1&2

Divided row 1 by 4

Subtracted 2 times row 1 from row 2

Subtracted 6 times row 1 from row 3

Switched rows 2&3

104

Cont. from 

previous slide

Divrow 2 by ­4

Div row 3 by 4.5

Sub 1.5 times row 2 from row 1

Sub ­.625 times row 3 from row 2

Sub 1.1875 times row 3 from row 1

105

We began with this:

We ended with this:

Meaning the inverse of                        is

106

Find the inverse of:

107

Find the inverse of:

108

Representing 2­ and 3­Variable Systems

Return to Table of Contents

109

Solving Matrix Equations

Return to Table of Contents

110

Matrices can be used to solve systems of equations.Consider the system of equations:

Note: equations need to be in standard form.

Rewrite the system into a product of matrices:

coefficients constantsvariables

111

To solve this equation, you need to isolate the variables, but how?

The inverse of the coefficient matrix multiplied to both sides will work.

Think of it as:

112

Solve:

Step 1:

Step 2: find the inverse of

113

Step 3: 

Recall that in matrix multiplication, the commutative property doesn't hold true.

The associative property does work: (AB)C=A(BC)

The solution to the system is x = 3 and y = 7.

114

Rewrite each system as a product of matrices.

115

Find x and y

116

Find x and y

117

47 Is this system ready to be made into a matrix equation?

Yes  

No  

118

48 Which of the following is the correct matrix equation for the system?

A  

B  

C  

D  

119

49 What is the determinant of:

A ­17

B ­13

C 13

D 17

120

50 What is the inverse of:

A  

B  

C  

D  

121

51 Find the solution to                   What is the x­value?

122

52 Find the solution to                   What is the y­value?

123

53 Is this system ready to be made into a matrix equation?

Yes  

No  

124

54 Which of the following is the correct matrix equation for the system?

A  

B  

C  

D  

125

55 What is the determinant of:

A ­10

B ­2

C 2

D 10

126

56 What is the inverse of:

A  

B  

C  

D  

127

57 Find the solution to                   What is the x­value?

128

58 Find the solution to                   What is the y­value?

129

For systems of equations with 3 or more variables, create an augmented matrices with the coefficients on one side and the constants on the other.

Row reduce. When the identity matrix is on the left, the solutions are on the right.

130

Start

Swap Rows 1&2

Subtract 5 times row 1 from row 2

Subtract row 1 from row 2

Swapped row 2 and 3

(rather divide by 3 than 7)

Divide row 2 by ­3

Add 7 times row 2 to row 3

Subtract 2 times row 2 from row 1

131

From Previous slide

Divide row 3 by ­37/3

Subtract 2/3 times row 3 from row 2

Subtract 5/3 times row 3 from row 1

The solution to the system is x = 1, y = 1, and z = 2.

132

Convert the system to an augmented matrice. Solve using row reduction

133

Convert the system to an augmented matrice. Solve using row reduction

134

Convert the system to an augmented matrice. Solve using row reduction

135

Circuits

Return to Table of Contents

136

Definition

Return to Table of Contents

137

A Graph of a network consists of vertices (points) and edges (edges connect the points)

The points marked v are the vertices, or nodes, of the network.The edges are e.

138

Edge endpoints 

139

Vocab

Adjacent edges share a vertex.

Adjacent vertices are connected by an edge.

e5 and e6 are parallel because they connect the same vertices.

A e1 and e7 are loops.

v8 is isolated because it is not the endpoint for any edges.

A simple graph has no loops and no parallel edges.

140

Make a simple graph with vertices {a, b, c, d} and as many edges as possible.

141

59 Which edge(s) are loops?

A e1B e2C e3D e4E e5F e6

G v1H v2I v3J v4

142

60 Which edge(s) are parallel?

A e1B e2C e3D e4E e5F e6

G v1H v2I v3J v4

143

61 Which edge(s) are adjacent to e4?

A e1B e2C e3D e4E e5F e6

G v1H v2I v3J v4

144

62 Which vertices are adjacent to v4?

A e1B e2C e3D e4E e5F e6

G v1H v2I v3J v4

145

63 Which vertex is isolated?

A e1B e2C e3D e4E e5F none

G v1H v2I v3J v4

146

Some graphs will show that an edge can be traversed in only one direction, like one way streets.

This is a directed graph.

147

An adjacency matrix shows the number of paths from one vertex to another.

So row 4 column 5 shows that there is 1 path from v4 to v5.

148

64 How many paths are there from v2 to v3?

149

65 Which vertex is isolated?

150

Properties

Return to Table of Contents

151

Complete Graph

Every vertex is connected to every other by one edge. So at a meeting with 8 people, each person shook hands with 

every other person once. The graph shows the handshakes.

So all 8 people shook hands 7 times, that would seem like 56 handshakes.  But there 28 edges to the graph.  Person A shaking with B and B shaking with A is the same handshake.

152

Complete GraphThe number of edges of a complete graph is

153

66 The Duggers, who are huggers, had a family reunion. 50 family members attended.  How many hugs were exchanged?

154

The degree of a vertex is the number edges that have the vertex as an endpoint.

The degree of a network is the sum of the degrees of the vertices.  The degree of the network is twice the number of edges. Why?

Degrees

Loops count as 2.

155

67 What is the degree of A?

A

B

C

156

68 What is the degree of B?

A

B

C

157

69 What is the degree of C?

A

B

C

158

70 What is the degree of the network?

A

B

C

159

Corollaries:• the degree of a network is even• a network will have an even number of odd vertices

160

Can odd number of people at a party shake hands with an odd number of people?

Corollaries:• the degree of a network is even• a network will have an even number of odd vertices

Think about the corollaries.

An odd number of people means how many vertices?

An odd number of handshakesmeans what is the degreeof those verticces?

161

Euler

Return to Table of Contents

162

Konisberg Bridge Problem

Konisberg was a city in East Prussia, built on the banks of the Pregol River.  In the middle of the river are 2 islands, connected to each other and the banks by a series of bridges.  

The Konisberg Bridge Problem asks if it is possible to travel each bridge exactly once and end up back where you started?

163

In 1736, 19 year old Leonhard Euler, one of the greatest mathematicians of all time, solve the problem.

Euler, made a graph of the city with the banks and islands as vertices and the bridges as edges.

He then developed rules about traversable graphs.

164

TraversableA network is traversable if each edge can be traveled travelled exactly once.

In this puzzle, you are asked to draw the house,or envelope, without repeating any lines.

Determine the degree of each vertex.  Traversable networks will have 0 or 2 odd vertices. If there are 2 odd vertices start at one and end at the other.

165

Euler determined that it was not possible  because there are 4 odd vertices.

166

A walk is a sequence of edges and vertices from a to b.

A path is a walk with no edge repeated.(Traversable)

A circuit is a path that starts and stops at the same vertex.

An Euler circuit is a circuit that can start at any vertex.

167

For a network to be an Euler circuit, every vertex has an even degree.

168

v1

v2v4

v5

v3e4

e3

e1e5

e7

e8

71 Which is a walk from v1 to v5?

A v1,e3,v3,e4,v5B v1,e2,v2,e3,v3,e5,v4,e7,v5C v1,e3,e2,e7,v5D v1,e3,v3,e5,v4,e7,v5

e2

169

72 Is this graph traversable?

Yes  

No  v1

v2v4

v5

v3e4

e3

e1e5

e7

e8

170

Connected vertices have at least on walk connecting them.

Connected graphs have all connected vertices

v1

v2v4

v5

v3e4

e3

e1e5

e7

e8

171

Euler's Formula

V ­ E + F = 2V is the number verticesE is the number of edgesF is the number of faces

For all Polyhedra,

TetrahedronPentagonal Prism

10 ­ 15 + 7 = 2 4 ­ 6 + 4 =2

172

Apply Euler's Formula to circuits.Add 1 to faces for the not enclosed region.

Euler's Formula

V ­ E + F = 2V is the number verticesE is the number of edgesF is the number of faces

V=5E=7F=3+1

V=7E=9F=3+1

173

73 How many 'faces' does this graph have?

174

74 How many 'edges' does this graph have?

175

75 How many 'vertices' does this graph have?

176

76 For this graph, what does V ­ E + F= ?

177

Matrix Powers and Walks

Return to Table of Contents

178

Earlier in this unit, we looked at adjacency matrices for directed graphs.

179

There are also adjacency matrices for undirected graphs.

a1

a2

a3

a4

maindiagonal

What do the numbers on the main diagonal represent?

What can be said about the halves of adjacency matrix?

180

The number of walks of length 1 from a1 to a3 is 3. a1

a3

a4a2How many walks of length 2 are there from 

a1 to a3? 

By raising the matrix to the power of the desired length walk, the element in the 1st row 3rd column is the answer.

Why does this work?  When multiplying, its the 1st row, all the walks length one from a1, by column 3, all the walks length 1 from a3.

181

77 How many walks of length 2 are there from a2 to a4?

a1

a3

a4a2

182

78 How many walks of length 3 are there from a2 to a2?

a1

a3

a4a2

183

79 How many walks of length 5 are there from a1 to a3?

a1

a3

a4a2

184

Markov Chains

Return to Table of Contents

185

During the Super Bowl, it was determined that the  commercials could be divided into 3 categories: car, Internet sites, and other. The directed graph below shows the probability that after a commercial aired what the probability for the next type of commercial.

<

< <

<< <

< <

<

C I

O

.40

.30.20

.40

.10

.50

.60.10

.40

<

186

<

< <

<

< <

< <

<

C I

O

.40

.30.20

.40

.10

.50

.60.10

.40

<

What is the probability that a car commercial follows an Internet commercial?

187

<

< <

<

< <

< <

<

C I

O

.40

.30.20

.40

.10

.50

.60.10

.40

<

An adjacency matrix that shows the probabilities of what happens next is called a transition matrix.

Since each row adds to 1(100%) this matrix is also called a stochastic matrix.

188

<

< <

<

< <

< <

<

C I

O

.40

.30.20

.40

.10

.50

.60.10

.40

<

What will the commercial be 2 commercials after a car ad? Using the properties from walks, square the transition matrix.

The first row gives the likelihood of the type of ad following a car ad.

189

<

This method can be applied for any number of ads. But notice what happens to the elements as we get to 10 ads away.

This means that no matter what commercial is on, there is an 18% chance that 10 ads from now will be an Internet ad.

190

Horse breeders found that the if a champion horse sired an offspring it had 40% of being a champion. If a non­champion horses had offspring, they were 35% likely of being champions.

Make a graph and a transition matrix.

191

80 Using the transition matrix for champion horse breeding,  what is the likelihood of a champion being born in 10 generations?

192

81 Using the transition matrix for champion horse breeding,  what is the likelihood of a champion being born to non­champions in 2 generations?