This course is about designing algorithms for solving practical problems. We will deal only with sequential deterministic algorithms.
Here are some Examples Of Algorithms
We need to give a mathematical proof that an algorithm we have designed terminates and returns a solution to the problem at hand when this is not obvious by inspecting the algorithm using common sense.
Here is an example of role of proofs
We need a way to compare two functions, in this case representing the runtime of each algorithm. We prefer to talk in terms of asymptotics.
Definition
We say f(n) = O(g(n))
if there exist positive constants C and N such that 0 ≤ f(n) ≤ C · g(n) for all n ≥ N.
g(n) is said to be an asymptotic upper bound for f(n).
Informally, f (n) is eventually (i.e. for large n) controlled by a multiple of g(n), i.e. f (n) grows “no faster than g(n)”.
f (n) = Ω(g(n))
if there exist positive constants c and N such that 0 ≤ C · g(n) ≤ f (n) for all n ≥ N.f(n) = Θ(g(n))
if f(n) = O(g(n))
and f(n) = Ω(g(n))
.