Search Knowledge

© 2026 LIBREUNI PROJECT

Linear Algebra / Overview

Matrices and Linear Systems

Matrices and Linear Systems

Matrices are the numerical engines of Linear Algebra. While a “Vector Space” is a theoretical playground, a Matrix is the specific blueprint that tells us how to manipulate that space.

1. The Matrix as a Map

A matrix AA of size m×nm \times n is a grid of numbers that represents a mapping from Rn\mathbb{R}^n to Rm\mathbb{R}^m. Each column of the matrix tells us where one of the basis vectors of Rn\mathbb{R}^n “lands” in Rm\mathbb{R}^m.

Let’s visualize a Shear Transformation matrix: A=(1101)A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}. This matrix leaves the xx-axis alone but shifts the yy-direction.

python
1import numpy as np
2import matplotlib.pyplot as plt
3 
4# A 2x2 Shear Matrix
5A = np.array([[1, 1],
6 [0, 1]])
7 
8# Create a grid of points (a square)
9x, y = np.meshgrid(np.linspace(0, 1, 10), np.linspace(0, 1, 10))
10points = np.vstack([x.flatten(), y.flatten()])
11 
12# Transform the points: A * points
13transformed = A @ points
14 
15plt.figure(figsize=(8, 4))
16plt.subplot(1, 2, 1)
17plt.scatter(points[0], points[1], c='blue', s=5)
18plt.title("Original Square")
19plt.axis('equal')
20 
21plt.subplot(1, 2, 2)
22plt.scatter(transformed[0], transformed[1], c='red', s=5)
23plt.title("Transformed (Shear)")
24plt.axis('equal')
25plt.show()

2. Linear Systems: Ax=bAx = b

A system of linear equations asks: “Which vector xx lands on bb when we apply the transformation AA?”

If the matrix AA squashes space into a lower dimension (i.e., it is Rank-Deficient or Singular), then bb might be unreachable, or there might be infinitely many paths to reach it.

python
1import numpy as np
2 
3# A singular matrix (rows are multiples)
4A = np.array([[1, 2],
5 [2, 4]])
6b = np.array([5, 10])
7 
8try:
9 x = np.linalg.solve(A, b)
10 print(f"Solution: {x}")
11except np.linalg.LinAlgError:
12 print("Matrix is singular! No unique solution.")
13 
14# Check the rank
15print(f"Rank of A: {np.linalg.matrix_rank(A)}")
16print("Since Rank (1) < Dimensions (2), the matrix isn't 'full' and can't be inverted.")

3. Multiplication: Composition of Maps

Multiplying two matrices ABAB represents applying transformation BB first, then AA. Because the order of geometric transformations (like rotating then shifting) matters, matrix multiplication is not commutative (ABBAAB \neq BA).

What geometric transformation is represented by the matrix [[0, -1], [1, 0]]?

4. Reduced Row Echelon Form (RREF)

RREF is the “simplest” version of a matrix that still represents the same linear system. It allows us to read off the solutions directly. In RREF, the leading entry of each row is 1, and all other entries in that column are 0.

If the RREF of a matrix has a row of zeros [0, 0, 0] but the constant vector b is [0, 0, 1], what can we conclude?

5. Summary Check

If A is an n x n matrix and Rank(A) = n, which of the following is true?