1 One Application of Linear Systems: Network...
Transcript of 1 One Application of Linear Systems: Network...
![Page 1: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/1.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
Professor Joana Amorim, [email protected]
What is on today
1 One Application of Linear Systems: Network Flow 1
2 Linear Independent sets 3
3 Application of systems to Linear Transformations 5
4 Matrix Operations 74.1 Sum and scalar Multiples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74.2 Matrix Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5 The inverse of a matrix 115.1 Inverse of 2× 2 matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125.2 An Algorithm to find the inverse of n× n matrices . . . . . . . . . . . . . . . . . . . . . . 125.3 Solving systems using the inverse of a matrix . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6 Invertibility criteria 14
1 One Application of Linear Systems: Network Flow
In the book:
• Section 1.6, pages 53 – 54.
• Exercises 11 to 14.
• To see more applications have a look at the other two examples in section 1.6, pages 50 – 52 andthe examples in section 1.10.
• Objective: study the flow of some quantity through a network ( traffic flow, current in circuits,distribution of products...)
• Representing a network:
• Arrows represent direction of the flow. If you get negative flow it means things are moving in thedirection opposite to that shown on the model.
• Assumption: Total flow in a junction= Total flow out that junction.
1
![Page 2: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/2.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
Example 1 (Similar to Exercise 11, section 1.6)
2
![Page 3: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/3.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
2 Linear Independent sets
In the book:
• Section 1.7, all.
Definition 2
• A set of vectors {v1, . . . ,vp} in Rn is said to be linearly independent (LI) if the vector equation
x1v1 + x2v2 + . . . + xpvp = 0
has only the trivial solution x = 0.
• The set {v1, . . . ,vp} is said to be linearly dependent (LD) if there is a non-trivial solution (asolution x 6= 0) for the above equation.
Example 3 (Exercise 1, section 1.7) Determine if the vectors are linearly independent. Justify youranswer. 5
00
,
72−6
,
94−8
Example 4 Determine if the vectors are linearly independent. Justify your answer.500
,
72−6
,
194−12
Deciding if a set of vectors is {v1, . . . ,vp} LI or LD IS EQUIVALENT to deciding if the homo-geneous system
x1v1 + x2v2 + . . . + xnvn = 0⇔ [v1 v2 . . . vp]x = 0
has only the trivial solution (LI) or has an infinite number of solutions (LD).
3
![Page 4: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/4.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
Possibilities:
• Sets with 1 vector: if the vector is zero they are LD, if the vector is not 0 the set is LI.
• Sets with two vectors: the set if LD iff one vector is a multiple of the other.
• Sets with two or more vectors: the set is LD iff one vector can be written as a linear combination ofthe rest (ie, one vector is in the span of the other vectors).
Example 5 Decide if the following sets are LI or LD. Justify your answer. 19
4−12
{[24
],
[612
]}{[
24
],
[10
],
[38
]}
Remark 6 • If the zero vector is included in the set, the set is always LD.
• If we have m vectors of Rn, with m > n, they are always LD. (For example 3 or more vectors of R2,4 or more vectors of R3, etc, are always LD).
Example 7 (Exercise 7, section 1.7) Determine if the columns of the matrix below form a LI set.Justify your answer. 1 4 −3 0
−2 −7 5 1−4 −5 7 5
Example 8 (Similar to Exercise 5, section 1.7) Determine if the columns of the matrix below forma LI set. Justify your answer.
0 −3 92 1 −7−1 4 −51 −4 −2
4
![Page 5: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/5.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
Example 9 (Exercise 13, section 1.7) Find the value(s) of h or which the vectors are LD. Justify youranswer. 1
5−3
,
−2−96
,
3h−9
3 Application of systems to Linear Transformations
In the book:
• Parts of Sections 1.8 and 1.9 that involve systems: read example 1 page 65 and then pages 76 –78.
• You can now do all exercises from section 1.8 and 1.9.
Example 10 (Similar to Exercise 11, section 1.8) Let
A =
1 −3 5 −50 1 −3 52 −4 4 −4
,b =
−110
,
and let T : R4 → R3 be defined by T (x) = Ax. Is b in the range of the linear map T? If is the answer isno justify, if the answer is yes find one x whose image under T is b.
5
![Page 6: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/6.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
Definition 11
• A map T : Rn → Rm is said to be onto if each b in Rm is the image of at least one x in Rn (ie,range = codomain, ie T (x) = b has one or infinite solutions).
• A map T : Rn → Rm is said to be one-to-one if each b in Rm is the image of at most one x in Rn
(ie, T (x) = b has one or none solutions).
Theorem 12T : Rn → Rm is one-to-one if and only if the equation T (x) = 0 has only the trivial solution (ie, x = 0).
Example 13 (Based on exercise 17, section 1.9) Let T : R4 → R4 be defined by
T (x1, x2, x3, x4) = (x1 + 2x2, 0, 2x2 + x4, x2 − x4).
Is this map one-to-one? Is it onto? Justify your answer.
6
![Page 7: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/7.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
4 Matrix Operations
In the book:
• Section 2.1, pages 94 – 100.
• Exercises 1 – 12.
Notation:
Identity Matrix Zero Matrix Diagonal Matrix Upper Triangular Matrix
4.1 Sum and scalar Multiples
Sum: the sum of two matrices A and B (of the same size!!) is the matrix A + B whose columns are thesums of the corresponding columns in A and B.
Scalar Multiplication: If A is a matrix and c a scalar, the scalar multiple cA is the matrix whose columnsare c time the corresponding columns in A.
7
![Page 8: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/8.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
Proposition 14 (Properties of sums and scalar multiples of matrices)
Example 15 (First part of exercise 1, section 2.1) Let
A =
[2 0 −14 −5 −2
]and B =
[7 −5 11 −4 −3
].
Compute each expression if possible. If an expression is undefined explain why.
−2A
B − 2A
4.2 Matrix Multiplication
Matrix multiplication is more sensitive than matrix sum. We can think of it as composition of maps:
So for the product AB to be defined we need to have that
#columns in A = #rows in B.
8
![Page 9: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/9.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
If this is the case (A is m× n and B is n× s) we have
(AB)ij = ai1b1j + . . . + ainbnj.
An example illustrates this better:
[2 3 10 1 2
] 1 −23 1−2 6
Proposition 16 (Properties of multiplication of matrices)
Example 17 (Second part of exercise 1, section 2.1) Let
A =
[2 0 −14 5 −2
], C =
[1 2−2 1
]and D =
[3 5−1 4
].
Compute each expression if possible. If an expression is undefined explain why.
AC
CD
9
![Page 10: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/10.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
Example 18 (Similar to Exercise 10, section 2.1) Let
A =
[3 −6−1 2
], B =
[−1 13 4
]and C =
[−3 −52 1
].
Verify that AB = AC and yet B 6= C!
Important remarks about multiplication of matrices
10
![Page 11: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/11.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
5 The inverse of a matrix
In the book:
• Section 2.2, pages 104 – 110 except elementary matrices and end of page 108.
• Exercises 1 – 10, 29 – 33.
Idea:
Definition 19 A n × n matrix A is invertible if there exists a matrix C, called the inverse of A, suchthat
AC = CA = In.
If A is invertible, its inverse is unique and represented by A−1.A non-invertible matrix is called singular. An invertible matric is called non-singular.
Proposition 20 (Properties of the Inverse) 1. (A−1)−1 = A.
2. (AB)1 = B−1A−1.
3. (AT )−1 = (A−1)T
Example 21 A =
[2 5−3 −7
], C =
[−7 −53 2
].
11
![Page 12: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/12.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
5.1 Inverse of 2× 2 matrices
Determinant:
If A =
[a bc d
]we define detA = determinant of A= ad− bc.
Theorem 22 If detA 6= 0 then A is invertible and
A−1 =1
ad− bc
[d −b−c a
].
If detA = 0 the A is not invertible.
Example 23 (Exercises 1 and 2, section 2.2) Find the inverses of the matrices (if possible).
A =
[8 65 4
]
A =
[3 28 5
]
5.2 An Algorithm to find the inverse of n× n matrices
Theorem 24 An n × n matrix A is invertible if and only if it is row equivalent to In (ie, its reducedechelon form is In). In this case the operations that take A to In also take In to A−1.
Algorithm: Reduce [ A | In ] and you get [ In | A−1 ].
12
![Page 13: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/13.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
Example 25 (Similar to Ex 32, sec 2.2) Find the inverse of A =
1 2 −1−4 −7 3−2 −6 4
.
Example 26 (Similar to Ex 30, sec 2.2) Use the above algorithm to find the inverse of A =
[3 64 7
].
13
![Page 14: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/14.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
5.3 Solving systems using the inverse of a matrix
Theorem 27 Let A be a n× n invertible matrix.Then the system Ax = b has a unique solution x = A−1b.
Example 28 (Exercise 5, section 2.2) Solve the system using the theorem above.{8x1 + 6x2 = 25x1 + 4x2 = −1
6 Invertibility criteria
In the book:
• Section 2.3, pages 113 – 116.
• Exercises all, specially 1 – 8 and 33 – 34.
When can we invert a matrix A? What we already know:
• 2× 2 if detA 6= 0.
• n× n if A −→ In.
14
![Page 15: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/15.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
Theorem 29
Example 30 (Exercises 2, 4, 5 and 7 section 2.3) Decide if the following matrices are invertible ornot. Do as little operations as possible.
A =
[−4 26 −3
], B =
−5 1 40 0 01 4 9
, C =
3 0 −32 0 4−4 0 7
15
![Page 16: 1 One Application of Linear Systems: Network Flowmath.bu.edu/people/jamorim/ek102/C1spring2017/lectures/... · 2017-01-31 · EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017](https://reader033.fdocuments.in/reader033/viewer/2022060419/5f1681b498b26b48531b2b05/html5/thumbnails/16.jpg)
EK102: Linear Algebra Lectures 5, 6: Feb 6th, 8th 2017 Section C1
D =
−1 −3 0 13 5 8 −3−2 −6 3 20 −1 2 1
Remark 31 A linear map T : Rn → Rn is represented by a n× n matrix A:
T is invertible if there exists a map S such that T (S(x)) = x and S(T (x)) = x. S is the inverse of T ,S = T−1.
A map T is invertible iif A is invertible and A−1 is the matrix representation of T−1.
[Do exercises 33 and 34 section 2.3]
16