Unit 1 - Practice Quiz

INT255 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 In the context of a typical machine learning dataset, what does a single row of a data matrix usually represent?

Vectors, matrices, and tensors in machine learning Easy
A. A single data point or sample
B. A single feature for all samples
C. The entire dataset
D. The model's hyperparameters

2 Which of these data types would be best represented by a 3rd-order tensor?

Vectors, matrices, and tensors in machine learning Easy
A. A list of housing prices
B. A grayscale image (height, width)
C. A color image (height, width, color channels)
D. A user's age

3 What is the primary difference between a vector and a scalar?

Vectors, matrices, and tensors in machine learning Easy
A. A vector has both magnitude and direction, while a scalar has only magnitude.
B. A vector has a single element, while a scalar has multiple elements.
C. A vector can only contain integers, while a scalar can be any number.
D. A vector is a matrix, while a scalar is a single number.

4 If a matrix has dimensions , what does represent?

Vectors, matrices, and tensors in machine learning Easy
A. The number of columns
B. The number of cells
C. The determinant of the matrix
D. The number of rows

5 In machine learning, a vector of feature values for a single data point is often called a...

Vectors, matrices, and tensors in machine learning Easy
A. Loss function
B. Weight matrix
C. Scalar tensor
D. Feature vector

6 Which of the following is a necessary condition for a set of vectors to be considered a vector space?

Vector spaces and subspaces Easy
A. It must contain at least 100 vectors.
B. All vectors in the space must have a norm of 1.
C. The space must be two-dimensional.
D. It must be closed under vector addition and scalar multiplication.

7 What is the zero vector in the vector space ?

Vector spaces and subspaces Easy
A. [0, 0, 0]
B. 0
C. [0]
D. [1, 1, 1]

8 The number of vectors in a basis for a vector space is called the...?

Vector spaces and subspaces Easy
A. Dimension of the space
B. Subspace of the space
C. Span of the space
D. Norm of the space

9 Which of the following sets forms a subspace of ?

Vector spaces and subspaces Easy
A. A line that does not pass through the origin
B. A line passing through the origin (0, 0)
C. A single point at (1, 1)
D. The first quadrant (where x >= 0 and y >= 0)

10 What does it mean for a set of vectors to 'span' a vector space?

Vector spaces and subspaces Easy
A. The set has more vectors than the dimension of the space.
B. All vectors in the set are perpendicular to each other.
C. Any vector in the space can be written as a linear combination of the vectors in the set.
D. The set contains the zero vector.

11 What is the L2 norm (Euclidean norm) of the vector ?

Norms (L1, L2) and projections Easy
A. 7
B. 1
C. 25
D. 5

12 Which norm is also known as the 'Manhattan distance' or 'taxicab norm'?

Norms (L1, L2) and projections Easy
A. L2 Norm
B. L1 Norm
C. Infinity Norm
D. Frobenius Norm

13 What is the L1 norm of the vector ?

Norms (L1, L2) and projections Easy
A. 4
B. 14
C. 0
D. 6

14 In machine learning, using the L1 norm in regularization (like in LASSO regression) often leads to what kind of models?

Norms (L1, L2) and projections Easy
A. Complex non-linear models
B. Models with very large weights
C. Dense models (no zero weights)
D. Sparse models (many zero weights)

15 Geometrically, the L2 norm of a vector represents its...

Norms (L1, L2) and projections Easy
A. Sum of its components
B. Angle with the x-axis
C. Length from the origin in Euclidean space
D. Projection onto the y-axis

16 Multiplying a vector by a matrix is an example of a...

Linear operators and transformations in ML Easy
A. Non-linear transformation
B. Linear transformation
C. Scalar multiplication
D. Vector normalization

17 Which of the following matrices represents a scaling transformation that doubles the size of a 2D vector along both the x and y axes?

Linear operators and transformations in ML Easy
A.
B.
C.
D.

18 What is the result of applying the identity matrix to any vector ?

Linear operators and transformations in ML Easy
A. The vector itself
B. The zero vector
C. A vector with all components equal to 1
D. The vector is rotated by 90 degrees

19 A function is a linear transformation if it satisfies for any vectors and scalars . What property does this demonstrate?

Linear operators and transformations in ML Easy
A. Superposition (Additivity and Homogeneity)
B. Invertibility
C. Orthogonality
D. Normalization

20 In the context of machine learning, the weights of a single layer in a neural network can often be represented by a:

Linear operators and transformations in ML Easy
A. Scalar
B. Single vector
C. Matrix
D. Norm

