This document provides an overview of asymptotic notation used to analyze algorithms. It defines common asymptotic classifications like Big O, Big Omega, and Theta notation. Examples are given to demonstrate how to determine the asymptotic complexity of functions and algorithms using these notations. Key concepts like monotonicity, floors/ceilings, and modular arithmetic are also summarized.
4. Asymptotically N o Negative Functions f(n) is asymptotically no negative if there exist n 0 N such that for every n n 0 , 0 f(n) n 0 f
5. Theta ( g(n) ) = { f : N R * | ( c 1 , c 2 R + ) ( n 0 N) ( n n 0 ) ( 0 c 1 g(n) f(n) c 2 g(n) ) } c 1 lim f(n) c 2 n g(n ) n 0 g c 1 g f c 2 g
8. For all n n 0 , Dividing by n 2 yields We have that 3/n is a decreasing sequence 3, 3/2, 1, 3/4, 3/5, 3/6, 3/7… and then 1/2 - 3/n is increasing sequence -5/2, -1, -1/2, -1/4, -1/10, 0, 1/14 that is upper bounded by 1/2 .
9. The right hand inequality can be made to hold for n 1 by choosing c 2 1/2 . Likewise the left hand inequality can be made to hold for n 7 by choosing c 1 1/14 .
10. Thus by choosing c 1 = 1/14 , c 2 = 1/2 and n 0 =7 then we can verify that
11. Big O O (g(n)) = { f : N R * | ( c R + ) ( n 0 N) ( n n 0 ) ( 0 f(n) cg(n) ) } lim f(n) c n g(n) n 0 g cg f
14. For all n n 0 , Dividing by n yields The inequality can be made to hold for n 1 by choosing c a+b . Thus by choosing c = a+b and n 0 =1 then we can verify that
16. Big Omega ( g(n) ) = { f : N R * | ( c R + ) ( n 0 N) ( n n 0 ) ( 0 cg(n) f(n) ) } c lim f(n) n g(n) n 0 g f cg
17.
18. Little o o (g(n)) = { f : N R * | ( c R + ) ( n 0 N) ( n n 0 ) ( 0 f(n) < cg (n) ) } lim f(n) = 0 n g(n) “ o(g(n)) functions that grow slower than g ” g f
19.
20. n 2 n Examples Lets show that We only have to show
22. Little Omega ( g(n) ) = { f : N R * | ( c R + ) ( n 0 N) ( n n 0 ) ( 0 c g(n) < f(n ) ) } lim f(n) = n g(n) “ (g(n)) functions that grow faster than g ” f g
23.
24. Analogy with the comparison of two real numbers Asymptotic Real Notation numbers f(n) O(g(n)) f g f(n) (g(n)) f g f(n) (g(n)) f = g f(n) o(g(n)) f < g f(n) (g(n)) f > g Trichotomy does not hold
25. Not all functions are asymptotically comparable Example f(n)=n g(n)=n (1+sin n) (1+sin(n)) [0,2]
26.
27.
28.
29.
30.
31.
32.
33. Asymptotic notation two variables O(g(m, n))= { f: N N R * | ( c R + )( m 0 , n 0 N) ( n n 0 ) ( m m 0 ) (f(m, n) c g(m, n)) }
38. Modular arithmetic For every integer a and any possible positive integer n, a mod n is the remainder of ( or residue ) of the quotient a/n a mod n = a - a / n n.
39. congruency or equivalence mod n If ( a mod n) = ( b mod n) we write a b ( mod n) and we say that a is equivalent to b modulo n or that a is congruent to b modulo n. In other words a b ( mod n) if a and b have the same remainder when divided by n . Also a b ( mod n) if and only if n is a divisor of b-a.
40. 0 1 2 3 -4 -3 -2 -1 -8 -7 -6 -5 -12 -11 -10 -9 12 13 14 15 8 9 10 11 4 5 6 7 Example (mod 4) (mod n) defines a equivalence relation in Z and produces a partitioned set called Z n = Z /n = {0,1,2,…, n -1} in which can be defined arithmetic operations a+b (mod n) a*b (mod n) [0] [1] [2] [3] Z /4 = {[0],[1],[2],[3]} = {0,1,2,3} 4+1 ( mod 4) = 1 5*2 ( mod 4) = 2
41. Polynomials Given a no negative integer d, a polynomial in n of degree d is a function p(n) of the form: Where a 1 , a 2 , …, a d are the coefficients and a d 0.
42.
43.
44.
45.
46.
47.
48.
49. A function f(n) is polylogaritmically bounded if f(n)= O ( lg k n) for some constant k. We have the following relation between polynomials and polylogarithms: then lg k n = o ( n k )
53. Functional iteration Given a function f ( n ) the i-th functional iteration of f is defined as : with I the identity function. For a particular n , we have,