### 3.4.Assignment #2: Using Vectors and Matrices(back to full lecture notes)

In this assignment you will solve problems involving vectors and matrices. Please submit a single file `a2.*` containing your solutions. The file extension may be anything you choose; please ask before submitting a file in an exotic or obscure file format (plain text is preferred).

1. Consider the line L in R2 that passes through the following two vectors:
 u
=

 9 7

 v
=

 1 -5

1. Using set notation, define L in terms of u and v.
Below are some possible definitions:
 L
=
 { a (u - v) + u  |  a ∈ R }
 L
=
 { a (u - v) + v  |  a ∈ R }
 L
=
{ a (

 9 7

-

 1 -5

) +

 1 -5

|  a R }
 L
=
{

 x y

|  y = (3/2) x - 13/2 }
Solutions are acceptable as long as the definition is correct set notation for the set of vectors representing the line.
2. Determine whether the following vectors are on the line L:

 25 31

,

 7 −1

,

 −3 −11

The quickest way is to derive the y = (3/2) x − 13/2 equation for points on the line and use it to check each point:
 31
=
 (3/2) ⋅ 25 − 13/2
,
so

 25 31

L
 −1
 (3/2) ⋅ 7 − 13/2
,
so

 7 −1

L
 −11
=
 (3/2) ⋅ (−3) − 13/2
,
so

 −3 −11

L
3. Find all unit vectors orthogonal to L.
It is sufficient to find the two unit vectors on the line through the origin that is perpendicular to L. A vector that is parallel to L can be obtained using u - v:

 9 7

 1 -5

=

 8 12

The unit vectors must be orthogonal to the above vector. Thus, we have the following two equations for the unit vectors [ x ; y ] that we want to find:

 8 12

 x y

=
 0
||

 x y

||
=
 1
The two vectors that satisfy the above are:

 x y

{

 3/√(13) −2/√(13)

,

 −3/√(13) 2/√(13)

}
4. Define the line L that passes through the origin and is orthogonal to L using an equation of the form:
 y
=
 m ⋅ x + b
In other words, find m, b R such that:
 L⊥
=
{

 x y

|   y = mx + b }
We can use one of the unit vectors we found in part (c) above to determine the slope of L. Since the line passes through the origin, b = 0.
 m
=
 (2/√(13))  /  (−3/√(13))
=
 −2/3
 b
=
 0
2. For each of the following collections of vectors, determine whether the collection is linearly independent. If it is, explain why; if not, show that one of the vectors is a linear combination of the other vectors in the collection.

1. The following two vectors in R2:

 2 1

,

 3 2

The following equation has no solution a R since assuming there is a solution leads to a contradiction:
a

 2 1

=

 3 2

 a ⋅ 2
=
 3
 a ⋅ 1
=
 2
 a
=
 2
 2 ⋅ 2
 3
Thus, the two vectors do not satisfy the definition of linear independence. They must be linearly independent, so the collection is linearly independent.
2. The following three vectors in R2:

 -2 1

,

 1 3

,

 2 4

We must check if any of the three vectors might be a linear combination of the other two. In fact, there is at least one such vector, so the collection of vectors is not linearly independent:

 -2 1

=
5 ⋅

 1 3

+ (−7/2) ⋅

 2 4

Notice that we could have concluded this immediately without finding the above counterexample because these vectors are in R2 and there are at least two linearly independent vectors in the collection. Thus, those two vectors can be used in a linear combination to obtain the third.
3. The following three vectors in R4:

 2 0 4 0

,

 6 0 4 3

,

 1 7 4 3

We must check if any of the three vectors might be a linear combination of the other two. We check if the first can be a linear combination of the second and third; since we arrive at a contradiction below, it cannot.

 2 0 4 0

=
a

 6 0 4 3

+ b

 1 7 4 3

 2
=
 6 a + b
 0
=
 7 b
 b
=
 0
 a
=
 1/3
 4
 4/3 + 0
Next, we check if the second vector can be a linear combination of the first and third.

 6 0 4 3

=
a

 2 0 4 0

+ b

 1 7 4 3

 6
=
 2 a + b
 0
=
 7 b
 b
=
 0
 a
=
 3
 4
 12 + 0
Finally, we check if the third can be a linear combination of the first and second:

 1 7 4 3

=
a

 6 0 4 3

+ b

 2 0 4 0

 7
=
 0 ⋅ a + 0 ⋅ b
 7
 0
Since no vector is a linear combination of the other two, the collection is linearly independent.
3. Consider the following vectors in R3:
 u
=

 3 7 9

 v
=

 2 −5 3

 w
=

 3 4 −3

1. Compute the orthogonal projection of w onto the vector:

 1/√(12) 1/√(12) 1/√(12)

We use the formula for an orthogonal projection. First, we compute the norm of the vector onto which we are projecting.
||

 1/√(12) 1/√(12) 1/√(12)

||
=
 √(3/12)
Notice that 2 ⋅ √(3/12) = √((4 ⋅ 3)/12) = 1. Thus, to obtain a unit vector, we simply multiply the vector onto which we are projecting by the scalar 2.
2 ⋅

 1/√(12) 1/√(12) 1/√(12)

=

 2/√(12) 2/√(12) 2/√(12)

To project w onto the above unit vector, we can use the orthogonal projection formula:
(

 3 4 -3

 2/√(12) 2/√(12) 2/√(12)

) ⋅

 2/√(12) 2/√(12) 2/√(12)

=
(8/√(12)) ⋅

 2/√(12) 2/√(12) 2/√(12)

=

 16/12 16/12 16/12

=

 4/3 4/3 4/3

2. Determine whether each of the following points lies on the plane perpendicular to u:

 3 0 -1

,

 7 -9 -5

,

 1 1 -1

If a vector lies on the plane perpendicular to u, then it must be orthogonal to u. Thus, we compute the dot product of each of these vectors with u:

 3 0 -1

 3 7 9

=
 9 + 0 - 9
=
 0, so this vector is on the plane;

 7 -9 -5

 3 7 9

=
 21 - 63 - 45
 0, so this vector is not on the plane;

 1 1 -1

 3 7 9

=
 3 + 7 - 9
 0, so this vector is not on the plane.
3. Extra credit: Given the vector v and w, let P be the plane orthogonal to v, and let Q be the plane orthogonal to w. Find a vector p R3 that lies on the line in R3 along which P and Q intersect, and provide a definition of the line.
We have the following:
 P
=
 { p  |  p ⋅ v = 0 }
 Q
=
 { p  |  p ⋅ w = 0 }
The line along which P and Q intersect is the set of vectors that are orthogonal to both P and Q.
 P ∩ Q
=
 { p  |  p ⋅ v = 0  and  p ⋅ w = 0}
We can expand the two equations pv = 0 and pw = 0 in order to obtain a system of equations that restricts the possible components of p = [ x ; y ; z ]:

 x y z

 2 −5 3

=
 0

 x y z

 3 4 −3

=
 0
 2 x − 5 y + 3 z
=
 0
 3 x + 4 y − 3 z
=
 0
 5 x − y
=
 0
 y
=
 5 x
 z
=
 (23/3) x
Given the above, we can introduce a scalar a and write:
 x
=
 a
 y
=
 5 a
 z
=
 (23/3) a
 P ∩ Q
=
{ a

 1 5 (23/3)

|  a R }
4. You decide to drive the 2800 miles from New York to Los Angeles in a hybrid vehicle. A hybrid vehicle has two modes: using only the electric motor and battery, it can travel 1 mile on 3 units of battery power; using only the internal combustion engine, it can travel 1 mile on 0.1 liters of gas (about 37 mpg) while also charging the battery with 1 unit of battery power. At the end of your trip, you have 1400 fewer units of battery power than you did when you began the trip. How much gasoline did you use (in liters)?

You should define a system with the following dimensions:

• net change in the total units of battery power;
• total liters of gasoline used;
• total number of miles travelled;
• number of miles travelled using the electric motor and battery;
• number of miles travelled using the engine.

You should define a matrix M R3×2 to characterize this system. Then, write down an equation containing that matrix (and three variables in R), and solve it to obtain the quantity of gasoline.

M

 x y

=

 ? ? ?

One possible solution is to solve the matrix equation below for n, the number of liters of gasoline used:

 -3 battery power/mile on battery 1 battery power/mile on engine 1 miles/mile on battery 1 miles/mile on engine 0 liters of gas/mile on battery -0.1 liters of gas/mile on engine

 x miles on battery y miles on engine

