Homework 4: Lines and Planes in $\mathbb{R}^3$

due Friday, October 2nd at 11:59PM

Write your solutions to the following problems either by writing them on a piece of paper or on a tablet and scanning your answers as a PDF. Note that you are not allowed to use LaTeX, Google Docs, or any other digital document creation software to type your answers. Homeworks are due to Pensive by 11:59PM on the due date. See the syllabus for details on the slip day policy.

Homework will be evaluated not only on the correctness of your answers, but on your ability to present your ideas clearly and logically. You should always explain and justify your conclusions, using sound reasoning. Your goal should be to convince the reader of your assertions. If a question does not require explanation, it will be explicitly stated.

Before proceeding, make sure you’re familiar with the collaboration policy.


Problems


Total Points: \(6 + 12 + 7 + 12 + 13 + 11 + 7 + 15 + 10 + 7 = 100\)


Have the notes open while working on the homework! Chapter 2.4, Chapter 2.5, Chapter 2.6, and Chapter 2.7 (coming soon) are all very relevant. We’ve added the relevant lab and lecture worksheet content to them, so they are comprehensive.


Problem 1: Homework 3 Solutions Review (6 pts)

Review the solutions to Homework 3. Pick two problem parts (for example, Problem 3a and Problem 5b) from Homework 3 in which your solutions have the most room for improvement, i.e., where they have unsound reasoning, could be significantly more efficient or clearer, etc. Include a screenshot of your solution to each problem part, and in a few sentences, explain what was deficient and how it could be fixed.

Alternatively, if you think one of your solutions is significantly better than the posted one, copy it here and explain why you think it is better. If you didn’t do Homework 3, choose two problem parts from it that look challenging to you, and in a few sentences, explain the key ideas behind their solutions in your own words.

Solution

Responses will vary. Look for specific comparisons with the posted solutions and clear explanations of how to improve the selected work.


Problem 2: A Line as an Intersection (12 pts)

First, consider the line through the origin

$$ \ell_0=\operatorname{span}\left(\begin{bmatrix}6\\-4\\9\end{bmatrix}\right). $$
a)

(2 pts) Write \(\ell_0\) in parametric form. In other words, write three separate equations: \(x=\cdots\), \(y=\cdots\), and \(z=\cdots\), each of which involves the same parameter, e.g., \(t\).

Solution

The scalar-parametric equations are

$$ \boxed{x=6t,\qquad y=-4t,\qquad z=9t,\qquad t\in\mathbb R.} $$

Every vector on \(\ell_0\) is a scalar multiple of its spanning vector:

$$ \begin{bmatrix}x\\y\\z\end{bmatrix} =t\begin{bmatrix}6\\-4\\9\end{bmatrix} =\begin{bmatrix}6t\\-4t\\9t\end{bmatrix}. $$

Reading off the entries gives the three equations above. They use the same \(t\) because each value of \(t\) selects one point on the line.

b)

(4 pts) Write a system of two linear equations in \(x\), \(y\), and \(z\) whose common solutions are exactly the points on \(\ell_0\). Your equations should not contain a parameter.

Then, verify that every point on \(\ell_0\) satisfies your system by plugging in your parametric formulas from part (a).

Solution

One possible system is

$$ \boxed{\begin{cases}2x+3y=0,\\3x-2z=0.\end{cases}} $$

Following Chapter 2.5, let’s find two independent vectors perpendicular to the direction of the line. A vector \(\begin{bmatrix}a\\b\\c\end{bmatrix}\) is perpendicular to \(\begin{bmatrix}6\\-4\\9\end{bmatrix}\) when

$$ 6a-4b+9c=0. $$

Setting \(c=0\) gives \(6a=4b\), so one choice is \(\vec n_1=\begin{bmatrix}2\\3\\0\end{bmatrix}\). Setting \(b=0\) gives \(6a=-9c\), so another is \(\vec n_2=\begin{bmatrix}3\\0\\-2\end{bmatrix}\). These vectors are not scalar multiples of each other.

Substituting the formulas from part (a) verifies both equations:

$$ \begin{align*} 2x+3y&=2(6t)+3(-4t)=12t-12t=0,\\ 3x-2z&=3(6t)-2(9t)=18t-18t=0. \end{align*} $$

Thus every point on \(\ell_0\) satisfies both equations.

To see that the system has no extra solutions, set \(t=x/6\). The first equation forces \(y=-2x/3=-4t\), and the second forces \(z=3x/2=9t\). We recover exactly the parametrization in part (a).

c)

(4 pts) Now, consider the affine line

$$ \ell=\begin{bmatrix}-5\\7\\4\end{bmatrix}+\operatorname{span}\left(\begin{bmatrix}6\\-4\\9\end{bmatrix}\right). $$

Write \(\ell\) in parametric form, then find a system of two linear equations whose common solutions are exactly the points on \(\ell\). Verify your equations by substituting your parametric formulas. How do the equations change from part (b)?

Solution

The parametric equations are

$$ \boxed{x=-5+6t,\qquad y=7-4t,\qquad z=4+9t,\qquad t\in\mathbb R.} $$

The direction has not changed, so we can keep the normals from part (b). Chapter 2.6 tells us how to find the new right-hand sides: take each normal’s dot product with the translation vector \(\vec p=\begin{bmatrix}-5\\7\\4\end{bmatrix}\).

$$ \begin{align*} \vec n_1\cdot\vec p&=2(-5)+3(7)=11,\\ \vec n_2\cdot\vec p&=3(-5)-2(4)=-23. \end{align*} $$

Therefore, one possible system is

$$ \boxed{\begin{cases}2x+3y=11,\\3x-2z=-23.\end{cases}} $$

Let’s verify the parametric formulas:

$$ \begin{align*} 2(-5+6t)+3(7-4t)&=-10+12t+21-12t=11,\\ 3(-5+6t)-2(4+9t)&=-15+18t-8-18t=-23. \end{align*} $$

Conversely, set \(t=(x+5)/6\). The two equations give

$$ y=\frac{11-2x}{3}=7-4t,\qquad z=\frac{23+3x}{2}=4+9t. $$

So the common solutions are exactly the points on \(\ell\). Compared with part (b), the coefficients stay the same; only the right-hand sides change. Translating the line changes its location but preserves its direction.

d)

(2 pts) Give a geometric interpretation of your systems in parts (b) and (c): in each case, what type of object does each equation describe in \(\mathbb{R}^3\), and what is the connection between those two objects and the corresponding line (\(\ell_0\) or \(\ell\))?

Solution

Each equation describes a plane in \(\mathbb R^3\). Solving both equations means finding the points common to the two planes.

Part (b): The planes \(2x+3y=0\) and \(3x-2z=0\) both pass through the origin. Their intersection is the line \(\ell_0\).

Part (c): The planes \(2x+3y=11\) and \(3x-2z=-23\) intersect in the affine line \(\ell\). These planes are translations of those in part (b), so their normals stay the same, and \(\ell\) is parallel to \(\ell_0\).

In both systems, the normals are not scalar multiples, so the two planes intersect in a line.


Problem 3: Perfectly Normal (7 pts)

The point \(A=(8,11,9)\) lies on the plane \(P\) with equation

$$ 4x-7y+5z=0. $$
a)

(3 pts) Find a nonzero vector normal to \(P\).

Solution

One choice is

$$ \boxed{\vec n=\begin{bmatrix}4\\-7\\5\end{bmatrix}.} $$

As in Chapter 2.5, we read the coefficients of \(x\), \(y\), and \(z\) from the plane’s equation. Indeed,

$$ 4x-7y+5z=0 \quad\Longleftrightarrow\quad \vec n\cdot\begin{bmatrix}x\\y\\z\end{bmatrix}=0. $$

Every vector on \(P\) is perpendicular to this nonzero vector, so it is normal to \(P\).

b)

(4 pts) Find a parametric form for the line through \(A\) that is perpendicular to \(P\). Explain why your line passes through \(A\) and is perpendicular to \(P\).

Solution

Use \(A\) as the starting point and the normal from part (a) as the direction:

$$ \boxed{\begin{bmatrix}x\\y\\z\end{bmatrix} =\begin{bmatrix}8\\11\\9\end{bmatrix} +t\begin{bmatrix}4\\-7\\5\end{bmatrix},\qquad t\in\mathbb R.} $$

Equivalently, \(x=8+4t\), \(y=11-7t\), and \(z=9+5t\).

Our line passes through \(A\) because setting \(t=0\) gives \((8,11,9)\). It is perpendicular to \(P\) because its direction vector is the normal from part (a).


Problem 4: Common Ground (12 pts)

You might find desmos.com/3d useful for visualizing the planes in this question.

Consider the vectors

$$ \vec{v}_1=\begin{bmatrix}5\\4\\2\end{bmatrix},\qquad \vec{v}_2=\begin{bmatrix}-4\\1\\11\end{bmatrix},\qquad \vec{v}_3=\begin{bmatrix}4\\-7\\-5\end{bmatrix},\qquad \vec{v}_4=\begin{bmatrix}8\\3\\7\end{bmatrix}, $$

and the planes

$$ P=\operatorname{span}(\vec{v}_1,\vec{v}_2),\qquad Q=\operatorname{span}(\vec{v}_3,\vec{v}_4). $$
a)

(4 pts) Find equations for \(P\) and \(Q\) in the form \(ax+by+cz=d\).

Solution

The equations are

$$ \boxed{P:\ 2x-3y+z=0,\qquad Q:\ x+2y-2z=0.} $$

Both planes are spans, so they contain the origin and have \(d=0\). To find their coefficients, we’ll use the method from Chapter 2.5: write an unknown normal \(\vec n=\begin{bmatrix}a\\b\\c\end{bmatrix}\) and require it to be perpendicular to both spanning vectors.

For \(P\): The two dot-product conditions are

$$ 5a+4b+2c=0,\qquad -4a+b+11c=0. $$

The second equation gives \(b=4a-11c\). Substitute into the first:

$$ \begin{align*} 5a+4(4a-11c)+2c&=0,\\ 21a-42c&=0,\\ a&=2c. \end{align*} $$

Then \(b=4(2c)-11c=-3c\). Choosing \(c=1\) gives \(\vec n_P=\begin{bmatrix}2\\-3\\1\end{bmatrix}\), and hence \(2x-3y+z=0\).

For \(Q\): This time the conditions are

$$ 4a-7b-5c=0,\qquad 8a+3b+7c=0. $$

Subtract twice the first equation from the second:

$$ 17b+17c=0\quad\Longrightarrow\quad b=-c. $$

Substituting into the first equation gives \(4a+2c=0\), or \(a=-c/2\). Choose \(c=-2\); then \(a=1\) and \(b=2\). Thus \(\vec n_Q=\begin{bmatrix}1\\2\\-2\end{bmatrix}\) and \(x+2y-2z=0\).

In each case, the two given spanning vectors are independent, so their span is a plane. The equation we found describes that same plane: its normal is perpendicular to both spanning directions, and it passes through the origin.

b)

(4 pts) The planes \(P\) and \(Q\) intersect in a line \(\ell\). Give a parametric description of \(\ell\), and write it as the span of a single vector.

Hint: Points on \(\ell\) satisfy both equations from part (a). Solve this system of two equations in three variables by eliminating variables.

Solution

The line is

$$ \boxed{\begin{bmatrix}x\\y\\z\end{bmatrix} =t\begin{bmatrix}4\\5\\7\end{bmatrix},\qquad t\in\mathbb R,} \qquad \boxed{\ell=\operatorname{span}\left(\begin{bmatrix}4\\5\\7\end{bmatrix}\right).} $$

To find it, solve the equations from part (a) simultaneously:

$$ \begin{cases}2x-3y+z=0,\\x+2y-2z=0.\end{cases} $$

Subtract twice the second equation from the first to eliminate \(x\):

$$ -7y+5z=0\quad\Longrightarrow\quad y=\frac57z. $$

The second equation now gives

$$ x=2z-2y=2z-\frac{10}{7}z=\frac47z. $$

Since \(z\) can be any real number, write \(z=7t\). This avoids fractions and gives \(x=4t\), \(y=5t\), \(z=7t\).

c)

(4 pts) Now, let \(R=\operatorname{span}(\vec{v}_2,\vec{v}_3)\). Find an equation for \(R\), and use it to find all points that belong to all three planes. What type of geometric object is their intersection?

Solution

An equation for the third plane is

$$ \boxed{R:\ 3x+y+z=0.} $$

As before, a normal \(\begin{bmatrix}a\\b\\c\end{bmatrix}\) must be perpendicular to both spanning vectors, so

$$ -4a+b+11c=0,\qquad 4a-7b-5c=0. $$

Adding the equations gives \(-6b+6c=0\), so \(b=c\). The first equation then becomes \(-4a+12c=0\), giving \(a=3c\). Choosing \(c=1\) gives the normal \(\begin{bmatrix}3\\1\\1\end{bmatrix}\) and the displayed equation.

A point belonging to all three planes must first belong to \(P\) and \(Q\), so part (b) tells us it has the form \((4t,5t,7t)\). For it to lie on \(R\) as well, we need

$$ 3(4t)+5t+7t=0\quad\Longrightarrow\quad24t=0\quad\Longrightarrow\quad t=0. $$

The intersection is therefore the single point \(\boxed{(0,0,0)}\).


Problem 5: Three Points, One Plane (13 pts)

Let \(A=(4,-7,5)\), \(B=(10,-3,7)\), and \(C=(-2,-1,13)\).

a)

(4 pts) Find vectors \(\vec{u}\) and \(\vec{v}\) pointing from \(A\) to \(B\) and from \(A\) to \(C\), respectively. Then, explain how you know these three points do not lie on one line.

Solution

Subtract the starting point from the ending point:

$$ \boxed{\vec u=\begin{bmatrix}10-4\\-3-(-7)\\7-5\end{bmatrix} =\begin{bmatrix}6\\4\\2\end{bmatrix},\qquad \vec v=\begin{bmatrix}-2-4\\-1-(-7)\\13-5\end{bmatrix} =\begin{bmatrix}-6\\6\\8\end{bmatrix}.} $$

If the three points lay on one line, the two displacement vectors would be scalar multiples. Their first entries would require \(\vec v=-\vec u\), but the second entry of \(-\vec u\) is \(-4\), not \(6\). So they are independent, and the three points do not lie on one line.

b)

(5 pts) Find a nonzero normal vector to the plane through \(A\), \(B\), and \(C\).

Solution

One possible normal is

$$ \boxed{\vec n=\begin{bmatrix}1\\-3\\3\end{bmatrix}.} $$

To find it, write \(\vec n=\begin{bmatrix}a\\b\\c\end{bmatrix}\). A normal must be perpendicular to both directions from part (a):

$$ 6a+4b+2c=0,\qquad -6a+6b+8c=0. $$

The first equation gives \(c=-3a-2b\). Substituting into the second gives

$$ \begin{align*} -6a+6b+8(-3a-2b)&=0,\\ -30a-10b&=0,\\ b&=-3a. \end{align*} $$

Then \(c=-3a-2(-3a)=3a\). Choosing \(a=1\) gives the stated normal. As a check,

$$ \vec n\cdot\vec u=6-12+6=0,\qquad \vec n\cdot\vec v=-6-18+24=0. $$
c)

(4 pts) Find an equation for this plane in the form \(ax+by+cz=d\). Verify that all three points satisfy your equation.

Solution

The plane has equation

$$ \boxed{x-3y+3z=40.} $$

The normal tells us the left-hand side. To find the constant, use the point \(A\) as in Chapter 2.6:

$$ \vec n\cdot\left(\begin{bmatrix}x\\y\\z\end{bmatrix} -\begin{bmatrix}4\\-7\\5\end{bmatrix}\right)=0. $$

Equivalently, \(\vec n\cdot\begin{bmatrix}x\\y\\z\end{bmatrix} =\vec n\cdot\begin{bmatrix}4\\-7\\5\end{bmatrix}\), so

$$ d=4-3(-7)+3(5)=4+21+15=40. $$

Let’s verify all three points:

$$ \begin{align*} A:&\quad 4-3(-7)+3(5)=40,\\ B:&\quad 10-3(-3)+3(7)=10+9+21=40,\\ C:&\quad -2-3(-1)+3(13)=-2+3+39=40. \end{align*} $$

Problem 6: Three Points, Take Two (11 pts)

Let \(A=(-5,8,6)\), \(B=(-1,15,1)\), and \(C=(-13,-6,16)\).

a)

(4 pts) Is there a unique plane through \(A\), \(B\), and \(C\)? Justify your answer using vectors pointing from \(A\) to the other two points.

Solution

No, there is not a unique plane. The displacement vectors are

$$ \overrightarrow{AB}=\begin{bmatrix}4\\7\\-5\end{bmatrix},\qquad \overrightarrow{AC}=\begin{bmatrix}-8\\-14\\10\end{bmatrix} =-2\begin{bmatrix}4\\7\\-5\end{bmatrix}. $$

They are scalar multiples, so \(A\), \(B\), and \(C\) lie on the same line. Any plane containing that line contains all three points, and there are infinitely many such planes. In part (b), we’ll construct two of them explicitly.

b)

(7 pts) Find equations for two distinct planes that contain all three points. Verify that both planes contain all three points, and explain how you know the planes are different.

Solution

Two possible planes are

$$ \boxed{7x-4y=-67,\qquad 5x+4z=-1.} $$

To construct them, find two independent normals perpendicular to the common line direction \(\begin{bmatrix}4\\7\\-5\end{bmatrix}\). Their entries must satisfy

$$ 4a+7b-5c=0. $$

