* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Solutions to Homework 2
Linear least squares (mathematics) wikipedia , lookup
Rotation matrix wikipedia , lookup
Vector space wikipedia , lookup
Determinant wikipedia , lookup
Euclidean vector wikipedia , lookup
Matrix (mathematics) wikipedia , lookup
Laplace–Runge–Lenz vector wikipedia , lookup
Jordan normal form wikipedia , lookup
Eigenvalues and eigenvectors wikipedia , lookup
Singular-value decomposition wikipedia , lookup
Orthogonal matrix wikipedia , lookup
Non-negative matrix factorization wikipedia , lookup
Perron–Frobenius theorem wikipedia , lookup
Covariance and contravariance of vectors wikipedia , lookup
Gaussian elimination wikipedia , lookup
Cayley–Hamilton theorem wikipedia , lookup
System of linear equations wikipedia , lookup
Matrix multiplication wikipedia , lookup
Math 314H Solutions to Homework # 2 1. Let T : U → V be a linear transformation. Suppose {u1 , . . . , uk } is a basis for ker T and {v1 , . . . , v` } a basis for im T . Now, as v1 , . . . , v` are in im T , there exists vectors w1 , . . . , w` in U such that T (wi ) = vi for i = 1, . . . , `. Prove that {u1 . . . , uk , w1 , . . . w` } spans U . (This completes the proof of the theorem from class on March 13.) Solution: Let y ∈ U . Then T (y) ∈ im T . Therefore, T (y) = c1 v1 + · · · + c` v` for some scalars c1 , . . . , c` = c1 T (w1 ) + · · · + c` T (w` ) = T (c1 w1 + · · · + c` w` ). For notational convenience, let x = c1 w1 + · · · + c` well . Then we have T (y) = T (x). Hence, T (y − x) = T (y) − T (x) = 0. Thus, y − x ∈ ker T , and so y − x = d1 u1 + · · · dk uk for some scalars d1 , . . . , dk . Then y = d 1 u1 + · · · d k uk + x = d 1 u 1 + · · · d k u k + c 1 w1 + · · · c ` w` ∈ Span{u1 , . . . , uk , w1 , . . . , w` }. Therefore, U = Span{u1 , . . . , uk , w1 , . . . , w` }. 2. Prove that the set of functions β = {1, cos x, cos2 x, . . . , cos6 x} is linearly independent in C(R). (Hint: Suppose c0 · 1 + c1 · cos x + · · · + c6 · cos6 x = 0. Then this equation holds for all values of x. Hence, for each value you substitute in for x, you get a different linear equation in the ci ’s. Use different values for x until you get enough independent equations to force all the ci ’s to be zero.) Solution: Suppose c0 · 1 + c1 · cos x + · · · + c6 · cos6 x = 0. As this equation holds for all x, we can obtain many linear equations in the ci ’s by substituting different values for x into this equation: π : 2 x=0: x=π: π x= : 3 2π x= : 3 π x= : 4 3π x= : 4 x= c0 = 0 c 0 + c1 + c2 + c3 + c4 + c5 + c6 c0 − c1 + c2 − c3 + c4 − c5 + c6 1 1 1 1 1 1 c0 + c1 + c2 + c3 + c4 + c5 + c6 2 4 8 16 32 64 1 1 1 1 1 1 c0 − c1 + c2 − c3 + c4 − c5 + c6 4 8 16 32 64 √2 √ √ 2 1 2 1 2 1 c0 + c1 + c2 + c3 + c4 + c5 + c6 2 4 8 √2 √4 √8 2 2 2 1 1 1 c0 − c1 + c2 − c3 + c4 − c5 + c6 2 2 4 4 8 8 =0 =0 =0 =0 =0 =0 The coefficient matrix for this 1 1 1 1 1 1 1 system is: 0 1 −1 1 2 1 − √2 2 2√ − 22 0 1 1 1 4 1 4 1 2 1 2 0 1 −1 1 8 1 − √8 2 4√ − 42 0 1 1 1 16 1 16 1 4 1 4 0 1 −1 1 32 1 −√32 2 8√ − 82 0 1 1 1 64 . 1 64 1 8 1 8 Using Maple, this matrix is row equivalent to the identity matrix. Therefore, the only solution to this system is c0 = c1 = c2 = c3 = c4 = c5 = c6 = 0. Hence, the set β is linearly independent. 3. Let W = Span(β) where β is the set of functions from the previous problem. Then β is a basis for W (as β is linearly independent and spans W ). Let α = {1, cos x, cos 2x, . . . , cos 6x}. Prove that α is also a basis for W . You may assume the following trig identities: cos 2x = −1 + 2 cos2 x cos 3x = −3 cos x + 4 cos3 x cos 4x = 1 − 8 cos2 x + 8 cos4 x cos 5x = 5 cos x − 20 cos3 x + 16 cos5 x cos 6x = −1 + 18 cos2 x − 48 cos4 x + 32 cos6 x. Solution: Consider the coordinate mapping T : W → R7 defined by T (f ) = [f ]β , where [f ]β is the coordinate vector of f with respect to the basis β. Then α is linearly independent in W if and only if the set T (α) = {T (1), T (cos x), T (cos 2x), . . . , T (cos 6x)} is linearly independent in R7 . This is because T is a one-to-one linear transformation. (See Theorem 8 on page 244 and Exercise 25 on page 249.) Now, T (α) = {[1]β , [cos x]β , [cos 2x]β , [cos 3x]β , [cos 4x]β , [cos 5x]β , [cos 6x]β } −1 0 1 0 −1 0 1 0 1 0 −2 0 5 0 0 0 2 0 −8 0 18 , 0 , 0 , 4 , 0 , −20 , 0 . 0 = 0 0 0 0 8 0 −48 0 0 0 0 0 16 0 32 0 0 0 0 0 0 Writing these vectors as columns of a matrix and using Maple to row reduce this matrix, we see that T (α) is linearly independent. Therefore, α is a linearly independent subset of W . Since α has 7 elements, this means that α spans a 7-dimensional subspace of W . Since dim W = 7, we see that α must also span W . (See Theorem 12 on page 253.) Hence, α is a basis for W . 4. Let W, α, β be as in the previous problem. (a) Find the change of coordinates matrix from α to β. Solution: According to Theorem 15 on page 267, to find the change of coordinates matrix from α to β, we find the coordinate vectors with respect to β for each of the elements of α and write them as columns of a matrix. We already found these coordinate vectors in the previous problem. The change of coordinates matrix P from α to β is 1 0 −1 0 1 0 −1 0 1 0 −3 0 5 0 0 0 2 0 −8 0 18 . 0 0 0 4 0 −20 0 P = 0 0 0 0 8 0 −48 0 0 0 0 0 16 0 0 0 0 0 0 0 32 (b) Find the change of coordinates matrix from β to α. (Hint: See the gray box on page 268 of your text.) Solution: Since P is the change of coordinates matrix from α to β, the change of coordinates matrix from β to α is just P −1 . Using Maple, we find 5 1 0 21 0 38 0 16 0 1 0 3 0 5 0 4 8 0 0 1 0 1 0 15 2 2 32 1 5 P −1 = 0 0 0 4 01 16 03 . 0 0 0 0 0 16 8 0 0 0 0 0 1 0 16 1 0 0 0 0 0 0 32 (c) Use the matrix you found in (b) to rewrite the following indefinite integral as an integral of a linear combination of functions from α: Z 7 + 3 cos2 x − 7 cos4 x + 5 cos5 x − 13 cos6 x dx. 7 0 3 . Then 0 Solution: Let f be the integrand of the above integral. Then [f ]β = −7 5 −13 [f ]α = P −1 [f ]β , where P −1 is the matrix from part (b). Using Maple, we find 29 16 25 8 −259 32 25 [f ]α = 16 . −53 16 5 16 −13 32 Thus, Z Z 29 25 259 25 53 5 13 f dx = + cos x− cos 2x+ cos 3x− cos 4x+ cos 5x− cos 6x dx. 16 8 32 16 16 16 32 (d) Evaluate (by hand) the integral you found in part (c). R Solution: Since cos nx dx = sinnnx + C for any n 6= 0, the evaluation of the above integral is 29 25 259 25 53 1 13 x+ sin x − sin 2x + sin 3x − sin 4x + sin 5x − sin 6x + C. 16 8 64 48 64 16 192 5. Let P be an n × n matrix all of whose entries are nonnegative. Let S be the n × n matrix which has a ‘1’ in every entry. (a) Prove that P is a stochastic matrix if and only if SP = S. q1 .. Solution: Let q = . be a column vector whose entries are nonnegative. Then qn q1 + q 2 + · · · q n .. Sq = . Since q is a probability vector if and only if q1 + · · · + . q1 + q 2 + · · · q n 1 .. qn = 1, we see that q is a probability vector if and only if Sq = . . Let P = 1 q1 q2 · · · qn , where q1 , . . . , qn are the columns of P . Then P is a stochastic matrix if and only if each of the qi ’s is a probability vector. Hence, P is stochastic if 1 .. and only if Sqi = . for i = 1, . . . , n, which is true if and only if 1 SP = S q1 · · · qn = Sq1 · · · Sqn 1 ··· 1 = ... ... ... 1 ··· 1 = S. (b) Use part (a) to prove that if P and Q are stochastic matrices, so is P Q. Solution: It is clear that if all the entries of P and Q are nonnegative, the same holds true for P Q. As P and Q are stochastic, we know SP = S and SQ = S. Therefore, S(P Q) = (SP )Q = SQ = S. Therefore, by part (a), P Q is a stochastic matrix. (c) Prove that if P is a stochastic matrix, so is P n for every n ≥ 1. Solution: Letting Q = P and applying part (b), we have that P 2 = P P is a stochastic matrix. Lather, rinse, repeat (i.e., use induction) to get P n is stochastic for all n ≥ 1. (d) If P is an invertible stochastic matrix, is P −1 necessarily stochastic? Justify your answer. Solution: Certainly, if SP = S and P is invertible then S = SP −1 . However, it is not necessarily true that P −1 will have nonnegative entries. For example, let 1 1 P = 21 . 0 2 Then P −1 0 2 = . 1 −1 6. In this exercise you will prove that every stochastic matrix has at least one steady state vector. Let P be an n × n stochastic matrix. (a) Let I be the n × n identity matrix. Prove that P − I is not invertible. (Hint: From the preceding problem, you know that S(P − I) = 0.) Solution: From the previous problem, we have SP = S. Therefore, S(P − I) = SP − S = 0. If P − I were invertible, then by multiplying both sides of this equation by (P −I)−1 , we would have S = 0, a contradiction. Therefore, P −I is not invertible. (b) Prove there exists a nonzero vector u such that P u = u. (Hint: Use the theorem on page 262.) Solution: As P − I is not invertible, the nullspace of P − I is non-trivial. (This is part of the “Invertible Matrix Theorem”– see page 262, for instance.) Therefore, there is a nonzero vector u ∈ Rn such that (P − I)u = P u − Iu = 0. Hence, P u = u. 7. A mouse is placed in a box with nine rooms as shown in the figure below. Every 10 seconds, an observer checks to see which room the mouse is in. Assume that for each 10 second interval it is equally likely that the mouse goes through any door in the room, or stays put in the room. (a) Suppose the mouse is initially placed in room 1. What is the probability the mouse will be in room 9 one minute later? Solution: First we find the stochastic matrix for this Markov chain. The ith column of this matrix is the probability vector for the next observation given that the mouse was last observed in room i. For example, if the mouse was last observed in room 6, there is a 14 probability he will next be found in room 3, 14 probability in room 5, 41 probability in room 9, and 14 probability he will be observed in room 6 again. Thus, the probability vector for room 6 is 0 0 1 4 0 1 . 41 4 0 0 1 4 Doing this for all the rooms, we find the stochastic matrix for this Markov process is: 1 3 1 3 0 1 3 P = 0 0 0 0 0 1 4 1 4 1 4 0 1 4 0 0 0 0 1 4 0 0 0 0 0 1 0 51 0 0 0 0 3 1 0 0 14 0 0 0 3 0 41 51 0 13 0 0 0 14 51 14 0 41 0 . 1 1 1 1 0 5 4 0 0 3 3 0 41 0 0 31 14 0 0 0 51 0 13 14 13 0 0 0 41 0 41 13 0 As the mouse is initially placed in room 1, the initial state of the mouse is given by the probability vector 1 0 0 0 x= 0 . 0 0 0 0 The state vector for the mouse after 10 seconds is P x, after 20 seconds, P (P x) = P 2 x, and after 30 seconds, P (P (P x))) = P 3 x. Thus, the state vector for the mouse after one minute is (using Maple) .1249 .1444 .0913 .1444 . .1531 P 6x u .0958 .0913 .0958 .0590 Thus, the probability that the mouse will be in room 9 one minute later is about .0590, or approximately 5.9%. (b) Find the steady state vector for this Markov chain. Solution: A steady state vector for this Markov chain is a probability vector q such that P q = q. Such a vector q must satisfy the equation (P − I)q = 0, so q is in the nullspace of P − I. Using Maple, we find that a basis for the nullspace of P − I is {u} where 1 4 3 1 4 35 u= 34 . 3 1 4 3 1 Thus, the nullspace of P − I is one-dimensional and everything in the nullspace is a multiple of u. Unfortunately, u is not a probability vector since the sum of its entries 1 is 11. But, if we multiply u by 11 , then the result is a probability vector which is in the nullspace of P − I. Therefore, the steady state vector for P is 1 11 4 33 1 11 4 33 5 1 u= 33 . 11 4 33 1 11 4 33 1 11 Thus, after many observations, this vector gives the probability that the mouse will be observed in any given room. Notice that each room’s probability depends only on the number of doors ito that room (i.e., the steady state probability for any room is n+1 11 where n is the number of doors).