14

Click here to load reader

EECS16A Guerilla Section I - Solutions (Spring 2017) · EECS16A Guerilla Section I - Solutions (Spring 2017) September 10, 2017 Directions: In groups of 4-5, work on the following

  • Upload
    hathuan

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

Page 1: EECS16A Guerilla Section I - Solutions (Spring 2017) · EECS16A Guerilla Section I - Solutions (Spring 2017) September 10, 2017 Directions: In groups of 4-5, work on the following

EECS16A Guerilla Section I - Solutions (Spring 2017)

September 10, 2017

Directions: In groups of 4-5, work on the following exercises. Make sure everyone in the group understandsthe process before moving on. The rule is that everyone in the entire group must understand a problembefore anyone is allowed to move on to the next problem. By helping each other understand, your ownunderstanding will be deepened and strengthened. In some cases, you will discover that you don’t reallyunderstand it even though you thought you did. This is a good thing because it lets you get help and fixyour understanding of these fundamentals right now.

The purpose here in this worksheet is to make sure that you understand the mechanics and fundamentals.The modeling aspects (i.e. “word problems”) are purposefully absent here because you have seen many suchproblems on the homework but it is hard to get them right if you have holes in mechanics and manipulations.So, this worksheet is not meant to be a comprehensive guide to the upcoming midterm or future homeworkproblems. It is here to strengthen your foundations.

* Asterisked problems are adapted from Linear Algebra by Lipschutz, Seymour and Lipson, Marc, Schaum’sOutlines, 5th Ed.

1 Vectors

(a) Draw the vectors

[10

]and

[01

]on the coordinate plane. Then add the two vectors together and draw

the resulting vector on the same plane. What is this vector? Give the coordinates.

Solution:

[11

](b) Draw the vectors

[12

]and

[21

]on the coordinate plane. Then add the two vectors together and draw

the resulting vector on the same plane. What is this vector? Give the coordinates.

Solution:

[33

](c) For general 2d vectors u =

[ab

]and v =

[cd

], evaluate the following in terms of a, b, c, d:

(i) u + v

Solution:

[a+ cb+ d

](ii) u +

[00

]Solution:

[ab

](iii) k · v where k is a real number

Solution:

[kckd

]

(d) *from Schaum’s, Page 14, Problem 1.3: Let u =

53−4

, v =

−152

, w =

3−1−2

.

1

Page 2: EECS16A Guerilla Section I - Solutions (Spring 2017) · EECS16A Guerilla Section I - Solutions (Spring 2017) September 10, 2017 Directions: In groups of 4-5, work on the following

Find: (i) 5u− 2v

Solution:

275−24

2 Matrices and Gaussian Elimination

(a) Describe the Gaussian Elimination algorithm. Focus on the simple case when everything goes exactly asexpected and nothing goes “wrong.” Solution: Guassian elimination is a series of row operations suchas swapping, scaling a row by a factor, or adding or subtracting one row from another. When nothinggoes wrong, we end with the identity matrix.

(b) Describe the Gaussian Elimination algorithm. This time, include all the ways that something could gowrong and make sure that those cases are covered. It is fine if you come back to this after doing theexamples in later parts to this question.

Solution: One way Gaussian Elimination can go ”wrong” is if we end up with a row of zeros, whichmeans the row and column vectors of the original matrix was linearly dependent, and the system hasno unique solution (it either has no solutions or infinite solutions). If we also run Gaussian Eliminationand encounter a pivot that is 0, we move to the next column and repeat the process. This particularcase is especially important when finding the null space of a matrix (out of scope for midterm 1).

(c) Rewrite the following system of equations into matrix-vector form and then find the solution.

(a)

x = 10

y = 5

(b)

2x+ y = 6

y = 4

(c)

−x+ 5y = 2

2y = 2

2

Page 3: EECS16A Guerilla Section I - Solutions (Spring 2017) · EECS16A Guerilla Section I - Solutions (Spring 2017) September 10, 2017 Directions: In groups of 4-5, work on the following

Solution to (a) - (c) of part (c)

(a) [1 00 1

] [xy

]=

[105

]

x = 10

y = 5

(b) [2 10 1

] [xy

]=

[64

]x = 1

y = 4

(c) [−1 50 2

] [xy

]=

[22

]x = 3

y = 1

(d) Rewrite the following system of equations into matrix-vector form and then find the solution.

(i) *from Schaum’s, Page 91, Problem 3.7b:

