Other Measures
Notes
- O(g(n)) bounds above
- Ω(g(n)) bounds below
- $\Omega(g(n)) = \{ f(n) : \text{ there exists constants } c > 0, n_0 > 0 \text{ such that } 0 \le c \times g(n) \le f(n) \text{ for all } n \ge n_0 \}$
- This provides a lower bound on the performance of an algorithm.
- We know, for example that insertion sort is Ω(n)
- Because the outer loop runs from 2 to n.
- This is used less frequently that O(n)
- Θ(g(n)); bounds from above and below
- $\Theta(g(n)) = \{ f(n) : \text{ there exists constants } c_0, c_1 > 0, n_0 > 0 \text{ such that } 0 \le c_0 \times g(n) \le f(n) ≤ c_1 \times g(n) \text{ for all } n \ge n_0 \}$
- This is a tight bound
- There are three other sets
- $o(g(n)) = \{ f(n) : \text{ for any constant } c > 0, n_0 > 0 \text{ such that } 0 \le f(n) \le c \times g(n) \text{ for all } n \ge n_0 \}$
- little-o
- This says that g(n) dominates f(n)
- n ∈ o(n2)
- n2 ∉ o(n2)
- Definitions for ω and θ exist as well.
- But I have not really ever seen them outside of the text book.