Growth of Functions - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Growth of Functions

Description:

How the running time of an algorithm increase with the size of the input in the ... transpose symmetry, and trichotomy of asymptotically positive functions ... – PowerPoint PPT presentation

Number of Views:98
Avg rating:3.0/5.0
Slides: 13
Provided by: ccNct
Category:

less

Transcript and Presenter's Notes

Title: Growth of Functions


1
Growth of Functions
2
Introduction
  • Order of growth of the running time of an
    algorithm
  • Characterization of the algorithms efficiency
  • Is used to compare relative performance of
    alternative algorithms
  • Asymptotic efficiency of algorithms
  • How the running time of an algorithm increase
    with the size of the input in the limit, as the
    size of the input increases without bound
  • Usually, an algorithm that is asymptotically more
    efficient will be the best choice for all but
    very small inputs.

3
Asymptotic Notation
4
?-notation
  • ?(g(n)) f(n) there exist positive constants
    c1, c2 and n0 such that 0 ? c1g(n) ? f(n) ?
    c2g(n) for all n ? n0
  • Domains of functions are the set of natural
    number
  • f(n) and g(n) must be asymptotically nonnegative
  • ?(g(n)) is a set of functions
  • f(n) is a member of ?(g(n)) ? f(n) ? ?(g(n)) ?
    f(n) ?(g(n))
  • f(n) is equal to g(n) within a constant factor
  • g(n) is an asymptotically tight bound for f(n)
  • The lower-order terms of an asymptotically
    positive function can be ignored in determining
    asymptotically tight bounds because they are
    insignificant for large n

5
?-notation (Cont.)
6
?-notation (Cont.)
  • Prove that
  • Determine c1, c2 and n0 such that
  • c11/14, c21/2, n07
  • Prove that
  • Suppose for the purpose of contraction that c2
    and n0 exist such that

Impossible for arbitrarily large n, since c2 is
constant.
7
O-notation
  • O(g(n)) f(n) there exist positive constants c
    and n0 such that 0 ? f(n) ? cg(n) for all n ? n0
  • Asymptotic upper bound
  • f(n) ?(g(n)) implies f(n) O(g(n)) ? ?(g(n))
    ? O(g(n))
  • an2 bn c O(n2)
  • an b O(n2) (Why???)
  • O-notation is often used to describe the
    worst-case running time of an algorithm
  • The running time of an algorithm is O(g(n)) ?
    there is a function f(n) that is O(g(n)) such
    that for any value of n, no matter what
    particular input of size n is chosen, the running
    time on that input is bounded from above by the
    value f(n)

8
O-notation (Cont.)
9
?-notation
an2 bn c ?(n2)an2 bn c ?(n)
  • ?(g(n)) f(n) there exist positive constants c
    and n0 such that 0 ? cg(n) ? f(n) for all n ? n0
  • Asymptotic lower bound
  • f(n) ?(g(n)) implies f(n) ?(g(n)) ? ?(g(n))
    ? ?(g(n))
  • ?-notation is often used to describe the
    best-case running time of an algorithm
  • The running time of an algorithm is ?(g(n)) ?
    there is a function f(n) that is ?(g(n)) such
    that for any value of n, no matter what
    particular input of size n is chosen, the running
    time on that input is bounded from below by the
    value f(n)
  • Theorem 3.1. For any two functions f(n) and g(n),
    we have f(n) ?(g(n)) if and only if f(n)
    O(g(n)) and f(n) ?(g(n))

10
?-Notation (Cont.)
11
o-notation and ?-notation
  • o(g(n)) f(n) for any positive constant c,
    there exists a positive constant n0 such that 0 ?
    f(n) lt cg(n) for all n ? n0
  • Denotes an upper bound that is not asymptotically
    tight
  • 2n2 O(n2) ? asymptotically tight
  • 2n O(n2) ? not asymptotically tight
  • 2n o(n2) but 2n2 ? o(n2)
  • ?(g(n)) f(n) for any positive constant c,
    there exists a positive constant n0 such that 0 ?
    cg(n) lt f(n) for all n ? n0
  • Denotes an lower bound that is not asymptotically
    tight
  • n2/2 ?(n) but n2/2 ? ?(n2)

12
Self-Study
  • Section 3.1. Asymptotic notation in equations and
    inequalities (pp. 46-47)
  • Section 3.1. Comparison of functions (pp. 49-50)
  • Transitivity, reflexivity, symmetry, transpose
    symmetry, and trichotomy of asymptotically
    positive functions
  • Section 3.2. Standard notations and common
    functions (pp. 51-56)
Write a Comment
User Comments (0)
About PowerShow.com