Week 8
Week 8
8 Test questions
Week 7:
1. (2 points) Two positive numbers have a sum of 60. What is the minimum product of
one number times the square of other number?
A. 0
B. 900
C. 60
D. 240
Answer: A
Let the two numbers be x and y
x+y=60
objective function from the question will be,
f (x) = x2 (60 − x)
For optima f 0 (x) = 0, 120x − 3x2 = 0
x = 0, 40
Product is minimum when x=0.
Answer: A,C
Objective function f (x) = (x − 0)2 + (x2 + 1 − 2)2
f (x) = x4 − x2 + 1
For minima f 0 (x) = 0
4x3 − 2x = 0
x = 0, 0.707, −0.707
Corresponding y = 1, 1.5, 1.5
3. (2 points) The volume of the largest cone that can be inscribed in a circle of radius 6 m
is (correct up to two decimal places)
Answer: 268.19 m3
V = 31 πr2 h
√
r = 36 − x2
h=6+x
Course: Machine Learning - Foundations Page 2 of 5
Answer: D
1000 machine hours must be used daily.
(Questions 9-11 have common data)
A factory manufactures two products A and B. To manufacture one unit of A, 1 machine
hours and 2 labour hours are required. To manufacture product B, 2 machine hours and
1 labour hours are required. In a month, 200 machine hours and 140 labour hours are
available. Profit per unit for A is Rs. 45 and for B is Rs. 35.
Let x1 =Number of units of A produced per month
and x2 =Number of units of B produced per month
Answer: A
We need to maximize profit.
Answer: B
Total machine hours available=200.
Answer: B
Total labour hour available is 140.
Course: Machine Learning - Foundations Page 4 of 5
Answer: A,C,D
For critical points gradient of a function is 0.
As we move towards minima gradient decreases.
12. The value of a function at point 10 is 100. The values of the function’s first and second
order derivatives at this point are 20 and 2 respectively. What will be the function’s
approximate value correct up to two decimal places at the point 10.5 (Use second order
approximation)?
Answer: 110.25
According to Taylor’s series,
2 0
f (x + h) = f (x) + hf 0 (x) + h f2 (x) + ......
Here x = 10, h = 0.5
∴ f (x + h) = 110.25
13. (2 points) For the function f (x) = x sin(x) − 1, with an initial guess of x0 = 2.5, and
step size of 0.1, as per gradient descent algorithm, what will be the value of the function
after 4 iterations? (Correct up to 3 decimal places)
14. (2 points) The value of f (x1 , x2 ) = 4x21 − 4x1 x2 + 2x22 with an initial guess of (2, 3)
after two iterations of gradient descent algorithm will be ............... Take the step size
1
η = t+1 , where t= 0,1,2....
Answer: 130
xn+1 =xn − η∇f (x)
8x1 − 4x2
∇f =
−4x
1 + 4x2
−2
x1 =
−1
Course: Machine Learning - Foundations Page 5 of 5
4
x2 =
−3
f (4, −3) = 130
15. (2 points) The point of minimum for the function f (x1 , x2 ) = x21 − x1 x2 + 2x22 with an
initial guess of (3, 2) with step size=0.5 using gradient descent algorithm after second
iteration will be .............. (correct up to 3 decimal places)
16. (2 points) Suppose we have n data points randomly distributed in space given by D =
{x1 , x2 , ....., xn }. A function f (p) is defined to
Pncalculate the sum of distances of data
2
points from a fixed point, say p. Let f (p) = i=1 (p − xi ) . What is the value of p so
that f(p) is minimum?
A. x1 + x2 + ..... + xn
B. x1 − x2 + x3 − x4 ....
x1 + x2 + .... + xn
C.
n
x1 − x2 + x3 − x4 ....
D.
n
Answer: Pn C
f (p) = i=1 (p − xi )2
f (p) = (p − x1 )2 + ...... + (p − xn )2
f 0 (p) = 2p(p − x1 ) + ..... + 2p(p − xn )
For minima f 0 (p) = 0
(p − x1 ) + (p − x2 ) + ..... + (p − xn ) = 0
np − (x1 + x2 + .... + xn ) = 0
x1 + x2 + .... + xn
p=
n