0% found this document useful (0 votes)
9 views36 pages

Essential Matrix Concepts in AI

Essential math for Ai

Uploaded by

mohiuddinrafi786
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views36 pages

Essential Matrix Concepts in AI

Essential math for Ai

Uploaded by

mohiuddinrafi786
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Essential

Mathematics in AI

Saurabh Singh
Department of AI & Big Data
Woosong University
2025/09/29
Matrices
• Matrices are rectangular arrays of numbers, symbols, or
characters where all of these elements are arranged in each row
and column.

⨯ and columns, and the location of each element is given by the row
• A matrix is identified by its order, which is given in the form of rows

and column it belongs to.


• A matrix is represented as ([P]m⨯n), where P is the matrix, m is
the number of rows, and n is the number of columns.
• A matrix is a rectangular arrangement of numbers into rows
and columns.
• For example, matrix [A] has two rows and three columns.
Matrix dimensions
• The dimensions of a matrix tells its size: the number of rows
and columns of the matrix, in that order.
• Since matrix two rows and three columns], we write its
dimensions 2pronounced "two by three".
• In contrast, matrix B has three rows and two columns so it is a 3×2
Order of Matrix
• The Order Of a Matrix tells about the number of rows
and columns present in a matrix. The order of a
matrix is represented as the number of rows times
the number of columns. Let's say if a matrix has 4
rows and 5 columns, then the order of the matrix will
be 4⨯5. Always remember that the first number in
the order signifies the number of rows present in the
matrix, and the second number signifies the number
of columns in the matrix.
• The order of a matrix refers to its dimensions, i.e.,
the number of rows and columns. If a matrix has m
rows and n columns, its order is denoted as m × n.
• What are the dimensions of matrix [D]?

Matrix elements
Type of Matrices Based on Order of Matrix
• Singleton Matrix: A singleton matrix is defined as a matrix that has
only one element, i.e., it has only one row and one column. So,
the order of a singleton matrix is "1 × 1"
• Matrix given below is a singleton matrix. A=[23]
• Row Matrix:A row matrix is defined as a matrix that has only one
row. A matrix "A = [aij]" is said to be a row matrix if the order of
the matrix is "1 × n"
• Matrix given below is a row matrix of order "1 × 3"
• B=[−1 0 1]
• Column Matrix:A column matrix is defined as a matrix that has only
one column. The matrix "A = [aij]" is said to be a column matrix if
the order of the matrix is "m × 1"
• Matrix given below is a row matrix of order "4 × 1"
• Rectangular Matrix: A rectangular matrix is defined as a matrix that
does not have an equal number of rows and columns. The order of
a rectangular matrix that has "m" rows and "n" columns is "m × n"
• Matrix given below is a row matrix of order "2 × 3“

• A square matrix is defined as a matrix that has an equal number of


rows and columns. The order of a square matrix that has "n" rows
and "n" columns is "n × n"
• Matrix given below is a row matrix of order "2 × 2"
Identity
Matrix

• An identity matrix is a special square matrix with:


• 1s on the main diagonal (from top-left to bottom-right)
• 0s everywhere else
• It is usually denoted as I.

Example for 3×3times 3×3 identity matrix:

Key Property
The identity matrix acts like 1 in matrix multiplication:
I×A=A×I=A
What is a Determinant?
• The determinant is a single number that can be calculated from a
square matrix (matrix with the same number of rows and columns).
It tells us:
• Whether the matrix is invertible (determinant ≠ 0 → invertible).
• How a matrix scales space (area, volume).
• Whether a system of equations has a unique solution.
• It is denoted as:
det(A) or ∣A∣
• (a) Determinant of a 2×2 Matrix
• Determinant of a 3×3 Matrix
Operation on Matrices
• We can perform various mathematical operations on matrices, such
as addition, subtraction, scalar multiplication, and multiplication.
These operations are performed between the elements of two
matrices to give an equivalent matrix that contains the elements that
are obtained as a result of the operation between the elements of
two matrices.
• Addition: Add two matrices of the same size.
• Subtraction: Subtract two matrices of the same size.
• Scalar Multiplication: Multiply each element of a matrix by
a constant.
• Matrix Multiplication: Multiply two matrices to create a new matrix.
• Transpose: Flip the rows and columns of a matrix.
• Inverse: Find the inverse of a Matrix.
Addition of Matrices
• In matrix addition or subtraction of matrices, the operation is
performed between two matrices of the same order to yield a matrix
that contains elements obtained by performing the operations on
the elements of the two matrices.
• The addition of matrices A and B:
Matrix Subtraction
Given two matrices A and B of the same size, the matrix subtraction A−B is defined as:

Subtraction of n × n Matrices
Scalar Multiplication of Matrices
• Scalar Multiplication of matrices refers to the multiplication of each term of a
matrix by a scalar. If a scalar let's 'k' is multiplied by a matrix, then the equivalent
matrix will contain elements equal to the product of the scalar and the element
of the original matrix.
• For any matrix A = [aij]m×n, if we multiply the matrix A by any scalar (say k), then
the scalar is multiplied by each element of the matrix, and this is called the
scalar multiplication of matrices.
• Let's see an example:

Properties of Scalar Multiplication


For any matrices A and B of the same order, and λ and μ are any two
scalars, then,
• λ(A + B) = λA + λB
• (λ + μ)A = λA + μA
• λ(μA) = (λμA) = μ(λA)
• (-λA) = -(λA) = λ(-A)
Multiplication of Matrices
• Matrix multiplication is the operation that helps us multiply two matrices. This
is different from algebraic multiplication, and not all matrices can be multiplied.
Only those matrices can be multiplied where the number of columns in the
first is equal to the number of rows in the second, i.e, for matrix Am×n and
matrix
Bn×p, the multiplication is possible for any other matrices where the column of the
first matrix is not equal to the row in the second matrix the multiplication is not
possible.

•For example:
• A 2×3 matrix can be multiplied by
a 3×2 matrix, resulting
in a 2×2 matrix.
• A 3×3 matrix cannot be
multiplied by a 4×2 matrix
because their dimensions are
incompatible.
Properties of Matrix Multiplication
• Matrix Multiplication is not commutative in general i.e AB ≠ BA.
• Matrix Multiplication is associative i.e (AB)C = A(BC).
• Matrix Multiplication is distributive over matrix addition i.e A(B + C) =
A.B + A.C.
• The product of two matrices can be null matrix while neither of them
is null i.e If AB = 0 it is not necessary that A = 0 or B =0.
• If AB = AC then B ≠ C ( Cancellation law is not applicable).
• There exists a multiplicative identity for every square matrix, such as
AI = IA = A.
Special Properties of Matrix Multiplication

• The product of two matrices A and B is defined if the number


of columns of A is equal to the number of rows of B.
• If AB multiplication of a matrix is defined, then BA
multiplication matrix may or may not be defined.
• Both AB and BA matrix multiplication are defined if both A and B
are square matrices.
• One of the matrices doesn't need to be a zero matrix if the product
of two matrices A and B is zero.
• Commutative Property : If A and B are two matrices, then AB ≠ BA.
• Associative Property: The matrix multiplication is associative
in nature. If A, B, and C are three matrices, then A(BC) =
(AB)C
• Distributive Property:
A (B + C) = AB + AC
(B + C) A = BA + CA
Multiplicative Identity Property: A·I = I · A = A
Product with a Scalar: k(AB) = (kA)B = A(Bk)
Transpose of a Matrix
• A Matrix is a rectangular arrangement of numbers (or elements) in
rows and columns. It is often used in mathematics to represent
data, solve systems of equations, or perform transformations. A
matrix is written as:

A = [a(ij)]m × n
At = [a(ji)]n × m
here i, j present the position of a matrix element,
row- and column-wise, respectively, such that,1 ≤ i
≤ m and 1 ≤ j ≤ n.
Trace
• Trace of a Matrix is the sum of the principal diagonal elements of a square matrix.
The trace of a matrix is only found in the case of a square matrix because
diagonal elements exist only in square matrices. Let's see an example.