Setting \(c=0\) gives the choice \(\vec n_1=\begin{bmatrix}7\\-4\\0\end{bmatrix}\). Setting \(b=0\) gives \(\vec n_2=\begin{bmatrix}5\\0\\4\end{bmatrix}\). Taking dot products with \(A\) supplies the constants:

$$ \vec n_1\cdot\begin{bmatrix}-5\\8\\6\end{bmatrix}=-35-32=-67,\qquad \vec n_2\cdot\begin{bmatrix}-5\\8\\6\end{bmatrix}=-25+24=-1. $$

Both planes contain all three points, as these substitutions show:

$$ \begin{array}{c|c|c} \text{Point}&7x-4y&5x+4z\\\hline A&7(-5)-4(8)=-67&5(-5)+4(6)=-1\\ B&7(-1)-4(15)=-67&5(-1)+4(1)=-1\\ C&7(-13)-4(-6)=-67&5(-13)+4(16)=-1 \end{array} $$

Finally, the normals are not scalar multiples, so the planes have different orientations and are distinct. For a direct check, \((-5,8,0)\) is on the first plane, but not the second: \(5(-5)+4(0)=-25\ne-1\).


Problem 7: Changing the Spanning Vectors (7 pts)

Let \(\vec{u}\) and \(\vec{v}\) be nonzero vectors in \(\mathbb{R}^3\) that are not scalar multiples of one another, and let

$$ P=\operatorname{span}(\vec{u},\vec{v}). $$

For each pair below, determine whether it also spans \(P\).

  • If the pair does span \(P\), show how to write an arbitrary vector \(a\vec{u}+b\vec{v}\) as a linear combination of the new pair.

  • If the pair does not span \(P\), describe its span and give a vector that is in \(P\) but not in the span of the new pair.

a)

(4 pts) \(\vec{u}\) and \(\vec{u}+\vec{v}\).

Solution

Yes, this pair spans \(P\). We can rewrite any vector in \(P\) as

$$ \boxed{a\vec u+b\vec v=(a-b)\vec u+b(\vec u+\vec v).} $$

To see where the coefficients come from, expand an arbitrary combination of the new pair:

$$ c\vec u+d(\vec u+\vec v)=(c+d)\vec u+d\vec v. $$

To obtain \(a\vec u+b\vec v\), choose \(d=b\) and \(c=a-b\).

We also need the reverse direction: any combination of the new pair is a combination of \(\vec u\) and \(\vec v\), as the expansion shows. Thus both pairs produce exactly the same vectors, which is the span argument from Chapter 2.4.

b)

(3 pts) \(\vec{u}+\vec{v}\) and \(2(\vec{u}+\vec{v})\).

Solution

No, this pair spans only a line:

$$ \boxed{\operatorname{span}(\vec u+\vec v).} $$

The second vector is twice the first, so every combination has the form

$$ c(\vec u+\vec v)+d\bigl(2(\vec u+\vec v)\bigr) =(c+2d)(\vec u+\vec v). $$

Also, \(\vec u+\vec v\ne\vec0\): otherwise \(\vec v=-\vec u\), contradicting the assumption that they are not scalar multiples.

An example of a missing vector is \(\boxed{\vec u}\). It belongs to \(P\), but suppose it belonged to the new span. Then \(\vec u=t(\vec u+\vec v)\) for some \(t\). If \(t=0\), this says \(\vec u=\vec0\), a contradiction. If \(t\ne0\), rearranging gives

$$ \vec v=\frac{1-t}{t}\vec u, $$

again contradicting the assumption. Thus \(\vec u\) cannot belong to the new span.


Problem 8: Breaking It Down (15 pts)

Note: This problem involves content from Tuesday, September 29th’s lecture, and the soon-to-be-released Chapter 2.7.

Let \(\vec{v}=\begin{bmatrix}19\\2\\9\end{bmatrix}\).

a)

(3 pts) Find the orthogonal projection of \(\vec{v}\) onto the line

$$ \ell=\operatorname{span}\left(\begin{bmatrix}2\\3\\6\end{bmatrix}\right). $$
Solution

The projection is \(\boxed{\operatorname{proj}_{\ell}(\vec v)=\begin{bmatrix}4\\6\\12\end{bmatrix}}\). Let \(\vec w\) be the given direction vector. Using the projection formula from Chapter 2.3,

