0% found this document useful (0 votes)
131 views15 pages

Fundamentals of Matrices: Scalar, Vectors and Matrices

A matrix is a rectangular arrangement of numbers organized into rows and columns. Key aspects of matrices include their elements, order (number of rows and columns), and the position of each element. A vector is a special type of matrix with only one row or one column. There are several types of matrices including square, diagonal, identity, upper/lower triangular, and scalar matrices. Basic matrix operations include addition, subtraction, scalar multiplication, and multiplication of two matrices which is only defined if the number of columns in the first matrix matches the number of rows in the second.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views15 pages

Fundamentals of Matrices: Scalar, Vectors and Matrices

A matrix is a rectangular arrangement of numbers organized into rows and columns. Key aspects of matrices include their elements, order (number of rows and columns), and the position of each element. A vector is a special type of matrix with only one row or one column. There are several types of matrices including square, diagonal, identity, upper/lower triangular, and scalar matrices. Basic matrix operations include addition, subtraction, scalar multiplication, and multiplication of two matrices which is only defined if the number of columns in the first matrix matches the number of rows in the second.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Fundamentals of Matrices

Scalar, Vectors and Matrices


Scalar
A scalar is a number, like 3, -5, 0.368, etc,

Vector
A vector is a list of numbers (can be in a row or column)

Matrix
A matrix is an array of numbers (one or more rows, one or more columns).

A matrix is just a rectangular arrangement of numbers, letters, characters,


symbols, or expressions in rows and columns. The plural of matrix is matrices.
 
Each row  
  Equal number of elements 
Each column  
 

Three basic things of every matrix are 

1) elements (e.g. 6 elements)  

2) order (e.g. 2x3 Matrix. i.e. 2 rows and 3 columns) 

3) position of an element [(row, column) th element. e.g. (1,2)th element = a12; (2,3)th element = a23; 
etc.) 

In fact a vector is also a matrix! Because a matrix can have just one row or
one column. So the rules that work for matrices also work for vectors.

   

PMASDS06, Apr 2020   Note by Ataul Morshed, ID #10, Batch 2, Sec ‐ A  P a g e  | 1 


Row vector 
417 526 , 41 0 26   Only one row and any number of 
columns 
Column  9
82 Only  one  column  and  any 
Vector  , 3  
63 number of rows 
0
Square Matrix  4 1 3 A matrix with the same number 
87 6 of rows and columns. 
, 7 4 0 
21 34
0 6 9
Diagonal  2 0 0 1 0 0 A  square  matrix  all  of  whose 
3 0
Matrix  , 0 4 0 , 0 7 0  non‐diagonal  elements  are  zero 
0 4
0 0 1 0 0 0 and  at  least  one  diagonal 
element is non‐zero 
Zero Matrix  0 0 0
0 0
, 0 0 0 
0 0
0 0 0
Identity  1 0 0
1 0 A  diagonal  matrix  all  of  whose 
Matrix (Unity  , 0 1 0  
0 1 leading  diagonal  elements  are 
matrix)  0 0 1 unity (1) 
Scalar Matrix  82 0 0
17 0 A  diagonal  matrix  all  of  whose 
, 0 82 0   diagonal  elements  are  equal. 
0 17
0 0 82 A  scalar  matrix  is  basically  a 
multiple of an identity matrix. 
Upper  2 1 3 1 4 2
3 1 A square matrix in which all the 
Triangular  , 0 4 2 , 0 7 0 
0 5 elements below the diagonal are 
Matrix  0 0 1 0 0 3 zero 
(Canonical 
form) 
Lower  2 0 0 1 0 0 A square matrix in which all the 
Triangular  3 0 elements above the diagonal 
, 7 4 0 , 8 7 0 
Matrix  2 5 are zero 
3 9 1 6 0 3
(Canonical 
form) 
Trace of a  3 0 The  sum  of  all  the  diagonal 
Matrix  ; ∴ 3 5 elements of a square matrix 
2 5

Transpose of a  1 3 1 2 Interchanging  rows  and 
Matrix  ;   columns.  1st  row  of  the  matrix 
2 5 3 5
becomes  the  1st  column  of  the 
2 3
2 1 4 transposed matrix, then 2nd row 
1 0  
3 0 5 becomes the 2nd column and so 
4 5
on. The order of the transposed 
matrix  will  also  be  transposed. 
So after transpose a 2 3 matrix 
will become 3 2 matrix 
 