2x− 6y + 7z = 1

4y + 3z = 8

2z = 4

Soluion for parts (d) (i)

(i) 2 −6 70 4 30 0 2

xyz

=

184

x = −5

y =1

2

z = 2

(e) Consider the systems:

3

Page 4: EECS16A Guerilla Section I - Solutions (Spring 2017) · EECS16A Guerilla Section I - Solutions (Spring 2017) September 10, 2017 Directions: In groups of 4-5, work on the following

(i)

x+ y = 4

x+ ay = 6

(ii)

x+ ay = 1

x+ by = c

(iii) *from Schaum’s, Page 90,Problem 3.6:

x+ ay = 4

ax+ 9y = b

What are all possible values of a, b, c, . . . in the systems above for which there exists:

(i) a unique solution? (ii) multiple solutions? (iii) no solutions?Solution for (e) (i):(i) There exists a unique solution for any a that does not equal 1(ii) There is no value for a in which there exists multiple solutions(iii) For a = 1, there is no solutionSolution for (e) (ii):(i) There exists a unique solution for any a 6= b and for all c(ii) a = b and c = 1(iii) For a = b and c 6= 1, there is no solution

Solution for (e) (iii):(i) There exists a unique solution for any a 6= ±3 and for all b(ii) a = ±3 and b = 4a(iii) For a = ±3 and b 6= 4a, there is no solutionExplain why. Illustrate by drawing representative plots of the scenarios with each equation representinga line on the 2D plane.Solution: When there exists a unique solution, the lines that represent the system of equations intersectat a point. When there exists multiple solutions, there equations represent the same line. When, thereexists no solutions, a set of equations form lines that are parallel.

3 Matrix Multiplication

(a) For the following:

A =

[1 23 −4

], B =

[5 0−6 7

], C =

[1 −3 42 6 −5

],

e =

[10

], f =

[01

]

g =

100

, h =

010

, i =

001

x =

[−14

], y =

2−13

Find the following:

(i) Ae

(ii) Af

(iii) Cy

(iv) BCy

(v) ABx + Cy

4

Page 5: EECS16A Guerilla Section I - Solutions (Spring 2017) · EECS16A Guerilla Section I - Solutions (Spring 2017) September 10, 2017 Directions: In groups of 4-5, work on the following

Solution for part (a) (i) - (viii)(i) [

13

](ii) [

2−4

](iii) [

17−17

](iv) [

58

](v) [

80−168

]

(b) Find α, if there exists, such that A2 = B when

A =

[1 0α 1

]B =

[1 05 1

]

Solution: α = 52

(c) Find α, if there exists, such that A2 = B when

A =

[α 01 1

]B =

[1 05 1

]Solution: No such α exists

(d) For the matrices:

A =

[1 −2 12 0 3

]I2 =

[1 00 1

]I3 =

1 0 00 1 00 0 1

(i) Find I2A (ii) Find AI3

Solution for (e) (i) - (ii)(i) [

1 −2 12 0 3

](ii) [

1 −2 12 0 3

]

5

Page 6: EECS16A Guerilla Section I - Solutions (Spring 2017) · EECS16A Guerilla Section I - Solutions (Spring 2017) September 10, 2017 Directions: In groups of 4-5, work on the following

(e) *from Schaum’s, Page 47, Problem 2.22: Let A =

2 0 00 3 00 0 5

and B =

7 0 00 0 00 0 −4

. Find:

(i) AB,A2,B2

(ii) f(A), where f(x) = (x − 2)(x − 3)(x − 5) (interpret the constant term of the polynomial as beingthat constant times the Identity matrix)

(iii) g(B), where g(x) = x(x− 7)(x+ 4)

(iv) A−1

6

Page 7: EECS16A Guerilla Section I - Solutions (Spring 2017) · EECS16A Guerilla Section I - Solutions (Spring 2017) September 10, 2017 Directions: In groups of 4-5, work on the following

Solution for (f) (i) - (iv)(i)

AB =

14 0 00 0 00 0 −20

A2 =

4 0 00 9 00 0 25

B2 =

49 0 00 0 00 0 16

(ii)

f(A) =

0 0 00 0 00 0 0

(iii)

g(B) =

0 0 00 0 00 0 0

(iv)

A−1 =

12 0 00 1

3 00 0 1

5

4 Matrix Inverses

(a) Find the inverses of the following matrices:

2x2 Matrices

