Professional Documents
Culture Documents
Fundamentals of Mathematics For Computer Science Course Outline
Fundamentals of Mathematics For Computer Science Course Outline
John Vince
describes a range of
mathematical topics to
provide a foundation for
an undergraduate course
in computer science,
starting with a review of
number systems and
their relevance to digital
computers, and finishing
with differential and
integral calculus.
Readers will find that the
author s visual approach
will greatly improve their
understanding as to why
certain mathematical
structures exist, together
with how they are used in
real-world applications.
Each chapter includes
full-colour illustrations to
clarify the mathematical
descriptions, and in
some cases, equations
are also coloured to reveal vital algebraic patterns. The numerous worked examples will
consolidate comprehension of abstract mathematical concepts. Foundation Mathematics for
Computer Science covers number systems, algebra, logic, trigonometry, coordinate systems,
determinants, vectors, matrices, geometric matrix transforms, differential and integral
calculus, and reveals the names of the mathematicians behind
x Contents
Table of Contents
1 Visual Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Visual Brains Versus Analytic Brains . . . . . . . . . . . . . . . . . 1
1.2 Learning Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 What Makes Mathematics Difficult? . . . . . . . . . . . . . . . . . . 2
1.4 Does Mathematics Exist Outside Our Brains? . . . . . . . . . . . . 3
1.5 Symbols and Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Sets of Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Negative Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4.1 The Arithmetic of Positive and Negative
Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5 Observations and Axioms. . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.5.1 Commutative Law . . . . . . . . . . . . . . . . . . . . . . . 9
2.5.2 Associative Law . . . . . . . . . . . . . . . . . . . . . . . . 10
2.5.3 Distributive Law . . . . . . . . . . . . . . . . . . . . . . . . 10
2.6 The Base of a Number System . . . . . . . . . . . . . . . . . . . . . . 11
2.6.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.6.2 Octal Numbers . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.6.3 Binary Numbers . . . . . . . . . . . . . . . . . . . . . . . . 12
2.6.4 Hexadecimal Numbers . . . . . . . . . . . . . . . . . . . . 13
2.6.5 Adding Binary Numbers. . . . . . . . . . . . . . . . . . . 17
2.6.6 Subtracting Binary Numbers . . . . . . . . . . . . . . . . 18
2.7 Types of Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.7.1 Natural Numbers . . . . . . . . . . . . . . . . . . . . . . . . 18
2.7.2 Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.7.3 Rational Numbers . . . . . . . . . . . . . . . . . . . . . . . 19
2.7.4 Irrational Numbers. . . . . . . . . . . . . . . . . . . . . . . 19
2.7.5 Real Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.7.6 Algebraic and Transcendental Numbers . . . . . . . . 20
2.7.7 Imaginary Numbers . . . . . . . . . . . . . . . . . . . . . . 20
2.7.8 Complex Numbers. . . . . . . . . . . . . . . . . . . . . . . 24
2.7.9 Quaternions and Octonions . . . . . . . . . . . . . . . . . 27
2.8 Prime Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.8.1 The Fundamental Theorem of Arithmetic . . . . . . . 30
2.8.2 Is 1 a Prime?. . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.8.3 Prime Number Distribution . . . . . . . . . . . . . . . . . 31
2.8.4 Perfect Numbers . . . . . . . . . . . . . . . . . . . . . . . . 32
2.8.5 Mersenne Numbers . . . . . . . . . . . . . . . . . . . . . . 32
2.8.6 Transcendental and Algebraic Numbers . . . . . . . . 32
2.8.7 Infinity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.9 Worked Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Contents xi
2.9.1 Algebraic Expansion . . . . . . . . . . . . . . . . . . . . . 34
2.9.2 Binary Subtraction . . . . . . . . . . . . . . . . . . . . . . . 35
2.9.3 Complex Numbers. . . . . . . . . . . . . . . . . . . . . . . 35
2.9.4 Complex Rotation . . . . . . . . . . . . . . . . . . . . . . . 35
2.9.5 Quaternions. . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3 Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2.1 Solving the Roots of a Quadratic Equation . . . . . . 39
3.3 Indices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.3.1 Laws of Indices. . . . . . . . . . . . . . . . . . . . . . . . . 44
3.4 Logarithms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.5 Further Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.6 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.6.1 Explicit and Implicit Equations . . . . . . . . . . . . . . 47
3.6.2 Function Notation . . . . . . . . . . . . . . . . . . . . . . . 47
3.6.3 Intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.6.4 Function Domains and Ranges . . . . . . . . . . . . . . 49
3.6.5 Odd and Even Functions . . . . . . . . . . . . . . . . . . 50
3.6.6 Power Functions . . . . . . . . . . . . . . . . . . . . . . . . 52
3.7 Worked Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.7.1 Algebraic Manipulation . . . . . . . . . . . . . . . . . . . 52
3.7.2 Solving a Quadratic Equation . . . . . . . . . . . . . . . 53
3.7.3 Factorising . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4 Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.2 Truth Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.2.1 Logical Connectives. . . . . . . . . . . . . . . . . . . . . . 58
5 Trigonometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.3 Units of Angular Measurement . . . . . . . . . . . . . . . . . . . . . . 81
5.4 The Trigonometric Ratios. . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.4.1 Domains and Ranges . . . . . . . . . . . . . . . . . . . . . 85
6 Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
6.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
6.3 The Cartesian Plane. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
6.4 Function Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
6.5 Shape Representation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
6.5.1 2D Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
6.5.2 Areas of Shapes . . . . . . . . . . . . . . . . . . . . . . . . 98
Contents xiii
6.6 Theorem of Pythagoras in 2D. . . . . . . . . . . . . . . . . . . . . . . 99
6.7 3D Cartesian Coordinates. . . . . . . . . . . . . . . . . . . . . . . . . . 99
6.7.1 Theorem of Pythagoras in 3D . . . . . . . . . . . . . . . 100
6.8 Polar Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
6.9 Spherical Polar Coordinates . . . . . . . . . . . . . . . . . . . . . . . . 102
6.10 Cylindrical Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
6.11 Barycentric Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
6.12 Homogeneous Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . 104
6.13 Worked Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6.13.1 Area of a Shape. . . . . . . . . . . . . . . . . . . . . . . . . 105
6.13.2 Distance Between Two Points . . . . . . . . . . . . . . . 105
6.13.3 Polar Coordinates . . . . . . . . . . . . . . . . . . . . . . . 105
6.13.4 Spherical Polar Coordinates . . . . . . . . . . . . . . . . 106
6.13.5 Cylindrical Coordinates . . . . . . . . . . . . . . . . . . . 107
6.13.6 Barycentric Coordinates . . . . . . . . . . . . . . . . . . . 107
7 Determinants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
7.2 Linear Equations with Two Variables . . . . . . . . . . . . . . . . . 110
7.3 Linear Equations with Three Variables. . . . . . . . . . . . . . . . . 113
7.3.1 Sarrus’s Rule. . . . . . . . . . . . . . . . . . . . . . . . . . . 120
7.4 Mathematical Notation. . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
7.4.1 Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
7.4.2 Order of a Determinant. . . . . . . . . . . . . . . . . . . . 121
7.4.3 Value of a Determinant . . . . . . . . . . . . . . . . . . . 121
7.4.4 Properties of Determinants . . . . . . . . . . . . . . . . . 122
8 Vectors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
8.2 2D Vectors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
8.2.1 Vector Notation. . . . . . . . . . . . . . . . . . . . . . . . . 128
8.2.2 Graphical Representation of Vectors. . . . . . . . . . . 129
8.2.3 Magnitude of a Vector . . . . . . . . . . . . . . . . . . . . 130
8.3 3D Vectors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
8.3.1 Vector Manipulation . . . . . . . . . . . . . . . . . . . . . 132
8.3.2 Scaling a Vector . . . . . . . . . . . . . . . . . . . . . . . . 132
8.3.3 Vector Addition and Subtraction . . . . . . . . . . . . . 132
8.3.4 Position Vectors . . . . . . . . . . . . . . . . . . . . . . . . 133
8.3.5 Unit Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
8.3.6 Cartesian Vectors. . . . . . . . . . . . . . . . . . . . . . . . 135
8.3.7 Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
xiv Contents
8.3.8 Scalar Product. . . . . . . . . . . . . . . . . . . . . . . . . . 136
8.3.9 The Vector Product . . . . . . . . . . . . . . . . . . . . . . 137
8.3.10 The Right-Hand Rule. . . . . . . . . . . . . . . . . . . . . 142
8.4 Deriving a Unit Normal Vector for a Triangle . . . . . . . . . . . 142
8.5 Surface Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
8.5.1 Calculating 2D Areas . . . . . . . . . . . . . . . . . . . . . 144
8.6 Worked Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
8.6.1 Position Vector . . . . . . . . . . . . . . . . . . . . . . . . . 145
8.6.2 Unit Vector. . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
8.6.3 Vector Magnitude . . . . . . . . . . . . . . . . . . . . . . . 145
8.6.4 Angle Between Two Vectors. . . . . . . . . . . . . . . . 146
8.6.5 Vector Product . . . . . . . . . . . . . . . . . . . . . . . . . 146
9 Matrices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
9.2 Geometric Transforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
9.3 Transforms and Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . 151
9.4 Matrix Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
9.4.1 Matrix Dimension or Order. . . . . . . . . . . . . . . . . 154
9.4.2 Square Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . 154
9.4.3 Column Vector . . . . . . . . . . . . . . . . . . . . . . . . . 155
9.4.4 Row Vector . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
9.4.5 Null Matrix. . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
9.4.6 Unit Matrix. . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329