Comparing Functions - PowerPoint PPT Presentation

About This Presentation
Title:

Comparing Functions

Description:

Comparing f(n) and g(n) Let f be a function from N to R. O(f) (Big O of f) is the set of all functions g from N to R such that: ... – PowerPoint PPT presentation

Number of Views:306
Avg rating:3.0/5.0
Slides: 15
Provided by: peterm8
Learn more at: http://cs.baylor.edu
Category:

less

Transcript and Presenter's Notes

Title: Comparing Functions


1
Comparing Functions

2
Notes on Notation
  • N 0,1,2,3, ...
  • N 1,2,3,4, ...
  • R Set of Reals
  • R Set of Positive Reals
  • R R U 0

3
Comparing f(n) and g(n)
  • Let f be a function from N to R.
  • O(f) (Big O of f) is the set of all functions g
    from N to R such that
  • 1. There exists a real number cgt0
  • 2. AND there exists an n0 in N
  • Such that g(n) cf(n) whenever n ³ n0

4
Notation and Pronunciation
Proper Notation g Î O(f)
g is oh of f
Also Seen g O(f)
5
Big Omega
Let f be a function from N to R. W(f) (Big W of
f) is the set of all functions g from N to R such
that 1. There exists a real number cgt0 2. AND
there exists an n0 in N Such that g(n) ³ cf(n)
whenever n ³ n0
6
Big Theta
Q(f) O(f) Ç W(f)
g is of Order f
g is Order f
g Î Q(f)
7
Little o and Little Omega
o(f) O(f) - Q(f)
w(f) W(f) - Q(f)
8
English Interpretations
  • O(f) - Functions that grow no faster than f
  • W(f) - Functions that grow no slower than f
  • Q(f) - Functions that grow at the same rate as f
  • o(f) - Functions that grow slower than f
  • w(f) - Functions that grow faster than f

9
Limit Formulas
if
for some
if
or
10
More Limit Formulas
if
for some
if
11
The Last Limit Formula
if
12
Properties
  • Transitivity
  • if f Î O(g) and g Î O(h) then f Î O(h)
  • Same holds for Q , W, o, and w
  • Anti Symmetry (Sort of ...)
  • f Î O(g) if and only if g Î W(f)
  • May replace O with o and W with w

13
Some More Properties
  • Symmetry
  • if f Î Q(f), then g Î Q(f)
  • Reflexivity
  • f Î O(f)
  • Also true for Q and W
  • Not True for o and w

14
And Even More Properties
  • Big Theta is an equivalence relation
  • f R g if and only if f Î Q(g)
  • O(fg) O(max(f,g))
  • Also true for Q and W
Write a Comment
User Comments (0)
About PowerShow.com