21 A feed-forward neural network layer processes a batch of 64 data points, where each data point is a vector of 128 features. The layer's weight matrix transforms this input to an output where each data point is a vector of 32 features. Assuming the transformation is computed as , what are the dimensions of the weight matrix ?

Vectors, matrices, and tensors in machine learning Medium
A.
B.
C.
D.

22 For a computer vision task, you have a dataset of 1,000 color images, each with a resolution of pixels. The images use the RGB color model. What is the most appropriate shape for a tensor representing this entire dataset, following the common 'channels-last' convention (batch, height, width, channels)?

Vectors, matrices, and tensors in machine learning Medium
A.
B.
C.
D.

23 Given two non-zero column vectors and , what is the rank of the matrix formed by their outer product, ?

Vectors, matrices, and tensors in machine learning Medium
A.
B. 1
C. 0
D.

24 The Hadamard product (element-wise product) is used in various ML algorithms, such as in the gates of an LSTM cell. Given matrices and , what is their Hadamard product ?

Vectors, matrices, and tensors in machine learning Medium
A.
B.
C.
D. This operation is undefined

25 In a linear regression model, the normal equation to find the optimal coefficients is . If you have a dataset with 500 samples () and 10 features (), what are the dimensions of the matrix ?

Vectors, matrices, and tensors in machine learning Medium
A.
B.
C.
D.

26 Which of the following sets is a subspace of ?

Vector spaces and subspaces Medium
A.
B.
C.
D.

27 Consider the vectors and in . What geometric object does the span of these two vectors, , represent?

Vector spaces and subspaces Medium
A. A line through the origin
B. The origin point only
C. All of
D. A plane through the origin

28 In machine learning, feature spaces are represented as vector spaces. Which of the following sets of vectors cannot form a basis for the vector space ?

Vector spaces and subspaces Medium
A.
B.
C.
D.

29 In a linear regression model represented by the equation , the vector of predicted values, , is calculated as where is the estimated coefficient vector. The vector must belong to which fundamental subspace?

Vector spaces and subspaces Medium
A. The row space of
B. The null space of
C. The column space of
D. The null space of

30 A linear transformation used for dimensionality reduction maps data from to and is represented by a matrix . If the dimension of the column space (rank) of is 3, what is the dimension of the null space (kernel) of this transformation?

Vector spaces and subspaces Medium
A. 1
B. 6
C. 4
D. 7

31 Lasso regression uses L1 regularization. A key feature of Lasso is that it can produce sparse models, where some coefficients become exactly zero. What is the geometric reason for this?

Norms (L1, L2) and projections Medium
A. The L1 norm constraint is a hypersphere, which is smooth.
B. The L1 norm constraint is a diamond or cross-polytope, whose sharp corners align with the axes, making intersections on an axis (where a coefficient is zero) more probable.
C. The L1 norm constraint is a hypercube, which tends to intersect error function level curves at the axes.
D. The L1 norm is always smaller than the L2 norm, forcing coefficients to zero.

32 A feature vector in a machine learning model is given by . What are its Manhattan distance (L1 norm) and Euclidean distance (L2 norm) from the origin?

Norms (L1, L2) and projections Medium
A. L1 = 17, L2 = 13
B. L1 = 13, L2 = 17
C. L1 = 7, L2 = 169
D. L1 = 17, L2 =

33 In the Gram-Schmidt process, vector projection is a key step. What is the projection of vector onto vector ?

Norms (L1, L2) and projections Medium
A.
B.
C.
D.

34 Let be the projection of the true data vector onto the column space of a feature matrix . In linear regression, the residual vector is . What is the relationship between the residual vector and the column space of ?

Norms (L1, L2) and projections Medium
A. is orthogonal to the column space of
B. is parallel to
C. is always the zero vector
D. is in the column space of

35 In neural networks, the Frobenius norm is often used for weight decay, a form of regularization. Calculate the Frobenius norm of the weight matrix .

Norms (L1, L2) and projections Medium
A. 8
B.
C. 4
D. 50

36 A 2D dataset is transformed by first reflecting it across the y-axis and then rotating it 90 degrees clockwise. What single matrix represents this combined linear transformation?

Linear operators and transformations in ML Medium
A.
B.
C.
D.

37 In Principal Component Analysis (PCA), we compute the eigenvectors of the data's covariance matrix. What is the significance of the eigenvalues associated with these eigenvectors?

Linear operators and transformations in ML Medium
A. They are always equal to 1, indicating a change of basis.
B. They indicate the direction of maximum variance.
C. They measure the amount of variance in the data along the direction of the corresponding eigenvector.
D. They represent the new feature values for the transformed data.

