(1 pt) Let \(\vec{d}\) be the vector that describes the displacement from \(P\) to \(Q\). Find \(\vec{d}\).
Homework 3: Vectors and the Dot Product
due Friday, September 25th, 2026 at 11:59PM Ann Arbor Time
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
- Problem 1: Homework 2 Solutions Review
- Problem 2: Feedback
- Problem 3: Drawing Linear Combinations
- Problem 4: Displacement and Distance
- Problem 5: Distributing the Dots
- Problem 6: Parallelogram Law
- Problem 7: Linear Combinations
- Problem 8: Correlation
- Problem 9: Projections
- Problem 10: Norms
- Problem 11: Neighbors
Total Points: 10 + 6 + 6 + 7 + 13 + 12 + 10 + 8 + 9 + 13 + 10 = 104
Problem 1: Homework 2 Solutions Review (10 pts)
Review the solutions to Homework 2. Pick two problem parts (for example, Problem 2a and Problem 4b) from Homework 2 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 2, 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.
Problem 2: Feedback (6 pts)
We’d like to get your feedback on how the course has been going so far, now that we’re a few weeks in.
You can find the survey at this link. It is not anonymous, but it links to an anonymous feedback form if you’d like to provide some feedback anonymously.
When submitting to Pensive, it does not matter which page of your submission you assign to Problem 2; we will enter survey completion credit in manually.
Thank you for your feedback — it’s helping shape our relatively new course.
Problem 3: Drawing Linear Combinations (6 pts)
In this problem, draw all vectors on the same set of axes, like the one below. Your final graph should contain five vectors. Draw each vector starting at the origin, and label it.
Draw \(\vec u=\begin{bmatrix}3\\4\end{bmatrix}\).
Draw \(\vec v=\begin{bmatrix}-1\\-4\end{bmatrix}\).
(2 pts) Draw \(\vec a=-\vec u-\vec v\). Verify that your drawing is correct by finding \(\vec a\)’s components.
(2 pts) Draw \(\vec b=2\vec u+\vec v\). Verify that your drawing is correct by finding \(\vec b\)’s components.
(2 pts) Draw \(\vec c=\frac12\vec u-\frac12\vec v\). Verify that your drawing is correct by finding \(\vec c\)’s components.

Problem 4: Displacement and Distance (7 pts)
A drone begins at the point
and flies in a straight line to the point
The coordinates here are in meters.
(2 pts) Find the exact distance traveled by the drone.
(4 pts) Suppose the drone continues to travel another 10 meters in the same direction. What are its coordinates?
Problem 5: Distributing the Dots (13 pts)
Let \(\vec{u},\vec{v}\in\mathbb{R}^n\) satisfy
(3 pts) Find \(\vec{u}\cdot\vec{v}\). Show your work.
(2 pts) Find \(|-2\vec{u}|\) and \(|3\vec{v}|\). Explain why neither length is negative.
(3 pts) Recall, the cosine similarity of two nonzero vectors \(\vec u,\vec v\) is defined as
where \(\theta\) is the angle between the vectors.
Find the cosine similarity of \(\vec{u}\) and \(\vec{v}\). Then find the cosine similarity of \(-2\vec{u}\) and \(3\vec{v}\). If the two cosine similarities are different, why are they different?
(1 pt) Find \(\vec{u}\cdot\vec{u}\) and \(\vec{v}\cdot\vec{v}\).
(4 pts) Find \(|\vec{u}+\vec{v}|\). Is it equal to \(\sqrt{|\vec{u}|^2+|\vec{v}|^2}\)? Explain what condition would make these quantities equal.
Hint: Start by writing \(\lVert\vec{u}+\vec{v}\rVert^2\) as \((\vec{u}+\vec{v})\cdot(\vec{u}+\vec{v})\).
Problem 6: Parallelogram Law (12 pts)
(2 pts) Let \(\vec{u} = \begin{bmatrix} 3 \\ -6 \\ 0 \\ 2 \end{bmatrix}\) and \(\vec{v} = \begin{bmatrix} 2 \\ 1 \\ 4 \\ -2 \end{bmatrix}\). Compute the following quantities:
\(\lVert \vec{u} \rVert\)
\(\lVert \vec{v} \rVert\)
\(\lVert \vec{u} + \vec{v} \rVert\)
\(\lVert \vec{u} - \vec{v} \rVert\)
(2 pts) Using the same vectors as in part a), compute the angle between \(\vec{u}\) and \(\vec{v}\). Leave your answer in terms of \(\cos^{-1}\). We asked you to do something very similar in Problem 5c, but here we are asking for the angle itself, which is why your answer involves \(\cos^{-1}\).
(4 pts) Now, suppose \(\vec{u} = \begin{bmatrix} u_1 \\ u_2 \\ \vdots \\ u_n \end{bmatrix}\) and \(\vec{v} = \begin{bmatrix} v_1 \\ v_2 \\ \vdots \\ v_n \end{bmatrix}\) are any two vectors in \(\mathbb{R}^n\). Prove that:
The statement above is called the parallelogram law of vectors.
Hint: The point of part a) was to give you a feel for which quantities are involved in this statement. Your proof should not use these values in particular. Refer to the hint from Problem 5e.
(4 pts) Why is the equality from part c) called the parallelogram law? Let’s explore.
Suppose points \(A\), \(B\), \(C\), and \(D\) in \(\mathbb{R}^n\) form a parallelogram: a polygon with four sides where opposite sides are parallel and equal in length.

