Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Solutions to Sage problem for Homework 3, EUP Math 275, Spring 2015

Views: 67

Homework 3 Solutions

This week's homework contains two parts, a written part and a SageMathCloud part:

  • Written: For Wednesday, 2/11, you are to write up (neatly) and hand in problem 2.18 parts a, c, and d from Chapter 1, section II.2 (p. 47) on the dot product properties.

  • SageMathCloud: Answer the following questions in this file, including any relevant Sage work under each problem. Delete cells that you do not want included.

When you need to enter text, start a new cell and type %md as the first thing in the cell. This will create a markdown cell. (Markdown can include formatting commands and even LaTeX\LaTeX commands, if you wish, but you are not required to use any special formatting.)

This problem will be collected on SageMathCloud on Friday, 2/13, at noon. (You do not need to do anything except complete the problem on SageMathCloud in this file; I will collect the files automatically.)

Sage Problem

Here are three vectors: [ \mathbf{v1} = \left(1302\begin{array}{c} 1 \\ -3 \\ 0 \\ -2 \end{array}\right), \qquad \mathbf{v2} = \left(1111\begin{array}{c} 1 \\ 1 \\ 1 \\ 1 \end{array}\right), \qquad \mathbf{v3} = \left(5001\begin{array}{c} -5 \\ 0 \\ 0 \\ 1 \end{array}\right), \qquad ] For each of the following vectors, decide if the vector is a linear combination of the vectors v1, v2, and v3. (We will later say that a vector which is a linear combination of a set of vectors is in the span of the set, so we are really asking if these vectors are in the span of v1, v2, and v3.)

Show evidence to support your claim.

a) [ \left(314512\begin{array}{c} 3 \\ -14 \\ -5 \\ -12 \end{array}\right) ]

(Note: In what follows, I have chosen a particular approach using the reduced echelon form of a matrix to solve this problem. There are other approaches to solving the problem which are equally valid. You should be able to check any proposed solution you find by making sure that c1*v1 + c2*v2 + c3*v3 yields the vector you were interested in.)

We must attempt to solve the system c1*v1 + c2*v2 + c3*v3 = (3, -14, -5, -12). We write the system as a matrix and find the reduced echelon form:

v1 = vector(QQ, [1, -3, 0, -2]); v2 = vector(QQ, [1, 1, 1, 1]); v3 = vector(QQ, [-5, 0, 0, 1]); m = matrix(QQ, [v1, v2, v3]).transpose() mprime = m.augment(vector(QQ, [3, -14, -5, -12])) mprime
[ 1 1 -5 3] [ -3 1 0 -14] [ 0 1 0 -5] [ -2 1 1 -12]
mprime.rref()
[ 1 0 0 3] [ 0 1 0 -5] [ 0 0 1 -1] [ 0 0 0 0]

From the above, we see that c1 = 3, c2 = -5, and c3 = -1 is the unique solution to the system. Checking, we see that the vector is a linear combination of v1, v2,and v3:

3*v1+(-5)*v2+(-1)*v3
(3, -14, -5, -12)

b) [ \left(1250\begin{array}{c} 1 \\ -2 \\ 5 \\ 0 \end{array}\right) ]

Here we have the same system with a different right hand side, so reuse matrix m:

mprime=m.augment(vector(QQ, [1, -2, 5, 0])) mprime.rref()
[1 0 0 0] [0 1 0 0] [0 0 1 0] [0 0 0 1]

The final row of the reduced matrix says that 1 = 0, so there is no solution, and this vector is not a linear combination of the first three.

c) [ \left( 17/6107/6\begin{array}{c} 17/6 \\ -1 \\ 0 \\ -7/6 \end{array}\right) ]

We repeat the process of solving the system we developed above:

mprime=m.augment(vector(QQ, [17/6, -1, 0, -7/6])) mprime.rref()
[ 1 0 0 1/3] [ 0 1 0 0] [ 0 0 1 -1/2] [ 0 0 0 0]

Here, c1 = 1/3, c2 = 0, and c3 = -1/2:

1/3*v1 - 1/2*v3
(17/6, -1, 0, -7/6)