Week 10 (2)
Week 10 (2)
Test Questions
Lecture Details: Week 10
1. (1 point) For a given point x = 2, is the function f (x) = xe−3x increasing or decreasing?
A. increasing
B. decreasing
Answer: B
If the first derivative of f (x) at any point x is positive or negative, then we call f (x) as
increasing or decreasing respectively.
f ′ (x) = e−3x (1 − 3x), at x = 2 we get f ′ (2) = −0.012. Hence decreasing.
2. (1 point) Find the value of a functionf (x) = x + 3x2 at its global minimum point.
Answer: -0.0833
range: -0.09,-0.08
Answer: B
In order to find the interval over which f (x) is convex, let us find where f ′′ (x) > 0.
2
f ′ (x) = 2x2 ex
2
f ′′ (x) = ex (4x3 + 6x)
2
Therefore f ′′ (x) > 0 implies ex (4x3 + 6x) > 0.
2
To satisfy this inequality, we want an interval of x for which ex > 0 and (4x3 + 6x) > 0.
Because e raised to any power will be positive, first condition can be satisfied for any
value of x.
Second condition can be written as 2x(x2 + 3) > 0.
(x2 + 3) will be greater than 0 for any values of x.
2x will be positive only when x > 0.
Thus in interval notation, the largest interval of x for which f (x) is convex is (0, inf).
Course: Machine Learning - Foundations Page 2 of 8
4. (1 point) (Multiple select) Let the composition of two functions f (x) = sin(x) − 2x2 + 1
and g(x) = ex be h = f og. At a point x = 5, Select the true statement(s).
A. h(x) is a convex function.
B. h(x) is a concave function.
C. h(x) is a non-decreasing function.
D. h(x) is a decreasing function.
Answer: B,D
L(x, y, λ) = x + y + λx2 + λy 2 − λ
∂L
= 2λy + 1 = 0
∂y
1
y=− (2)
2λ
∂L
= x2 + y 2 = 1 (3)
∂λ
Substituting (1) and (2) in (3), we get
1 1
2
+ 2 =1
4λ 4λ
1
λ = ±√ (4)
2
Using (3) in (1) and (2) we get, x = ∓ √12 and y = ∓ √12 . Since we want to minimize
f (x, y), we shall consider x = − √12 and y = − √12 .
Minimum value of f (x, y) = −1.414.
6. (1 point) For the functions g(x) = (3x + 2)2 and f (x) = ex , select the plot that corre-
sponds to the correct composition h = f og.
A.
Course: Machine Learning - Foundations Page 4 of 8
B.
C.
D.
Answer: A
Course: Machine Learning - Foundations Page 5 of 8
The functions f(x), g(x) and their composition h(x) are plotted as follows:
(Common data for Q7, Q8) Linear programming deals with the problem of finding a
vector x that minimizes a given linear function cT x, where x ranges over all vectors
(x ≥ 0) satisfying a given system of linear equations Ax = b. Here A is a m × n matrix,
c, x ∈ Rn and b ∈ Rm .
7. (1 point) Choose the correct dual program with y as the dual variable for the above
linear program from the following.
A.
min by subject to AT y ≥ c
y
B.
max bT y subject to AT y ≤ c
y
C.
max bT y subject to AT y ≥ c
y
D.
max by subject to AT y ≤ c
y
Answer: B
8. (1 point) From the below given statements regarding constraints and decision variables
related to the primal and dual problems of the linear program, choose the correct state-
ment.
A. Primal problem has m constraints and m decision variables whereas dual prob-
lem has n constraints and n decision variables.
B. Primal problem has m constraints and n decision variables whereas dual prob-
lem has n constraints and m decision variables.
Course: Machine Learning - Foundations Page 6 of 8
C. Primal problem has n constraints and n decision variables whereas dual prob-
lem has m constraints and m decision variables.
D. Primal problem has n constraints and m decision variables whereas dual prob-
lem has m constraints and n decision variables.
Answer: B
9. (2 points)
Let a set of data points with five samples and two features per sample be
1 2 1.5
2 3 2
X= 4 2.5 and the corresponding labels be y = 2.5. Perform linear regression
6 4 3
7.5 5 4
∗
on this data set and choose the optimal solution for w to minimize the sum of squares
error.
0.2763
A.
1.2039
0.0691
B.
0.3010
0.1382
C.
0.6019
0.0276
D.
0.1204
Answer: C
optimal w∗ = (X T X)−1 (X T y)
113.25 79.5
XT X =
79.5 60.25
63.5
XT y =
47.25
0.1382
w∗ =
0.6019
A, B and D are scalar multiples of C.
(Common data for Q10, Q11) Krishna runs a steel fabrication industry and produces
steel products. He regularly purchases
√ raw steel for Rs.500 per ton. His revenue is
modeled by a function R(s) = 100 s, where s is the tons of steel purchased. His budget
for steel purchase is Rs.150000.
10. (1 point) Using Lagrangian function, find the amount of raw steel to be purchased to
get maximum revenue?
Answer: 300
range: 298, 302
Course: Machine Learning - Foundations Page 7 of 8
√
Maximum revenue: 100 ∗ 300 = 1732.05
2
12. (1 point) Consider a vector ŵ = 4 in R3 . In R3 , there are many unit vectors. Use
3
Lagrange method to find the unit vector which gives the minimum dot product.
2
1
A. û = 2λ 4 , with λ ≥ 0
3
2
−1
B. û = 3λ 4 , with λ ≥ 0
3
2
−1
C. û = 4λ 4 , with λ ≥ 0
3
2
D. û = −1
2λ
4, with λ ≥ 0
3
Answer: D
x
Let unit vector be ⃗u = y .
z
⃗ subject to x2 + y 2 + z 2 = 1.
Objective is to minimize ⃗u.w
f (x, y, z) = ⃗u.w
⃗ = 2x + 4y + 3z
Course: Machine Learning - Foundations Page 8 of 8
subject to
0.5y1 + y2 ≥ 6
2y1 + 2y2 ≥ 14
y1 + 4y2 ≥ 13
y1 ≥ 0, y2 ≥ 0
Answer: C
][y1∗ , y2∗ ] = [11, 0.5], satisfies all the constraints and gives minimum value of v.