PMASDS06, Apr 2020   Note by Ataul Morshed, ID #10, Batch 2, Sec ‐ A  P a g e  | 2 


Matrix Operations
Addition & Subtraction 
 Two matrices can be added only if they are of same order 
 Add corresponding elements (e.g two corresponding elements from Matrices A & B, a23 + 
b23) 
5 4 2 2 1 3
,  
1 6 3 4 0 5
5 2 4 1 2 3 7 3 5
 
1 4 6 0 3 5 3 6 2

To add two matrices: add the numbers in the matching positions:

These are the calculations:

3+4=7 8+0=8 

4+1=5 6−9=−3

The two matrices must be the same size, i.e. the rows must match in size, and
the columns must match in size.

Example: a matrix with 3 rows and 5 columns can be added to another


matrix of 3 rows and 5 columns.

But it could not be added to a matrix with 3 rows and 4 columns (the columns
don't match in size)

Negative
The negative of a matrix is also simple:

These are the calculations:

−(2)=−2 −(−4)=+4 

−(7)=−7 −(10)=−10

PMASDS06, Apr 2020   Note by Ataul Morshed, ID #10, Batch 2, Sec ‐ A  P a g e  | 3 


Subtracting
To subtract two matrices: subtract the numbers in the matching positions:

These are the calculations:

3−4=−1 8−0=8 

4−1=3 6−(−9)=15

Note: subtracting is actually defined as the addition of a negative matrix:


A + (−B)

Multiplication
Scalar Multiplication (Multiply by a Constant)
′  

We can multiply a matrix by a constant (the value 2 in this case):

These are the calculations:

2×4=8 2×0=0 

2×1=2 2×−9=−18

Product of two Matrices


Product compatibility of two matrices A and B 

 
A×B  If 
  Columns A = Rows B  A×B = B×A (NOT always!)
compatible 
  Sometimes,  
B×A  If  it can be A×B ≠ B×A 
Columns B = Rows A
compatible   
 

PMASDS06, Apr 2020   Note by Ataul Morshed, ID #10, Batch 2, Sec ‐ A  P a g e  | 4 


1 2 1 2 0
: ,  
1 0 1 1 3
In this example   is compatible of multiplication because Columns A = Rows B (i.e. 2 = 2) 

1 1 2 1 1 2 2 1 1 0 2 3
 
1 1 0 1 1 2 0 1 1 0 0 3
3 0 6
∴  
1 2 0
But, in this example   is NOT compatible of multiplication because Columns B ≠ Rows A 
,  

But to multiply a matrix by another matrix we need to do the "dot product"


of rows and columns ... what does that mean? Let us see with an example:

To work out the answer for the 1st row and 1st column:

The "Dot Product" is where we multiply matching members, then sum up:

(1, 2, 3) • (7, 9, 11) = 1×7 + 2×9 + 3×11 = 58

We match the 1st members (1 and 7), multiply them, likewise for the 2nd
members (2 and 9) and the 3rd members (3 and 11), and finally sum them
up.

Want to see another example? Here it is for the 1st row and 2nd column:

PMASDS06, Apr 2020   Note by Ataul Morshed, ID #10, Batch 2, Sec ‐ A  P a g e  | 5 


(1, 2, 3) • (8, 10, 12) = 1×8 + 2×10 + 3×12 = 64

We can do the same thing for the 2nd row and 1st column:

(4, 5, 6) • (7, 9, 11) = 4×7 + 5×9 + 6×11 = 139

And for the 2nd row and 2nd column:

(4, 5, 6) • (8, 10, 12) = 4×8 + 5×10 + 6×12 = 154

And we get:

DONE!

 
The multiplication of two matrices if the dimensions of the matrices conform in
the following manner: When A is ( n X k ) and B is ( k X p), so that the number
of elements in a row of A is the same as the number of elements in a column
of B, we can form the matrix product AB. An element of the new matrix AB is
formed by taking the inner product of each row of A with each column of B.

PMASDS06, Apr 2020   Note by Ataul Morshed, ID #10, Batch 2, Sec ‐ A  P a g e  | 6 


Identity Matrix
The "Identity Matrix" is the matrix equivalent of the number "1":

A 3×3 Identity Matrix


 It is "square" (has same number of rows as columns)
 It can be large or small (2×2, 100×100, ... whatever)
 It has 1s on the main diagonal and 0s everywhere else
 Its symbol is the capital letter I

It is a special matrix, because when we multiply by it, the original is


unchanged:
A×I=A
I×A=A
Order of Multiplication
In arithmetic we are used to:

3×5=5×3
(The Commutative Law of Multiplication)

But this is not generally true for matrices (matrix multiplication is not
commutative):
AB ≠ BA
When we change the order of multiplication, the answer is (usually) different.

Example:
See how changing the order affects this multiplication:

The answers are different!

It can have the same result (such as when one matrix is the Identity Matrix)
but not usually.

PMASDS06, Apr 2020   Note by Ataul Morshed, ID #10, Batch 2, Sec ‐ A  P a g e  | 7 


Dividing
And what about division? Well we don't actually divide matrices, we do it
this way:

A/B = A × (1/B) = A × B-1

Where, B-1 means the "inverse" of B.

So we don't divide, instead we multiply by an inverse.

And there are special ways to find the Inverse, which is explained later.

Transposing
To "transpose" a matrix, swap the rows and columns.

We put a "T" in the top right-hand corner to mean transpose:

 
; ⟶   
 
; :

Notation
A matrix is usually shown by a capital letter (such as A, or B)

Each entry (or "element") is shown by a lower case letter with a


"subscript" of row,column:

PMASDS06, Apr 2020   Note by Ataul Morshed, ID #10, Batch 2, Sec ‐ A  P a g e  | 8 


Determinant of a Matrix
The determinant of a matrix is a special number that can be calculated
from a square matrix.

A Matrix
(This one has 2 Rows and 2 Columns)

The determinant of that matrix is (calculations are explained later):

3×6 − 8×4 = 18 − 32 = −14


What is it for?

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

Symbol
The symbol for determinant is two vertical lines either side.

Example:

|A| means the determinant of the matrix A

Calculating the Determinant


First of all the matrix must be square (i.e. have the same number of rows as
columns). Then it is just basic arithmetic. Here is how:

For a 2×2 Matrix 
For a 2×2 matrix (2 rows and 2 columns):

The determinant is:

|A| = ad − bc
"The determinant of A equals a times d minus b times c"

It is easy to remember when you think of a cross:

 Blue is positive (+ad),


 Red is negative (−bc)

PMASDS06, Apr 2020   Note by Ataul Morshed, ID #10, Batch 2, Sec ‐ A  P a g e  | 9 


Example:

|B|= 4×8 − 6×3


= 32 − 18
= 14
For a 3×3 Matrix 

For a 3×3 matrix (3 rows and 3 columns):

The determinant is:

|A| = a(ei − fh) − b(di − fg) + c(dh − eg)


"The determinant of A equals ... etc"

It may look complicated, but there is a pattern:

To work out the determinant of a 3×3 matrix:

 Multiply a by the determinant of the 2×2 matrix that is not in a's


row or column.
 Likewise for b, and for c
 Sum them up, but remember the minus in front of the b

As a formula (remember the vertical bars || mean "determinant of"):

"The determinant of A equals a times the determinant of ... etc"

PMASDS06, Apr 2020   Note by Ataul Morshed, ID #10, Batch 2, Sec ‐ A  P a g e  | 10 


Example:

|C|= 6×(−2×7 − 5×8) − 1×(4×7 − 5×2) + 1×(4×8 − (−2×2))


= 6×(−54) − 1×(18) + 1×(36)
= −306
Summary of Matrix Determinant
 For a 2×2 matrix the determinant is ad - bc
 For a 3×3 matrix multiply a by the determinant of the 2×2
matrix that is not in a's row or column, likewise for b and c, but
remember that b has a negative sign!
 The pattern continues for larger matrices: multiply a by
the determinant of the matrix that is not in a's row or column,
continue like this across the whole row, but remember the + − + −
pattern.

Singular Matrix ⟶ Det = 0


Non-Singular Matrix ⟶ Determinant of the matrix is non-zero (Det≠0)

Determinants can only be calculated for square matrices.


1
, | | 0
| |
The adjoint of a matrix A is the transpose of the cofactor matrix of A. It is denoted
by Adj (A). An adjoint matrix is also called an adjugate matrix. 


′ 

 


∴  

In case of a Symmetric matrix ⟶ ′

PMASDS06, Apr 2020   Note by Ataul Morshed, ID #10, Batch 2, Sec ‐ A  P a g e  | 11 


Inverse of a Matrix

This is the reciprocal of a number:

Reciprocal of a Number

The Inverse of a Matrix is the same idea but we write it A-1

Why not 1/A ? Because we don't divide by a matrix! And anyway 1/8 can also
be written 8-1

And there are other similarities:

When we multiply a number by its reciprocal we get 1

8 × (1/8) = 1

When we multiply a matrix by its inverse we get the Identity


Matrix (which is like "1" for matrices):

A × A-1 = I

Same thing when the inverse comes first:

(1/8) × 8 = 1
A-1 × A = I
1. The inverse of A is A-1 only when A × A-1 = A-1 × A = I.
2. To find the inverse of a 2x2 matrix: swap the positions of a and d, put negatives in
front of b and c, and divide everything by the determinant (ad-bc).
3. Sometimes there is no inverse at all.

PMASDS06, Apr 2020   Note by Ataul Morshed, ID #10, Batch 2, Sec ‐ A  P a g e  | 12 


Why Do We Need an Inverse?

Because with matrices we don't divide! Seriously, there is no concept of


dividing by a matrix.

But we can multiply by an inverse, which achieves the same thing.

Imagine we can't divide by numbers ...

... and someone asks "How do I share 10 apples with 2 people?"

But we can take the reciprocal of 2 (which is 0.5), so we answer:

10 × 0.5 = 5

They get 5 apples each.

The same thing can be done with matrices:

Say we want to find matrix X, and we know matrix A and B:

XA = B

It would be nice to divide both sides by A (to get X=B/A), but remember we
can't divide.

But what if we multiply both sides by A-1 ?

XAA-1 = BA-1

And we know that AA-1 = I, so:

XI = BA-1

We can remove I (for the same reason we can remove "1" from 1x = ab for
numbers):

X = BA-1

And we have our answer (assuming we can calculate A-1)

In that example we were very careful to get the multiplications correct,


because with matrices the order of multiplication matters. AB is almost never
equal to BA.

PMASDS06, Apr 2020   Note by Ataul Morshed, ID #10, Batch 2, Sec ‐ A  P a g e  | 13 


 

We can calculate the Inverse of a Matrix by:


1. Step 1: calculating the Matrix of Minors,
2. Step 2: then turn that into the Matrix of Cofactors,
3. Step 3: then the Adjugate, and.
4. Step 4: multiply that by 1/Determinant.

PMASDS06, Apr 2020   Note by Ataul Morshed, ID #10, Batch 2, Sec ‐ A  P a g e  | 14 


The Inverse May Not Exist

First of all, to have an inverse the matrix must be "square" (same number of
rows and columns).

But also the determinant cannot be zero (or we end up dividing by zero).
How about this:

24-24? That equals 0, and 1/0 is undefined.


We cannot go any further! This Matrix has no Inverse.

Such a matrix is called "Singular", which only happens when the


determinant is zero.

And it makes sense ... look at the numbers: the second row is just double
the first row, and does not add any new information.

And the determinant lets us know this fact.

Square matrices are best understood in terms of quantities called eigenvalues and
eigenvectors.

Eigenvectors & Eigenvalues


During Matrix Transformation most vectors will stretch and rotate. However there are
certain vectors that only stretch and do not at all change direction. These vectors are
known as Eigenvectors. And the amounts by which they stretch are known as
Eigenvalues

A vector that after transformation has not changed at all except by a scalar value
known as the eigenvalue.
λ  
Let A be an n×n matrix. A scalar λ is called an eigenvalue of A if there is a
nonzero vector such that λ . Such a vector is called eigenvector of A
corresponding to λ.

PMASDS06, Apr 2020   Note by Ataul Morshed, ID #10, Batch 2, Sec ‐ A  P a g e  | 15 

You might also like