Overview
A matrix is a rectangular array of numbers arranged in rows and columns. Matrices are fundamental tools in linear algebra for representing linear transformations and systems of equations.
Definition
An m × n m \times n m × n matrix A A A has m m m rows and n n n columns:
A = [ a 11 a 12 ⋯ a 1 n a 21 a 22 ⋯ a 2 n ⋮ ⋮ ⋱ ⋮ a m 1 a m 2 ⋯ a m n ] A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix} A = a 11 a 21 ⋮ a m 1 a 12 a 22 ⋮ a m 2 ⋯ ⋯ ⋱ ⋯ a 1 n a 2 n ⋮ a mn
Entry a i j a_{ij} a ij is in row i i i and column j j j .
Matrix Notation
Notation Meaning A = [ a i j ] A = [a_{ij}] A = [ a ij ] Matrix with entries a i j a_{ij} a ij A m × n A_{m \times n} A m × n m × n m \times n m × n matrixA ( i , j ) A(i,j) A ( i , j ) or a i j a_{ij} a ij Entry in row i i i , column j j j A i ⋅ A_{i\cdot} A i ⋅ i i i -th row of A A A A ⋅ j A_{\cdot j} A ⋅ j j j j -th column of A A A
Types of Matrices
Square Matrix
Number of rows equals number of columns (n × n n \times n n × n ).
A = [ 1 2 3 4 ] A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} A = [ 1 3 2 4 ]
Row Matrix
Single row (1 × n 1 \times n 1 × n ):
A = [ 1 2 3 4 ] A = \begin{bmatrix} 1 & 2 & 3 & 4 \end{bmatrix} A = [ 1 2 3 4 ]
Column Matrix
Single column (m × 1 m \times 1 m × 1 ):
A = [ 1 2 3 ] A = \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix} A = 1 2 3
Zero Matrix
All entries are zero:
O = [ 0 0 0 0 ] O = \begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix} O = [ 0 0 0 0 ]
Identity Matrix
Square matrix with 1s on main diagonal, 0s elsewhere:
I 2 = [ 1 0 0 1 ] I 3 = [ 1 0 0 0 1 0 0 0 1 ] I_2 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \qquad I_3 = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} I 2 = [ 1 0 0 1 ] I 3 = 1 0 0 0 1 0 0 0 1
Property: A I = I A = A AI = IA = A A I = I A = A
Diagonal Matrix
Non-zero entries only on main diagonal:
D = [ d 1 0 0 0 d 2 0 0 0 d 3 ] D = \begin{bmatrix} d_1 & 0 & 0 \\ 0 & d_2 & 0 \\ 0 & 0 & d_3 \end{bmatrix} D = d 1 0 0 0 d 2 0 0 0 d 3
Main Diagonal
The main diagonal consists of entries a i i a_{ii} a ii :
[ a 11 ⋅ ⋅ ⋅ a 22 ⋅ ⋅ ⋅ a 33 ] \begin{bmatrix} \boxed{a_{11}} & \cdot & \cdot \\ \cdot & \boxed{a_{22}} & \cdot \\ \cdot & \cdot & \boxed{a_{33}} \end{bmatrix} a 11 ⋅ ⋅ ⋅ a 22 ⋅ ⋅ ⋅ a 33
Trace
For a square matrix A A A , the trace is the sum of diagonal entries:
tr ( A ) = a 11 + a 22 + ⋯ + a n n = ∑ i = 1 n a i i \text{tr}(A) = a_{11} + a_{22} + \cdots + a_{nn} = \sum_{i=1}^{n} a_{ii} tr ( A ) = a 11 + a 22 + ⋯ + a nn = ∑ i = 1 n a ii
Properties of Trace
tr ( A + B ) = tr ( A ) + tr ( B ) \text{tr}(A + B) = \text{tr}(A) + \text{tr}(B) tr ( A + B ) = tr ( A ) + tr ( B )
tr ( c A ) = c ⋅ tr ( A ) \text{tr}(cA) = c \cdot \text{tr}(A) tr ( c A ) = c ⋅ tr ( A )
tr ( A B ) = tr ( B A ) \text{tr}(AB) = \text{tr}(BA) tr ( A B ) = tr ( B A )
Matrix Equality
Two matrices A A A and B B B are equal if:
They have the same dimensions (m × n m \times n m × n )
All corresponding entries are equal: a i j = b i j a_{ij} = b_{ij} a ij = b ij
Examples
Example 1: Identify Matrix Type
A = [ 1 0 0 0 2 0 0 0 3 ] A = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \end{bmatrix} A = 1 0 0 0 2 0 0 0 3
This is a:
3 × 3 3 \times 3 3 × 3 matrix (square)
Diagonal matrix
Has trace = 1 + 2 + 3 = 6 = 1 + 2 + 3 = 6 = 1 + 2 + 3 = 6
Example 2: Extract Elements
For matrix:
A = [ 2 5 7 4 1 3 ] A = \begin{bmatrix} 2 & 5 & 7 \\ 4 & 1 & 3 \end{bmatrix} A = [ 2 4 5 1 7 3 ]
a 12 = 5 a_{12} = 5 a 12 = 5
a 23 = 3 a_{23} = 3 a 23 = 3
First row: [ 2 5 7 ] \begin{bmatrix} 2 & 5 & 7 \end{bmatrix} [ 2 5 7 ]
Second column: [ 5 1 ] \begin{bmatrix} 5 \\ 1 \end{bmatrix} [ 5 1 ]