Appendix: Mathematics Review
A certain familiarity with certain mathematical concepts will help you when trying to analyze algorithms. This section is meant as a review for some commonly used mathematical concepts, notation, and methodology. Where possible analogies between mathematical and programming concepts are drawn
Mathematical Notations and Shorthands
Shorthands
shorthand
meaning
iff
if and only if
therefore
approximately
a * b
a * b
absolute value of a
Variables
In math, like programming, we use variables. Variables can take on some numeric value and we use it as a short hand in a mathematical expression. Before using a variable, you should define what it means (like declaring a variable in a program)
For example:
"Let n represent the size of an array"
This means that the variable n is a shorthand for the size of an array in later statements.
Functions
Similar to functions in programming, mathematics have a notation for functions. Mathematically speaking, a function has a single result for a given set of arguments. When writing out mathematical proof, we need to use the language of math which has its own syntax
As a function works with some argument, we first define what the arguments mean then what the function represents.
For example:
Summary
When we talk about big-O notation (and related little-o, theta and omega notation) those are NOT functions. For example O(n) is NOT a function named O that takes a variable n. It's meaning is different.
Sigma Notation
Sigma notation is a shorthand for showing a sum. It is similar in nature to a for loop in programming.
General summation notation.
The above notation means that there are n terms and the summation notation adds each of them together.
Example:
Mathematical Definitions and Identities
Mathematical identities are expressions that are equivalent to each other. Thus, if you have a particular term, you can replace it with its mathematical identity.
Exponents
Definition
Identities
Logarithms
Definition
Identities
Series
A series is the sum of a sequence of values. We usually express this using sigma notation (see above).
Identities
Last updated