You are on page 1of 45

Matrices

Review this video

► https://www.youtube.com/watch?v=7vnfRPzAQ0g

What is a matrix?
►A matrix is a rectangular array of items/numbers.

Element
An individual item in a matrix
Terminology

Rows and Columns


► The elements of a matrix are arranged in rows and columns.
► Elements that are written from left to right (horizontally) are called rows.
► Elements that are written from top to bottom (vertically) are called columns.
► The first row is called ‘row 1’, the second ‘row 2’, and so on.
► The first column is called ‘column 1, the second ‘column 2’, and so on.
Terminology

Dimension
► The number of rows followed by columns in a matrix
Matrices
A matrix is a rectangular array of numbers
arranged in rows and columns.
The dimensions of a matrix are written as
rows x columns.
Count
Count Across
Down
Matrices - Introduction

1. Column matrix or vector:


The number of rows may be any integer but the number of
columns is always 1
Matrices - Introduction

Row matrix or vector


Any number of columns but only one row
Matrices - Introduction

3. Rectangular matrix
Contains more than one element and number of rows is not equal
to the number of columns
Matrices - Introduction

Square matrix
The number of rows is equal to the number of columns
(a square matrix A has an order of m)
mxm
Matrices - Introduction

5. Diagonal matrix
A square matrix where all the elements are zero except those on the
main diagonal
Matrices - Introduction
TYPES OF MATRICES

6. Unit or Identity matrix - I


A diagonal matrix with ones on the main diagonal
Matrices - Introduction
TYPES OF MATRICES

Null (zero) matrix - 0


All elements in the matrix are zero
Matrices - Introduction

Triangular matrix
A square matrix whose elements above or below the main diagonal
are all zero
Matrices – Introduction

Scalar matrix
A diagonal matrix whose main diagonal elements are equal
to the same scalar
A scalar is defined as a single number or constant
Matrices - Operations

EQUALITY OF MATRICES
Two matrices are said to be equal only when all
corresponding elements are equal
Therefore their size or dimensions are equal as well

A= B= A=B
Matrices - Operations
ADDITION AND SUBTRACTION OF MATRICES

The sum or difference of two matrices, A and B of the same size


yields a matrix C of the same size

Matrices of different sizes cannot be added or subtracted


Matrices - Operations
A+0=0+A=A
A + (-A) = 0 (where –A is the matrix composed of –aij as elements)
Naming Matrices
A capital letter is used to name a matrix.

Each individual entry/element is


named by its position in the matrix.
They are named by row then the
column ⎡a
a a a a ⎤
11 12 13 14 15⎥
⎢⎢ a a a a
a
⎢ a3 ⎥

21 22 23 24 25

a32 a33 a34 a35 ⎥



1
Naming Matrices

► easy way to remember


► You have to cross the bridge
► Before you jump into the river
Example

53
⎢⎡ ⎤ ⎥
−7 4 2 ⎢−4⎥ 4
⎡⎢ ⎥ ⎤
8−1 0 ⎢
⎣ ⎦ ⎣ 2

This is a 2 x 3 0 ⎦
This is a 3 x 2
matrix matrix
Find a13, a24, and
a33
a24, and
Find a13
a33
,
Find a13, a24, and
a33
Find a13, a24, and
a33
3 X 2 2 X 2 3 X 3

1X 2 2X 1 1X 1
Addition and Subtraction of matrices

► To add or subtract matrices, they must be of the same order, mxn.


To add matrices of the same order, add their corresponding
entries. To subtract matrices of the same order, subtract their
corresponding entries. The general rule is as follows using
mathematical notation:
An example:

► 1. Add the matrices ► Solution: Adding corresponding


entries we have

► First, note that each matrix has


dimensions of 3X3, so we are able
to perform the addition. The result
is shown at right:
Subtraction of matrices

► Now, we will subtract the ► Subtract corresponding


same two matrices entries as follows:

=
Scalar Multiplication

► The scalar product of a number k and a matrix A is the matrix denoted by


kA, obtained by multiplying each entry of A by the number k . The
number k is called a scalar. In mathematical notation,
Example of scalar multiplication

► Find (-1)A where ► Solution:


► A= ► (-1)A=

► -1
An example

► The example at right ► Solution:


illustrates this procedure for 2
2X2 matrices.
Multiplying Matrices
MATRIX MULTIPLICATION

1. The order makes a difference…AB is different from BA.


2. The number of columns in first matrix must equal number of
rows in second matrix.
In other words, the inner dimensions must be equal.
3. The answer will be number of rows in first matrix by number
of columns in second matrix.
In other words, the outside dimensions.

Are the following matrix multiplications possible?

2x1 1x2 1x2 2x1


A matrix of m rows and n columns is
called a matrix with dimensions m x
n.

2 X 3
3 X 3

2 X 1
1 X 2
Are the following matrix multiplications possible?

NO YES

3x2 3x2 2x3 3x2

YES YES

3x2 2x3 3x1 1x3

YES
NO

2x2 2x2
3x3 2x2
What is the dimension of the following products, if possible?

NO YES
2x2

3x2 3x2 2x3 3x2

YES YES
3x3 3x3
3x2 2x3 3x1 1x3

YES
NO
2x2
2x2 2x2
3x3 2x2
MATRIX MULTIPLICATION

The product of two matrices is found by multiplying the


corresponding elements in each row by each column
and then adding them together.

ROW…COLUMN
MATRIX MULTIPLICATION SUMMARY

1. Is the multiplication possible?

2. If yes, what is the dimension of the product?

3. Create a “blank” matrix.

4. “Multiply/Add” corresponding rows and columns


Column Column Column Column
1 2 3 4
Row 1

Row 2
Row 3

Row m
Evaluate
1) A+B
2) A-B
3) 3A+B
Matrix Multiplication

You might also like