Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Assignment 3

1. [10 points] Consider two binary vectors x and y (i.e., the entries are either 0 or 1). For example, suppose
we have a dictionary that contains 1000 words and the vector x is the 1000-vector that represents a
document, where xi = 1 if the document contains the i-th word of the dictionary and 0 otherwise.
a. What does the distance between two vectors x and y, ∥ 𝑥 − 𝑦 ∥ compute?
b. What does the dot product of the two vectors compute?
c. Which of the above measures would you want to use to compute dissimilarity/similarity between
the two documents represented by the binary vectors?
d. Would cosine similarity be a better measure that the two measures above? Why or why not?

2. [10 points] Find x that maximizes 𝑓(𝒙) =∥ 𝒙 − 𝒄 ∥2 −∥ 𝒙 − 𝒅 ∥2 , where vectors c and d are given/known
and x, c, and d are n-vectors.

3. [10 points] Consider the road network below that shows traffic flow (vehicles/hours) in several one-way
streets in a city during a typical afternoon. Write down a system of linear equations that describe the
traffic flow pattern. Here, x1, x2, x3, and x4 are amount of flow that are unknown. Since the variable
describe traffic flows of one-way streets these variables are all non-negative.
a. Does the system of linear equations have zero, one, or infinitely many solutions?
b. Determine the possible range of values for the variables x1, x2, x3, and x4.

4. [10 points] Find all the polynomials f(t) of degree ≤ 2 [of the form f(t) = a + bt + ct2] whose graphs run
through the points (1, 1) and (3, 3), such that f ’(2) = 1.

5. [20 points] Consider the data containing the marks obtained by 5 students in a course
Student ID Assignments (a) Midterm Exam (m) Final Exam (f)
101 76 48 43
201 92 92 90
301 68 82 64
401 86 68 69
501 54 70 50

a. Find the function of the form 𝑓 = 𝑐0 + 𝑐1 𝑎 + 𝑐2 𝑚 that fits the data. Use the pseudoinverse
method to find the least square solution.
b. Use QR factorization method to find the least square solution. Show the computation at each
step.
c. Find f for another student with a = 60 and m = 65.
[You may use Octave to do the computations, in which case provide the code and show the
results at each step]

You might also like