A matrix is a rectangular array of entries arranged in rows and columns. In linear algebra, the entries are usually scalars from a field, most often or . Matrices are used to store coefficients, write systems of equations compactly, represent linear transformations, and organize numerical data. The row-column structure is essential because it supports matrix-vector multiplication and matrix multiplication.
6.1 Definition of a Matrix
An matrix is a rectangular array with rows and columns:
The entry in row and column is written as
The first index records the row. The second index records the column.
For example,
is a matrix. It has two rows and three columns.
6.2 Rows and Columns
The rows of a matrix are horizontal lists. The columns are vertical lists.
For
the rows are
and
The columns are
Rows and columns give two different ways to read the same matrix. Row operations act on equations. Column combinations describe the action of the matrix on vectors.
6.3 Size and Shape
The size of a matrix is written as
The number is the number of rows. The number is the number of columns.
| Matrix shape | Name |
|---|---|
| General rectangular matrix | |
| Square matrix | |
| Row matrix | |
| Column matrix | |
| Single-entry matrix |
A column vector is often treated as an matrix:
A row vector is a matrix:
6.4 Matrix Equality
Two matrices are equal if they have the same size and the same entries in corresponding positions.
If and , then
means
for every row and every column .
For example,
But
The entries are the same numbers, but they occur in different positions.
6.5 Zero Matrices
A zero matrix is a matrix whose entries are all zero.
The zero matrix is written as
or simply when the size is clear.
For example,
The zero matrix is the additive identity for matrices of the same size. If is an matrix, then
6.6 Matrix Addition
Matrices of the same size can be added entry by entry.
If
and
are both matrices, then
For example,
Matrices of different sizes cannot be added.
6.7 Scalar Multiplication
A scalar multiplies a matrix by multiplying every entry.
If is a scalar and , then
For example,
Scalar multiplication preserves the shape of the matrix.
6.8 Matrix Subtraction
Matrix subtraction is defined using additive inverses.
If and have the same size, then
For example,
Subtraction is entrywise, just like addition.
6.9 Matrix-Vector Multiplication
Let be an matrix and let . Then is a vector in .
If
and
then
Each entry of is the dot product of one row of with the vector .
For example,
6.10 Column Combination View
Matrix-vector multiplication can also be read by columns.
If
where are the columns of , then
Thus is a linear combination of the columns of .
For example,
This viewpoint is central. The equation
asks whether can be written as a linear combination of the columns of .
6.11 Matrices as Coefficient Arrays
A system of linear equations can be encoded by a matrix.
The system
has coefficient matrix
unknown vector
and right-hand side vector
The system is written as
The matrix stores the coefficients. The vector multiplication reconstructs the left-hand sides of the equations.
6.12 Square Matrices
A square matrix has the same number of rows and columns. An matrix is called a square matrix of order . Square matrices play a special role because they can represent transformations from to itself, and because operations such as determinant, trace, eigenvalues, and invertibility are defined for them.
For example,
is a square matrix.
The matrix
is not square.
6.13 Diagonal Entries
In a square matrix, the main diagonal consists of the entries
For example, in
the diagonal entries are
The diagonal is important because many special matrices are defined by conditions on entries off the diagonal or on the diagonal itself.
6.14 Diagonal Matrices
A diagonal matrix is a square matrix whose off-diagonal entries are all zero.
For example,
is diagonal.
Multiplying by a diagonal matrix scales coordinates independently. If
then
Diagonal matrices are among the simplest matrices to understand and compute with.
6.15 Identity Matrix
The identity matrix is the diagonal matrix with all diagonal entries equal to :
It satisfies
for every .
The identity matrix is the matrix form of the identity transformation. It leaves every vector unchanged.
6.16 Triangular Matrices
A square matrix is upper triangular if all entries below the main diagonal are zero.
For example,
is upper triangular.
A square matrix is lower triangular if all entries above the main diagonal are zero.
For example,
is lower triangular.
Triangular matrices are important because systems involving them are easy to solve by substitution.
6.17 Transpose
The transpose of a matrix is obtained by turning rows into columns.
If , then the transpose is defined by
For example,
has transpose
If is , then is .
6.18 Symmetric Matrices
A square matrix is symmetric if
For example,
is symmetric.
Symmetric matrices occur throughout geometry, optimization, statistics, and spectral theory. They have especially strong eigenvalue properties, studied later in the book.
6.19 Sparse Matrices
A sparse matrix is a matrix whose entries are mostly zero. Sparse matrices occur in graphs, finite difference methods, finite element methods, optimization, and large-scale data problems. Algorithms often exploit sparsity to reduce memory use and computation.
For example,
is sparse.
A dense matrix has many nonzero entries. Dense and sparse matrices may represent the same kind of mathematical object, but they require different computational methods.
6.20 Matrices as Linear Transformations
Every matrix defines a function
by
This function is linear because
and
Thus matrices represent linear transformations. This is one of their most important roles.
For example,
maps
to
Geometrically, it stretches the plane in the first coordinate direction.
6.21 Data Matrices
Matrices also organize data.
A data matrix may have observations as rows and features as columns:
For example,
might record height and weight for three observations.
In this setting, matrix methods are used to transform, compress, compare, and model data. Least squares, covariance matrices, principal component analysis, and many machine learning algorithms use this view.
6.22 Summary
A matrix is a rectangular array of scalars. Its entries are indexed by row and column. Its size is written . Matrices can be added, subtracted, and scaled entry by entry when their sizes match.
The main concepts are:
| Concept | Meaning |
|---|---|
| Entry | Entry in row , column |
| Row | Horizontal list of entries |
| Column | Vertical list of entries |
| Size | rows and columns |
| Zero matrix | Matrix with all entries zero |
| Square matrix | Matrix with equal rows and columns |
| Diagonal matrix | Square matrix with zero off-diagonal entries |
| Identity matrix | Matrix representing the identity transformation |
| Transpose | Matrix obtained by interchanging rows and columns |
| Sparse matrix | Matrix with mostly zero entries |
Matrices have several simultaneous meanings. They are arrays of numbers, coefficient tables for systems of equations, rules for transforming vectors, and structured containers for data. Subsequent chapters develop their operations in detail.