Trace(A) = 1 + 5 + 9 = 15
For a square matrix A of order n×n, the trace is denoted
as tr(A) or trace(A) and is defined as the sum of the
principal diagonal elements:

tr(A) = a11 + a22 + a33 + ⋯ + ann or trace(A) = ⅀nn=1 Ann

tr(A) + tr(B) = tr (A + B)
The trace of an identity matrix of order "n × n"
tr(A) = tr (AT) tr (AB) = tr (BA)
tr(kA) = k
Tr(A)
is n.
tr(In) = n
Types of Matrices
• Row Matrix: A Matrix that has only one row and one or more columns is called a Row Matrix.
• Column Matrix: A matrix that has only one column and one or more rows is called a
Column Matrix.
• Horizontal Matrix: A Matrix in which the number of rows is less than the number of columns is
called a Horizontal Matrix.
• Vertical Matrix: A Matrix in which the number of columns is less than the number of rows
is called a Vertical Matrix.
• Rectangular Matrix: A Matrix in which the number of rows and columns is unequal is called a
Rectangular Matrix.
• Square Matrix: A matrix in which the number of rows and columns is the same is called a
Square Matrix.
• Diagonal Matrix: A square matrix in which the non-diagonal elements are zero is called
a Diagonal Matrix.
• Zero or Null Matrix: A matrix whose all elements are zero is called a Zero Matrix. A zero matrix is
also called as Null Matrix
• Unit or Identity Matrix: A diagonal matrix whose all diagonal elements are 1 is called a
Unit Matrix. A unit matrix is also called an Identity matrix. An identity matrix is represented
by I.
• Unit or Identity Matrix: A diagonal matrix whose all diagonal elements are 1 is called a
Unit Matrix. A unit matrix is also called an Identity matrix. An identity matrix is
represented by I.
• Symmetric matrix: A square matrix is said to be symmetric
T
if the transpose of the
original matrix is equal to its original matrix. i.e. (A ) = A.
• Skew-symmetric Matrix: A skew-symmetric (or antisymmetric or antimetric[1]) matrix is a
square matrix whose transpose equals its negative, i.e., (AT) = -A.
• Orthogonal Matrix: A matrix is said to be orthogonal if AAT = ATA = I
• Idempotent Matrix: A matrix is said to be idempotent if A2 = A
• Involutory Matrix: A matrix is said to be Involutory if A2 = I.
• Upper Triangular Matrix: A square matrix in which all the elements below the diagonal are
zero is known as the upper triangular matrix
• Lower Triangular Matrix: A square matrix in which all the elements above the diagonal
are zero is known as the lower triangular matrix
• Singular Matrix: A square matrix is said to be a singular matrix if its determinant is zero,
i.e., |A|=0
• Non-singular Matrix: A square matrix is said to be a non-singular matrix if its
determinant is non-zero.
Minor of a Matrix
• Minor of a matrix for an element is given by the determinant of a matrix obtained after deleting
the row and column to which the particular element belongs. Minor of a Matrix is represented
by Mij. Let's see an example.
• Find the minor of the matrix for the element 'a.
Cofactor of a Matrix
• The cofactor of a matrix is found by multiplying the minor of the matrix for a
given element by (-1)^(i+j). Cofactor of a Matrix is represented as Cij. Hence, the
relation between the minor and cofactor of a matrix is given as Cij = (-1)i+jMij. If
we arrange all the cofactors obtained for an element then we get a cofactor
matrix given as C =
Cij = (-1)i+j
Mij

Where,
•Mij is the minor of the element aij, and
•i and j respectively reprensent the number of row and
column of the element (position).
How to Find Cofactors of a Matrix
• Let's go step-by-step with an example to understand how to find the cofactor of
a matrix.
• Find the cofactor of the element a32.
Adjoint of a
Matrix Rank of a
Matrix invers
Rank of a Matrix
Eigenvalues and Eigenvectors, LU
Decomposition, Singular Value Decomposition
(SVD)
Contd…

…..
• Contd…..

You might also like