1. Matrix
2026-02-10
Matrix (矩阵)
Definition
In general, a m×n matrix is represented as
A=a1,1a2,1⋮am,1a1,2a2,2⋮am,2⋯⋯⋱⋯a1,na2,n⋮am,n
where m is the number of rows and n is the number of columns.
We can also write it as a function:
A:{(i,j)∣1≤i≤m,1≤j≤n}→R
We write the output by A(i,j)=ai,j, where the input (i,j) represents the $i$th row and $j$th column, and the output ai,j is the number at the $i$th row and $j$th column.
Every ai,j is called an entry of the matrix A.
Special Matrices
Square Matrix (方阵)
A matrix is called a square matrix if the number of rows equals the number of columns, i.e., m=n.
Zero Matrix (零矩阵)
A matrix is called a zero matrix if all of its entries are zero.
A zero matrix is a diagonal matrix.
Diagonal Matrix (对角矩阵)
A square matrix is called a diagonal matrix if all of its entries off the main diagonal are zero.
A=a1,10⋮00a2,2⋮0⋯⋯⋱⋯00⋮an,n
where the entries a1,1,a2,2,⋯,an,n are on the main diagonal of the matrix A.
Triangular Matrix (三角矩阵)
A square matrix is called an upper triangular matrix if all of its entries below the main diagonal are zero, and is called a lower triangular matrix if all of its entries above the main diagonal are zero.
For example, the following is an upper triangular matrix:
A=a1,10⋮0a1,2a2,2⋮0⋯⋯⋱⋯a1,na2,n⋮an,n
Identity Matrix (单位矩阵)
The identity matrix is a square matrix in which all the entries on the main diagonal are 1 and all other entries are 0:
In=10⋮001⋮0⋯⋯⋱⋯00⋮1n×n
An identity matrix is a diagonal matrix.
Matrix Operations
Matrix Addition (矩阵加法)
If A and B are two m×n matrices, then their sum is the m×n matrix obtained by adding corresponding entries:
A+B=a1,1+b1,1a2,1+b2,1⋮am,1+bm,1a1,2+b1,2a2,2+b2,2⋮am,2+bm,2⋯⋯⋱⋯a1,n+b1,na2,n+b2,n⋮am,n+bm,n
Adding two matrices is only defined when they are of the same size (m×n).
Scalar Multiplication (数乘)
If A is an m×n matrix and c is a scalar, then the scalar multiple of A by c is the m×n matrix obtained by multiplying each entry of A by c:
cA=ca1,1ca2,1⋮cam,1ca1,2ca2,2⋮cam,2⋯⋯⋱⋯ca1,nca2,n⋮cam,n
Matrix Multiplication (矩阵乘法) and Power of a Matrix (矩阵的幂)
Transpose (转置)
The transpose of an m×n matrix A is the n×m matrix obtained by interchanging the rows and columns of A:
AT=a1,1a2,1⋮am,1a1,2a2,2⋮am,2⋯⋯⋱⋯a1,na2,n⋮am,nT=a1,1a1,2⋮a1,na2,1a2,2⋮a2,n⋯⋯⋱⋯am,1am,2⋮am,n
An Example
[142536]T=123456