程序代写案例-MATH2061
Course Notes for LINEAR MATHEMATICS Weeks 1–6 of MATH2061 Jenny Henderson c© School of Mathematics and Statistics The University of Sydney, 2011. Contents 1 Solving Linear Systems 1 1.1 The existence of solutions . . . . . . . . . . . . . . . . . . . . 1 1.2 Techniques for finding solutions . . . . . . . . . . . . . . . . . 3 1.2.1 Gaussian elimination . . . . . . . . . . . . . . . . . . . 3 1.2.2 Solution by other methods . . . . . . . . . . . . . . . . 5 1.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2 Vector Spaces and Subspaces 9 2.1 Axioms of a vector space . . . . . . . . . . . . . . . . . . . . . 10 2.2 Examples of vector spaces . . . . . . . . . . . . . . . . . . . . 11 2.3 Subspaces of a vector space . . . . . . . . . . . . . . . . . . . 13 2.4 Examples of subspaces . . . . . . . . . . . . . . . . . . . . . . 15 2.4.1 Subspaces of R3 . . . . . . . . . . . . . . . . . . . . . . 15 2.4.2 Subspaces of F . . . . . . . . . . . . . . . . . . . . . . 18 2.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3 Linear Combinations and Span 21 3.1 Null space of a matrix . . . . . . . . . . . . . . . . . . . . . . 21 3.2 Linear combinations . . . . . . . . . . . . . . . . . . . . . . . 22 3.3 The span of a set of vectors . . . . . . . . . . . . . . . . . . . 23 3.4 Column space of a matrix . . . . . . . . . . . . . . . . . . . . 27 3.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4 Linear Dependence and Independence 33 4.1 Linear dependence . . . . . . . . . . . . . . . . . . . . . . . . 34 4.2 Linear independence . . . . . . . . . . . . . . . . . . . . . . . 35 4.3 Basis and dimension . . . . . . . . . . . . . . . . . . . . . . . 37 4.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 5 Some Special Bases 49 5.1 Lagrange polynomials . . . . . . . . . . . . . . . . . . . . . . . 49 i ii CONTENTS 5.2 Bases of the null and column spaces of a matrix . . . . . . . . 55 5.2.1 Null space basis . . . . . . . . . . . . . . . . . . . . . . 56 5.2.2 Column space basis . . . . . . . . . . . . . . . . . . . . 57 5.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 6 Linear Transformations 63 6.1 Linear transformations . . . . . . . . . . . . . . . . . . . . . . 63 6.2 Examples of linear transformations . . . . . . . . . . . . . . . 65 6.3 Matrix transformations . . . . . . . . . . . . . . . . . . . . . . 67 6.4 Geometric significance of matrix transformations . . . . . . . . 69 6.4.1 Reflections . . . . . . . . . . . . . . . . . . . . . . . . . 70 6.4.2 Rotations . . . . . . . . . . . . . . . . . . . . . . . . . 72 6.4.3 Shears . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 6.4.4 Scalings . . . . . . . . . . . . . . . . . . . . . . . . . . 74 6.5 Composite transformations . . . . . . . . . . . . . . . . . . . . 75 6.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 7 Eigenvalues and Eigenvectors 81 7.1 Eigenvalues, eigenvectors and eigenspaces . . . . . . . . . . . . 82 7.2 How to find eigenvalues and eigenvectors . . . . . . . . . . . . 83 7.3 The diagonalisation theorem . . . . . . . . . . . . . . . . . . . 88 7.4 Finding powers of a matrix . . . . . . . . . . . . . . . . . . . . 93 7.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 8 Linear Recurrence Relations 97 8.1 Leslie population model . . . . . . . . . . . . . . . . . . . . . 98 8.2 Conduction of electrical impulses . . . . . . . . . . . . . . . . 104 8.3 Growth of branches on a tree . . . . . . . . . . . . . . . . . . 106 8.4 The general case . . . . . . . . . . . . . . . . . . . . . . . . . 108 8.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 9 Systems of Differential Equations 115 9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 9.2 Solving using diagonalisation . . . . . . . . . . . . . . . . . . . 116 9.3 The mixing problem . . . . . . . . . . . . . . . . . . . . . . . 121 9.4 Populations of interlinked species . . . . . . . . . . . . . . . . 124 9.5 The diffusion equation . . . . . . . . . . . . . . . . . . . . . . 126 9.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 Chapter 1 Solving Linear Systems The ability to solve linear systems is the fundamental technique of any ele- mentary course in linear algebra. In this chapter we revise the methods of solution that were taught in first year. 1.1 The existence of solutions A system of m linear equations in the unknowns x1, x2, . . . , xn, a11x1 + . . .+ a1nxn = b1 ... ... am1x1 + . . .+ amnxn = bm is first rewritten as a single matrix equation: a11 . . . a1n... ... am1 . . . amn x1... xn = b1... bm Denoting the coefficient matrix by A, the unknowns by the n × 1 vector x and the known constants b1, . . . , bm by the m × 1 vector b, the system can be expressed concisely as Ax = b. Another way of writing this linear system is to describe it in a way which emphasises the columns of the matrix A. 1 2 CHAPTER 1. SOLVING LINEAR SYSTEMS We use the fact that Ax = a11 . . . a1n... ... am1 . . . amn x1... xn = a11x1 + . . .+ a1nxn... am1x1 + . . .+ amnxn = x1 a11... am1 + . . .+ xn a1n... amn = x1c1 + . . .+ xncn where the vectors c1, . . . , cn denote the columns of A. In this way, we see that the original linear system Ax = b can be written as x1c1 + . . .+ xncn = b. The left-hand side is called a linear combination of the column vectors c1, . . . , cn. Linear combinations occur frequently in this unit of study. They consist of the sum of one or more scalar multiples of vectors. The scalars x1, . . . , xn are called weights in the linear combination. (The use of the word “weights” does not imply that x1, . . . , xn are always positive.) If x1, . . . , xn are numbers which satisfy the original linear system, then the right hand side column vector b is therefore expressible as a linear combina- tion of the columns of A. Conversely, given any column vector b which can be expressed as a linear combination of the vectors c1, . . . , cn with weights w1, . . . , wn, that is, b = w1c1 + . . .+ wncn, then the weights w1, . . . , wn provide a solution of the linear system Ax = b. That is, the system has at least one solution, namely x = w1... wn . The system Ax = b has a solution if and only if b is a linear combination of the columns of A, the components of each solution vector x being weights in the linear combination. 1.2. TECHNIQUES FOR FINDING SOLUTIONS 3 1.2 Techniques for finding solutions The three techniques for finding solutions of Ax = b that were taught in first year are: solution by Gaussian elimination, solution by obtaining reduced row echelon form and solution by obtaining the inverse of the coefficient matrix A. 1.2.1 Gaussian elimination We illustrate this technique with an example of a system with infinitely many solutions. Example Solve Ax = b with A = 1 5 1 02 8 3 6 1 3 1 4 and b = 32 1 . The Gaussian elimination technique involves forming the augmented matrix [A b] and applying elementary row operations (EROs) to obtain a matrix in row echelon form. [A b] = 1 5 1 0 32 8 3 6 2 1 3 1 4 1 R2=R2−2R1, R3=R3−R1−−−−−−−−−−−−−−→ 1 5 1 0 30 −2 1 6 −4 0 −2 0 4 −2 R2=−12R2−−−−−→ 1 5 1 0 30 1 −1 2 −3 2 0 −2 0 4 −2 R3=R3+2R2−−−−−−→ 1 5 1 0 30 1 −1 2 −3 2 0 0 −1 −2 2 R3=−R3−−−−→ 1 5 1 0 30 1 −1 2 −3 2 0 0 1 2 −2 The last matrix is in row echelon form. The (1,1), (2,2) and (3,3) positions of this matrix are called pivot positions. These are the positions of the leading 1s.The fourth column (corresponding to the coefficients of x4) is missing a leading 1, so x4 is a free variable (parameter) and we express all other variables in terms of x4. The equivalent (simplified) linear system is x1 + 5x2 + x3 = 3 x2 − 12x3 − 3x4 = 2 x3 + 2x4 = −2 4 CHAPTER 1. SOLVING LINEAR SYSTEMS Using back substitution we get x3 = −2 − 2x4 x2 = 2 + 1 2 x3 + 3x4 = 2 + 1 2 (−2 − 2x4) + 3x4 = 1 + 2x4 x1 = 3− 5x2 − x3 = 3− 5(1 + 2x4)− (−2− 2x4) = −8x4 The system has infinitely many solutions, one for each value of x4, namely x = −8x4 1 + 2x4 −2 − 2x4 x4 = 0 1 −2 0 + x4 −8 2 −2 1 . This gives us not only the general solution x of the linear system but also a way of expressing b as a linear combination of the columns of A, using the components of the solution vector x as weights: b = 32 1 = −8x4 12 1 + (1 + 2x4) 58 3 + (−2 − 2x4) 13 1 + x4 06 4 for all values of x4. That is, b is expressible as a linear combination of the columns of A in infinitely many ways. For example, the particular solution of the system corresponding to x4 = 0 is x = 0 1 −2 0 , and b = 32 1 = 0 12 1 + 58 3 − 2 13 1 + 0 06 4 . The particular solution of the system corresponding to x4 = 1 is x = −8 3 −4 1 , and b = 32 1 = −8 12 1 + 3 58 3 − 4 13 1 + 06 4 . 1.2. TECHNIQUES FOR FINDING SOLUTIONS 5 Example Consider the system Ax = b where this time A is the square matrix 2 2 61 1 4 3 4 5 and b is the vector 23 6 . Form the augmented matrix and apply EROs to obtain row echelon form. [A b] = 2 2 6 21 1 4 3 3 4 5 6 R1=12R1−−−−→ 1 1 3 11 1 4 3 3 4 5 6 R2=R2−R1, R3=R3−3R1−−−−−−−−−−−−−−→ 1 1 3 10 0 1 2 0 1 −4 3 R2↔R3−−−→ 1 1 3 10 1 −4 3 0 0 1 2 The last matrix is in row echelon form. Again the pivot positions are the (1,1), (2,2) and (3,3) positions of the matrix. The equivalent (simplified) linear system is x1 + x2 + 3x3 = 1 x2 − 4x3 = 3 x3 = 2 Back substitution then gives x3 = 2, x2 = 3 + 4x3 = 11, x1 = 1− x2 − 3x3 = −16. The system has a unique solution, x = −1611 2 . According to our previous remarks, the vector b is therefore expressible uniquely as a linear combination of the columns of A, with the components of the solution x as weights: b = 23 6 = −16 21 3 + 11 21 4 + 2 64 5 . 1.2.2 Solution by other methods Another way of solving the system of the previous example would be to continue to apply EROs until the reduced row echelon form of [A b] is 6 CHAPTER 1. SOLVING LINEAR SYSTEMS obtained. Using this procedure we obtain the reduced row echelon matrix 1 0 0 −160 1 0 11 0 0 1 2 , yielding the unique solution x1 = −16, x2 = 11, x3 = 2. This method involves more row operations than Gaussian elimination but has the benefit that the solution is displayed in the final matrix, and no back substitution is required. A third way of solving the system is to use the fact that the matrix A is (in this example) invertible, with A−1 = 11/2 −7 −1−7/2 4 1 −1/2 1 0 . The unique solution is then given by the following calculation: x = A−1b = 11/2 −7 −1−7/2 4 1 −1/2 1 0 23 6 = −1611 2 . 1.3. SUMMARY 7 1.3 Summary These are the results you should know and understand: • A linear system Ax = b is consistent (that is, a solution vector x exists) if and only if the right-hand-side column vector b can be written as a linear combination of the columns of the matrix A. • Solutions of linear systems can be found in various ways, but Gaussian elimination is the most efficient from a computational point of view when the system is of reasonable size. This is the technique you must be able to apply: • To solve Ax = b by Gaussian elimination, apply elementary row op- erations (EROs) to the augmented matrix [A b] to obtain a matrix in row echelon form. Then find the solution by back-substitution. This is an essen- tial technique to master for this unit of study. Practice Examples Solve Ax = b using Gaussian elimination for the following matrices A and column vectors b. If you’re a bit rusty on the procedure, refer to “the little blue book” or re-read your first year linear algebra notes. 1. A = 1 2 53 1 0 0 2 2 , b = 26 4 . 2. A = 1 2 53 1 7 0 5 8 , b = 26 1 . 3. A = 1 0 1 33 1 0 2 1 0 2 2 , b = 5−3 6 . Answers 1. Unique solution, x = 13 −1 . 2. No solution – system inconsistent. 3. Infinitely many solutions, x = 4 −15 1 0 + x4 −4 10 1 1 for all values of x4. 8 CHAPTER 1. SOLVING LINEAR SYSTEMS Chapter 2 Vector Spaces and Subspaces So far we have been studying the theory and practice of solving Ax = b, in particular when A is square and the system has a unique solution. Now we look at the more general case of rectangular A and a system with infinitely many solutions, to motivate the study of vector spaces. Suppose that A is a 3× 4 matrix and that the augmented matrix [A b] has the following reduced row echelon form: [A b] various EROs−−−−−−−→ 1 0 2 3 10 1 5 7 8 0 0 0 0 0 There are two parameters (x3 and x4) and infinitely many solutions, x = 1− 2x3 − 3x4 8− 5x3 − 7x4 x3 x4 = 1 8 0 0 + x3 −2 −5 1 0 + x4 −3 −7 0 1 , x3, x4 ∈ R. One particular solution is x′ = 1 8 0 0 , corresponding to x3 = x4 = 0. If we had started with the homogeneous system Ax = 0, then the reduction 9 10 CHAPTER 2. VECTOR SPACES AND SUBSPACES to reduced row echelon form would have given the following matrix: [A 0] −→ 1 0 2 3 00 1 5 7 0 0 0 0 0 0 and the (infinitely many) solutions would be described by the equation x = x3 −2 −5 1 0 + x4 −3 −7 0 1 , x3, x4 ∈ R. We can see that every solution of Ax = b is the sum of a particular solution x′ of Ax = b plus a solution of the homogeneous system Ax = 0. The “infinity of solutions” comes from the homogeneous system Ax = 0. The study of homogeneous systems is important for two reasons: 1. If u and v are both solutions of Ax = 0 then so is u+ v. A(u+ v) = Au+ Av = 0+ 0 = 0. 2. If u is a solution of Ax = 0 then so is ku for any real number k. A(ku) = kAu = k0 = 0. In other words, if we confine our attention to the set of all solutions ofAx = 0, the operations of addition of vectors and multiplication of a vector by a scalar go on within the set, and never take us outside the set. This particular set is an example of a mathematical structure called a vector space. 2.1 Axioms of a vector space Definition A vector space over R is a non empty set V whose elements are called vectors, and on which there are two operations defined, namely addition of vectors and multiplication of a vector by a scalar (scalars being numbers in R), satisfying the following 10 axioms: A1 For all u and v in V , the vector u + v is also in V . This property is called closure under addition. A2 For all u, v and w in V , the vector (u + v) + w equals the vector u+ (v +w). This is called the associative law of addition. 2.2. EXAMPLES OF VECTOR SPACES 11 A3 For all u and v in V , the vector u + v equals the vector v + u. That is, addition is commutative. A4 There is a zero vector, written 0, in V with the property that for all vectors v in V , v + 0 = 0+ v = v. A5 For every vector v in V there is a vector which we write as −v and call a negative of v, such that v +−v = 0. S1 For every vector v in V , and for every scalar k in R, the vector kv is in V . This property is called closure under multiplication by a scalar. S2 For all scalars k in R and all vectors u and v in V , k(u+v) = ku+kv. S3 For all scalars k1 and k2 in R and all vectors v in V , (k1 + k2)v = k1v + k2v. S4 For all scalars k1 and k2 in R and all vectors v in V , (k1k2)v = k1(k2v). S5 For all vectors v in V , 1v = v. From these axioms it is possible to deduce a number of important results, including the following. In a given vector space V , there is only one zero vector; for each vector v in V there is a unique negative vector. As a result, we may confidently speak of the zero vector in V and the negative of v. In addition, it is also true that 0v = 0 and (−1)v = −v, for every vector v in V . 2.2 Examples of vector spaces The study of vector spaces is hugely important in mathematics because so many apparently unrelated mathematical structures obey the vector space axioms. Developing an abstract theory of vector spaces then allows us to apply the results to a wide range of different situations. Example The most important vector spaces for us are denoted by the symbols R, R2, R3, . . . Rn, . . . . . . (one for each positive integer n). The vector space Rn is defined as follows: Rn = x1 x2 ... xn | x1, x2, . . . , xn ∈ R 12 CHAPTER 2. VECTOR SPACES AND SUBSPACES This is read as “Rn is the set of all columns of length n containing real number entries which can take all real values”. In Rn, the operations of addition and multiplication by a scalar are performed “component by component” within the columns. For example, in R2,( 1 5 ) + ( 7 −2 ) = ( 8 3 ) and in R3, 5 31 4 = 155 20 . For a given positive integer n, the set Rn together with these operations satisfies all the axioms of a vector space. The vector 0 = 0 0 ... 0 in Rn has the property required in A4, and the vector −x1 −x2 ... −xn has the property required in A5; namely it is the negative of x1 x2 ... xn since x1 x2 ... xn + −x1 −x2 ... −xn = 0 0 ... 0 = 0. Example The next example of a vector space may be somewhat surprising. Define the set F as follows: F = { f | f is a function with domain and codomain R} = { f | f : R → R} This set F satisfies all ten axioms of a vector space. It is called a function space as the vectors are functions, with the two operations of addition of 2.3. SUBSPACES OF A VECTOR SPACE 13 functions and multiplication of a function by a scalar. Each of these is calculated using the formula for the function. For example, if f and g are the functions whose formulas are f(x) = x2 and g(x) = sin x, then the functions f+g, 3g, −5f are also in the set F, and are functions with formulas x2 + sin x, 3 sinx, −5x2 respectively. The zero vector in F is the function z with formula z(x) = 0 for all x in R: f(x) + z(x) = f(x) + 0 = f(x), for all x ∈ R, that is, f + z = z + f = f for all f ∈ F. Example Yet another quite different example of a vector space over R is the set C of all complex numbers, C = {a + ib | a, b ∈ R}. Addition and multiplication are the usual complex number operations, (a+ ib) + (c+ id) = (a+ c) + i(b+ d) and k(a + ib) = ka+ ikb. The zero vector is 0 + i0 and the negative of a + ib is −a− ib. Example The set Mm,n of all m × n matrices with real entries is a vector space over R. For example, two particular vectors in M2,3 include the matrices ( 1 3 4 0 2 1 ) and (−3 1 −1 −8 4 −6 ) . In M2,3 (and in all Mm,n) addition of vectors and multiplication of a vector by a scalar are defined by the usual rules:( a b c d e f ) + ( g h i j k l ) = ( a + g b+ h c+ i d+ j e+ k f + l ) and λ ( a b c d e f ) = ( λa λb λc λd λe λf ) . The zero vector in M2,3 is the zero 2× 3 matrix ( 0 0 0 0 0 0 ) . 2.3 Subspaces of a vector space The vector spaces we shall study most often are vector spaces contained within Rn or within F. If one vector space is contained within another vector space, 14 CHAPTER 2. VECTOR SPACES AND SUBSPACES with the same operations of addition and multiplication by a scalar, then the smaller space is called a subspace of the larger space. Definition Let S be a non empty subset of a vector space V . If S itself satisfies the 10 vector space axioms previously listed (axioms A1, A2, A3, A4, A5, S1, S2, S3, S4, S5), with the same operations of addition and multiplication by a scalar, then S is called a subspace of V . Note that this definition allows S to be equal to V , so that every vector space is considered to be a subspace of itself. Also note that at the other extreme, the set containing just the zero vector 0 of V also satisfies all ten axioms and is therefore a subspace of V . A more important observation is that it’s not necessary to test all 10 axioms to confirm that a given subset of a known vector space is a subspace. This is because every subset of a vector space automatically satisfies axioms A2, A3, S2, S3, S4 and S5. • If S also satisfies S1, then for all vectors v ∈ S, the vector 0v = 0 will also be in S, as will the vector (−1)v = −v. That is, “axiom S1 is true for S” implies that “axioms A4 and A5 are also true for S”. • If, in addition, S satisfies A1, then we have the complete set of 10 axioms satisfied for S. Our conclusion can then be summarised in the form of a testing procedure for subspaces, as follows. A subset S of a vector space V is a subspace of V if S is not empty and (i) S satisfies A1 (that is, for all vectors u and v ∈ S, the vector u+ v is also in S), and (ii) S satisfies S1 (that is, for all vectors u ∈ S and for all scalars k, the vector ku is in S. When testing a subset S to see if it’s a subspace of a given vector space V , the condition that S is non empty is traditionally confirmed by showing that the zero vector in V is a member of the subset S. Every subspace is a vector space in its own right, and therefore must possess a zero vector. In fact, the zero vector of a subspace of V must be the same as the zero vector of the space V . If the zero vector of V is not a member of a subset S of V , then that subset cannot be a subspace of V . Checking this as a first step is therefore a good idea. 2.4. EXAMPLES OF SUBSPACES 15 If the zero vector of V is not in S then S is not a subspace. If the zero vector of V is a member of S, then axioms A1 and S1 must then be checked to determine whether or not S is a subspace. 2.4 Examples of subspaces 2.4.1 Subspaces of R3 Example Let S = x1x2 x3 | x1 = x2 = x3 , a subset of R3. This set contains all columns of length 3 in which all entries are the same. The set S is not empty, as 00 0 ∈ S, since 0 = 0 = 0. We now check A1. Let aa a and bb b be any two vectors in S. Then aa a + bb b = a+ ba+ b a+ b , Clearly, a + ba + b a + b is also in S (since all the entries are the same), and therefore A1 is satisfied. We now check S1. Let aa a be any vector in S and let k be any scalar. Then k aa a = kaka ka . Clearly kaka ka is also in S, and therefore S1 is satisfied. We conclude that S is a subspace of R3. The subspace S has a geometrical interpretation: S corresponds to all points in 3D space with coordinates which are multiples of (1, 1, 1). To see this, identify the point in space with coordinates (x1, x2, x3) with the vector x1x2 x3 in R3. Then it is possible to visualise S as the line through the origin and the point (1, 1, 1), that is, the line in the direction of the cartesian vector i+ j + k. 16 CHAPTER 2. VECTOR SPACES AND SUBSPACES