Linear Algebra: Engaging Exercises with Comprehensive Solutions

Renda Zhang
10 min readJan 1, 2024

--

Section 1: Vector Basics

1. A vector can be represented as:

A) An ordered set of numbers

B) A mathematical equation

C) An unordered set of numbers

D) A mathematical symbol

2. The addition of vectors follows which laws?

A) Commutative and associative laws

B) Distributive and associative laws

C) Commutative and distributive laws

D) Inverse element and associative laws

3. Given two vectors a = (3, 4) and b = (1, 2), calculate a + b and 3a.

4. Given two vectors u = (3, 4) and v = (4, 3), find the angle between these vectors and the length of vector u.

Solutions

1. Answer: A

2. Answer: A

3. Solution:

  • a + b = (3 + 1, 4 + 2) = (4, 6)
  • 3a = 3 × (3, 4) = (9, 12)

4. Solution:

  • Dot product of vectors: u · v = 3×4 + 4×3 = 24
  • Length of vector u: |u| = √(3² + 4²) = 5
  • Length of vector v: |v| = √(4² + 3²) = 5
  • Angle θ calculation: cos θ = (u · v) / (|u| × |v|) = 24 / 25
  • Angle θ = cos^(-1)(24 / 25) (requires a calculator for the exact value)

Section 2: Matrices and Linear Systems of Equations

1. In matrix multiplication, if A is an m×n matrix and B is an n×p matrix, then the resulting matrix size is:

A) m×p

B) n×p

C) m×n

D) n×m

2. The transpose of a matrix involves switching its:

A) Rows and columns

B) Elements diagonally

C) First and last row

D) First and last column

3. Use Gaussian elimination to solve the linear system of equations:

x + 2y + 3z = 9
2x + 5y + 7z = 24
4x + 6y + 8z = 30

4. Discuss the application of diagonal matrices in electronic circuit design.

Solutions

1. Answer: A

2. Answer: A

3. Solution:

  • Transform the system into an augmented matrix and apply row operations.
  • First step: Eliminate the x terms from the second and third rows using the first row.
  • Second step: Use the new second row to eliminate the y term from the third row.
  • Third step: Back substitution to find the values of z, y, and x.
  • Final solution: x = 1, y = 2, z = 3. (The detailed matrix operations are required for a full solution)

4. Solution:

  • Diagonal matrices in electronic circuit design are often used to represent the impedance values of different components.
  • For example, in a circuit with multiple resistors, the impedance of each resistor can be represented by a diagonal matrix.
  • When changes in current or voltage occur in the circuit, diagonal matrices can be used to easily calculate the new current or voltage values.
  • This is very useful in the design and adjustment of circuit parameters, as it allows for quick calculations of outcomes under different configurations.

Section 3: Vector Spaces and Subspaces

1. Which of the following is a necessary condition for a vector space?

A) Must contain an infinite number of vectors

B) Must include the zero vector

C) All vectors must be of the same length

D) All vectors must be non-zero

2. Key properties of a subspace include:

A) Non-empty, closed under vector addition and scalar multiplication

B) Contains all basis vectors

C) Has the same dimension as the original space

D) Only contains the zero vector

3. Prove that the set {u, v, w}, where u, v, w are vectors in R³, is a subspace.

4. Given a set of vectors {a = (1, 2, 3), b = (4, 5, 6), c = (7, 8, 9)}, determine whether they form a subspace in R³.

Solutions

1. Answer: B

2. Answer: A

3. Solution:

  • First verify non-emptiness: The set includes the zero vector.
  • Next, verify closure under addition: For any two vectors u and v in the set, their sum u + v is also in the set.
  • Lastly, verify closure under scalar multiplication: For any vector u in the set and any scalar α, the scalar product αu is also in the set.
  • If all these conditions are satisfied, the set is a subspace.

4. Solution:

  • Verify non-emptiness: The set includes the zero vector.
  • Check for closure under addition: Verify that any linear combination of vectors a, b, c remains within the set.
  • Check for closure under scalar multiplication: For any vector (e.g., a) and any scalar α, verify that αa remains within the set.
  • If all these conditions are met, the vector set forms a subspace. Otherwise, it does not.

Section 4: Linear Transformations

1. Linear transformations must satisfy which conditions?

A) Preserve vector length and direction

B) Closed under vector addition and scalar multiplication

C) Change the dimension of the vector

D) Rotate but not scale vectors

2. Linear transformation T: R^n → R^m represents a mapping from:

A) n-dimensional space to m-dimensional space

B) m-dimensional space to n-dimensional space