(i) A =

[3 00 2

](ii) B =

[3 80 2

](iii) C =

[2 0−2 −5

]3x3 Matrices

(i) A =

1 0 00 2 00 0 3

(ii) B =

1 0 00 1 30 0 1

(b) For the following matrices, does an inverse exist? If so, find the inverse. If not, explain why.

2x2 Matrices

(i) A =

[0 00 0

](ii) B =

[0 015 0

](iii) C =

[5 31 −2

](iv) D =

[1 −1−1 1

]3x3 Matrices

7

Page 8: EECS16A Guerilla Section I - Solutions (Spring 2017) · EECS16A Guerilla Section I - Solutions (Spring 2017) September 10, 2017 Directions: In groups of 4-5, work on the following

(i) A =

1 0 00 0 100 0 1

(ii) B

0 0 03 3 10−2 1 1

(iii) C =

1 0 00 0 10 1 0

Solutions:

(a) Find the inverses of the following matrices:

2x2 Matrices

(i) A-1 =

[1/3 00 1/2

](ii) B-1 =

[1/3 −4/30 1/2

] (iii) C-1 =

[1/2 0−1/5 −1/5

](iv) D-1 =

[0 1/5−1/2 0

] (v) E-1 =

[5/16 1/8−1/8 −1/4

](vi) F-1 =

[0 1/2

1/3 −1/6

]3x3 Matrices

(i) A-1 =

1 0 00 1/2 00 0 1/3

(ii) B-1 =

1 0 00 1 −30 0 1

(iii) C-1 =

1/5 0 02/5 −1 0−2/15 −1/3 1/3

(iv) D-1 =

1 −1 10 1 −20 0 1

(v) E-1 =

3/8 −1/8 −3/43/4 −1/4 −1/2−1/2 1/2 1

(vi) *from Schaum’s, Page 45,

Problem 2.17

F-1 =

1 0 22 −1 34 1 8

(b) For the following matrices, does an inverse exist? If so, find the inverse. If not, explain why.

2x2 Matrices

(i) A-1 does not exist

(ii) B-1 does not exist

(iii) C-1 =[2/12 3/131/13 −5/13

](iv) D-1 does not exist

3x3 Matrices

(i) A-1 does not exist

(ii) B-1 does not exist(iii) C-1 =

1 0 00 0 10 1 0

5 Matrices as Linear Operators

(a) Given T =

a b cd e fg h i

and T

100

=

579

, can you conclude anything about a, d, g?

Solution: a = 5, d = 7, g = 9

(b) The linear operator T has the following property: T

100

=

130

, T

010

=

403

, T

001

=

073

. What

is T?

Solution: T =

1 4 03 0 70 3 3

8

Page 9: EECS16A Guerilla Section I - Solutions (Spring 2017) · EECS16A Guerilla Section I - Solutions (Spring 2017) September 10, 2017 Directions: In groups of 4-5, work on the following

(c) The linear operator T has the following property: T

110

=

101

, T

111

=

403

, T

011

=

073

. What

is T?

Solution: T =

4 −3 3−7 7 00 1 2

6 Linear Independence

(a) Let u =

13−2

, v =

−532

, w =

−3−1−2

, x =

624

, y =

43−4

Identify a set of the above that are linearly independent. How big can you make this set?

Solution: There are many possible answers, e.g., {u,v,w} can be a valid solution. The set can onlyhave 3 vectors in it.

(b) Given a square matrix A, prove that when Ax = b has exactly one solution for x no matter what b is,then Av = 0 if and only if v = 0.

(Hint: think about a particular b that makes this easy to see.)

Solution: If Ax = b has exactly one solution, then matrix is linearly independent.if: Since A is linearly independent, inverse of A exists. Times A inverse on both side → v = 0Only if: v = 0 → Av = 0

(c) Given a possibly rectangular (tall and narrow) matrix A, prove that when Ax = b has exactly onesolution for x for some b, then Av = 0 if and only if v = 0.

(Hint: think about what would happen if some other nonzero v satisfied Av = 0. )Solution: Have unique solution implies one to one relationship. A uniquely map to B. For each elementin B, there is unique −B, (B +−B = 0). A(x1, x2 map to -B)If: (v1 + v2) = 0A ∗ (v1 + v2) = 0Since it is one to one relationship, (v1 + v2) = v = 0

Only if: v = 0 − > Av = 0

(d) How would you use Gaussian Elimination to see if a collection of vectors is linearly independent?Solution: Do Gaussian Elimination, and see if it has full rank (number of pivots is equal to the lessernumber of rows or columns in a non-square matrix).

(e) How would you use Gaussian Elimination to find a largest possible set of vectors in a collection suchthat this set is linearly independent?Solution: Do Gaussian Elimination, and number of elements in set equals to the rank of the matrix.

7 Special Matrices

(a) Rotate the vector

[45

]by 90 degrees counterclockwise.

Solution:

[−54

](b) Give the matrix for rotating a 2D vector by 90 degrees counterclockwise.

Solution:

[cos(90) − sin(90)sin(90) cos(90)

]=

[0 −11 0

]

9

Page 10: EECS16A Guerilla Section I - Solutions (Spring 2017) · EECS16A Guerilla Section I - Solutions (Spring 2017) September 10, 2017 Directions: In groups of 4-5, work on the following

(c) Reflect the vector

[45

]across the x axis

Solution:

[4−5

](d) Give the matrix for reflecting a vector across the x axis.

Solution:

[1 00 −1

]

(e) Reflect the vector

[45

]across the y axis

Solution:

[−45

](f) Give the matrix for reflecting a vector across the y axis.

Solution:

[−1 00 1

]

10

Page 11: EECS16A Guerilla Section I - Solutions (Spring 2017) · EECS16A Guerilla Section I - Solutions (Spring 2017) September 10, 2017 Directions: In groups of 4-5, work on the following

8 Proof and Design Solutions

1. (a) If A is an invertible matrix, then A−1 is invertible and

(A−1)−1 = A

Solution: To see if A−1 is invertible, we need to find a matrix C such that

A−1C = I and CA−1 = I

We see that C = A. Hence, A−1 is invertible and A is its inverse.

(b) If A and B are n× n invertible matrices, then so is AB, and the inverse of AB is the product ofthe inverses of A and B in the reverse order. That is,

(AB)−1 = B−1A−1

(AB)(B−1A−1) = A(BB−1)A−1 = AIA−1 = AA−1 = I

Same for (B−1A−1)(AB) = I

(c) If A is an invertible matrix, then so is AT, and the inverse of AT is the transpose of A−1. Thatis,

(AT )−1 = (A−1)T

(A−1)TAT = (AA−1)T = IT = I

Same for AT (A−1)T = I.

2. In a certain region, about 7% of a city’s population moves to the surrounding suburbs each year, andabout 5% of the suburban population moves into the city. In 2012, there were 800,000 residents in thecity and 500,000 in the suburbs. Set up a system of equations that describes this situation, where x0

is the initial population in 2012. Then estimate the populations in the city and in the suburbs twoyears later in 2014.

We first write down equations to represent the situation. Let x0 represent the vector [c0 s0]T wherec0 is the initial population of the city, and s0 is the initial population of the suburbs. Then we definethe following equation for change in population after one year.[

cs

]=

[0.93 0.050.07 0.95

] [c0s0

]We call the 2× 2 matrix, A, and then define the following equation for the change in population aftern years. [

cs

]= Anx0

Finally, we substitute in n = 2 and solve for the final answer for the population at 2014. Our finalanswers are c = 741, 720 and s = 558, 280.

9 Word Problems

1. Its a beautiful Sunday afternoon, and instead of sitting in this guerrilla section working on EE, you arelying down on Memorial Glade. Unfortunately, you get hungry and thirsty, and you realize that your waterbottle and snacks are scattered across the field, as marked in the diagram. Moreover, you are too lazy toget up, so you remain lying down. Imagine yourself as a vector with your head at the head of the vector(see diagram). You can only move by scaling (hint: scale an identity matrix) and rotating, and you may usemultiple transformations to reach each item.

11

Page 12: EECS16A Guerilla Section I - Solutions (Spring 2017) · EECS16A Guerilla Section I - Solutions (Spring 2017) September 10, 2017 Directions: In groups of 4-5, work on the following

A

B C

D

Problem solving tip: While you should keep your end goal in mind, break the problem down into moremanageable parts.

a. Figure out how to get to the first spot. You will need to somehow transform the starting vector. Whatdo you need to know/calculate to reach the first item, and what do you already know? Use this to help:

[ ] []=

[]T · vold = vnew

Fill in what you know and think about what your goal is. Once you have found the transformation, drawthe vector. How would you check that you found the correct transformation?