Using the results of the previous part of this problem, prove that the sum of the squares of the side lengths of the parallelogram is equal to the sum of the squares of the diagonals. In other words, prove that:
where \(AB\) represents the length of the segment from point \(A\) to point \(B\), etc.
Hint: Define two vectors, \(\vec u\) and \(\vec v\), and explain why the result from the previous part of this problem implies the desired equality. This is mostly an English problem.
Problem 7: Linear Combinations (10 pts)
Much of our study of linear algebra involves understanding the set of possible linear combinations of a given set of vectors. As the notes detail, our multiple linear regression problem boils down to finding the best possible linear combination of the features, so it’s important that we understand how linear combinations work.
Let
You can find an interactive, three-dimensional visualization of these four vectors at this link:
https://eecs245.org/resources/homeworks/hw03/hw03-problem-7.html
We recommend you have this visual open while you work through this problem.
(4 pts) Find constants \(a\), \(b\), and \(c\) such that
In other words, write \(\vec x\) as a linear combination of \(\vec v_1\), \(\vec v_2\), and \(\vec v_3\).
Hint: Start by writing out the equation as a system of equations. Then, use your favorite method for solving systems of equations to find \(a\), \(b\), and \(c\). We reviewed how to solve systems of equations in Lab 3.
(3 pts) Try and find constants \(d\) and \(e\) such that
If you are able to find constants \(d\) and \(e\), explain why, even though there are two unknowns but three equations for them. If you are unable to find constants \(d\) and \(e\), explain why no solution exists.
(3 pts) Try and find constants \(p\) and \(q\) such that
If you are able to find constants \(p\) and \(q\), explain why, even though there are two unknowns but three equations for them. If you are unable to find constants \(p\) and \(q\), explain why no solution exists.
Problem 8: Correlation (8 pts)
In Chapter 2.4, you were told that the correlation coefficient, \(r\), ranges between \(-1\) and \(1\), where \(-1\) implies a perfect negative linear association and \(1\) implies a perfect positive linear association. However, you were never given a proof of the fact that \(-1 \leq r \leq 1\).
Here, you will prove this fact, given your newfound understanding of vectors, the dot product, and angles.
(2 pts) Let \(\vec x\) and \(\vec y\) be two vectors in \(\mathbb{R}^n\). We define the “mean-centered” version of \(\vec x\) to be:
where \(\displaystyle \bar{x} = \frac{1}{n} \sum_{i=1}^n x_i\) is the mean of the components of \(\vec{x}\). The mean-centered version of \(\vec y\), named \(\vec{y}_{\text{c}}\), is defined similarly.
Express \(\vec{x}_{\text{c}} \cdot \vec{y}_{\text{c}}\) using summation notation.
(4 pts) Prove that:
Do so by starting with the right-hand side of the equation, expanding it, and simplifying it until you reach the definition of \(r\).
(2 pts) In 1-2 English sentences, explain why the result from part b) implies that \(-1 \leq r \leq 1\).
Problem 9: Projections (9 pts)
In Chapter 3.4, we study the concept of projecting one vector onto one or more other vectors. In this problem, you’ll see how this concept can be thought of in terms of our friend from the first two weeks of the course: calculus.
Let \(\vec x\) and \(\vec y\) be two vectors in \(\mathbb{R}^n\). Consider the function \(f: \mathbb{R} \to \mathbb{R}\), defined as:
By \(\mathbb{R} \to \mathbb{R}\), we mean that \(f\) takes in a single real number (i.e. a scalar, not a vector) and outputs a single real number. This means that we can find \(\frac{\text{d} f}{\text{d} k}\), the derivative of \(f\) with respect to \(k\).
(4 pts) Rewrite \(f(k)\) using the properties of the dot product from Chapter 3.3. Then, show that:
(2 pts) Find \(k^{\ast}\), the value of \(k\) that minimizes \(f(k)\). A second derivative test is not necessary.
(3 pts) Show that the vectors \(k^{\ast} \vec x\) and \(\vec y - k^{\ast} \vec x\) are orthogonal.
Problem 10: Norms (13 pts)
In the Other Norms section of Chapter 3.2, we introduced the concept of vector norms other than the “default” Euclidean norm. Each of those norms describes a different way of measuring the length of a vector — just like how different loss functions described different ways of measuring the error of a prediction.
(3 pts) In this part only, let \(\vec v = \begin{bmatrix} 3 \\ -6 \\ 0 \\ 2 \end{bmatrix}\). Compute \(\lVert \vec v \rVert_2\), \(\lVert \vec v \rVert_1\), and \(\lVert \vec v \rVert_\infty\).
(3 pts) In the Parallelogram Law problem, we introduced the following identity:
In general, the parallelogram law only holds for the \(L_2\) norm, not necessarily other norms.
Find a counterexample involving two vectors \(\vec{u}\) and \(\vec{v}\) such that the parallelogram law does not hold for the \(L_1\) norm.
(3 pts) Prove that
Hint: Start by writing out the definition of the \(L_2\) norm, and then square it to remove the square root. You will have a sum of \(n\) terms. Explain why each of those \(n\) terms is less than or equal to \(\lVert \vec v \rVert_\infty^2\). This is most of the way to the proof, but there’s still some work you’ll need to do after you get to that point.
(4 pts) Prove that
Hint: Start with the fact that
Problem 11: Neighbors (10 pts)
This problem involves writing code and submitting it to the Pensive autograder.
There are two ways to access the supplemental Jupyter Notebook:
Option 1 (preferred): Set up a Jupyter Notebook environment locally, use
gitto clone our course repository, and openhomeworks/hw03/hw03.ipynb. For instructions on how to do this, see the Environment Setup page of the course website.Option 2: Click here to open
hw03.ipynbon DataHub. Before doing so, read the instructions on the Environment Setup page on how to use the DataHub.
To receive credit for the programming portion of the homework, you’ll need to submit your completed notebook to the autograder on Pensive. Your submission time for Homework 3 is the latter of your PDF and code submission times.