C) Any dimension to n-dimensional space

D) Any dimension to m-dimensional space

3. Calculate the matrix representation of the linear transformation T where T(x, y) = (2x, 3y).

4. Analyze the geometric impact of the linear transformation T(x, y) = (x, -y).

Solutions

1. Answer: B

2. Answer: A

3. Solution:

  • The linear transformation T can be expressed as a matrix multiplication T(v) = Av, where v is any vector (x, y), and A is the transformation matrix.
  • For the given T(x, y), we find A such that T(x, y) = A(x, y).
  • In this case, A = [[2, 0], [0, 3]]. Thus, the matrix representation of T is [[2, 0], [0, 3]].

4. Solution:

  • This linear transformation maps any given vector (x, y) to (x, -y).
  • Geometrically, this means it keeps the x-coordinate unchanged while reversing the y-coordinate.
  • This equates to a reflection across the x-axis in a two-dimensional plane.
  • Hence, the transformation geometrically represents a reflection along the x-axis.

Section 5: Determinants

1. Calculate the determinant of the following matrices: A) 2×2 matrix: [ [1, 2], [3, 4] ] B) 3×3 matrix: [ [1, 2, 3], [0, 1, 4], [5, 6, 0] ]

2. Explain the application of determinants in calculating the volume of a parallelepiped formed by three vectors in three-dimensional space.

3. Prove that swapping two rows of a matrix changes the sign of its determinant.

Solutions

1. Solution:

  • A) The determinant of A is |A| = 1×4–2×3 = -2.
  • B) The determinant of B is |B| = 1×(1×0–4×6) — 2×(0×0–4×5) + 3×(0×6–1×5) = -24.

2. Solution:

  • Consider three vectors a, b, c in three-dimensional space forming a parallelepiped.
  • The volume of this parallelepiped can be calculated by the determinant of the 3×3 matrix composed of these vectors.
  • Specifically, if matrix A = [a, b, c], where a, b, c are column vectors, then the volume of the parallelepiped is |A|.
  • The geometric interpretation of a determinant as a scaling factor in transformation applies here, representing the volume of the parallelepiped.

3. Solution:

  • Consider a 2×2 matrix A = [ [a, b], [c, d] ].
  • The determinant of A is ad — bc.
  • Swapping the two rows results in a new matrix B = [ [c, d], [a, b] ].
  • The determinant of B is cb — da, which is the negative of the determinant of A, i.e., |B| = -|A|.
  • This property extends to higher-dimensional matrices, based on the definition and expansion of determinants.

Section 6: Eigenvalues and Eigenvectors

1. Calculate the eigenvalues and eigenvectors for the matrix A = [ [4, 2], [1, 3] ].

2. Discuss the application of eigenvalues and eigenvectors in machine learning.

3. Which of the following statements is true regarding an eigenvalue λ of a matrix A?

A) A — λI is always a non-singular matrix

B) The eigenvalue of the inverse of A is 1/λ

C) The inverse of λ is one of the eigenvalues of A

D) Every eigenvector of A is a multiple of λ

Solutions

1. Solution:

  • First, find the eigenvalues by solving the equation |A — λI| = 0.
  • For A = [ [4, 2], [1, 3] ], the characteristic polynomial is λ² — 7λ + 10 = 0.
  • Solving this equation yields two eigenvalues: λ1 = 2 and λ2 = 5.
  • For λ1 = 2, solve the system (A — 2I)v = 0 to find the corresponding eigenvector.
  • Similarly, for λ2 = 5, solve the system (A — 5I)v = 0 to find the corresponding eigenvector.

2. Solution:

  • In machine learning, eigenvalues and eigenvectors are commonly used in Principal Component Analysis (PCA).
  • PCA is a dimensionality reduction technique that retains the most significant features of a dataset.
  • Eigenvalues and eigenvectors of a dataset’s covariance matrix are used to identify the principal directions in which the data varies most.
  • Directions with larger eigenvalues are considered more significant, capturing essential features of the dataset.
  • This method effectively reduces the complexity of the dataset while retaining crucial information.

3. Answer: B

Section 7: Linear Independence and Basis Vectors

1. Determine if the vector set {v1 = (1, 2, 3), v2 = (4, 5, 6), v3 = (7, 8, 9)} is linearly independent.

2. Identify a set of basis vectors from the group {v1 = (1, 0, 0), v2 = (0, 1, 0), v3 = (0, 0, 1), v4 = (1, 1, 1)}.

3. Analyze the application of basis vectors in two-dimensional and three-dimensional spaces.

Solutions