38 For a given linear transformation represented by matrix , a non-zero vector is called an eigenvector if . What is the effect of the transformation on its eigenvector ?

Linear operators and transformations in ML Medium
A. It only scales the vector by the factor , without changing its direction.
B. It inverts the vector .
C. It projects the vector onto another space.
D. It rotates the vector by an angle determined by .

39 Singular Value Decomposition (SVD) factorizes a matrix into . It is widely used for dimensionality reduction. How is the best rank- approximation of (denoted ) constructed from its SVD components?

Linear operators and transformations in ML Medium
A. By averaging the first singular values.
B. By taking the first columns of and the first rows of only.
C. By keeping only the first rows of , , and .
D. By setting all but the largest singular values in to zero and reconstructing the matrix.

40 A 2D linear transformation is applied to a dataset, represented by the matrix . If this transformation is applied to a unit square (area = 1), what will be the area of the resulting parallelogram?

Linear operators and transformations in ML Medium
A. 5
B. 4
C. 3
D. 2

41 In a Convolutional Neural Network (CNN) processing a batch of RGB images, a 4th-order tensor is used. is batch size, is height, is width, and is channels. What is the interpretation of the slice ?

Vectors, matrices, and tensors in machine learning Hard
A. A single pixel at position (i, j) across all images in the batch.
B. The j-th color channel of the i-th image in the batch.
C. The entire batch of images for a single color channel j.
D. The i-th row of pixels across all images and all channels.

42 Consider the outer product of two non-zero vectors and , resulting in a matrix . What is the rank of matrix , and what does this imply about its column space, ?

Vectors, matrices, and tensors in machine learning Hard
A. Rank is 1. The column space is the line spanned by the vector .
B. Rank is . The column space is a subspace of .
C. Rank is 1. The column space is the line spanned by the vector .
D. Rank can be 0 or 1. If 1, the column space is spanned by and .

43 Let and be two distinct 2-dimensional subspaces of . What are the possible dimensions of their intersection, ?

Vector spaces and subspaces Hard
A. 0 or 1
B. Exactly 2
C. Exactly 1
D. 1 or 2

44 A linear transformation is represented by a matrix with SVD . What is the geometric interpretation of applying this transformation to the set of all unit vectors (a unit sphere) in ?

Linear operators and transformations in ML Hard
A. The result is a hyperellipse in whose principal axes are the columns of scaled by the singular values in .
B. The result is a rotated version of the unit sphere, defined by the rotation matrix .
C. The result is a unit sphere in .
D. The result is a hyperellipse in whose principal axes are the columns of scaled by the singular values in .

45 Given a vector and a subspace spanned by the orthonormal columns of a matrix (), the projection of onto is . What is the squared L2 norm of the residual vector, ?

Norms (L1, L2) and projections Hard
A.
B.
C.
D.

46 The column space of a matrix , denoted , and the null space of its transpose, , are fundamental subspaces. What is the relationship between these two subspaces in ?

Vector spaces and subspaces Hard
A. Their intersection is the zero vector, but they are not necessarily orthogonal complements.
B. is the orthogonal complement of .
C. and are the same subspace.
D. is a subset of .

47 In Support Vector Machines (SVMs), the kernel function allows computations in a high-dimensional feature space. A condition for a function to be a valid kernel is that the Gram matrix (where ) must be positive semi-definite for any set of inputs. Why is this property crucial?

Linear operators and transformations in ML Hard
A. It ensures that the mapping is linear.
B. It guarantees that the decision boundary will be a hyperplane.
C. It ensures the SVM dual optimization problem is convex, guaranteeing a unique global minimum.
D. It is required for the matrix to be invertible.

48 The optimization problem for Lasso regression is . If the matrix has orthonormal columns (i.e., ), what is the closed-form solution for the -th component of the optimal weight vector, ?

Norms (L1, L2) and projections Hard
A.
B.
C.
D.

49 A weight matrix in a neural network is updated via a rank-one update: , where and is a scalar. If is invertible, under what condition is guaranteed to be invertible according to the Sherman-Morrison formula?

Vectors, matrices, and tensors in machine learning Hard
A.
B. and must be linearly independent
C. must be symmetric positive definite
D. and are non-zero vectors

50 A 2D rotation by an angle is a linear transformation represented by the matrix . What are the eigenvalues of this matrix for a general ?

Linear operators and transformations in ML Hard
A. and
B. and
C. and
D. and

51 Consider the set . Is a subspace of , and why?

