MLF Q2 Practice Problems
MLF Q2 Practice Problems
Quiz 2 (Week1-6)
(selected questions from
AQ, PA, GA and SWI)
Compiled by Venu Madhav A
Note: 1. Solutions provided are may vary, are provided to best of my knowledge
2. Revision Timeline: Week1: 4:50 Week2: 22:22 Week3: 1:07:25 1:30:03 Week4:
2:13:18
Week1:
Q1) Which of the following is true about machine learning?
1(355%2 = 1) = 1
1(788%2 = 1) = 0
1(355%2 = 0) = 1
1(788%2 = 0) = 1
The reconstruction loss of the encoder decoder pair is the mean of the squared
distance between the actual input and reconstructed input.
Compress a data point x = [1,2,3,4]ᵀ to obtain u and reconstruct x' from u. How
close is the reconstruction to the original?________________________
Q6) f(x₁, x₂, x₃) = (x₁+2 x₂)/3is used as encoder function and g(u)=[u,2u,3u] is used
as decoder function for dimensionality reduction of following data set.
Give the reconstruction error for this encoder decoder pair. The reconstruction
error is the mean of the squared distance between actual input and
reconstructed input.____________________
1 1
2 4
3 1
4 4
1 4
2 2
3 3
4 1
1 1
1 1
1 1
When a function that outputs the sign(x₁ - 3x₂) of is used as a classification model
to fit the data set, what is the resultant loss?__________________
What will be the amount of loss when the functions g = 3x₁ + 1 h = 2x₁ + 2 are
used to represent the regression line. Consider the average squared error as a
loss function.
Q14) The mean squared error loss obtained while fitting this function on the data
set is_________________
Q15) Look at the graph below and answer the following questions
Which of these regression lines is the best one (in the MSE sense)
a. y = x+1
b. y = 0.8x+0.8
Q16) Consider a line with zero slope and y-intercept of 2. The sum of squared
residuals obtained when this line is used to fit the following data set is
_________________
Q17) P(X) is obtained by the density estimation algorithm for the data points
x₁=2.5, x₂=1, x₃=3, x₄=4.5, x₅=4.95
Solutions:
1. All of these
2. A,b,d
3. C
4. 3,0.66
5. 25
6. 8.63
7. 4.628
8. 0.166, 4.98
9. B
10. -
11. 0.166
12. A
13. 2.964, 11.924
14. 8 to 9.5
15. B
16. 6
17. 0.698
Week - 2 (AQs)
Q1) If the vectors u and v belong to a vector space V, then,
A. Domain is R
B. Co-domain is R
C. Both domain and co-domain are R
A. perpendicular to f
B. parallel to f
C. tangent to f at the point (v,f(v))
Q5) Which of the following vectors is/are perpendicular to any given vector?
A. [1 1 1]
B. [0 1 1]
C. [1 0 1]
D. [0 0 0]
E. [-1 0 1]
Q6) Which of the following represents a multivariate function?
A. f:R→R
B. f:Rᵈ→R
C. f:R→Rᵈ
D. f:R→R×R
Q9) The approximation of f(x₁, x₂) = x₁² + x₂² around (3,1) is given by
A. 6x₂ - 2x₁ - 10
B. 6x₂ + 2x₁ - 10
C. 6x₂ - 2x₁ + 10
D. 6x₂ + 2x₁ + 10
Q10) For the function f(x) = x² - x
Solutions:
1. A
2. B
3. B,c,d
4. C
5. D
6. B
7. C
8. B
9. B
10. b
Week - 2 (PAs)
Q1) sin(x)/x is continuous at x=0
A. True
B. False
Q2) Consider two d-dimensional vectors x and y and the following terms:
A. 1+x
B. 1-x
C. x
D. 1-x
A. True
B. False
Q5) Which of the following is the best approximation of e^{0.019} (Use linear
approximation around 0).
A. 1
B. 0
C. 0.019
D. 1.019
Q7) The directional derivative of f(x,y,z)=x²+3y+z² at (1, 2, 1) along the unit vector
in the direction of [1, -2, 1] is (correct upto three decimal
places)_____________________________
Q8) Find the direction of steepest ascent for the function x²+y³+z⁴ at point (1, 1,
1) _______________ ?
Q9) The directional derivative of f[x,y,z]=x+y+z at point [-1, 1, -1] along the unit
vector in the direction of [1, -1, 1] is (correct upto three decimal places)
_______________________
Solutions:
1. B
2. D
3. C
4. A
5. D
6. B
7. -0.856 to -0.775
8. 1/(sqrt(29) [2 3 4]
9. 0.548 to 0.605
10. 1 + x/2 -⅛ (x^2) +1/16(x^3)
Week 2: (GAs)
A. 1/(x-1)
B. (x²-1)/(x-1)
C. sign(x-2)
D. sin(x)
Q2) Regarding a d-dimensional vector x, which of the following four options is not
equivalent to the rest two options?
A. xᵀx
B. ||x²||
C. xxᵀ
Q3) For two vectors a and b, which of the following is true as per
Cauchy-Schwarz inequality?
A. (i) only
B. (ii) only
C. (iii) only
D. (iv) only
E. (i) and (ii)
F. (iii) and (iv)
Q4) Which of the following is the equation of the line passing through [7,8,6] in
the direction of vector [1, 2, 3]?
A. [1,2,3]+α[−6,−6,3]
B. [7,8,9]+α[−6,−6,3]
C. [1,2,3]+α[6,6,3]
D. [7,8,6]+α[6,6,3]
E. [7,8,6]+α[1,2,3]
F. [1,2,3]+α[7,8,6]
Q5)_______________________________________ ?
Q6) _____________________________________________ ?
Q10) Without computing, tell whether x.y = ||x|| ||y|| , if x = [2, 5, 6] and y = [16, 40,
48]
A. Yes
B. No
Solutions:
1. D
2. C
3. E
4. E
5. 1.011
6. 1.975
7. 0.775 to 0.856
8. 1/sqrt(20) [2 0 4]
9. 13.41, 14.75, (2,1), (12/15, 9/15), 0
10. A
Week -2: Others
A. 1 is a local maximum.
B. −50 is the global minimum.
C. 0 is the global maximum.
D. 50 is the global minimum.
Q4) Find out the directional derivative of the function f(x,y)=x²y³ at (1,2), in the
direction of the vector (0,2) ___________________________
Q6) Determine the equation of the tangent line at x=0.5 and using it estimate the
value of g(1.5) ____________
Q8) For the function below at (1,1) the first element and second element of the
gradient of g(x,y) are _____________ &_____________________
Solutions:
1. A,c
2. A,b
3. B,d,e
4. 12
5. x+y/2+¼
6. 3.51
7. Range -4,-3
8. Range 1,2; range -0.6, -0.5
9. -41.2
10. -3
Week 3: (AQs)
A. True
B. False
Q2) If a n×n matrix A is invertible, then which of the following is/are false?
A. C(A) is Rⁿ
B. Ax=b has infinite solutions.
C. Ax=b has a unique solution.
D. N(A) only contains zero vector.
A. C(A)⊥N(A)
B. R(A)⊥N(A)
C. C(A)⊥N(Aᵀ )
D. R(A)⊥N(Aᵀ )
A. b∈R(A)
B. b∉R(A)
C. b∈C(A)
D. b∉C(A)
1. P²=P
2. P is symmetric
3. P² ≠ P
4. P is not symmetric
A. 1 only
B. 1 and 2
C. 2 only
D. 1, 2 and 3
E. 3 and 4
A. b∈ C(A)
B. b∈ R(A)
C. b∈ N(A)
D. b∈ N(Aᵀ)
A. b∈ C(A)
B. b∈ R(A)
C. b∈ N(A)
D. b∈ N(Aᵀ)
Q10) If Aθ=b has a solution then,
A. ∣∣Aθ−b∣∣² = 1
B. ∣∣Aθ−b∣∣² = 0
C. ∣∣Aθ−b∣∣² < 1
D. ∣∣Aθ−b∣∣² > 1
Solutions:
1. B
2. B
3. B,c
4. D
5. B
6. B
7. C
8. A
9. D
10. b
Week 3: (PAs)
Solutions:
1. 2
2. 3
3. 2
4. 3
5. Span of [1 0 9 2]ᵀ, [0 1 -3 1]ᵀ
6. 3x3 matrix with all elements with ⅓
7. 1/14 [3 -6 -9]
Week 3: (GAs)
Q5) 5 peaches and 6 oranges cost 150 rupees. 10 peaches and 12 oranges cost
300 rupees. Form a matrix out of the given information and its rank is
_________________
Q6) Which of the following would be the smallest subspace containing the first
quadrant of the space R² is
Q7) Consider a set of 3 paired observations on ((1,6), (-1,3), (3,15))For the closest
line b to go through these points, which of the following is the least squares
solution ?
A. (3,4)
B. (4,3)
C. (5,3)
D. (3,5)
Solutions:
2.
3.
4.
5. 1
6. D
7. D
Week 3: (Others)
Q1) Consider two lines: (a) A line with zero slope and y-intercept of 2.5. (b) A line
with zero slope and y-intercept of 3.5. Which of these lines give the minimal error
to fit the data points?
Q2) Find the projection matrix for 𝑎 = [−1 3 −2 1]ᵀ and use it to obtain the
projection of
a) C(A) is a line
b) C(A) is a plane
c) C(B) is a line
d) C(B) is a plane
Q7) What is the reduced row echelon form of the matrix A ________________?
Q8) The length of error vector obtained by projecting u= [ -1 4 2 ]ᵀ onto v=[ 1 2 3
]ᵀ is __________
Q9) A vector x=[a,b] has dot products x⋅r=1 and x⋅s=0 with two given vectors
r=[2,−1] and s=[−1,2] a = ____________ b = ______________
Solutions:
1. A
2. 1.652
3. Yes
4. 2
5. 1
6. 2
7. E
8. 3.47
9. 0.33, 0.66
10. 3
Week 4: (Aqs)
Q1) For a linear regression problem Aθ=Y, with A, Y as in lecture notes, which of
the following is the correct equation of the loss function?
A. L(θ)=(½) (Aθ−Y)(Aθ−Y)ᵀ
B. L(θ)=(½) (Aθ−Y)ᵀ(Aθ−Y)
C. L(θ)=(½) (Aθ−Y)²
A. True
B. False
Q3) For a matrix A with eigenvalue λ, the corresponding eigenvector lies in the
A. null space of A
B. null space of λI
C. null space of A−λI
D. null space of Aλ
Q4) Consider A=aI+B where A and B are matrices and a is a scalar. (I is the identity
matrix). Which of the following is true?
A. an identity matrix
B. a singular matrix
C. a non singular matrix
D. a zero matrix
Q6) All matrices are diagonalizable.
A. True
B. False
Q7) If the eigenvalues of a matrix are distinct, then its eigenvectors are linearly
independent.
A. True
B. False
A. True
B. False
Q10) Suppose that A and P are 2×2 matrices and P is an invertible matrix.
A. 1
B. 2
C. 3
D. 4
Solution:
1. B
2. B
3. C
4. C
5. C
6. B
7. A
8. B
9. 1+sqrt(5)/2, 1-sqrt(5)/2
10. B,c (replace 1 with 0 in the matrix in the question?)
Week 4: (PAs)
A. 0
B. 1
C. -1
A. -1, 2 and -3
B. 1, 4 and 9
C. -1, -4 and -9
D. 1, -2 and 3
Q4) The 90th term of Fibonacci sequence is approximately given
by_________________
1. A can shrink x
2. A can stretch x
3. A can change the basis of x
4. A does not change the basis of x
A. 1, 2, 3 and 4
B. 1, 2 and 3
C. 1, 2 and 4
D. 2, 3 and 4
Q6) If A is a real symmetric n×n matrix, then which of the following is/are true?
A. A is orthogonally diagonalizable.
B. Eigenvalues of A are real.
C. Eigenvectors corresponding to different eigenvalues are independent.
D. All of these
1. 1 is an eigen value of A
1. −1 is an eigen value of A
Which of the above statements are always true?
A. only 1
B. only 2
C. both 1 and 2
D. neither 1 nor 2
Q10) The best second degree polynomial that fits the data set is _______________
Solutions:
1. C
2. 2+sqrt(5), 2-sqrt(5)
3. B
4. 1/sqrt(5) (1+sqrt(5)/2)^90
5. C
6. D
7. 5, -1
8. -
9. A
10. -
Week 4: (GAs)
A. 0
B. 1
C. -1
Q4) Let A be an n×n matrix. Which of the following statements is/are false?
Solutions:
1. A
2. 2+sqrt(3), 2-sqrt(3)
3. 1/sqrt(5) (1+sqrt(5)/2)^110
4. B
5. 1,9,16
6. -0.316x^2+1.56x
Week 4: (Others)
Q3) The eigenvectors of the below matrix, are written in the form [1 a]ᵀ and [1 b]ᵀ
what is the value of a+b ____________
Q4) What is the value of x, if the below matrix is orthogonal _____________
Q5) Let A be the 2X2 matrix with elements a11 = a12 = a21 = 1 and a22 = -1, then
the eigenvalues of A¹⁸ are? __________________
Q6) The value of p such that the vector [1 2 3]ᵀ is eigenvector for the below
matrix:________
Q7) The maximum value of ‘a’ such that the below matrix, has three linearly
independent real eigenvectors is _____________
Q8) In the matrix equation Px=q, which of the following is a necessary condition
for the existence of at least one solution for the unknown vector x.
A) Augmented matrix [Pq] must have the same rank as matrix P.
B) Vector q must have only non zero elements.
C) Matrix P must be singular.
D) Matrix P must be square.
Q9) Consider the following system of equations in three variables x,y and z
2x-y+3z=1
3x-2y+5z=2
-x-4y+z=3
The system of equations has
A. Unique solution
B. Infinitely many solutions
C. No solution
D. none of the above
Q10) For a matrix given below, the eigen value corresponding to eigen vector [101
101]ᵀ is ______
Solutions:
1. 3
2. 4
3. 0.5
4. -⅘
5. 2^9
6. 17
7. 0.1911
8. -
9. Unique
10. 6
11. -1+3i, -1-3i
Week 5 (AQs):
Q1)The statement that the inner product of two complex vectors is always
commutative is
A. True
B. False
Q3) Which of the following properties are correct for complex vectors x and y ?
(Note: (i) c is a complex number. (ii) x⋅y denotes the inner product between
vectors x and y.)
1. x⋅y=y⋅x
2. x⋅y=conjugate(y⋅x)
3. x⋅(cy)=c(x⋅y)
4. (cx)⋅y=c(x⋅y)
A. 1 and 3
B. 1, 3 and 4
C. 2, 3 and 4
D. 2 and 3
A. transpose of A
B. transpose of conjugate of A
C. conjugate of transpose of A
D. conjugate of A
Q5) Hermitian matrices are orthogonally diagonalizable if their eigenvalues are
distinct.
A. True
B. False
A. always real
B. always irrational
C. always rational
D. always complex
A. U* is unitary.
B. UU*=I
C. The columns of U form an orthonormal set.
D. All of these.
A. orthonormal
B. orthogonal
C. of unit length
Q10) Every unitary matrix is a Hermitian matrix.
A. True
B. False
A. λ=1
B. ∣λ∣=1
C. λ=0
D. ∣λ∣≥1
Q12) For a ________ matrix A, we can find a _________ matrix B such that A=BΛB*
where Λ is a diagonal matrix with eigenvalues of A.
A. unitary, unitary
B. Hermitian, Hermitian
C. unitary, Hermitian
D. Hermitian, unitary
A. unitary
B. orthogonal
C. real and symmetric
D. diagonal
Q17) Which of the following statements about matrix decomposition is/are true?
1. Eigendecomposition exists only for real symmetric matrix
2. Any matrix can be factored using Singular Value Decomposition
A. only 1
B. only 2
C. 1 and 2
D. None
A. True
B. False
Solutions:
1. B
2. A,D
3. C
4. B,C
5. A
6. A
7. B,D
8. D
9. B
10. B
11. B
12. D
13. C
14. Mxm, nxn, mxn
15. C,D
16. C
17. B
18. D
19. C
20. B
Week 5 (PAs):
A. 4.69
B. 20
C. 4.47
D. 22
A. True
B. False
Q8) Let U and V be two symmetric matrices. Consider the following statements:
1. UV
2. UV is symmetric.
3. U+V
4. U+V is symmetric.
Then,
Solutions:
1. D
2. A
3.
4. E
5.
6.
7. 1,3
8. C
9. 2-2i
10.
Week5 (GAs):
1. UV
2. UV is always unitary.
3. U+V
4. U+V is always unitary.
A. True if DDᵀ=I
B. False
C. True if DD⁻¹ =I
Q10) The inner product of two distinct vectors x and y that are from C¹⁰⁰is
0.8−0.37i.The vector x is scaled by a scalar 1−2i to obtain a new vector z, then
the inner product between z and y is _______
Solutions:
1.
2.
3.
4. A,B,C,D
5. D
6. C,D
7. B
8.
9. A
10. 1.54+1.23i
Week 5(SWI):
Q1) The Length of a complex vector and its conjugate remains the same.
A. True
B. False
Q5) Find the unit vector that points in the opposite direction of the vector x
A. It is a stationary point.
B. The second order partial derivatives are always less than 0.
C. The determinant of the Hessian matrix is negative.
D. None of these
Q2)
Q3) Which of the following is a stationary point for the function f(x,y) = ax^2 +
2bxy + cy^2, where a,b,c are positive integers?
A. Point (1,0)
B. Point (1,1)
C. Point (0,0)
D. None of these
Q4) For a positive definite matrix A, which of the following is/are valid?
A. 1 and 2
B. 2 and 3
C. 1, 2 and 3
D. only 2
Q7) An n×n matrix A has n distinct eigenvalues. Which of the following could be
valid statements about A.
A. A is diagonalizable.
B. A has linearly independent eigenvectors say x₁, x₂, …..xn
C. Eigenvector matrix X = [ x₁, x₂, …..xn ] is an invertible matrix
D. None of these.
Q8) Given A = MCM⁻¹ λ and x are the eigenvalue and the corresponding
eigenvector of C respectively, which of the following are true statements about A?
Q12)
Solutions:
1. A,C
2. A,D
3. C
4. B,C,D
5.
6. C
7. A,B,C
8. B,D
9.
10. , 0.33
11.
12.
Week 6 (PAs):
Q1) Given matrix A is
A. positive definite
B. positive semi-definite
C. negative definite
D. negative semi-definite
Q4) A matrix 2x2 A has determinant 8 and trace 6. Which of the following are true
about the matrix?
A. A is positive definite.
B. A is positive semi-definite.
C. A is neither positive definite nor positive semi-definite.
D. Can not be determined
2.
3. C
4. A
5.
6.
7. 4,0
8.
9.
10. 2
Week 6 (GAs):
Q1) For the given data below:
Mean =___________
Covariance matrix = ___________
Eigenvalues of C = ___________
Eigenvectors matrix of C = ___________
Q2) For the above data (Q1) if x1,x2 and x3 are projected onto the one dimensional space
using PCA as points as z1, z2 and z3 then z1, z2 and z3 = ______________
Q3) For the above data set (Q1) if the approximation error J is given by:
A. positive definite
B. positive semi-definite
C. negative definite
D. negative semi-definite
Solutions:
1. , , 1.34 0 0,
2.
3. 3
4. A
Week 6 (SWI):
Q1) For the following data points:
Mean = ________
Covariance Matrix = __________
Eigen values for C = ____________
Eigenvectors for C = _________
Transformed data points for one dimensional PCA = ___________
Reconstruction error for one dimensional PCA = _________
Mean = ________
Covariance Matrix = __________
Eigen values for C = ____________
Eigenvectors for C = _________
Transformed data points for one dimensional PCA = ___________
Reconstruction error for one dimensional PCA = _________
Q3) Is A negative semi-definite ?
A. True
B. False
Q4) Is A negative definite?
A. True
B. False
Q5) Is A indefinite?
A. True
B. False
A. Maxima
B. Minima
C. Saddle point
D. Cannot be determined
A. Maxima
B. Minima
C. Saddle point
D. Cannot be determined
Q8) Stationary point is for following function:
f(x,y) = 2xy
A. Maxima
B. Minima
C. Saddle point
D. Cannot be determined
Q9) Stationary point is for following function is ________
Solutions:
, ,3
3. A
4. A
5. A
6. C
7. A
8. -
9. (1,1)
10. (0,0)