1. Solution:

  • To determine if these vectors are linearly independent, check if the equation a1v1 + a2v2 + a3v3 = 0 has only the trivial solution (all a_i = 0).
  • Solving this equation, we find non-trivial solutions exist, such as a1 = 1, a2 = -2, a3 = 1.
  • Therefore, these vectors are linearly dependent.

2. Solution:

  • Vectors v1, v2, and v3 in the set are clearly linearly independent as they are standard basis vectors for R³.
  • The fourth vector v4 is a linear combination of v1, v2, and v3 (v4 = v1 + v2 + v3).
  • Thus, a basis for this set of vectors is {v1, v2, v3}.

3. Solution:

  • In a two-dimensional space, basis vectors are typically two mutually perpendicular unit vectors, such as (1, 0) and (0, 1) in the Cartesian coordinate system.
  • These basis vectors are used to represent all other vectors in the plane as a linear combination.
  • In a three-dimensional space, basis vectors are usually three mutually perpendicular unit vectors, like (1, 0, 0), (0, 1, 0), and (0, 0, 1).
  • These basis vectors represent any vector in space as a linear combination of the three.
  • Choosing appropriate basis vectors can simplify problems in various applications, such as decomposing forces in physics or coordinate transformations in computer graphics.

Section 8: Inner Product, Cross Product, and Orthogonality

1. Calculate the inner product (dot product) and cross product of two vectors a = (1, 2, 3) and b = (4, 5, 6).

2. Which of the following statements is correct regarding orthogonal vectors and orthogonal matrices?

A) If two vectors have a dot product of zero, they must be identical

B) If two vectors have a dot product of zero, they are orthogonal

C) An orthogonal matrix is one where it contains identical rows and columns

D) An orthogonal matrix is one where its inverse is equal to its transpose

3. Explain the applications of inner and cross products in physics and geometry.

Solutions

1. Solution:

  • Inner Product (Dot Product): a · b = 1×4 + 2×5 + 3×6 = 4 + 10 + 18 = 32
  • Cross Product: a × b = (2×6–3×5, 3×4–1×6, 1×5–2×4) = (-3, 6, -3)

2. Answer: B, D

3. Solution:

Inner Product in Physics:

  • Used to calculate the work done when a force is applied. The work done is the inner product of the force and displacement vectors.
  • In electromagnetism, the inner product is used to calculate the interaction between electric field strength and the displacement of a charge.

Inner Product in Geometry:

  • Used to determine if two vectors are orthogonal. If their inner product is zero, they are orthogonal.
  • Also used to calculate the length of a vector and the angle between two vectors.

Cross Product in Physics:

  • Used to calculate torque and angular momentum, especially where torque can be represented as the cross product of position and force vectors.
  • In fluid dynamics, the cross product describes rotational flows and vortices.

Cross Product in Geometry:

  • Used to find the normal vector to the plane defined by two vectors.
  • Also used to calculate the area of a parallelogram formed by two vectors.

Section 9: Matrix Factorization

1. Perform LU decomposition, QR decomposition, and Singular Value Decomposition (SVD) for the matrix A = [ [1, 2], [3, 4] ].

2. Explore the application of QR decomposition in solving linear systems of equations.

3. Which of the following statements is accurate about matrix decomposition?

A) LU decomposition always exists and is unique for any matrix

B) In QR decomposition, the Q matrix is always square

C) The Σ matrix in Singular Value Decomposition contains the singular values of the matrix

D) Matrix decomposition is applicable only to square matrices

Solutions

1. Solution:

LU Decomposition:

  • LU decomposition involves splitting A into a lower triangular matrix L and an upper triangular matrix U.
  • For A = [ [1, 2], [3, 4] ], calculate L and U matrices.

QR Decomposition:

  • QR decomposition splits A into an orthogonal matrix Q and an upper triangular matrix R.
  • For A, calculate Q and R matrices.

Singular Value Decomposition (SVD):

  • SVD decomposes A into matrices U, Σ, and V^T, where U and V are orthogonal matrices and Σ is a diagonal matrix.
  • For A, calculate U, Σ, and V^T matrices.

2. Solution:

  • QR decomposition is used in solving the linear equation system Ax = b.
  • Decompose A into QR, then substitute into Ax = b, yielding QRx = b.
  • Multiply both sides by Q^T, resulting in R(Q^Tx) = Q^Tb.
  • This converts the original system into an upper triangular system, which is easier to solve via back substitution.

3. Answer: C

--

--

Renda Zhang
Renda Zhang

Written by Renda Zhang

A Software Developer with a passion for Mathematics and Artificial Intelligence.