b. Repeat the process to reach the second, third, and fourth items. Remember to write out what youknow and what you are looking for. Write out an equation with the transformation matrix and the vectorslike before for each step. Check that you found the correct transformation each time.

c. You successfully picked up all of your snacks. The curious student you are, you want to know theoverall transformation that got you to your current position. Calculate this by multiplying together theindividual transformations. Check that this is the correct transformation.

d. Finally, find the inverse of this matrix. How can you check that you found the inverse correctly?

e. What would you expect the result to be if you use this inverted matrix to transform your currentposition? Do it.

Solution:

Scale by 2

[2 00 2

] [20

]=

[40

]To get to item 2, rotate by 90 degrees:

[0 −11 0

] [40

]=

[04

]To get to item 3, rotate by -45 degrees and scale by

√2:

[1√2

1√2

−1√2

1√2

] [√2 0

0√

2

] [04

]=

[44

]To get to item 4, scale by 7

4 and reflect over y-axis:

[74 00 7

4

] [−1 00 1

] [44

]=

[−77

]

12

Page 13: EECS16A Guerilla Section I - Solutions (Spring 2017) · EECS16A Guerilla Section I - Solutions (Spring 2017) September 10, 2017 Directions: In groups of 4-5, work on the following

Check by ensuring that the transformation matrix times the old vector equals the new vector. Startingwith the transformation to get to the last item, multiply them all together. For the steps with twotransformations, it doesn’t matter what order the transformation matrices are multiplied.

(

[74 00 7

4

] [−1 00 1

]) (

[1√2

1√2

−1√2

1√2

] [√2 0

0√

2

])

[0 −11 0

] [2 00 2

]=

[−72

−72

72

−72

]Check :

[−72

−72

72

−72

] [20

]=

[−77

][−1

717−1

7−17

]Check by multiplying this with the overall transformation. The next part has another method forchecking.[20

]2. Apple brings 50 water bottles, 100 T-shirts, and 40 usb chargers to a conference. They split up all of

their items unevenly in 3 different bags, but you as the student who has a big family want water bottles asgift. So you use linear algebra to figure out how many water bottles there are in each bag.

You weigh each bag by hand, and with your magically calibrated hands, you deduce that bag 1 weighs52.5 pounds, bag 2 weighs 52.5 pounds, and bag 3 weighs 35 pounds. You know already that a water bottleweighs 1 pound, a T-shirt weighs 0.5 pounds, and a usb charger weighs 2 pounds.

You can also see through the bottom of each bag, and because the company did not sort the itemswhen putting them in the bag, you see that there are 9 t-shirts in bag 1, 5 chargers in bag 2, and 20 waterbottles in bag 3. While you are making a phone call outside, you hear the manager saying that there are 20defective usb chargers in those 40 chargers, thus Apple takes them out and does not put any chargers in bag 3.

(a) Write down your known pieces of information into mathematical form. Use variables to track amounts.Solution:for bag 1, we have x1 water bottles, y1 tshirts, z1 usb charges. for bag 2, we have x2 water bottles, y2tshirts, z2 usb charges. for bag 3, we have x3 water bottles, y3 tshirts, z3 usb charges.y1 = 9z2 =5x3= 20z3= 0x1+ x2+ x3 = 50y1+ y2+ y3 = 100z1+ z2 + z3= 20x1 + 0.5y1 + 2z1 = 52.5x2 + 0.5y2 + 2z2 = 52.5x3 + 0.5y3 + 2z3 = 35

(b) Write your equations into a matrix vector form.Solution:

A =

0 0 0 1 0 0 0 0 00 0 0 0 0 0 0 1 00 0 1 0 0 0 0 0 01 1 1 0 0 0 0 0 00 0 0 1 1 1 0 0 00 0 0 0 0 0 1 1 11 0 0 0.5 0 0 2 0 00 1 0 0 0.5 0 0 2 00 0 1 0 0 0.5 0 0 2

13

Page 14: EECS16A Guerilla Section I - Solutions (Spring 2017) · EECS16A Guerilla Section I - Solutions (Spring 2017) September 10, 2017 Directions: In groups of 4-5, work on the following

b =

95205010020

52.552.535

Ax = b

(c) Perform Gaussian Elimination on the system to solve for the values of each type of item.x1 = 18x2 = 12x3 = 20y1 = 9y2 = 61y3 = 30z1 = 15z2 = 5z3 = 0

14