Matrices
Matrices
• A matrix is a rectangular array of numbers representing data in a
variety of forms.
• Computers work very heavily with matrices because operations with
matrices are efficient with memory.
• Matrices can represent statistical data with numbers, but also
graphical data with pictures.
2
Matrices - Introduction
• A matrix is a means of storing information effectively and
efficiently
• Each values of rows and columns are very specific and the location
of a number is also important as its value.
• The following are all examples of matrices:
3
Contd...
• The entries in a matrix can written using [ ] brackets.
• They can also be represented using a set of 2 subscript
indices i and j
• i represents the row number and j represents the column
number
• The matrix can be named with just a capital letter like A.
4
Contd...
• Square matrices have the same number of rows as columns.
• A symmetric matrix is a special type of square matrix that has reflection
symmetry across the main diagonal. The identity matrix is an example of a
symmetric matrix.
• The identity matrix of order has zeros everywhere except along the main
diagonal where it has ones. The identity matrix of any order has special
properties as well.
5
Contd...
• The Transpose of a matrix is a new matrix whose
columns and rows have been interchanged.
• This changes the order of the matrix, for example
6
Contd...
• A triangular matrix is described as either upper or
lower triangular. The opposite portion of the matrix is
entirely zeros.
• Here is an example of an upper triangular matrix:
7
Contd...
Diagonal Matrix Upper Triangular
Symmetric Matrix Identity Matrix
8
Example 1
Use a matrix to write the
following image
9
Example 2
Krishna runs three service centers and each service center
does service and sales for cars. The rows represent the
service centers and the columns represent service (left) and
sales (right). Answer the following questions about
Krishna’s sales.
10
Contd...
• What does 127 represent?
• How many items did krishna sold in total?
• How many Sales and services did krishna done in his
first location?
• Which location is doing poorly?
11
Linear Algebric operations on Matrices
Matrix Operations
• Matrix operations are a key part of linear algebra and
are vital for handling and analyzing data in machine
learning.
• Important operations are
✔ Multiplication
✔ Transpose
✔ Inverse
✔ Determinant
✔ Eigen value and Eigen vector
13
Eigenvalues and Eigenvectors
Eigenvalues and eigenvectors are fundamental concepts
in linear algebra
They are used in various applications
• Matrix diagonalization,
• Stability analysis, and
• Data analysis (e.g., Principal Component Analysis).
They are associated with a square matrix and provide
insights into its properties.
14
Eigenvalues
Eigenvalues are unique scalar values linked to a matrix or linear transformation.
They indicate how much an eigenvector gets stretched or compressed during the
transformation.
The eigenvector's direction remains unchanged unless the eigenvalue is negative, in
which case the direction is simply reversed.
The equation for eigenvalue is given by, Av=λv
Where,
• A is the matrix,
• v is associated eigenvector and
• λ is scalar eigenvalue
15
Eigen Vector
16
Contd...
This Vector is not a
eigen vector of the
matrix A.
(Since direction is
different)
17
Contd...
This Vector is a
eigen vector of the
matrix A (Since
direction is same)
18
Eigen Value
Eigen value tells us
how much the
eigenvector changes
in size when
multiplied with the
matrix.
19
Contd...
Eigen Value can also
be negative, eigen
vector is in opposite
direction.
20
Normalizing Eigen Vector
21