$$ \begin{align*} \operatorname{proj}_{\ell}(\vec v) &=\frac{\vec v\cdot\vec w}{\vec w\cdot\vec w}\vec w\\ &=\frac{19(2)+2(3)+9(6)}{2^2+3^2+6^2}\begin{bmatrix}2\\3\\6\end{bmatrix}\\ &=\frac{98}{49}\begin{bmatrix}2\\3\\6\end{bmatrix} =2\begin{bmatrix}2\\3\\6\end{bmatrix}=\begin{bmatrix}4\\6\\12\end{bmatrix}. \end{align*} $$

The squared length in the denominator accounts for the fact that \(\vec w\) is not a unit vector.

b)

(4 pts) Find the orthogonal projection of \(\vec{v}\) onto the plane \(P\) with equation \(2x+3y+6z=0\).

Hint: The line in part (a) is perpendicular to \(P\). What happens if you subtract the projection onto that line from \(\vec{v}\)?

Solution

The vector \(\begin{bmatrix}2\\3\\6\end{bmatrix}\) is normal to \(P\), so the line in part (a) is perpendicular to \(P\). Split \(\vec v\) into its component along that line and its component in the plane. Subtracting the first leaves the second:

$$ \operatorname{proj}_{P}(\vec v) =\vec v-\operatorname{proj}_{\ell}(\vec v) =\begin{bmatrix}19\\2\\9\end{bmatrix} -\begin{bmatrix}4\\6\\12\end{bmatrix} =\begin{bmatrix}15\\-4\\-3\end{bmatrix}. $$

Let’s check the geometry. The answer lies in \(P\) because \(2(15)+3(-4)+6(-3)=0\). The part we removed is normal to \(P\), so the error is perpendicular to the plane, as required for an orthogonal projection.

c)

(4 pts) Find the orthogonal projection of \(\vec{v}\) onto the plane

$$ Q=\operatorname{span}\left(\begin{bmatrix}5\\4\\-3\end{bmatrix},\begin{bmatrix}-2\\6\\5\end{bmatrix}\right). $$

Hint: First find a nonzero vector normal to \(Q\).

Solution

The projection onto \(Q\) is

$$ \boxed{\operatorname{proj}_{Q}(\vec v)=\begin{bmatrix}7\\8\\-3\end{bmatrix}.} $$

Let’s first find a normal, then subtract the component along it. If \(\vec n=\begin{bmatrix}a\\b\\c\end{bmatrix}\) is perpendicular to both spanning vectors, then

$$ 5a+4b-3c=0,\qquad -2a+6b+5c=0. $$

Multiply the first equation by \(5\) and the second by \(3\), then add:

$$ 19a+38b=0\quad\Longrightarrow\quad a=-2b. $$

Substituting into the first gives \(-6b-3c=0\), so \(c=-2b\). Choosing \(b=-1\) gives \(\vec n=\begin{bmatrix}2\\-1\\2\end{bmatrix}\). Thus \(Q\) has equation \(2x-y+2z=0\).

The component of \(\vec v\) along the normal line is

$$ \begin{align*} \operatorname{proj}_{\operatorname{span}(\vec n)}(\vec v) &=\frac{19(2)+2(-1)+9(2)}{2^2+(-1)^2+2^2}\begin{bmatrix}2\\-1\\2\end{bmatrix}\\ &=\frac{54}{9}\begin{bmatrix}2\\-1\\2\end{bmatrix} =\begin{bmatrix}12\\-6\\12\end{bmatrix}. \end{align*} $$

Subtracting this component leaves the projection into the plane:

$$ \operatorname{proj}_{Q}(\vec v) =\begin{bmatrix}19\\2\\9\end{bmatrix} -\begin{bmatrix}12\\-6\\12\end{bmatrix} =\begin{bmatrix}7\\8\\-3\end{bmatrix}. $$

Indeed, \(2(7)-8+2(-3)=0\), so the answer is on \(Q\), and the removed component is parallel to its normal.

d)

(4 pts) The vectors

$$ \vec{u}_1=\frac{1}{7}\begin{bmatrix}2\\3\\6\end{bmatrix},\qquad \vec{u}_2=\frac{1}{7}\begin{bmatrix}-3\\6\\-2\end{bmatrix},\qquad \vec{u}_3=\frac{1}{7}\begin{bmatrix}-6\\-2\\3\end{bmatrix} $$

form an orthonormal basis of \(\mathbb{R}^3\). Write \(\vec{v}\) as a linear combination of \(\vec{u}_1\), \(\vec{u}_2\), and \(\vec{u}_3\).

Solution

The linear combination is

$$ \boxed{\vec v=14\vec u_1-9\vec u_2-13\vec u_3.} $$

