You are on page 1of 4

LESSON SIX

MATRICES.

6.1 What is a Matrix ?.


 Matrices are the R objects in which the elements are arranged in a two-dimensional
rectangular layout. They contain elements of the same atomic types. Though we can create
a matrix containing only characters or only logical values, they are not of much use.
 We use matrices containing numeric elements to be used in mathematical calculations.

Terms used in Matrices:

Order Of Matrices
 It’s the number of rows and columns in a matrix (R*C)

2 5 row

6 4

Column

Null matrix
 This is a matrixes where all the elements are equal to zero

Identity matrix
 It’s a matrix where the elements in the main diagonal are equal to one and the other are
equal to zero eg
1 0

0 1

Types of Matrices:
1. Row matrix: The matrix has only one row and any number of columns.
2. Column matrix: The matrix has only one columns and any number of rows.
3. Singleton matrix: If a matrix has only one element.
4. Null or Zero matrix: All the elements are zero in such a matrix.

BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 1
5. Square matrix: If the number of rows and columns in a matrix are equal, then it is called a square
matrix.

Matrix addition scalar multiplication.


 You can only add or subtract matrix of the same order
Example
A= 3 4
5 6
B= 4 1
2 3
C= 0 5
3 1
D= 4 2 0
1 3 5

FIND:
1. A+B
2. B+C
3. A+B+C

Matrix multiplication.
There are two types of matrix multiplication;

1. Multiplication by scalar

Eg k 4 5 == 4k 5k

3 2 3k 2k

2. Multiplication of a matrix with another matrix

 For one to multiply a matrix with another matrix the number of columns in the first matrix
must be equal to the number of rows in the second matrix

Eg given the matrix

A*D

BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 2
WHERE

A= 3 4

5 6

D= 4 2 0

1 3 5

Square matrices
 This is a matrix where the number of columns are equal to the number of rows
eg 2*2, 3*3, 4*4

Determinants
To get a determinant you pre-Multiply elements in the main diagonal and subtract the pre-
multiplication of elements in the secondary diagonal

Example

X= a b

c d det= ad-cb

exercise find the determinant

A= 5 4

3 6

Inverse of a 2*2 matrices


a) To get the inverse of a matrix
b) First get the determinant of a matrix,
c) then interchange the elements in the main diagonal
d) Change the signs of the elements in the secondary diagonal 1/det
e) Pre-multiply the determinant with the matrix that results from c and d above to get the
inverse.

BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 3
Exercise:

1. 4 1 3. 10 0

2 3 4 3

2. 5 4 4. 6 7

2 6 8 9

Using matrix method to find the values of unknown


 Given a system of linear equation you can use a matrix method to find the value of
unknown
 From a matrix equation on both sides of the equal signs

4 1 x 2

2 3 y = 0

 Find the inverse of the matrix on the left side of the equal signs and premulitiply it with the
original matrix and the matrix on the right side to get the value of x and y

Exercise find the value of x and y

i. 2x+y=4
3x+2y=6

ii. 4x+5y=10
x+y=5

iii. 8x+y=7
2x+2y=5

BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 4

You might also like