Vector spaces and subspaces Hard
A. No, because it is not closed under scalar multiplication.
B. No, because it does not contain the zero vector.
C. Yes, because it contains the zero vector and is closed under addition and scalar multiplication.
D. No, because it is not closed under vector addition.

52 A projection matrix projects vectors onto a subspace . Which of the following statements about is necessarily FALSE?

Norms (L1, L2) and projections Hard
A. If it's an orthogonal projection, is symmetric ()
B. is idempotent ()
C. is invertible (unless )
D. The eigenvalues of are only 0 or 1

53 The covariance matrix of a dataset is real and symmetric. It can be diagonalized by an orthogonal matrix as , where is a diagonal matrix of eigenvalues. In Principal Component Analysis (PCA), what does this transformation represent?

Linear operators and transformations in ML Hard
A. A linear regression fit to the data.
B. A projection of the data onto a random lower-dimensional subspace.
C. A normalization of the data so that each feature has zero mean and unit variance.
D. A change of basis to a new coordinate system where the axes are the principal components and the data is uncorrelated.

54 Two vectors (for ) are constructed such that their L2 norms are equal, . However, their L1 norms are at the theoretical extremes for a unit L2 vector: and . What is the structure of these vectors?

Norms (L1, L2) and projections Hard
A. This scenario is impossible as the L1 norm cannot exceed the L2 norm.
B. has entries of equal magnitude, and is a standard basis vector.
C. is a standard basis vector (e.g., ), and has entries of equal magnitude (e.g., ).
D. Both and are standard basis vectors.

55 In a linear regression model , where is the design matrix and are the weights, the vector of predicted values must lie in a specific subspace of . What is this subspace, and what is the geometric interpretation of the ordinary least squares (OLS) solution?

Vector spaces and subspaces Hard
A. The null space of . OLS finds the component of that is orthogonal to this subspace.
B. The entire space . OLS is only applicable if is already in the column space of .
C. The row space of . OLS finds the orthogonal projection of onto the row space.
D. The column space of . OLS finds the orthogonal projection of the true target vector onto this subspace.

56 From a geometric perspective, why does L1 regularization (Lasso) tend to produce sparse solutions (i.e., many zero weights), whereas L2 regularization (Ridge) does not?

Norms (L1, L2) and projections Hard
A. The L1 norm is non-differentiable everywhere, which causes optimization algorithms to set weights to zero.
B. The L2 norm ball is convex, while the L1 norm ball is not, forcing solutions to be on an axis.
C. The L1 norm penalizes large weights more heavily than the L2 norm, forcing them to become exactly zero.
D. The L1 norm ball is a hyperdiamond with sharp corners that are more likely to intersect the elliptical contours of the loss function, while the L2 norm ball is a smooth hypersphere.

57 A linear transformation is represented by a matrix which is not full rank. Let . Which statement accurately describes the geometry of this transformation?

Linear operators and transformations in ML Hard
A. The transformation is invertible.
B. The transformation collapses the entire input space into an -dimensional subspace of the output space .
C. The transformation maps to the entire output space .
D. The null space of the transformation is the zero vector only.

58 The trace of a square matrix, , is the sum of its diagonal elements. It is also equal to the sum of its eigenvalues. Which of the following trace properties is NOT always true for general matrices ?

Vectors, matrices, and tensors in machine learning Hard
A. (for A square, c scalar)
B.
C.
D. (for A, B square)

59 In Principal Component Analysis (PCA), the data is projected onto a subspace spanned by the eigenvectors corresponding to the largest eigenvalues of the covariance matrix. If the covariance matrix of a 3D dataset has eigenvalues with corresponding eigenvectors , what is the geometric interpretation of the subspace ?

Vector spaces and subspaces Hard
A. It is a 2D plane that minimizes the reconstruction error when measured with the L1 norm.
B. It is the 2D plane passing through the origin that captures the maximum variance in the data.
C. It is an arbitrary 2D subspace; any pair of eigenvectors could be chosen.
D. It is the line that captures the minimum variance in the data.

60 A single-channel (grayscale) image is represented by a matrix . A transformation is applied such that the new value of each pixel is a weighted average of itself and its four cardinal neighbors: . This operation is a convolution. How can this entire transformation be expressed using matrix multiplication on a vectorized version of the image, ?

Vectors, matrices, and tensors in machine learning Hard
A. As an element-wise product with a weight matrix, .
B. This operation cannot be represented as a single matrix multiplication.
C. As a standard matrix multiplication, , for some small matrix .
D. As a multiplication by a large, sparse Toeplitz matrix, .