As in Chapter 2.2, orthonormality lets us find each coefficient with a dot product. If \(\vec v=a\vec u_1+b\vec u_2+c\vec u_3\), then

$$ \vec v\cdot\vec u_1 =a(\vec u_1\cdot\vec u_1)+b(\vec u_2\cdot\vec u_1)+c(\vec u_3\cdot\vec u_1) =a. $$

The same argument works for the other two coefficients. Computing them gives

$$ \begin{align*} \vec v\cdot\vec u_1&=\frac{19(2)+2(3)+9(6)}7=\frac{98}7=14,\\ \vec v\cdot\vec u_2&=\frac{19(-3)+2(6)+9(-2)}7=\frac{-63}7=-9,\\ \vec v\cdot\vec u_3&=\frac{19(-6)+2(-2)+9(3)}7=\frac{-91}7=-13. \end{align*} $$

As a check, reconstructing the vector gives

$$ 14\vec u_1-9\vec u_2-13\vec u_3 =\frac17\begin{bmatrix}28+27+78\\42-54+26\\84+18-39\end{bmatrix} =\begin{bmatrix}19\\2\\9\end{bmatrix}. $$

Problem 9: A Change of Reflection (10 pts)

In this problem, we will explore the idea of reflecting a vector across a line. This problem has applications to computer graphics, where reflecting the position vectors of points creates a mirror image of a two-dimensional shape.

Let \(\vec w=\begin{bmatrix}1\\1\end{bmatrix}\). The picture below shows reflection of the vector \(\vec v=\begin{bmatrix}7\\-3\end{bmatrix}\) across the line \(\ell=\operatorname{span}(\vec w)=\operatorname{span}\left(\begin{bmatrix}1\\1\end{bmatrix}\right)\).

image

In the picture above, reflecting \(\vec{v}=\begin{bmatrix}7\\-3\end{bmatrix}\) across \(\ell=\operatorname{span}(\vec w)\) gives us \(\vec{v}_{\mathrm{ref}}=\begin{bmatrix}-3\\7\end{bmatrix}\). Notice that \(\vec{p}=\begin{bmatrix}2\\2\end{bmatrix}\), the projection of \(\vec{v}\) onto \(\ell=\operatorname{span}(\vec w)\), has its tip halfway between the tips of \(\vec v\) and \(\vec v_{\mathrm{ref}}\). To get from \(\vec{v}\) to \(\vec{v}_{\mathrm{ref}}\), we move to \(\vec{p}\), then keep going the same distance in the same direction.

We’ll use this same idea to reflect vectors across lines in \(\mathbb{R}^2\), \(\mathbb{R}^3\), and eventually \(\mathbb{R}^n\). All of the lines in this problem pass through the origin.

a)

(5 pts) Let \(\vec v=\begin{bmatrix}4\\3\end{bmatrix}\) and \(\vec w=\begin{bmatrix}1\\2\end{bmatrix}\).

  1. (i)

    Find the projection \(\vec p\) of \(\vec v\) onto \(\ell=\operatorname{span}(\vec w)\).

  2. (ii)

    Now, find \(\vec v_{\mathrm{ref}}\), the reflection of \(\vec v\) across \(\ell=\operatorname{span}(\vec w)\).

  3. (iii)

    Draw a picture showing \(\vec w\), \(\ell=\operatorname{span}(\vec w)\) (dotted, as in our example), \(\vec p\), \(\vec v\), and \(\vec v_{\mathrm{ref}}\).

Solution

(i) The projection is \(\boxed{\vec p=\begin{bmatrix}2\\4\end{bmatrix}}\). Using the direction vector \(\vec w\),

$$ \vec p=\frac{4(1)+3(2)}{1^2+2^2}\begin{bmatrix}1\\2\end{bmatrix} =\frac{10}{5}\begin{bmatrix}1\\2\end{bmatrix} =\begin{bmatrix}2\\4\end{bmatrix}. $$

(ii) To move from the tip of \(\vec v\) to the tip of \(\vec p\), add \(\vec p-\vec v\). To reach the reflection, make the same move once more:

$$ \vec v_{\mathrm{ref}}=\vec p+(\vec p-\vec v) =2\vec p-\vec v =2\begin{bmatrix}2\\4\end{bmatrix}-\begin{bmatrix}4\\3\end{bmatrix} =\boxed{\begin{bmatrix}0\\5\end{bmatrix}}. $$

(iii) Here is the completed picture. The tip of \(\vec p\) is halfway between the tips of \(\vec v\) and \(\vec v_{\mathrm{ref}}\), and the dashed segment joining them is perpendicular to \(\ell=\operatorname{span}(\vec w)\).

