Asymptotic Bounds The Differences Between BigO Omega and
Asymptotic Bounds The Differences Between (Big-O, Omega and Theta) Properties
Measuring Efficiency • Scalability – When algorithm is applied to a large data set, will finish relatively quickly. • Speed and memory usage – Measuring speed-we measure algorithm speed in terms of Operations relative to input size.
y Big O g(x) f(x) C*g(x) xo x
Big O • Definition: Let f(x) and g(x) be two functions; We say that f(x) O(g(x)) if there exists a constant c, Xo > 0 such that f(x)≤c*g(x) for all X ≥ Xo. • f (x) is asymptotically less than or equal to g(x) • Big-O gives an asymptotic upper bound.
y Big g(x) xo f(x) C*g(x) x
Big-Omega • Definition: Let f (x)and g(x) be two functions; We say that f(x) (g(x)) if there exists a constant c, Xo ≥ 0 such that f(x) ≥ c*g(x) for all X ≥ Xo • f(x) is asymptotically greater than or equal to g(x) • Big-Omega gives an asymptotic lower bound
y Big Θ C 1*g(x) xo f(x) C 2*g(x) x
Big Θ • Definition: Let f(x) and g(x) be two functions ; We say that f(x) (g(x)) if there exists a constant c 1, c 2, Xo > 0; such that for every integer x x 0 we have c 1 g(x) ≥ f(x) ≥ c 2 g(x) • F(x) is asymptotically equal to g(x) • F(x) is bounded above and below by g(x) • Big-Theta gives an asymptotic equivalence
- Slides: 8