Numerical Mathematics: Part 2
In the previous article, we discussed vectors and their operations and properties. Today, I’m gonna talk about a crucial mathematical tool called “Matrix”. So without further ado, let’s get going!
Matrices
A matrix is a 2-dimensional collection of numbers. Often denoted in capital letters, a matrix with m rows and n columns has the size or dimension m x n.
The component of a matrix A in row i and column j is given by aᵢⱼ.
Matrices can also be considered collections of vectors.
A matrix is symmetric if and only if A = Aᵗ. To be symmetric a matrix needs to be square, rectangular matrices can never be symmetric.
Identity Matrix (I) is a square matrix with 1 on diagonal elements and 0 elsewhere. It is a matrix with the property { A x I = I x A = A }, hence the name identity matrix.
Matrix Operations
1. Addition
Addition is possible between equally sized matrices. If A and B are matrices in m x n matrix space then, C = A + B means cᵢⱼ = aᵢⱼ + bᵢⱼ.
2. Matrix-Vector Product
Ax = B can also be denoted in index notation as aᵢⱼxⱼ = bᵢ.
A and x must be compatible, which means that if the size of A is m x n and the size of x is p x 1, then A and B are compatible if and only if n = p.
A matrix-vector product is a linear combination of the column vectors of the matrix.
You can also get a row vector as a result of a matrix-vector product. Let A be a matrix in m x n matrix space and x be a vector in m x 1 vector space. In this case, Ax is only defined if n = m, and xA is undefined as 1 ≠ p. This is where we define xᵗA which gives us a 1 x n row vector.
3. Matrix-Matrix Product
Let A be a m x n dimension matrix and B be a p x q dimension matrix. In this case, AB is defined when n = p giving a m x q dimension matrix and BA is defined when m = q giving a p x n matrix.
AB = C implies aᵢₖbₖⱼ = cᵢⱼ.
4. Powers
Aᵖ = A x A x A … (p times).
5. Trace
Trace of a matrix A is defined as the sum of all the diagonal elements of a n x n square matrix and denoted by tr(A).
6. Outer Product
Outer Product is an operation on vectors producing a matrix.
Determinant of a Matrix
I’ve written an article on this very topic which is referenced below. Please give it a read.
Matrix Inverse
The inverse of a matrix is only defined for square matrices. Let A and B be two matrices in n x n matrix space. A and B are called inverses of each other if and only if AB = BA = I. If so, we denote A⁻¹ = B.
You can easily show that det(A⁻¹) = (det(A))⁻¹.
- If det(A) ≠ 0, then det(A⁻¹) is defined, hence A⁻¹ must exist.
- If det(A) = 0, then det(A⁻¹) is undefined, hence A⁻¹ does not exist.
In summary, Matrix is a very important mathematical concept and is crucial for Engineers and Data Scientists. Its significance can be estimated by the fact that the mathematical operations of MATLAB are completely performed around matrices.
In the next article, I’ll discuss Linear Systems. Till then keep learning and prosper. Thanks!