Coordinate diagram
b)

(2 pts) Now, let \(\vec w=\begin{bmatrix}1\\1\\2\end{bmatrix}\) and find the reflection of \(\vec{v}=\begin{bmatrix}3\\-1\\2\end{bmatrix}\) across the line \(\ell=\operatorname{span}(\vec w)\) in \(\mathbb{R}^3\). Again, start by finding \(\vec{p}\). You don’t need to draw a picture.

Solution

The reflection is

$$ \boxed{\vec v_{\mathrm{ref}}=\begin{bmatrix}-1\\3\\2\end{bmatrix}.} $$

First find the projection onto \(\ell=\operatorname{span}(\vec w)\):

$$ \vec p=\frac{3(1)+(-1)(1)+2(2)}{1^2+1^2+2^2}\begin{bmatrix}1\\1\\2\end{bmatrix} =\frac66\begin{bmatrix}1\\1\\2\end{bmatrix} =\begin{bmatrix}1\\1\\2\end{bmatrix}. $$

As in part (a), the tip of \(\vec p\) is the midpoint between the original tip and the reflected tip. Therefore,

$$ \vec v_{\mathrm{ref}}=2\vec p-\vec v =2\begin{bmatrix}1\\1\\2\end{bmatrix}-\begin{bmatrix}3\\-1\\2\end{bmatrix} =\begin{bmatrix}-1\\3\\2\end{bmatrix}. $$
c)

(3 pts) Let \(\vec{v}\in\mathbb{R}^n\), and let \(\ell=\operatorname{span}(\vec{w})\), where \(\vec{w}\) is nonzero. Find a formula for the reflection \(\vec{v}_{\mathrm{ref}}\) of \(\vec{v}\) across \(\ell=\operatorname{span}(\vec w)\). First, write your formula in terms of \(\vec{v}\) and its projection \(\vec{p}\) onto \(\ell=\operatorname{span}(\vec w)\). Then, write it using only \(\vec{w}\), \(\vec{v}\), and their dot products.

Solution

The formulas are

$$ \boxed{\vec v_{\mathrm{ref}}=2\vec p-\vec v} \qquad\text{and}\qquad \boxed{\vec v_{\mathrm{ref}}=2\frac{\vec v\cdot\vec w}{\vec w\cdot\vec w}\vec w-\vec v.} $$

Let’s see why. Going from the tip of \(\vec v\) to the tip of \(\vec p\) adds \(\vec p-\vec v\). The reflection continues the same distance in the same direction, so it adds this vector twice:

$$ \begin{align*} \vec v_{\mathrm{ref}} &=\vec v+2(\vec p-\vec v)\\ &=2\vec p-\vec v. \end{align*} $$

Now substitute the projection formula \(\vec p=\dfrac{\vec v\cdot\vec w}{\vec w\cdot\vec w}\vec w\) to get the second expression. The denominator is nonzero because \(\vec w\ne\vec0\).

Equivalently, the perpendicular decomposition \(\vec v=\vec p+(\vec v-\vec p)\) becomes \(\vec p-(\vec v-\vec p)\). Reflection keeps the component along the line and reverses the perpendicular component.


Problem 10: Programming Activity (7 pts)

Let’s implement your logic from Problem 9 in Python! In Homework 1, you changed the colors of pixels in an image. This time, you’ll change their positions to create a mirror image, while keeping the colors the same.

To open the notebook for Homework 4, click this link. Instructions on how to use Google Colab are at math124.org/running-code.

You won’t need to submit the notebook anywhere. To get credit, complete both tasks in the notebook and include the following in your PDF submission to Homework 4 on Pensive, specifically under Problem 10:

  1. 1.

    Task 1 (5 pts): A screenshot of your completed reflection(v, w) function and the successful check output.

  2. 2.

    Task 2 (2 pts): One screenshot of your canvas with a tilted line, showing the angle, original image, and reflected image. No written response is required.

Solution

Task 1: One implementation is

def reflection(v, w):
    p = np.dot(v, w) / np.dot(w, w) * w
    return 2 * p - v

The first line of the function computes the projection onto \(\operatorname{span}(\vec w)\); the second uses the reflection formula from Problem 9. This implementation passes all six supplied checks, including the two examples with direction vectors that span the same line.

Task 2: Images will vary. The screenshot should show a tilted line and its angle, with the original image and reflected image on opposite sides. Corresponding points should be equally far from the line, and the segment joining each pair should be perpendicular to it.