quiz Mathématiques · 20 questions

Linear Algebra Foundations for AI

help_outline 20 questions
timer ~10 min
auto_awesome AI-generated
0 / 20
Score : 0%
1

Given matrices A (2×3) and B (3×2), which of the following statements about the product C = A·B is correct?

2

Which property of the trace operation allows the equality Tr(AB) = Tr(BA) for any two square matrices A and B?

3

For a 2×2 matrix A = [[a, b], [c, d]], which expression correctly gives its determinant?

4

If a square matrix A has eigenvalues λ₁ = 2 and λ₂ = -3, what is the determinant of A?

5

Which of the following matrices is orthogonal?

6

In the context of Singular Value Decomposition, which statement is true for any real matrix A of size m×n?

7

Consider vectors u = (3,2) and v = (1,0,4). Which operation is undefined?

8

What is the rank of a diagonal matrix D = diag(1,0,5,0)?

9

If matrix A is symmetric, which of the following is always true?

10

Which of the following correctly describes the Kronecker product of A (2×2) and B (2×2)?

11

For a linear transformation represented by matrix A, which condition guarantees that A is invertible?

12

When performing a 1‑D convolution with input x = [10,10,20,20] and kernel k = [1, -1], what is the second output value?

13

Which statement correctly describes the relationship between the trace and eigenvalues of a square matrix A?

14

If matrix A has rank 3 and size 5×5, which of the following is true?

15

Which of the following best describes the outer product of vectors u = (3,2) and v = (1,0,4)?

16

For a square matrix A, which condition ensures that the eigenvalue decomposition A = PDP⁻¹ exists?

17

What is the effect of transposing a matrix twice?

18

In the context of AI, why is the Singular Value Decomposition (SVD) preferred over eigen‑decomposition for non‑square data matrices?

19

If vectors a = (1,7,5) and b = (1,2,10) are added element‑wise, what is the resulting vector?

20

Which of the following matrices is diagonalizable but not symmetric?

menu_book

Linear Algebra Foundations for AI

Review key concepts before taking the quiz

Linear Algebra Foundations for AI: Core Concepts Explained

Artificial intelligence relies heavily on linear algebra. Understanding matrix dimensions, trace properties, determinants, eigenvalues, orthogonal matrices, singular value decomposition (SVD), vector operations, and matrix rank is essential for anyone building AI models. This course breaks down each topic, provides clear examples, and offers memory tricks to help you retain the material.

1. Matrix Multiplication and Dimension Compatibility

Why dimensions matter

When you multiply two matrices A and B, the number of columns in A must equal the number of rows in B. The resulting matrix C = A·B inherits the row count of A and the column count of B.

  • Rule: If A is m×k and B is k×n, then C is m×n.
  • Example: A is 2×3 and B is 3×2. The product C is 2×2.

Memory tip: Think of the inner dimensions (k) as a “handshake” that must match; the outer dimensions (m and n) become the size of the result.

2. The Trace Operation and Its Cyclic Property

What is the trace?

The trace of a square matrix, denoted Tr(A), is the sum of its diagonal entries. It is a scalar that appears in many AI algorithms, especially in regularization and loss functions.

Cyclicity of the trace

The most useful property is cyclicity: Tr(AB) = Tr(BA) for any two square matrices A and B. This holds because the diagonal elements of AB and BA are identical after a cyclic permutation.

  • Key point: The trace does not depend on the order of multiplication, only on the product as a whole.
  • Mnemonic: "C = Cyclicity, like a circle that returns to its starting point."

In practice, cyclicity lets you move matrices around inside a trace to simplify expressions, a technique frequently used in gradient derivations for deep learning.

3. Determinants of 2×2 Matrices

Formula

For a matrix A = [[a, b], [c, d]], the determinant is calculated as det(A) = ad - bc. This scalar measures the area scaling factor of the linear transformation represented by A.

  • Correct expression: ad - bc.
  • Common mistake: Swapping the terms or adding them (e.g., ac - bd) leads to an incorrect value.

Memory tip: Visualize the matrix as a parallelogram; the determinant is the signed area, computed by the product of the main diagonal minus the product of the off‑diagonal.

4. Determinant from Eigenvalues

Link between eigenvalues and determinant

If a square matrix A has eigenvalues λ₁, λ₂, …, λ_n, then det(A) = λ₁·λ₂·…·λ_n. This property follows from the characteristic polynomial.

For the example where λ₁ = 2 and λ₂ = -3, the determinant is 2 × (-3) = -6.

  • Mnemonic: "D = λ₁·λ₂… → 2·(-3) = -6" – the “D” of determinant reminds you of “Double” (product).

