You are on page 1of 20

CSE1202 Mathematics & Statistics

for Computer Science

Lecture 5 – Linear Algebra

Facilitator:
Ms. Alicia Layne
14/02/2018
15/02/2018
Matrices

A matrix is an ordered array of elements,
usually numbers, arranged in rows and
columns

Matrices are categorized by their “size”

The size of a matrix is measured in the number
of rows and columns the matrix has

Matrices that have the same number of rows as
columns are called square matrices
Matrices

ROW x COL

2 x 2 matrix – this is a square matrix


3 x 4 matrix
Matrices - Elements

The elements of a matrix are specified by the
row and column they reside in

For example, the 5 in the matrix below is at
position (2, 3) : the 2nd row and 3rd column
● More explicitly, M2,3 = 5
Basic Matrix Operations - Addition

Matrix addition is defined only on two matrices
of the same size, and works by adding
corresponding elements

Therefore the sum of an n x n matrix and n x n
matrix results in an n x n matrix
Basic Matrix Operations - Addition

Formally,
The sum S of two matrices A, B of the same size
satisfies
Si,j = Ai,j + Bi,j
for all i,j within the size of the matrices

It is worth noting that subtracting is defined as
the addition of a negative matrix
Si,j = Ai,j + (-Bi,j)
Basic Matrix Operations - Scalars

It is also possible to multiply matrices by
scalars, i.e. single numbers, by multiplying
element-wise:
Basic Matrix Operations - Scalars

Formally
The Product p of a constant c and a Matrix A
satisfies the relation
Pij = c · Aij
for all ij within the matrix
Basic Matrix Operations -
Multiplication

The product of two matrices is defined only
when the number of columns of the first
matrices is the same as the number of rows as
the second
– only possible to multiply m x n and n x p matrices
Basic Matrix Operations -
Multiplication


Is this m x n and n x p?
– Yes, 2x3 and 3x2
– The product will be a 2x2 matrix
Determinant of the Matrix

The determinant of a matrix is calculated from a
square matrix

It tells us things about the matrix that are useful
in systems of linear equations, helps us find the
inverse of a matrix, is useful in calculus and
more

|A| means the determinant of the matrix A
Determinant of 2x2 Matrix
Determinant of 3x3 Matrix
Determinant of 4x4 and higher
Inverse Matrix

When we multiply a Matrix by its Inverse we get
the Identity Matrix
– Similar to 8 * 1/8 = 1

It is "square" and has 1s on the diagonal and 0s
everywhere else
The Inverse May Not Exist

For instance if the determinant is 0

Singular matrix
Inverse – minors, adjugate,
cofactors

https://www.mathsisfun.com/algebra/matrix-
inverse-minors-cofactors-adjugate.html

You might also like