Maths2_Lecture_Notes
Maths2_Lecture_Notes
Kieran Hughes
1 Relations 5
1.9 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2
CONTENTS 3
2 Matrices 18
3 Probability 26
3.4.1 Independence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.5 Permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.6 Combinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4 Trigonometry 37
Relations
In this chapter, we will explore the concept of relations, which form the foundation of many important ideas in both
mathematics and computer science. A relation describes how elements from different sets are associated with one
another. While the formal definition of a relation will come later, for now, we focus on understanding the broader
significance of relations and their applications.
Relations are essential because they help us model and understand how different entities are connected or interact.
In computing, relations allow us to describe and work with associations between data, making them a key tool for
organising, analysing, and processing information.
• Databases: The design of relational databases is directly built on the concept of relations. In fact, SQL
(Structured Query Language) is used to define and manipulate relations between tables of data.
• Data Modelling: When modelling real-world problems, we often need to represent relationships between
different entities, such as users and their permissions in a system, or nodes in a network. Relations are used to
formally describe these connections.
• Graph Theory and Networks: Relations underpin graph theory, which is widely used in network design,
social network analysis, and communication systems.
• Programming: In functional programming languages, relations help define how data inputs are mapped to
outputs in functions, providing a way to reason about program behaviour.
By gaining an understanding of relations, you will develop a powerful toolset for modelling and solving problems that
are fundamental to the field of computing. Relations give you a way to express complex relationships in a clear, formal,
and structured manner. Below is an example of a relation in the programming language C#.
5
6 CHAPTER 1. RELATIONS
1 using System ;
2 using System . Collections . Generic ;
3
4 class Program
5 {
6 static void Main ()
7 {
8 // Define a relation where each key can map to multiple values
9 Dictionary < string , List < string > > relation = new Dictionary < string , List < string > >() ;
10
11 // Adding relations
12 relation [ " A " ] = new List < string > { " 1 " , " 2 " }; // A is related to 1 and 2
13 relation [ " B " ] = new List < string > { " 2 " , " 3 " }; // B is related to 2 and 3
14 relation [ " C " ] = new List < string > { " 3 " }; // C is related to 3
15
16 // Display the relation
17 foreach ( var key in relation . Keys )
18 {
19 Console . Write ( key + " is related to : " ) ;
20 foreach ( var value in relation [ key ])
21 {
22 Console . Write ( value + " " ) ;
23 }
24 Console . WriteLine () ;
25 }
26 }
27 }
A set is a well-defined collection of distinct objects, considered as an object in its own right. Sets are typically denoted
by capital letters, and the elements of a set are usually enclosed in curly braces. For example, the set A = {1, 2, 4}
contains the elements 1, 2, and 4.
The Cartesian product of two sets A and B, denoted A × B, is the set of all ordered pairs (a, b), where a ∈ A and
b ∈ B. Formally:
A × B = {(a, b) | a ∈ A and b ∈ B}.
For example, if A = {1, 2, 4} and B = {x, y}, then:
A × B = {(1, x), (1, y), (2, x), (2, y), (4, x), (4, y)}.
A relation R from a set A to a set B is a subset of the Cartesian product A × B. In other words, R ⊆ A × B, and for
each pair (a, b) ∈ R, a ∈ A is related to b ∈ B through the relation R.
Example 1.2.1. Let A = {bat, cat, rat, brat} and B = {green, white, gold}. Define the relation R from A to B by
R = {(bat, white), (bat, gold), (rat, white)}.
Example 1.2.2. In computing, a common example of a relation is the mapping of users to multiple devices. Let A
be a set of users and B be a set of devices. A relation R ⊆ A × B can represent the devices associated with each user.
For instance, in C# we can represent this relation using a dictionary where each user is mapped to a list of devices:
1.3. SOURCE SET, CODOMAIN, DOMAIN, AND RANGE 7
1 Dictionary < string , List < string > > relation = new Dictionary < string , List < string > >();
2 relation [ " User1 " ] = new List < string > { " DeviceA " , " DeviceB " };
3 relation [ " User2 " ] = new List < string > { " DeviceC " };
Exercises 1.2.3. Let A = {Car, Boat, Aeroplane, Hoverboard}, B = {4, 6, 8, 9} and let C = {33, 34, 35, 39, 55}.
(a) Write down any relation R from A to B (b) Write down any relation S from B to C
(c) Write down any relation T from C to A (d) Write down any relation U from A to B × C.
The terms source set, codomain, domain, and range all refer to specific sets for each relation. The following example
will demonstrate which sets they refer to.
Example 1.3.1. Let A = {1, 2, 3, 4} and B = {a, b, c}. Define the relation R from A to B as follows:
Then
• The Source Set is the set that the relation R is mapped from: A = {1, 2, 3, 4}
• The codomain is the set that the relation R is mapped to: B = {a, b, c}
• The domain, denoted by Dom, is the largest subset of the source set such that each element in the domain is
mapped by the relation R: Dom(R) = {1, 2}.
• The range, denoted by Ran, is the largest subset of the codomain such that each element in the range is mapped
to by the relation R: Ran(R) = {a, c}.
Exercises 1.3.2. Let A = {x, y, z}, B = {1, 2, 3, 4}, and C = {α, β, γ}. Define the relation R from B to A by
R = {(2, y), (2, z), (4, z)}. Define the relation S from A to C by R = {(x, α), (x, β), (y, α), (y, β), (y, γ)}.
(a) List the elements of Dom(R). (b) List the elements of Ran(S).
(c) List the elements of the source set of S. (d) List the elements of the codomain of R.
(e) List the elements of Ran(R) ∩ Dom(S). (f) List the elements of Dom(R) × Ran(S).
A restriction of a relation R is a new relation formed by selecting a subset of the elements from the original relation.
We will examine four types of restrictions on a relation.
8 CHAPTER 1. RELATIONS
This represents the relation R with the domain restricted to the set C. Specifically:
• The domain of C ◁ R is Dom(R) ∩ C, that is, the set of elements x ∈ C that appear in the first position of some
pair in R.
• The range of C ◁ R is {y ∈ B | ∃x ∈ C such that (x, y) ∈ R}, that is, the set of elements y ∈ B that appear in
the second position of pairs in C ◁ R.
C−
◁ R = {(x, y) | (x, y) ∈ R and x ∈
/ C} = R ∩ ((A \ C) × B)
This represents the relation R with the domain restricted to the set A \ C. Specifically:
• The domain of C −◁ R is Dom(R) ∩ (A \ C), that is, the set of elements x ∈ A \ C that appear in the first position
of some pair in R.
• The range of C − ◁ R is {y ∈ B | ∃x ∈ (A \ C) such that (x, y) ∈ R}, that is, the set of elements y ∈ B that
appear in the second position of pairs in C −
◁ R.
• The codomain of C −
◁ R is the set B.
This represents the relation R with the range restricted to the set C. Specifically:
• The domain of R ▷ C is {x ∈ A | ∃y ∈ C such that (x, y) ∈ R}, that is, the set of elements x ∈ A that appear
in the first position of pairs in R ▷ C.
Answers:
(a) {1, 5} ◁ R is the relation from A to B defined by {(1, a), (1, b), (1, d), (1, e), (5, b), (5, e)}.
(b) {1, 2, 4} ◁
− R is the relation from A to B defined by {(3, a), (3, c), (5, b), (5, e)}.
(c) R ▷ {a, c} is the relation from A to B defined by {(1, a), (2, a), (2, c), (3, a), (3, c)}.
(d) R−
▷ {a, b} is the relation from A to B defined by {(1, d), (1, e), (2, c), (2, e), (3, c), (5, e)}.
Exercises 1.4.2. Let R be the relation from the set X = { Apple, Sony, Adidas, Puma, Nike, Samsung } to the set
Y = { very poor, poor, ok, good, very good } defined by
R = {(Apple, poor), (Sony, very poor), (Adidas, very good), (Puma, ok), (Nike, poor), (Samsung, ok)}.
The inverse of a relation R, denoted R−1 , is the relation obtained by swapping the elements in each pair of R.
Formally, for a relation R from a set A to a set B, the inverse relation R−1 is a relation from B to A defined as:
R−1 = {(y, x) | (x, y) ∈ R}.
Thus, R−1 contains all pairs where the first element is from B and the second element is from A, with their order
reversed from the original relation R.
10 CHAPTER 1. RELATIONS
Exercises 1.5.2. Let R be the relation from the set {Red, Blue, Green, Grey} to the set {1, 2, 3, 4} and let S be the
relation from the set {1, 2, 3, 4} to {Red, Blue, Green} defined by
(a) Find the inverse relation R−1 . (b) Find S −1 , the inverse relation of S.
The composition of two relations R and S is a new relation that combines the two original relations. Formally, if R is
a relation from set A to set B and S is a relation from set B to set C, then the composition S ◦ R is defined as follows:
In simpler terms, we can think of the composition as a way to ’chain’ the relations together. For each element a in set
A, we can find a corresponding b in set B through R, and then from b, we find a corresponding c in set C through S.
Example 1.6.1. Let R be the relation from the set A = {1, 2, 3, 4} to the set B = {a, b, c, d}, defined by R =
{(1, a), (1, b), (2, d), (3, a)}. Let S be the relation from the set B = {a, b, c, d} to the set C = {α, β, γ}, defined by
S = {(b, β), (b, γ), (c, β), (d, α)}.
This means that from the element 1 in set A, we can reach both β and γ in set C via the intermediate element b in
set B. Also 2 ∈ A is mapped to α ∈ C, via d ∈ B.
1.7. A PRACTICAL EXAMPLE OF USING RELATIONS IN COMPUTING 11
1 a α
2 b β
3 c γ
4 d
Exercises 1.6.2. Let A = {x, y, z}, let B = {1, 2, 3, 4, 5} and let C = {α, β, γ}.
For each of the defined relations, find the resulting composition as specified below.
(a) Find the composition S1 ◦ R1 . (b) Find the composition S2 ◦ R1 . (c) Find the composition S3 ◦ R1 .
(d) Find the composition S1 ◦ R2 . (e) Find the composition S2 ◦ R2 . (f) Find the composition S3 ◦ R2 .
(g) Find the composition S1 ◦ R3 . (h) Find the composition S2 ◦ R3 . (i) Find the composition S3 ◦ R3 .
Example 1.7.1. Consider a scenario in a software application where users can access different modules based on their
roles. Let R represent the relation between users and roles, and S represent the relation between roles and accessible
modules.
Let R be the relation from the set of users A = {Alice, Bob, Charlie, David, Eva, Frank} to the set of roles B =
{Admin, Editor, Viewer, Manager, Contributor} defined by
R = {(Alice, Admin), (Bob, Editor), (Charlie, Viewer), (David, Viewer), (Eva, Contributor), (Frank, Editor)}.
Let S be the relation from the set of roles B to the set of modules C = { Dashboard, Reports, Settings, Analytics,
User Management } defined by
S = {(Admin, Dashboard), (Admin, Reports), (Editor, Reports), (Viewer, Dashboard), (Manager, User Management),
(Contributor, Analytics), (Editor, Analytics), (Manager, Reports)}.
12 CHAPTER 1. RELATIONS
R−1 = {(Admin, Alice), (Editor, Bob), (Viewer, Charlie), (Viewer, David), (Contributor, Eva), (Editor, Frank)}
S ◦ R = {(Alice, Dashboard), (Alice, Reports), (Bob, Reports), (Bob, Analytics), (Charlie, Dashboard),
(David, Dashboard), (Eva, Analytics), (Frank, Reports), (Frank, Analytics)}.
(i) If a user is in the Viewer role, what modules can they access?
Answer: A user in the Viewer role can only access the Dashboard module.
Exercises 1.7.2. Consider a scenario in which a company where employees join teams and teams are assigned projects.
Let R represent the relation between employees and teams, and S represent the relation between teams and projects.
Let R be the relation from the set of employees A = {Ann, Barry, Cath, Dude, Emma, Freya, Greta, Henry} to the set
of teams B = {HR, Finance, Sales, Research, Management} defined by
R = {(Ann, Management), (Ann, HR), (Barry, Sales), (Cath, Finance), (Dude, Research), (Emma, Sales),
(Freya, Sales), (Greta, Finance), (Henry, Management)}.
Let S be the relation from the set of teams B to the set of projects C = { Payroll, Accounts, Gismo2000, 5%MarketShare}
defined by
S = {(HR, Payroll), (Management, Payroll), (Finance, Accounts), (Management, Accounts), (Research, Gismo2000),
(Management, Gismo2000), (Sales, 5%MarketShare), (Management, 5%MarketShare)}.
(a) What is the domain of the relation R? (b) What is the range of the relation R?
(c) What is the codomain of the relation R? (d) Identify the source set of the relation S?
(e) Determine the inverse of the relation S. (f) Determine the inverse of the relation R.
(g) Find the composition S ◦ R. (h) Which project has the most people working on it?
(i) List the employees who are working of the Gismo2000 project?
1.8. RELATIONS ON A SET 13
In this section we shall consider relations where the source set and the codomain are the same set. Let R be a relation
from a set A to A. Then R is said to be a relation on A. This is just a special case of the relations that we have
already studied. However, it is a very important special case as it allows for R to be composed with itself. This means
that R ◦ R is also a relation on A and so can again be composed with R. Therefore R can be composed with itself
any number of times. Thus, we introduce the concept of a relation having an exponent. There are three important
properties that a relation on a set may have, namely reflexive, symmetric and transitive.
Let R be a relation on the set A (from A to A). Then R is reflexive if for every element a ∈ A, the pair (a, a) is in
R. That is, every element of A is related to itself. In other words, R is reflexive if and only if (a, a) ∈ R for all a ∈ A.
When studying a relation on a set, it can be very useful to draw the relation as a directed graph (digraph) as the next
example shows.
Example 1.8.1. Let A = {1, 2, 3} and let R = {(1, 1), (2, 2), (3, 3), (1, 2)}. In this case, R is reflexive because each
element of A is related to itself. We see (1, 1), (2, 2), and (3, 3) are all in R. Using the digraph to represent the relation,
we see that the reflexive property is represented by each element (node) having a loop (an arrow from the node back
to itself).
1 2
Let R be a relation on the set A (from A to A). Then R is symmetric if for every pair of elements (a, b) ∈ R, the
pair (b, a) is also in R. In other words, if a is related to b, then b is related to a.
When studying a relation on a set, it can be very useful to draw the relation as a directed graph (digraph) as the next
example shows.
Example 1.8.2. Let A = {1, 2, 3} and let R = {(1, 2), (2, 1), (2, 3), (3, 2)}. In this case, R is symmetric because for
every pair in R, the corresponding pair in the opposite direction is also included. We see that both (1, 2) and (2, 1)
are in R, as well as (2, 3) and (3, 2). Using the digraph to represent the relation, we see that the symmetric property
is represented by pairs of arrows pointing in opposite directions between the nodes.
14 CHAPTER 1. RELATIONS
1 2
Let R be a relation on the set A (from A to A). Then R is transitive if for every pair of elements (a, b) ∈ R and
(b, c) ∈ R, the pair (a, c) is also in R. In other words, if a is related to b and b is related to c, then a must be related
to c.
When studying a relation on a set, it can be very useful to draw the relation as a directed graph (digraph) as the next
example shows.
Example 1.8.3. Let A = {1, 2, 3} and let R = {(1, 2), (2, 3), (1, 3)}. In this case, R is transitive because for the pairs
(1, 2) and (2, 3) in R, the pair (1, 3) is also included in R. Using the digraph to represent the relation, we see that the
transitive property is represented by an arrow from a to c whenever there is a path from a to b and then from b to c.
In other words, if you can get from a node to a node in 2 steps you must be able to get there directly (in one step).
1 2
R = {(1, 1), (1, 2), (2, 2), (3, 3), (3, 4), (4, 1), (4, 2)}.
Let S be the relation on the set B = {x | x ∈ Z and 0 < x < 12} defined by (a, b) ∈ R if and only if a divides b.
1.9 Functions
In this section, we shall define a function and discuss its properties. A function f from a set A to a set B, denoted
f : A → B, is a relation from A to B such that for every element a ∈ A, there is exactly one element b ∈ B such that
(a, b) ∈ f . In other words, a function assigns to each element of A exactly one element of B.
There are three important properties that a function may have, namely injective, surjective, and bijective.
A function f : A → B is injective (or one-to-one) if for every pair of elements a1 , a2 ∈ A, if f (a1 ) = f (a2 ), then
a1 = a2 . In other words, no two different elements of A are mapped to the same element of B.
When studying functions, it can be useful to represent them with a diagram, as the next example shows.
Example 1.9.1. Let A = {1, 2, 3} and B = {a, b, c}, and define the function f : A → B by f (1) = a, f (2) = b, and
f (3) = c. In this case, f is injective because no two different elements of A are mapped to the same element of B.
Now, define another function g : A → B by g(1) = b, g(2) = c, and g(3) = c. In this case, g is not injective because
both g(2) = c and g(3) = c, meaning two different elements of A are mapped to the same element of B.
f g
A B A B
1 a 1 a
2 b 2 b
3 c 3 c
16 CHAPTER 1. RELATIONS
A function f : A → B is surjective (or onto) if for every element b ∈ B, there is at least one element a ∈ A such that
f (a) = b. In other words, every element of B is mapped to by some element of A.
Example 1.9.2. Let A = {1, 2, 3} and B = {a, b}, and define the function f : A → B by f (1) = a, f (2) = b, and
f (3) = a. In this case, f is surjective because every element of B is mapped to by at least one element of A. Element
a is mapped to by both 1 and 3, and element b is mapped to by 2.
Now, define another function g : A → B by g(1) = a, g(2) = a, and g(3) = a. In this case, g is not surjective because
there is no element of A that maps to b, meaning b ∈ B is not covered by the function.
f g
A B A B
1 1
a a
2 2
b b
3 3
A function f : A → B is bijective (or a one-to-one correspondence) if it is both injective and surjective. In other
words, a bijective function pairs every element of A with exactly one unique element of B, and every element of B is
paired with exactly one unique element of A.
Example 1.9.3. Let A = {1, 2, 3} and B = {a, b, c}.
• Define the function f1 : A → B by f1 (1) = a, f1 (2) = a, and f1 (3) = b. In this case, f1 is not injective since
f1 (1) = f1 (2) = a. The function f1 is also not surjective, since c ∈ B is not mapped to by any element of A.
• Define the function f2 : (A \ {3}) → B by f2 (1) = a, and f2 (2) = b. In this case, f2 is injective since no two
different elements of (A \ {3}) are mapped to the same element of B. The function f1 is not surjective because
no element of (A \ {3}) is mapped to c ∈ B.
• Define the function f3 : A → (B \ {a}) by f3 (1) = b, f3 (2) = c, and f3 (3) = b. In this case, f3 is not injective
since f3 (1) = f3 (3) = b. The function f3 is surjective because every element of (B \ {a}) is mapped to by some
element of A.
• Finally, define the function f4 : A → B by f4 (1) = c, f4 (2) = a, and f4 (3) = b. In this case, f4 is both injective
and surjective, making it a bijective function.
f1 f2 f3 f4
A B A \ {3} B A B \ {a} A B
1 a 1 a 1 1 a
2 b 2 b 2 b 2 b
3 c c 3 c 3 c
1.9. FUNCTIONS 17
Exercises 1.9.4. Let f : {1, 2, 3, 4} → {a, b, c} be defined by f (1) = a, f (2) = b, f (3) = a, and f (4) = c.
Let A = {1, 2, 3, 4, 5, 6, 7}. Define the function n : A → A by n(x) =, the number of letter in the English spelling of
the number x. Therefore for example n(5) = 4, since ”five” has 4 letters.
Matrices
Matrices are rectangular arrays of numbers, symbols, or expressions, arranged in rows and columns. They serve as a
fundamental tool in linear algebra, a branch of mathematics that studies vector spaces and linear mappings between
them. A matrix can be denoted as A = [aij ], where aij represents the element in the i-th row and j-th column.
In linear algebra, matrices are used to represent and solve systems of linear equations, transform geometric objects, and
perform operations on vectors. Their study is essential for understanding various concepts in computing, particularly
in fields such as computer graphics, machine learning, and data analysis.
Matrices have numerous applications in computing, which include but are not limited to:
• Computer Graphics: Matrices are used to perform transformations such as translation, rotation, and scaling
of objects in a 2D or 3D space. They facilitate the manipulation and rendering of images on the screen.
• Machine Learning: In machine learning, matrices are essential for representing datasets, where rows cor-
respond to observations and columns correspond to features. Matrix operations are crucial in algorithms for
training models, such as linear regression and neural networks.
• Data Analysis: Matrices are used in data analysis techniques, such as Principal Component Analysis (PCA),
which involves matrix decomposition to reduce dimensionality and identify patterns in large datasets.
• Network Analysis: In computer networking, matrices can represent connections between nodes in a graph,
facilitating the analysis of network structures and flows.
• Scientific Computing: Matrices are used to solve differential equations, model systems in physics and engi-
neering, and perform numerical simulations.
Given their versatility and importance, understanding matrices and their properties is vital for students pursuing
studies in computing and related fields.
18
2.2. THE SHAPE OF A MATRIX 19
Matrices can come in various shapes, depending on the number of rows and columns they contain. For instance, a
matrix with m rows and n columns is said to have a shape of m × n. Below are examples of matrices with different
shapes:
• A 2 × 3 matrix:
1 2 3
A=
4 5 6
• A 3 × 2 matrix:
7 8
B =9 10
11 12
20
• A 2 × 2 identity matrix:
1 0
I=
0 1
To understand how to calculate the shape of a matrix, consider the following worked example:
1 2 3
4 5 6
Example 2.2.1. Let M = 7
.
8 9
10 11 12
Answer: To determine the shape of matrix M , we count the number of rows and columns.
(a) Determine the shape of matrix P . (b) Determine the shape of matrix Q.
(c) Determine the shape of matrix R. (d) If S is a matrix with shape 5×4, how many elements
does matrix S contain?
(e) Write down any 3 × 2 matrix. (f) Describe what happens to the shape of a matrix
when a row is added or removed.
20 CHAPTER 2. MATRICES
Matrix addition is an operation that combines two matrices of the same shape to produce a new matrix. Given two
matrices A = [aij ] and B = [bij ] of the same shape, their sum C = A + B is defined as:
In other words, the operation of matrix addition is done ”componentwise”. This operation is only defined when both
matrices have the same number of rows and columns. If the dimensions differ, the addition is not defined.
Remark 2.3.1. Matrix addition is commutative. That is, if A and B are matrices of the same shape (addition is
defined), then
A + B = B + A.
Answer:
1+5 2+6 6 8
C= =
3+7 4+8 10 12
Thus, the result of adding matrices A and B is the matrix C.
Calculate where possible each of the following matrix additions, if the addition is not defined answer the question with
”not defined”.
Scalar multiplication is an operation that involves multiplying each entry of a matrix by a scalar (a single real number).
Given a scalar k and a matrix A = [aij ], the product B = kA is defined as:
This operation scales the matrix A by the factor k. If k is positive, the matrix retains its direction; if k is negative,
the matrix is flipped to the opposite direction. The operation of scalar multiplication is done ”componentwise”.
2.5. MATRIX MULTIPLICATION 21
Answer:
2·1 2·2 2 4
B = 2A = =
2·3 2·4 6 8
Thus, the result of multiplying matrix A by the scalar k is the matrix B.
Example 2.4.2. Consider the matrices:
6 −2 10 2
X= , and Y = ,
7 4 −5 1
Calculate 3X − Y :
Definition 2.5.1. Matrix multiplication is defined for two matrices A and B when the number of columns in A
matches the number of rows in B. If A has dimensions m × n and B has dimensions n × p, then their product AB
will have dimensions m × p. Matrix multiplication is not commutative, meaning AB ̸= BA in general.
Example 2.5.2. Consider matrices A and B below:
2 3
5
A = 1 4 , B=
−2
0 −1
Here, A is a 3 × 2 matrix, and B is a 2 × 1 matrix. Since the number of columns in A matches the number of rows in
B, we can calculate AB.
C is a 2 × 3 matrix, and D is a 3 × 2 matrix. We can calculate CD because the number of columns in C matches the
number of rows in D.
Here, E is a 3 × 2 matrix, and F is also a 3 × 2 matrix. Since the number of columns in E does not match the number
of rows in F , the product EF is not defined or undefined. These are the only two acceptable answers.
Exercises 2.5.5. Calculate the following matrix products where defined. If not defined, write “undefined” or ”not
defined”.
1 −2 2 −1 3 7 −3
(a) (b)
3 4 4 0 5 2 1
5 0 2
−3 2
(c) 4 1 −2 −6 (d) −1 4
1 6
3 5 −7
0
1 2 2 1 5 −6 7
(e) (f) −2
3 4 4 3 1 0 −1
3
3 5
8 1 0 −2 3 4 0
(g) 2 (h)
2 −1 1 −5 −3 6
1 4
Remark 2.5.6. Matrix multiplication is associative, meaning (AB)C = A(BC) if all products are defined. However,
it is not commutative, so AB ̸= BA in general.
Definition 2.5.7. The identity matrix I is a square matrix with 1’s on the diagonal and 0’s elsewhere. For any
matrix A, if the product AI or IA is defined, then AI = A and IA = A. The identity matrix, is the ”one” of matrix
multiplication.
Definition 2.5.8. For a square matrix A, we can define the power An as the matrix product of A with itself n times.
For instance, A2 = A × A, and A3 = A × A × A.
Exercises 2.5.9. Let
1 0 2 −1 1 −2
I= A= and B = .
0 1 1 3 −4 7
Calculate the following, where possible:
(c) A2 (d) AB
2.6. THE TRANSPOSE OF A MATRIX 23
Definition 2.6.1. The transpose of a matrix A, denoted by AT , is obtained by flipping the matrix over its diagonal.
This operation turns the row vectors of A into column vectors and vice versa. If A is an m × n matrix, then its
transpose AT is an n × m matrix.
1 2 3
Answer: Let us consider the matrix A = . The transpose of A is given by:
4 5 6
1 4
AT = 2 5
3 6
It is important to note that the products AT A and AAT are always defined and the product is a symmetric matrix.
For the given matrix A:
1 4 17 22 27
1 2 3
AT A = 2 5 = 22 29 36
4 5 6
3 6 27 36 45
1 4
1 2 3 14 32
AAT = 2 5 =
4 5 6 32 77
3 6
In both cases, the resultant matrices AT A and AAT are defined, demonstrating the properties of the transpose
operation.
Exercises 2.6.2. Let
2 −5 −1 0 2 0 8
A= B= and C = .
7 3 4 −4 1 7 −2
Calculate the following involving matrix transposes, where defined. If not defined, write “Not defined” or ”undefined”.
(a) AT . (b) 2A − B T .
In this section, we will explore the concepts of determinants, inverses, and solving systems of linear equations specifically
for 2 × 2 matrices. Understanding these concepts is essential for solving a wide range of mathematical problems and
applications in various fields, including engineering and computer science.
24 CHAPTER 2. MATRICES
The determinant of a matrix provides critical information about the matrix, particularly regarding its invertibility.
The inverse of a matrix is crucial when solving systems of equations, allowing us to find the values of variables
systematically. We will demonstrate these ideas through definitions and worked examples, followed by exercises for
practice.
a b
Definition 2.7.1. The determinant of a 2 × 2 matrix A = is denoted by det(A) and is given by the formula:
c d
det(A) = ad − bc.
The determinant provides important information about the matrix, such as whether it is invertible.
3 2
Example 2.7.2. Calculate the determinant of the matrix A = .
1 4
The resulting matrix is the identity matrix I. This confirms that the product of a matrix and its inverse equals the
identity matrix, which demonstrates the fundamental property of inverses in linear algebra. This property is essential,
as it means that multiplying a matrix by its inverse effectively ”cancels out” the effect of the original matrix, returning
us to the identity transformation.
Definition 2.7.5. A system of linear equations can be represented in matrix form as Ax = b, where A is a coefficient
matrix, x is a column vector of variables, and b is a column vector of constants. For a 2 × 2 matrix, the system can
be solved using the inverse:
x = A−1 b.
2.7. INVERSES AND SOLVING SYSTEMS OF LINEAR EQUATIONS 25
Answer: The coefficient matrix and the constant vector are given by:
3 2 11
A= , b= .
1 4 7
(g) For the system −4x + 3y = 14 and 5x + y = −27, write the matrix form and solve for x and y.
(h) For the system 6x − 8y = 74 and 14x + 5y = 7, write the matrix form and solve for x and y.
Chapter 3
Probability
Probability is a branch of mathematics that deals with the likelihood of events occurring. Probability plays a crucial
role in various fields, including statistics, finance, insurance, science, and engineering. It helps in making informed
decisions based on the likelihood of different outcomes.
Definition 3.1.1. A probability is a measure of how likely an event is to happen, expressed as a number between 0
and 1. A probability of 0 indicates that an event will not occur, while a probability of 1 indicates that an event is
certain to occur.
Remark 3.1.2. Events in probability can be represented using set notation or Venn diagrams, each providing a
different perspective on the relationships between events.
• Set Notation: In set notation, each event is considered a subset of the sample space S, which contains all
possible outcomes. For example, if A represents an event, then A ⊆ S, and the elements in A are the outcomes
where event A occurs. Set operations like union (A ∪ B), intersection (A ∩ B), and complement (Ac ) are used
to describe combinations or relationships between events.
26
3.2. CALCULATING BASIC PROBABILITIES:THEORETICAL PROBABILITY AND RELATIVE FREQUENCY27
• Venn Diagrams: Venn diagrams are graphical representations that illustrate the relationships between different
events as overlapping regions. Each event is shown as a circle within the sample space, where overlapping areas
represent intersections (outcomes common to multiple events), and non-overlapping areas represent disjoint
events (events with no outcomes in common). Complements are represented by the areas outside of an event’s
circle.
Using both set notation and Venn diagrams can aid in understanding event relationships, such as mutual exclusivity,
independence, and conditional probability, by providing both symbolic and visual interpretations.
Exercises 3.1.3.
(b) A card is selected at random from a deck of cards. What is the sample space of this experiment?
(c) Define a simple event and give an example that is not related to rolling a die.
(d) A bag contains 5 red balls and 3 green balls. If two balls are drawn at random, what is the sample space?
(e) If you flip a coin three times, list the sample space of this experiment.
In probability theory, the probability of an event is a measure of the likelihood that the event will occur. If each
outcome in an experiment is equally likely, we can calculate the probability of an event as the ratio of the number of
favourable outcomes to the total number of possible outcomes in the sample space. The formula for calculating the
probability P (A) of an event A is given by:
This calculation assumes that all outcomes are equally likely, which may not always be the case in practical situations.
Example 3.2.1. Calculate the probability of rolling a 3 on a standard six-sided die.
Answer: In the experiment of rolling a standard six-sided die, all events are equally likely. Therefore, we can use
Equation (3.1). The number of favourable outcomes (rolling a 3) is 1, and the total number of possible outcomes is 6.
1
Thus, the probability P (3) = .
6
Remark 3.2.2. The probability of all possible outcomes of an event adds up to 1. Therefore, the probability that an
event A does not happen, often called the probability of the complement of A, is given by:
P (Not A) = 1 − P (A).
This relationship follows from the fact that either A occurs or it does not, making A and ”not A” complementary
events.
28 CHAPTER 3. PROBABILITY
Example 3.2.3. Calculate the probability of rolling any number other than a 3 on a standard six-sided die.
1 5
Answer: P (Not 3) = 1 − P (3) = 1 − = .
6 6
Relative Frequency
In some cases, the outcomes are not equally likely, or probability must be estimated based on observed data from
experiments. Here, we calculate probability using the relative frequency of the event, defined by the formula:
Relative frequency becomes a more accurate approximation of theoretical probability as the number of trials increases.
Example 3.2.4. An experiment consists of rolling a standard six-sided die up to 1000 times, with cumulative results
recorded every 100 rolls. The frequency table summarises these results.
Outcomes
Number of Rolls
1 2 3 4 5 6
100 12 13 18 23 18 16
200 28 24 37 41 34 36
300 43 41 53 54 51 58
400 55 56 70 76 69 74
500 70 71 85 97 92 85
600 95 89 98 113 109 96
700 114 103 114 134 121 114
800 130 121 131 150 137 131
900 153 135 154 163 149 146
1000 168 157 173 171 168 163
Questions
(a) What is the theoretical probability of rolling any specific number on a six-sided die.
(e) Compare the relative frequencies of rolling a 4 to the theoretical probability. What do you observe about the
relationship between the relative frequency and theoretical probability as n increases?
Answers:
1
a) The theoretical probability of rolling any specific number on a six-sided die is P (any Outcome) = ≈ 0.167.
6
23
b) After 100 rolls, the relative frequency of rolling a 4 is = 0.23.
100
3.2. CALCULATING BASIC PROBABILITIES:THEORETICAL PROBABILITY AND RELATIVE FREQUENCY29
97
c) After 500 rolls, the relative frequency of rolling a 4 is = 0.194.
500
171
d) After 1000 rolls, the relative frequency of rolling a 4 is = 0.171.
1000
e) As the number of rolls n increases, the relative frequencies of rolling a 4 tend to approach the theoretical
probability of 0.167.
0.25
Outcome 1
Outcome 2
Outcome 3
Outcome 4
Outcome 5
Relative Frequency
0.20
Outcome 6
0.15
0.10
0 100 200 300 400 500 600 700 800 900 1,000
Number of Rolls
This plot illustrates how the relative frequency for each outcome gets closer to the theoretical probability as the
number of rolls increases, demonstrating the Law of Large Numbers.
(f) What is the probability that a student selected at random from a class of 12 boys and 8 girls is a girl?
(g) In an experiment, an unfair die was rolled 1000 times, and the result was a 4 in 76 of those rolls. Estimate
the probability of rolling a 4 using relative frequency.
30 CHAPTER 3. PROBABILITY
Definition 3.3.1. A compound event is formed when two or more simple events are combined. For instance, the
event of rolling a die and getting an even number (2, 4, or 6) is a compound event.
The probability of compound events can be calculated using the Addition Rule. This rule is useful when determining
the probability of the occurrence of at least one of multiple events.
where:
• P (A) and P (B) are the probabilities of events A and B occurring, respectively.
If events A and B are mutually exclusive (i.e., they cannot occur at the same time), the Addition Rule simplifies to:
Example 3.3.2. When rolling a six-sided die, what is the probability of rolling either an even number or a number
greater than 4?
Answer:
Let event A be rolling an even number, and let event B be rolling a number greater than 4.
3 2 1 4 2
P (A ∪ B) = P (A) + P (B) − P (A ∩ B) = + − = = . (3.5)
6 6 6 6 3
2
Thus, the probability of rolling either an even number or a number greater than 4 is .
3
Exercises 3.3.3. In these exercises, ‘rolling’ refers to a fair six-sided die, and ‘dealing’ refers to drawing one card
from a standard 52-card deck.
3.4. INDEPENDENCE AND CONDITIONAL PROBABILITY 31
(a) What is the probability of rolling either an odd number or a number greater than 2?
Understanding the concepts of independence and conditional probability is crucial in probability theory.
Independence refers to situations where the outcome of one event does not influence the outcome of another. For
example, flipping a coin and rolling a die are independent events: whether the coin lands on heads or tails does not
affect the number shown on the die.
Conditional Probability, on the other hand, deals with the likelihood of an event occurring given that another
event has already happened. For instance, if we know that a card drawn from a deck is red, the probability that it is
a heart changes because there are fewer options to consider (only hearts and diamonds among the red cards).
3.4.1 Independence
Definition 3.4.1. Two events are considered independent if the occurrence of one does not affect the probability of
the other. Mathematically, this is defined as:
Example 3.4.2. Let’s say we flip a coin and roll a die. What is the probability that the coin shows heads and the
die shows a 5?
Answer:
Let event A be the coin shows heads and let event B be the die shows a 5. Then the events A and B are independent
since the outcome of the coin flip does not affect the die roll. Therefore
1 1 1
P (A and B) = P (A ∩ B) = P (A) × P (B) = × = .
2 6 12
Definition 3.4.3. Conditional probability measures the likelihood of an event occurring given that another event has
already occurred. The conditional probability of event A given event B is denoted by P (A|B) and is defined as:
P (A ∩ B)
P (A|B) = , where P (B) > 0. (3.6)
P (B)
32 CHAPTER 3. PROBABILITY
This formula indicates that the probability of A occurring under the condition that B has occurred is equal to the
probability of both A and B occurring divided by the probability of B.
Example 3.4.4. Suppose a card is drawn from a standard deck of 52 playing cards. What is the probability of
drawing a heart given that the card drawn is red.
Answer: Let event A be drawing a heart, and let event B be drawing a red card. Then
13
• P (A) = (since there are 13 hearts in a deck)
52
26
• P (B) = (since there are 26 red cards: 13 hearts and 13 diamonds)
52
13
• P (A ∩ B) = P (A) = (since all hearts are red)
52
Therefore
13
P (A ∩ B) 52 13 1
P (A|B) = = 26 = = . (3.7)
P (B) 52
26 2
1
Thus, the probability of drawing a heart given that the card drawn is red is .
2
Exercises 3.4.5. In these exercises, ‘flipping’ refers to a fair coin flip, ‘rolling’ refers to a fair six-sided die, and
‘dealing’ refers to drawing one card from a standard 52-card deck.
(c) What is the probability of dealing a king given that the card is a club?
(d) What is the probability of dealing a king given that the card is a picture card?
(e) What is the probability of dealing a king given that you flipped tails?
(g) What is the probability of dealing a picture card given that you dealt an ace?
(h) What is the probability of dealing an ace or a club given that you dealt either a picture card or a heart?
3.5 Permutations
Definition 3.5.1. The factorial of a non-negative integer n, denoted by n!, is the product of all positive integers
from n down to 1. Specifically, it is defined as:
n! = n × (n − 1) × (n − 2) × · · · × 1
By convention, 0! = 1.
Example 3.5.2. What is n! (n factorial), where n ∈ {2, 3, 4, 5, 6}.
Answer:
n 2 3 4 5 6
n! 2 6 24 120 720
3.5. PERMUTATIONS 33
Definition 3.5.3. A permutation is an arrangement of objects in a specific order. The number of permutations of n
distinct objects taken r at a time is given by:
n!
nP r =
(n − r)!
Example 3.5.4. Consider the letters A, B, C, and D. How many ways can we arrange 3 of these letters?
Answer: We need to find the number of permutations of 4 letters taken 3 at a time. Using the formula, we have:
4! 4!
4P 3 = = = 4 × 3 × 2 = 24.
(4 − 3)! 1!
Thus, there are 24 different ways to arrange 3 letters from A, B, C, and D. Here they are listed:
Answer: The word ”MATH” has 4 distinct letters. The number of permutations of these 4 letters is:
4P 4 = 4! = 24.
Answer: We are selecting and arranging 4 digits from a total of 10. Thus, the number of permutations is:
10! 10!
10P 4 = = = 10 × 9 × 8 × 7 = 5040.
(10 − 4)! 6!
So, there are 5040 different possible PIN codes.
Example 3.5.7. How many different ways can the letters in the word ”BANANA” be arranged?
Answer: The word ”BANANA” consists of 6 letters where B appears once, A appears three times, and N appears
twice. The number of distinct permutations is given by:
n! 6! 720
= = = 60.
n1 ! · n2 ! · n3 ! 1! · 3! · 2! 1·6·2
Therefore, there are 60 distinct arrangements of the letters in ”BANANA”.
Exercises 3.5.8.
(a) List all two-letter arrangements that can be made from the word help?
(b) How many six-letter arrangements ways can be made from the word Problems?
(c) The user codes on a certain computer consist of a lowercase letter followed by 3 digits and then another
lowercase letter. If all characters must be distinct. How many user codes are there?
(d) The user codes on a certain computer consist of 3 lowercase letters followed by 4 digits. If all characters must
be distinct. How many user codes are there?
(e) The user codes on a certain computer consist of 3 lowercase letters followed by 4 digits. If all characters must
be distinct. How many user codes start with the letter a and end with the digit 7?
34 CHAPTER 3. PROBABILITY
3.6 Combinations
Definition 3.6.1. A combination is a selection of objects where the order does not matter. The number of combi-
nations of n distinct objects taken r at a time is given by:
n n!
nCr = =
r r!(n − r)!
Example 3.6.2. Consider the letters A, B, C, and D. How many ways can we select 3 of these letters?
Answer: We need to find the number of combinations of 4 letters taken 3 at a time. Using the formula, we have:
4 4! 4! 24
4C3 = = = = = 4.
3 3! · (4 − 3)! 3! · 1! 6·1
Thus, there are 4 different ways to select 3 letters from A, B, C, and D:
{ABC, ABD, ACD, BCD}.
Example 3.6.3. How many ways can you select 3 students from a group of 5?
Answer: We are choosing 3 students from a group of 5, where the order does not matter. Thus, the number of
combinations is:
5 5! 5 × 4 × 3! 20
5C3 = = = = = 10.
3 3! · (5 − 3)! 3! × 2! 2
So, there are 10 different ways to select 3 students from a group of 5.
Example 3.6.4. A password consists of selecting 4 different letters from the alphabet, where the order does not
matter. How many such passwords can be created?
Answer: Since we are selecting 4 letters from a total of 26 without regard to order, the number of combinations is:
26 26! 26 × 25 × 24 × 23
26C4 = = = = 14, 950.
4 4! · (26 − 4)! 4×3×2×1
Thus, there are 14,950 different possible selections.
Example 3.6.5. How many ways can a committee of 2 managers and 3 lecturers be formed from a group of 10
managers and 30 lecturers?
Answer: We are choosing 2 people from a group of 10 without regard to order and choosing 3 people from a group
of 30. Thus, the number of combinations is:
10 30 10! 30!
10C2 × 30C3 = × = × = 45 × 4060 = 182700.
2 3 2! · (10 − 2)! 3! · (30 − 3)!
So, there are 182700 different ways to form a committee of 2 managers and 3 lecturers be formed from a group of 10
managers and 30 lecturers.
Exercises 3.6.6.
(a) How many ways can you choose 3 books from a shelf of 18 books?
(b) A team of 5 players is selected from a group of 12. How many different teams are possible?
(c) How many ways can you select 5 cards from a standard deck of 52 cards?
(d) Out of a class of 15 students, a teacher needs to select 4 to form a study group. How many ways can this
selection be made?
(e) In a lottery, a player picks 6 numbers from a set of 49. How many possible selections are there?
3.7. USING PERMUTATIONS AND COMBINATIONS IN PROBABILITY 35
In many probability problems, we use permutations and combinations to calculate the number of possible outcomes,
which is crucial for finding probabilities. Here, we explore how these concepts apply to probability calculations.
Example 3.7.1. A user code consists of 3 distinct lowercase letters. If a user code is selected at random, what is the
probability that the code contains at least 1 vowel?
Solution: To find the probability that a randomly selected user code contains at least 1 vowel, we can use the following
steps:
1. Total Outcomes: The total number of ways to arrange 3 distinct lowercase letters from the 26 letters of the
alphabet is given by:
26!
26P 3 = = 26 × 25 × 24 = 15600.
(26 − 3)!
2. Favorable Outcomes (No Vowels): Next, we calculate the arrangements of choosing 3 letters from the 21
consonants (since there are 5 vowels in the alphabet). The number of arrangements is:
21!
21P 3 = = 21 × 20 × 19 = 7980.
(21 − 3)!
3. Probability Calculation: The probability that none of the selected letters are vowels is given by:
21P 3 7980
P (No vowels) = = .
26P 3 15600
4. At Least One Vowel: The probability that at least one letter is a vowel is the complement of the above probability:
7980
P (At least 1 vowel) = 1 − P (No vowels) = 1 − ≈ 0.488.
15600
Therefore, the probability that the user code contains at least 1 vowel is approximately 0.488 or 48.8%.
Example 3.7.2. A box contains 6 red, 4 green, and 5 blue balls. If we randomly select 3 balls without replacement,
answer the following questions.
Answer:
a) To find the probability of selecting 3 red balls from a total of 6 red balls, we calculate the number of ways to
choose 3 red balls from 6, and the total number of ways to choose 3 balls from the total of 15 balls.
6
6!
3 3!·(6−3)! 20 4
P (all red) = 15
= 15!
= = ≈ 0.044.
3 3!·(15−3)!
455 91
4
Thus, the probability that all selected balls are red is .
91
36 CHAPTER 3. PROBABILITY
b) We are selecting 3 balls, so the number of ways to select exactly 2 green balls is the number of ways to choose
2 from 4 (green) multiplied by the number of ways to select 1 non-green ball from the remaining 11 balls (6 red
+ 5 blue).
Therefore,
4
11
2 · 1 6 · 11 66
P (2 green) = 15
= = ≈ 0.145.
3
455 455
66
Thus, the probability that exactly 2 of the selected balls are green is .
455
Exercises 3.7.3. A deck of 52 cards is shuffled, and 5 cards are drawn. What is the probability of drawing:
(c) A 10 a Jack a Queen a King and an Ace? (d) Exactly three aces and exactly one 7?
Trigonometry
Trigonometry is a branch of mathematics that studies relationships between the angles and sides of triangles. Orig-
inating from the Greek words trigonon (triangle) and metron (measure), trigonometry initially developed as a tool
for astronomical calculations and has evolved to become essential in various fields, including physics, engineering, and
computer science.
The fundamental elements of trigonometry involve right-angled triangles, where one angle is always 90°. The ratios
of the triangle’s sides with respect to its angles give rise to trigonometric functions, which help in describing periodic
phenomena and solving real-world problems involving wave patterns, circular motion, and oscillations.
The naming convention for triangles is to use lower case letters for
the side lengths and the corresponding upper case letter for the angle B
c
opposite the side. For example the triangle on the right, the angle A is a
opposite the side labelled a.
A C
b
A right angle is an angle that measures 90° and a right angled triangle is a triangle such that one of its angles measures
90°. The other two angles in a right angled triangle sum to 90°. In a right-angled triangle, the side opposite the right
angle is called the hypotenuse, while the other two sides are known as the opposite and adjacent sides relative to
a given angle.
Consider the angle A in the right angled triangle on the right. The c
side opposite the angle A is called opposite. The side that is between B
hypotenuse a
(or along side) angle A and the right angle is called adjacent. The side
opposite the right angle is called the hypotenuse. opposite
A C = 90°
b
adjacent
37
38 CHAPTER 4. TRIGONOMETRY
The three primary trigonometric functions are Sine, Cosine and Tangent. These trigonometric functions provide the
foundation for exploring and understanding complex relationships in both two-dimensional and three-dimensional
spaces, making trigonometry a powerful tool in mathematical analysis. Evaluating the trigonometric function at an
angle A can be done using the following formulas.
Pythaoras’ theorem gives the relationship between the side lengths in a right angled triangle.
c 2 = a 2 + b2 (4.2)
Example 4.2.1. A dendrologist wanted to measure the height of a tree. She set up a clinometer at a height of 1.5m
and at a distance of 50m from the base of the tree (on flat ground) and measured the angle of elevation to the top of
the tree to be 51°. What is the height of the tree to the nearest meter?
Answer:
Let H be the height of the tree measured in meters and let h = H −1.5. Top of tree
Then
h
tan(51) = , and so h = 50 × tan(51) ≈ 61.74486.
50
Therefore H ≈ 63.24486 and so the height of the tree is 63 meters.
51°
1.5 m
50 m Base of tree
Exercises 4.2.2. Consider a right angled triangle with angles labelled A, B and C such that C = 90°.
(a) Calculate sin(A) given that a = 3 and c = 7. (b) Calculate cos(A) given that a = 5 and c = 13.
(c) Calculate tan(A) given that b = 10 and a = 3. (d) Calculate cos(B) given that a = 16 and c = 28.
(e) Calculate A given that sin(A) = 0.2. (f) Calculate B given that cos(B) = 0.8.
(g) Calculate A given that tan(B) = 1.6. (h) Calculate a given that c = 22 and sin(A) = 0.35.
√
(i) Calculate a given that c = 10 and cos(A) = 0.8. (j) Calculate tan(B) given that c = 5a.
4.3. THE SINE RULE 39
The Sine Rule provides a relationship between the sides and angles of any triangle,
not just right-angled triangles. It is particularly useful when we know either two C
angles and one side (AAS or ASA cases) or two sides and a non-enclosed angle
(SSA case) of a triangle. The Sine Rule states that in any triangle with angles b a
A, B, and C and opposite sides a, b, and c respectively, the following relationship
holds:
a b c
= = A B
sin A sin B sin C c
This rule allows us to solve for unknown sides or angles in non-right-angled triangles, making it an essential tool for
solving a variety of geometric problems.
Example 4.3.1. A surveyor is measuring the distance between two points P and Q on a hill and so she sets up two
markers at the points P and Q. There is another point marked R.which is known to be at a distance of 120 m from
the point Q. The surveyor measures the angle ∠QP R to be 40° and the angle ∠P QR to be 85°. Find the distance
from P to Q, rounding to the nearest centimetre.
Answer:
Let a = 120 m, A = 40°, and C = 85°. To find side b, we use the Sine Rule: R
b a a · sin(B) B
= ⇒ b=
sin(B) sin(A) sin(A)
Exercises 4.3.2. In each of the following triangles, use the Sine Rule to find the missing side or angle.
(a) Find a given that A = 30°, B = 45°, and b = 15. (b) Find B given that b = 8, a = 10, and A = 50°.
(c) Calculate c given A = 80°, B = 60°, and a = 25. (d) Determine A given b = 20, c = 12, and B = 40°.
(e) Solve for b if a = 14, A = 35°, and B = 75°. (f) Find an angle C given a = 18, b = 25, and A = 40°.
(g) Calculate the two possible values for A given that a = 8, b = 6, and B = 20°.
40 CHAPTER 4. TRIGONOMETRY
The Cosine Rule provides a relationship between the sides and angles of any
triangle. It is particularly useful when we know either all three sides (SSS C
case) or two sides and the included angle (SAS case) of a triangle. The Cosine
Rule states that for any triangle with angles A, B, and C and opposite sides b a
a, b, and c, respectively, the following formulas hold:
A B
a2 = b2 + c2 − 2bc cos(A)
c
b2 = a2 + c2 − 2ac cos(B) (4.3)
2 2 2
c = a + b − 2ab cos(C).
This rule is especially useful for solving triangles when the Sine Rule does not apply, such as in cases where we know
two sides and the included angle.
Example 4.4.1. A pilot wants to calculate the distance between two points, X and Y , separated by a lake. The pilot
knows that the angle ∠XZY measures 65°, where Z is a particular point on the shoreline. The pilot also knows that
|XZ| = 280 m and |Y Z| = 350 m. Calculate |XY |, rounding to the nearest metre.
Answer:
Let a = 350 m, b = 280 m, and C = 65°. To find c, we use the Cosine Rule: Y
c2 = a2 + b2 − 2ab cos(C) B
Exercises 4.4.2. In each of the following triangles, use the Cosine Rule to find the missing side or angle.
(a) Find c given that a = 8, b = 6, and C = 30°. (b) Determine A given that a = 10, b = 12, and c = 15.
(c) Calculate b given a = 5, c = 7, and B = 45°. (d) Find C if a = 20, b = 25, and c = 30.
(e) Solve for a given b = 14, c = 10, and A = 40°. (f) Calculate B given a = 18, b = 25, and c = 30.
4.5. POLAR AND RECTANGULAR COORDINATES 41
Polar and rectangular (or Cartesian) coordinate systems are two ways to represent y
points in a plane.
These conversions allow us to switch seamlessly between the two systems, depending on the context of the problem.
However, as always we must be careful when using the calculator to calculate the inverse of a trig function.
Example 4.5.1. Convert the point (x, y) = (3, 4) from rectangular to polar coordinates.
Answer:
As mentioned previously we must be careful when using the inverse of a trig function like tan−1 .
Example 4.5.3. Convert the point (x, y) = (−5, 7) from rectangular to polar coordinates.
Answer:
Exercises 4.5.4. Convert the following points between polar and rectangular coordinates as specified:
4.6. USING TRIGONOMETRIC IDENTITIES 43
(a) Convert (6, 8) to polar coordinates. (b) Convert (−5, 12) to polar coordinates.
(c) Convert (10, 30°) to rectangular coordinates. (d) Convert (7, 285°) to rectangular coordinates.
√
(e) Verify that the point (1, 3) in rectangular coordinates converts to (2, 60°) in polar coordinates.
(f) Find the polar coordinates of the point (0, −5), considering all possible values of θ.
Trigonometric identities are fundamental tools in mathematics that allow us to simplify and manipulate trigonometric
expressions. These identities express relationships between different trigonometric functions, enabling us to rewrite
expressions in more manageable forms. By using trigonometric identities, we can simplify complex equations, solve for
unknowns, and transform expressions into equivalent forms that are easier to work with. Understanding and applying
these identities is essential for solving trigonometric equations, proving other mathematical results, and modelling
periodic phenomena in fields such as physics and engineering. In this section, we will explore several key trigonometric
identities that are widely used in problem-solving.
sin(A) cos(2A) = cos2 (A) − sin2 (A) cos(A + B) = cos(A) cos(B) − sin(A) sin(B)
tan(A) =
cos(A)
sin(2A) = 2 sin(A) cos(A) cos(A − B) = cos(A) cos(B) + sin(A) sin(B)
cos(A)
cot(A) =
sin(A) 1 sin(A + B) = sin(A) cos(B) + cos(A) sin(B)
cos2 (A) = (1 + cos(2A))
2
1 sin(A − B) = sin(A) cos(B) − cos(A) sin(B)
sec(A) = 1
cos(A) 2
sin (A) = (1 − cos(2A))
2 tan(A) + tan(B)
1 tan(A + B) =
cosec(A) = 2 tan(A) 1 − tan(A) tan(B)
sin(A) tan(2A) =
1 − tan2 (A) tan(A) − tan(B)
cos(−A) = cos(A) tan(A − B) =
1 + tan(A) tan(B)
1 − tan2 (A)
cos(2A) =
sin(−A) = − sin(A) 1 + tan2 (A)
A+B A−B
cos(A) + cos(B) = 2 cos cos
2 2
tan(−A) = − tan(A) 2 tan(A)
sin(2A) =
1 + tan2 (A)
A+B A−B
cos2 (A) + sin2 (A) = 1 cos(A) − cos(B) = −2 sin sin
2 2
sec2 (A) = 1 + tan2 (A) A+B A−B
sin(A) + sin(B) = 2 sin cos
2 2
A+B A−B
sin(A) − sin(B) = 2 cos sin
2 2
Note that cosec(A) is also sometimes referred to as csc(A).
Example 4.6.1. Prove that for any angle A which is not a multiple of 90° the following identity holds:
cos(A) sin(A)
+ = cosec(A) sec(A).
sin(A) cos(A)
44 CHAPTER 4. TRIGONOMETRY
Answer:
cos(A) sin(A) cos2 (A) sin2 (A)
+ = +
sin(A) cos(A) sin(A) cos(A) sin(A) cos(A)
cos2 (A) + sin2 (A)
=
sin(A) cos(A)
1
=
sin(A) cos(A)
1 1
=
sin(A) cos(A)
= cosec(A) sec(A).
Example 4.6.2. Solve the equation cos(5x) = cos(x), for 0° ≤ x < 360°.
Answer:
Similarly, solving sin(2x) = 0 gives 2x = 180° × n, for some non-negative integer n. Therefore x = 90° × n. However,
0 ≤ x < 360 and so x = 0°, 90°, 180°, 270°.
Combining these results we have x = 0°, 60°, 90°, 120°, 180°, 240°, 270°, 300°.
Example 4.6.3. Solve the equation 6 sin2 (x) − cos(x) = 5, for 0° < x ≤ 360°.
Answer:
Using the identity cos2 (x) + sin2 (x) = 1 gives sin2 (x) = 1 − cos2 (x) and so
0 = 6 sin2 (x) − cos(x) − 5
= 6(1 − cos2 (x)) − cos(x) − 5
= 6 − 6 cos2 (x) − cos(x) − 5
= −6 cos2 (x) − cos(x) + 1
= 6 cos2 (x) + cos(x) − 1.
This is a quadratic equation in cos(x). We can rename cos(x) as C to ease the notation. Then our quadratic equation
becomes 6C 2 + C − 1 = 0. This factorises to (3C − 1)(2C + 1) = 0. You could also use the -b-formula to solve the
quadratic equation if you like. We shall now solve each factor separately.
1 −1 1
If 3C − 1 = 0, then C = cos(x) = and so x = cos = 70.53°. Recall that the calculator will only gives you
3 3
one possible value, the other value less than or equal to 360° is x = 360° − 70.53° = 289.47°.
1 1
If 2C + 1 = 0, then C = cos(x) = − and so x = cos−1 − = 120°. The other value less than or equal to 360° is
2 2
x = 360 − 120° = 240°.
Exercises 4.6.4. Let A and B be measured in degrees. Simplify or rewrite the following expressions using trigono-
metric identities:
(e) Solve cos(7x) + cos(3x) = 0, for 0° ≤ x ≤ 180° (f) Solve sin(5x) = sin(2x), for 0° ≤ x ≤ 180°
(g) Solve 2 sin2 (x) + cos(x) = 1, for 0° ≤ x ≤ 180° (h) Solve 15 cos2 (x) = 4(sin(x) + 3), for 0° ≤ x ≤ 360°.
Chapter 5
Mathematics is rich with structures that extend our understanding of numbers beyond the real number line. Two
such extensions are complex numbers and quaternions, both of which play fundamental roles in various fields such
as computer science, engineering and physics. This chapter introduces these two intriguing mathematical constructs,
exploring their definitions, properties, and applications.
• Signal Processing: Complex numbers are used in Fourier transforms, which are essential for analysing sig-
nals in digital signal processing (DSP). They help in converting time-domain signals into frequency-domain
representations.
• Control Systems: Complex numbers are used in the analysis and design of control systems, particularly in the
study of system stability through poles and zeros, which are often represented in the complex plane.
• Image Processing: Complex numbers are applied in techniques like image filtering and enhancement. They
also play a role in encoding and processing visual data, such as in the use of the Fourier transform in image
compression.
• Quantum Computing: Complex numbers are integral to quantum mechanics, where states and transforma-
tions are often represented using complex vectors and matrices, essential for quantum algorithms.
Quaternions are especially useful in the field of computer graphics and 3D modelling:
• 3D Rotations: Quaternions are widely used to represent rotations in three-dimensional space, offering several
advantages over other methods like Euler angles, such as avoiding gimbal lock and providing more stable and
efficient calculations.
• Animation and Motion Capture: Quaternions are used in animation systems to interpolate rotations
smoothly and efficiently, which is essential for realistic motion capture and character animation.
• Game Development: In gaming, quaternions are often used to manage the orientation and rotation of objects
within a 3D environment, providing precise control over objects’ movements.
• Virtual Reality (VR) and Augmented Reality (AR): Quaternions are important in VR and AR systems
for tracking head movements, hand gestures, and other interactive elements in 3D space, ensuring smooth and
accurate user interactions.
46
5.2. INTRODUCTION TO COMPLEX NUMBERS 47
Definition 5.2.1. A complex number is a number of the form z = a + bi, where a and b are real numbers, and i
is the imaginary unit, defined by the property that i2 = −1.
Complex numbers provide a natural extension of real numbers, allowing for solutions to equations that have no real
solutions, such as x2 + 1 = 0. The Real numbers are a subset of the Complex number, that is R ⊂ C. The complex
number system is crucial in many areas of mathematics, including algebra, calculus, and geometry, and forms the
foundation for more advanced concepts in analysis and mathematical physics.
Complex numbers can be represented geometrically on the complex plane, where the real part a corresponds to the
x-axis and the imaginary part b corresponds to the y-axis. The number z = a + bi is plotted as the point (a, b) in the
plane, and the distance of the point from the origin is called the modulus of the complex number.
Definition 5.2.2. The modulus of the complex number z = a + bi is the distance from the origin to the point
representing z on the Argand diagram and is given by:
p
|z| = (a)2 + (b)2 . (5.1)
Argand diagram
ℑ(z) (3, 4)
Example 5.2.3. Consider the complex number z = 3 + 4i. Draw z 4
on an Argand diagram and calculate its modulus.
3
Answer:
Answer:
We shall use the ”−b formula” to solve this quadratic equation. let a = 1, b = −4 and c = 10. Then
√ √ √
√
p p
−(b) ± (b)2 − 4(a)(c) −(−4) ± (−4)2 − 4(1)(10) 4 ± −24 4 ± 24i2 4 ± 2 6i
z= = = = = = 2 ± 6i.
2(a) 2(1) 2 2 2
In this section, we will explore the operations of addition and multiplication of complex numbers.
The addition of two complex numbers is performed by adding their corresponding real and imaginary parts. Specifically,
if z1 = a + bi and z2 = c + di are two complex numbers, their sum z1 + z2 is given by:
z1 + z2 = (a + c) + (b + d)i
This operation is straightforward, as it simply involves adding the real parts together and the imaginary parts together.
An operation of this type is referred to as being performed componentwise.
Answer:
The sum of z1 and z2 is:
z1 + z2 = (3 + 1) + (2 − 4)i = 4 − 2i
Thus, z1 + z2 = 4 − 2i.
The multiplication of two complex numbers involves the distributive property and the fact that i2 = −1. If z1 = a + bi
and z2 = c + di, their product z1 · z2 is given by:
Answer:
z1 · z2 = (3 + 2i)(1 − 4i)
= 3(1) + 3(−4i) + 2i(1) + 2i(−4i) Using the distributive property
2
= 3 − 12i + 2i − 8i
= 3 − 12i + 2i + 8 Using i2 = −1
= 11 − 10i.
Thus, z1 · z2 = 11 − 10i.
5.4. COMPLEX CONJUGATE AND DIVISION OF COMPLEX NUMBERS 49
Exercises 5.3.3. Let z1 = 2 + 3i, z2 = 4 − i, z3 = −1 + 2i and z4 = 3 + 5i. Calculate each of the following giving your
answer in the form a + bi, where a, b ∈ R and i2 = −1.
In this section, we will examine the complex conjugate of a complex number and explore the division of complex
numbers.
The complex conjugate of a complex number is obtained by changing the sign of its imaginary part.
Definition 5.4.1. Let z = a + bi be a complex number. Then the complex conjugate of z, denoted by z, is given by
z = a − bi.
The complex conjugate has important properties, including the fact that multiplying a complex number by its conjugate
yields a real number:
z · z = (a + bi)(a − bi) = a2 + b2 ∈ R.
This product is always non-negative, and it represents the square of the modulus (or absolute value) of z, that is:
|z|2 = a2 + b2
The division of two complex numbers can be performed by multiplying both the numerator and the denominator by
the conjugate of the denominator. Specifically, if we want to divide z1 = a + bi by z2 = c + di, the division is given by:
z1 a + bi
=
z2 c + di
To simplify this, multiply both the numerator and denominator by the complex conjugate of the denominator:
z1
Example 5.4.2. Let z1 = 3 + 2i and z2 = 1 − 4i. Find .
z2
Answer:
We compute the conjugate of z2 , which is z2 = 1 + 4i, and multiply both the numerator and denominator by this
conjugate. Therefore
z1 (3 + 2i)(1 + 4i)
=
z2 (1 − 4i)(1 + 4i)
3 + 12i + 2i + 8i2
= Removing the brackets
1 + 4i − 4i − 16i2
3 + 14i + 8(−1)
= Using i2 = −1
1 − 16(−1)
−5 + 14i
= Adding like terms
17
5 14
=− + i Writing in the forma + bi.
17 17
z1 5 14
Therefore, = − + i.
z2 17 17
Exercises 5.4.3. Let z1 = −1 + 4i, z2 = 2 − i, z3 = 3 − 2i, and z4 = 5 − 3i. Calculate each of the following, expressing
your answer in the form a + bi, where a, b ∈ R and i2 = −1.
z1
(a) z1 (b) z2 (c) z4 · z4 (d)
z2
z3 z4 z1 · z2
(e) (f) (g) z1 · z2 (h)
z4 z3 z3
Let z be a complex number. Then z can be written in rectangular form as z = a + bi. This is what we have
been doing so far in this chapter. However, it is possible to write the complex number z in different forms. In this
section, we explore the polar and exponential forms of complex numbers and their applications in multiplication and
exponentiation (raising a complex number to a power).
Im
θ
a Re
5.5. POLAR AND EXPONENTIAL FORM 51
Answer:
Step 1: Calculate the modulus r.
Im
p p √
r = a2 + b2 = (−3)2 + (−4)2 = 9 + 16 = 5.
z = 5(cos(233.13°) + i sin(233.13°)).
Using this, the complex number z = r(cos θ + i sin θ) can be expressed as:
z = reiθ .
This compact form is especially useful for operations like multiplication and exponentiation.
In polar or exponential form, the multiplication of two complex numbers z1 = r1 eiθ1 and z2 = r2 eiθ2 is given by:
This highlights that the moduli multiply and the arguments add.
52 CHAPTER 5. COMPLEX NUMBERS AND THE QUATERNIONS
π π
Example 5.5.3. Let z1 = 2ei 6 and z2 = 3ei 4 . Find z1 z2 .
Answer:
z1 z2 = (2)(3)ei( 6 + 4 )
π π
Multiply moduli, add arguments.
i 5π
= 6e 12 . Simplify the expression.
5π
Thus, z1 z2 = 6ei 12 .
De Moivre’s Theorem states that for a complex number z = reiθ and an integer n, the n-th power of z is given by:
z n = rn einθ .
This follows directly from the multiplication formula, as raising z to a power involves multiplying z by itself n-times.
π
Example 5.5.4. Let z = 2ei 3 . Find z 8 .
Answer:
z 8 = (2)8 ei(8· 3 )
π
Apply De Moivre’s Theorem.
i 8π i 2π
= 256e 3 = 256e 3 . Simplify the modulus and argument.
2π
Thus, z 8 = 256ei 3 .
√ √
Exercises 5.5.5. Let z1 = 1 + i, z2 = −1 + 3i, z3 = 3i, and z4 = 3 − i. First convert the complex numbers
z1 , z2 , z3 and z4 into exponential form. Then perform the following calculations (in exponential form) and then give
your answer in the form asked for in the square brackets:
(c) z13 , [answer in polar form] (d) z24 , [answer in polar form]
z1
(e) , [answer in rectangular form] (f) z3 · z12 , [answer in rectangular form]
z2
z4
(g) z45 , [answer in exponential form] (h) , [answer in exponential form]
z3
Quaternions are an extension of complex numbers, introduced by the Irish mathematician Sir William Rowan Hamilton
in 1843. They are four-dimensional numbers expressed in the form:
q = a + bi + cj + dk,
i2 = j 2 = k 2 = ijk = −1.
Quaternions are a crucial mathematical tool in fields such as computer graphics, robotics, and physics, particularly
for representing rotations in three dimensions.
In this section, we explore the fundamental operations of addition, conjugation, and multiplication for quaternions.
These operations are crucial for understanding their algebraic structure and applications.
Answer:
a − 3b = 5 − 6i + 3j − 2k − 3(6 + 0i + 3j − 4k)
= 5 − 6i + 3j − 2k − 18 + 0i − 9j + 12k
= (5 − 18) + (−6 + 0)i + (3 − 9)j + (−2 + 12)k
= −13 − 6i − 6j + 10k.
The conjugate of a quaternion is obtained by negating the i, j, and k components. Let a = a1 + a2 i + a3 j + a4 k. The
conjugate of a, denoted a, is:
a = a1 − a2 i − a3 j − a4 k.
• (q1 + q2 ) = q1 + q2 .
• (q1 · q2 ) = q2 · q1 .
Multiplication of quaternions is non-commutative. To multiply quaternions, the rules for the basis elements i, j, and
k must be used. These rules are:
i2 = j 2 = k 2 = −1,
ij = k, ji = −k,
jk = i, kj = −i,
ki = j, ik = −j.
i j k
i −1 k −j
j −k −1 i
k j −i −1
q1 · q2 = (2 + i + 2j − k)(1 − i + j + k)
= 2(1 − i + j + k) + i(1 − i + j + k) + 2j(1 − i + j + k) − k(1 − i + j + k)
= 2 − 2i + 2j + 2k + i − i2 + ij + ik + 2j − 2ji + 2j 2 + 2jk − k + ki − kj − k 2
= 2 − 2i + 2j + 2k + i − (−1) + ij − ki + 2j + 2ij + 2(−1) + 2jk − k + ki + jk − (−1)
= 2 − 2i + 2j + 2k + i + 1 + k − j + 2j + 2k − 2 + 2i − k + j + i + 1
= (2 + 1 − 2 + 1) + (−2 + 1 + 2 + 1)i + (2 − 1 + 2 + 1)j + (2 + 1 + 2 − 1)k
= 2 + 2i + 4j + 4k.
Therefore, q1 · q2 = 2 + 2i + 4j + 4k.
Exercises 5.7.3. Let q1 = 1 + i, q2 = −1 + 3i − 2k, q3 = −1 − 3i + 5k, and q4 = 1 + 2i + 3i − 4k. Perform
the following calculations: