0% found this document useful (0 votes)
9 views8 pages

Week 10 (2)

The document contains test questions and answers related to a Machine Learning course, focusing on concepts such as function behavior, convexity, Lagrangian methods, and linear programming. Key topics include determining whether functions are increasing or decreasing, finding global minimum values, and solving optimization problems using dual programs and KKT conditions. The document also includes specific calculations and derivations for various mathematical problems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views8 pages

Week 10 (2)

The document contains test questions and answers related to a Machine Learning course, focusing on concepts such as function behavior, convexity, Lagrangian methods, and linear programming. Key topics include determining whether functions are increasing or decreasing, finding global minimum values, and solving optimization problems using dual programs and KKT conditions. The document also includes specific calculations and derivations for various mathematical problems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Course: Machine Learning - Foundations

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

To get global minimum, f ′ (x) = 0. Therefore 1 + 6x = 0, x = − 16 .


1
f ( ) = −0.0833
6
2
3. (1 point) Choose the largest interval of x in which a function f (x) = xex is convex.
A. (-0.5,0.5)
B. (0, ∞)
C. (∞,0)
D. (1,0)

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

h(x) = f (g(x)) = sin(ex ) − 2e2x + 1


First derivative:
h′ (x) = ex cos(ex ) − 4e2x
At x = 5; h′ (x) = −88232.28 which is less than 0. Hence h(x) is decreasing.
Second derivative:
h′′ (x) = e2x (cos(ex ) − sin(ex )) − 8e2x
At x = 5; h′′ (x) = −177055.6 which is negative. Hence h(x) is concave.

5. (2 points) Find the minimum value of f (x, y) = x + y subject to x2 + y 2 = 1, where x,


y are the coordinates of points on the circumference of the unit circle.
Answer: -1.414
range: -1,-2 The Lagrangian function for the problem is

L(x, y, λ) = x + y + λx2 + λy 2 − λ

Take partial derivatives with respect to x,y, λ and equate to zero.


∂L
= 2λx + 1 = 0
∂x
1
x=− (1)

Course: Machine Learning - Foundations Page 3 of 8

∂L
= 2λy + 1 = 0
∂y
1
y=− (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

Lagrangian function: L(s, λ) = 100s0.5 + λ(s − 150000)

L(s, λ) = 100s0.5 + sλ − λ150000


Take partial derivatives with respect to s and λ and equate to zero.
∂L
= 0 = 50s−0.5 + λ500 = 0
∂s
∂L
= 0 = s500 − 150000 = 0
∂λ
s = 300

11. (1 point) What is the maximum revenue value in Rs?


Answer: 1732.05
range: 1730,1734


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

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

Lagrangian function can be written as follows:

L(x, y, z, λ) = (2x + 4y + 3z) + λ(x2 + y 2 + z 2 − 1)

Take partial derivatives with respect to x, y, z and λ and equate to zero.


∂L
= 2 + 2λx = 0
∂x
−1
x= 2

∂L
= 4 + 2λy = 0
∂y
−1
y= 4

∂L
= 3 + 2λz = 0
∂z
−1
z= 3

(Common data for Q13, Q14) Solve the following linear program using KKT conditions.

minimize v = 24y1 + 60y2

subject to
0.5y1 + y2 ≥ 6
2y1 + 2y2 ≥ 14
y1 + 4y2 ≥ 13
y1 ≥ 0, y2 ≥ 0

13. (2 points) Choose the optimal solution for [y1∗ , y2∗ ]


A. [8,2.5]
B. [10,6]
C. [11,0.5]
D. [10.5,1]

Answer: C
][y1∗ , y2∗ ] = [11, 0.5], satisfies all the constraints and gives minimum value of v.

14. (1 point) Enter the minimum value of v.


Answer: 294

v = 24(11) + 60(0.5) = 294

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy