solutions8 - Math 152, Spring 2010 Assignment #8 Notes: •...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Math 152, Spring 2010 Assignment #8 Notes: • Each question is worth 5 marks. • Due in class: Monday, March 15 for MWF sections; Tuesday, March 16 for TTh sections. • Solutions will be posted Tuesday, March 16 in the afternoon. • No late assignments will be accepted. 1. Consider a random walk with n states (this number n will be known for a given case, but we are also interested in considering it for general n). It has the following properties: • If it is in states 1 to n − 1 (that is, any state but the last) is is equally likely to stay in that state or move to the state numbered one higher. • If it is in the last state (number n) then it remains there forever. (a) Write down the transition matrix P for the case of three states (that is, n = 3). (b) For the system above with three states, if it starts in state 1, what is the chance it will be in state 3 after 3 time steps? (c) Write lines of MATLAB commands that would generate the matrix P for general n. Hint: use a for loop. Solution: a) Suppose the particle starts in state 1. Then there is a chance of 1/2 that it stays in state 1, and a 1/2 chance that it moves to state 2. It never moves to state 3. The vector of probabilities is (1/2, 1/2, 0). If the particle starts in state 2, it has 1/2 chance of staying and 1/2 chance of moving to state 3. It never goes to state 1. Thus the vector of probabilities is (0, 1/2, 1/2). Finally, if the particle starts in state 3, it never probabilities is (0, 0, 1). 1/2 Thus the matrix P describing the walk is 1/2 0 leaves, so the vector of 0 1/2 1/2 0 0. 1 b) There are different to do this problem. The easiest would form ways 1 the initial vector e = 0, which represents a particle in state 1. Then 0 the passage of each time step corresponds to multiplying by P , and we Alternatively, one could calculate P 3 and read off the answer from the left 1/8 0 0 column. Multiplying out the cube of P gives P 3 = 3/3 1/8 0, so 1/2 7/8 1 the chance of going from state 1 to state 3 in three moves is 1/2. Finally, we can simply enumerate all possible moves that go from state 1 to state 3 in 3 steps. For instance, we can achieve the result by going from 1 → 2 → 3 → 3. The transition in the first arrow has probablity 1/2, the second has probability 1/2, and the third has probability 1. Thus this happens with probability 1/2 · 1/2 · 1 = 1/4. so that the probability of going from 1 → 3 is 1/2. have to do this three times. We can multiply out successively to get P e, P 2 e = (P (P e), and P 3 e = P (P 2 e), and we find that 1/8 f = P 3 e = 3/4 , 1/2 A third way is to go 1 → 2 → 2 → 3, and this has probability 1/2/ · 1/2 · 1/2 = 1/8 as well. We need to check that there are no other ways to from to 1 to 3, ie, that the list of 3 ways given above is complete. This is easy but tedious, so we won’t do it here, but once it’s done, we can see that the total probability of going from 1 to 3 is 1/4 + 1/8 + 1/8 = 1/2, as before. Note that it’s not practical to enumerate cases for a system with many time steps or many states. It’s also not easy to calculate P n directly if n or P is big. Later in the course we will find better way to do this problem. 2. Consider the circuit in the figure below. It has one voltage source (with voltage V ) and one current source (with current I ). Another way to get from state 1 to 3 is 1 → 1 → 2 → 3. This has probability 1/2/ · 1/2 · 1/2 = 1/8. Solve the circuit with these symbolic values for the sources. Determine the 2 × 2 “fundamental” matrix F of the problem. That is, the matrix such that ￿ ￿ ￿ ￿ E V =F J I where E is the voltage across the current source and J is the current through the voltage source. Solution: Let i1 and i2 denote the loops currents in the left and right loops respectively, flowing clockwise. Then we have i1 = J and i2 = −I . The equation for the voltage drop around the left loop gives the equation 3i1 − 2i2 = V ⇐⇒ 3J + 2I = V, while the right loop gives −2i1 + 5i2 = E ⇐⇒ −2J − 5I = −E. Putting in the fact that i2 = −I , we get 3i1 = V − 2I , and E = 2i1 − 5i2 = 2 11 2 3 ((V − 2I ) + 5I = 3 V + 3 I , which is the solution of the system in terms of the parameters V and I . b) We want E and J in terms of V and I , so we write the equations as 3J = V − 2I −2J + E = 5I. and The above two equations can be written as a matrix product: ￿ 0 1 ￿￿ ￿ ￿ 3 E 1 = −2 J 0 ￿￿ ￿ −2 V . 5 I Thus ￿ 1 0 ￿ ￿−1 ￿ −2 0 5 1 1 0 F= ￿−1 ￿ −2 0 5 1 ￿￿ ￿ ￿ ￿ 3 E V = , and we get −2 J I ￿ ￿ 15 3 = −2 50 ￿￿ 2 0 1 1 3 −2 ￿ 1 = 5 ￿ 2 1 ￿ 11 . −2 Note that there are different ways to compute the inverse of the matrix ￿ ￿ 1 −2 . One way would be to use the formula for a 2 × 2 matrix, which 05 ￿ ￿−1 ￿ ￿ ab d −b 1 says that = ad−bc . One could also compute the cd −c a inverse via Gaussian elimination on the augmented matrix, as explained in class and in the notes, which gives ￿ 1 0 −2 5 1 0 0 1 1 5 ￿ ∼ 5 0 Thus the inverse is ￿ ￿ 1 0 0 5 1 0 2/5 1 ￿ 2 . 1 1 A= 1 1 1 1 2 ￿ ∼ ￿ 1 0 0 1 1 0 2/5 1/5 ￿ . 3. Consider the matrix (a) Calculate the determinant of A (because the determinant of A is not zero, we know it is invertible). (b) Calculate the inverse of A. Solution: a) Expanding in the first row, we get det(A) = 1(7−6)−1(7−3)+2(2−1) = 1 − 4 + 2 = −1. b) To get the 1 1 1 1 0 0 1 0 1 inverse, we have to do Gaussian elimination. We have 12100 112 1 00 1 3 0 1 0 ∼ 0 0 1 −1 1 0 ∼ 27001 0 1 5 −1 0 1 0 1 0 3 −2 0 −1 1 0 4 −5 1 10 0 1 00 0 0 1 1 ∼ 0 0 −1 4 −1 0 0 1 0 1 0 −1 −1 4 3 1 −5 2 3 7 3 −5 1 4. Suppose A and B are invertible, square matrices. Give an example to show that A + B is not necessarily invertible. Solution: Take A = I, B = −I , then both A and B are obviously invertible. But A + B = 0, which is not invertible. 5. Let T be the linear transformation from R5 → R5 which sends a vector x = (x1 , x2 , x3 , x4 , x5 ) to the vector T (x) = (x1 + x2 , x2 + x3 , x3 + x4 , x4 + x5 , x5 + x1 ). (a) Write the matrix A that corresponds to T . (b) Is A is invertible? Justify briefly. −1 1 . 0 −1 0 ∼ 1 Solution: Let’s write y1 = x1 + x2 y2 = x2 + x3 y3 = x3 + x4 , y4 = x4 + x5 , y5 = x5 + x1 . Reading off the coefficients of the xi from the right, we get y1 x1 y 2 x2 y3 = A x3 y 4 x4 y5 x5 11000 0 1 1 0 0 with A = 0 0 1 1 0. 0 0 0 1 1 10001 Furthermore, we can solve for the x’s in terms of the y ’s. For instance, if we want x1 , we could write x1 = y1 − y2 + x3 = (y1 − y2 ) + (y3 − x4 ) = (y1 − y2 + y3 − y4 ) + x5 = (y1 − y2 + y3 − y4 ) + (y5 − x1 ) = (y1 − y2 + y3 − y4 + y5 ) − x1 which gives 2x1 = y1 − y2 + y3 − y4 + y5 . Repeating this with the other variables, we get x1 = x2 = x3 = x4 = x5 = 1 (y1 − y2 + y3 − y4 + y5 ) 2 1 (y2 − y3 + y4 − y5 + y1 ) 2 1 (y3 − y4 + y5 − y1 + y2 ) 2 1 (y4 − y5 + y1 − y2 + y3 ) 2 1 (y5 − y1 + y2 − y3 + y4 ) 2 −1 1 1 −1 1 1 −1 1 1 −1 −1 1 −1 1 1 1 −1 1 . −1 1 1 1 1 Thus we collect up the coefficients of the y1 and put B = 2 −1 1 −1 Since if we write Ax = y , with y the vector of the yi , we finally get By = x, which B is the inverse of A so A is invertible. One could also do this problem by row reducing the matrix A and checking that it has a pivot in each row, which means it’s invertible. However, row reducing a 5 × 5 matrix is slightly tedious. A third way is to compute the determinant of A, using the expansion formulae that come later in the notes. This way is easy for this particular matrix, but in general, computing a 5 × 5 matrix by hand should be avoided. ...
View Full Document

This note was uploaded on 03/30/2011 for the course MATH 152 taught by Professor Caddmen during the Spring '08 term at The University of British Columbia.

Ask a homework question - tutors are online