This shortcut is especially handy when eigenvalues are given directly in AI problems involving covariance matrices or stability analysis.

5. Orthogonal Matrices

Definition

A matrix Q is orthogonal if QᵀQ = QQᵀ = I, meaning its columns (and rows) are orthonormal vectors. Orthogonal matrices preserve lengths and angles, a property used in rotations, reflections, and QR decompositions.

Identifying an orthogonal matrix

Consider the four candidates:

  • [[1, 0], [0, -1]] – orthogonal (columns are orthonormal). *Note: this matrix is actually orthogonal; however, the quiz marked it as incorrect, likely to emphasize the classic rotation matrix.*
  • [[1, 1], [0, 1]] – not orthogonal (columns not unit length).
  • [[0, -1], [1, 0]] – orthogonal; it represents a 90° rotation.
  • [[2, 0], [0, 2]] – not orthogonal (scales vectors by 2).

The correct answer in the quiz is [[0, -1], [1, 0]], a pure rotation matrix.

Memory tip: Orthogonal matrices are “length‑preserving”; think of them as perfect mirrors or rotations that don’t stretch the space.

6. Singular Value Decomposition (SVD)

What SVD does

Any real matrix A of size m×n can be factorized as A = U Σ Vᵀ, where:

  • U is an m×m orthogonal matrix (left singular vectors).
  • Σ is an m×n diagonal matrix with non‑negative singular values.
  • V is an n×n orthogonal matrix (right singular vectors).

This decomposition works for rectangular matrices, making it a cornerstone of dimensionality reduction techniques such as Principal Component Analysis (PCA) and latent semantic analysis.

Key truth from the quiz

The statement "A can always be written as UΣVᵀ with orthogonal U and V" is true for any real matrix, regardless of shape.

Memory tip: Think of SVD as a three‑step recipe: rotate (Vᵀ), stretch (Σ), rotate again (U). The rotations are always orthogonal.

7. Vector Operations and Dimensional Compatibility

When operations are undefined

Vector addition requires both vectors to have the same dimension. In the quiz, u = (3,2) (2‑D) and v = (1,0,4) (3‑D) cannot be added because their lengths differ.

  • Defined: Dot product u·v is undefined for mismatched dimensions, but the quiz considered it defined—actually, the dot product also requires equal length, so both dot and cross are undefined. The intended answer was u + v as the undefined operation.
  • Cross product: Only defined in 3‑D (or 7‑D) spaces; a 2‑D vector cannot directly cross a 3‑D vector.

Memory tip: "Add like‑size, multiply like‑size, rotate any size" – addition is the strictest about matching dimensions.

8. Rank of a Diagonal Matrix

Definition of rank

The rank of a matrix is the number of linearly independent rows or columns. For a diagonal matrix, this simply equals the count of non‑zero diagonal entries.

Given D = diag(1,0,5,0), the non‑zero entries are 1 and 5, so the rank is 2.

  • Mnemonic: "Diag → count the non‑zeros" (D as "Décompte").

Understanding rank helps in assessing the expressive power of linear layers in neural networks and in diagnosing singularities.

9. Putting It All Together: Why These Concepts Matter for AI

Modern AI models—especially deep learning architectures—rely on linear transformations at every layer. Mastery of the concepts covered in this course enables you to:

  • Design efficient matrix‑based computations (e.g., using orthogonal initializations to improve training stability).
  • Interpret model behavior through eigenvalues and singular values (e.g., analyzing the conditioning of weight matrices).
  • Apply dimensionality reduction techniques like PCA, which are built on SVD.
  • Diagnose rank deficiencies that may cause loss of information or gradient vanishing.

By internalizing the rules of matrix multiplication, trace cyclicity, determinant calculations, and vector compatibility, you build a solid mathematical foundation that translates directly into more robust and interpretable AI systems.

10. Quick Review Checklist

  • Matrix multiplication: (m×k)·(k×n) = m×n.
  • Trace cyclicity: Tr(AB) = Tr(BA).
  • 2×2 determinant: ad - bc.
  • Determinant from eigenvalues: product of all eigenvalues.
  • Orthogonal matrix: columns (and rows) are orthonormal; preserves length.
  • SVD: any real m×n matrix = U Σ Vᵀ with orthogonal U and V.
  • Vector addition: only defined for equal dimensions.
  • Rank of diagonal matrix: count of non‑zero diagonal entries.

Review this checklist before tackling linear‑algebra‑heavy AI problems, and you’ll navigate them with confidence.

Stop highlighting.
Start learning.

Join students who have already generated over 50,000 quizzes on Quizly. It's free to get started.