=

 -1400 battery power 2800 miles n liters of gas

The above equation can be rewrittenn as:
 −3 ⋅ x + 1 ⋅ y
=
 -1400
 x + y
=
 2800
 0 ⋅ x - 0.1 ⋅ y
=
 n
We then have that 245 liters were used:
 x
=
 2800 − y
 −3 ( 2800 − y) + y
=
 −1400
 −8400 + 4 y
=
 −1400
 4 y
=
 7000
 y
=
 1750
 n
=
 − 0.1 ⋅ 1750
 n
=
 −175
Notice that it is possible to solve an equation for a 2 × 2 matrix first, and then use x and y to determine n. For example:

 -3 1 1 1

 x y

=

 -1400 2800

It is also possible to immediately notice that 10 ⋅ n is the number of miles travelled on n liters of gasoline. Then, the following matrix equation can be set up and solved:

 -3 battery power/mile on battery 10 battery power/liter of gas 1 miles/mile on battery 10 miles/liter of gas

 x miles on battery n liters of gas

=

 -1400 battery power 2800 miles

5. Suppose we create a very simple system for modelling how predators and prey interact in a closed environment. Our system has only two dimensions: the number of prey animals, and the number of predators. We want to model how the state of the system changes from one generation to the next.

If there are x predators and y prey animals in a given generation, in the next generation the following will be the case:

• all predators already in the system will stay in the system;
• all prey animals already in the system will stay in the system;
• for every prey animal, two new prey animals are introduced into the system;
• for every predator, two prey animals are removed from the system;
• we ignore any other factors that might affect the state (e.g., natural death or starvation).

1. Specify explicitly a matrix T in R2×2 that takes a description of the system state in one generation and produces the state of the system during the next generation. Note: you may simply enter the matrix on its own line for this part of the problem, but you must also use it in the remaining three parts below.

The following matrix reflects the constraints imposed by the description of a state transformation:
 T
=

 1 # predators at time t+1 / predator at time t 0 # predators at time t+1 / prey at time t -2 # prey at time t+1 / predator at time t 3 # prey at time t+1 / prey at time t

2. Show that the number of predators does not change from one generation to the next.

T

 x y

=

 x y'

It is sufficient to derive that the number of predators does not change after a transformation is applied. Let x be the number of predators before the transformation is applied, and let x' be the number of predators after it is applied. Then we have that:

 1 0 -2 3

 x y

=

 x' y'

 1 ⋅ x + 0 ⋅ y
=
 x'
 x
=
 x'
3. Determine what initial state [x0; y0] is such that there is no change in the state from one generation to another.

T

 x0 y0

=

 x0 y0

It is sufficient to solve the equation for x0 and y0:
T

 x0 y0

=

 x0 y0

 1 0 -2 3

 x0 y0

=

 x0 y0

 1 ⋅ x0 + 0 ⋅ y0
=
 x0
 -2 ⋅ x0 + 3 ⋅ y0
=
 y0
The first equation of real numbers above imposes no constraints on x0 or y0. Thus, any vector that satisfies the last equation would be a solution. All vectors on the line defined by this equation are solutions:
 -2 ⋅ x0 + 3 ⋅ y0
=
 y0
 -2 ⋅ x0
=
 -2 y0
 y0
=
 x0
4. Suppose that in the fourth generation of an instance of this system (that is, after the transformation has been applied three times), we have 2 predators and 56 prey animals. How many predators and prey animals were in the system in the first generation (before any transformations were applied)? Let [x; y] represent the state of the system in the first generation. Set up a matrix equation that involves [x; y] and matrix multiplication, and solve it to obtain the answer.

It is sufficient to solve the following equation for x and y:
T3

 x y

=

 2 56

We solve it below:

 1 0 -2 3

 1 0 -2 3

 1 0 -2 3

 x y

=

 2 56

 1 0 -8 9

 1 0 -2 3

 x y

=

 2 56

 1 0 -26 27

 x y

=

 2 56

 x − 0 ⋅ y
=
 2
 x
=
 2
 −26 x + 27 y
=
 56
 27 y
=
 108
 y
=
 4