Floor and Ceiling Functions PowerPoint PPT Presentation

presentation player overlay
1 / 17
About This Presentation
Transcript and Presenter's Notes

Title: Floor and Ceiling Functions


1
Floor and Ceiling Functions
  • Floorx is the largest integer less than or
    equal to x.
  • Ceilingx is the smallest integer greater than
    or equal to x.

2
Logarithms
  • For bgt1 and xgt0, logbx (read log to the base b
    of x) that is real number L such that bL x
  • logbx is the power to which b must be raised to
    get x.

3
Logarithm properties
  • def lg x log2 x ln x loge x
  • Let x and y be arbitrary positive real numbers,
    and let bgt1 and cgt1 be real numbers.
  • logb is a strictly increasing function, if x gt y
    then logb x gt logb y
  • logb is a one-to-one function, if logb x logb
    y then x y
  • logb 1 0 logb b 1 logb xa a logb x
  • logb(xy) logb x logb y
  • xlog y ylog x
  • change base logcx (logb x)/(logb c)

4
Series
  • A series is the sum of a sequence.
  • Arithmetic series
  • The sum of consecutive integers
  • Polynomial Series
  • The sum of squares
  • The general case is sum of
  • numbers raised to
  • the power of k

5
Series
  • Powers of 2
  • Arithmetic Geometric Series

6
Summations Using Integration
  • If f(x) is nondecreasing then
  • If f(x) is nonincreasing then

7
Monotonic Functions
  • A function f(x) is said to be monotonic, or
    nondecreasing, or increasing in wider sense if x
    ? y always implies that f(x) ? f(y).
  • A function f(x) is antimonotonic, or
    nonincreasing, if f(x) is monotonic.

8
Asymptotic Growth Rates
  • asymptotic growth rate, asymptotic order, or
    order of functions
  • Comparing and classifying functions that ignores
    constant factors and small inputs.
  • The Sets big oh O(g), big theta ?(g), big omega
    ?(g)

9
Classifying functions by theirAsymptotic Growth
Rates

?(g) functions that grow at least as fast as g
?(g) functions that grow at the same rate as g
O(g) functions that grow no faster as g
10
The Sets O(g), ?(g), ?(g)
  • Let g and f be functions from the nonnegative
    integers into the positive real numbers
  • For some real constant c gt 0 and some
    nonnegative integer constant n0
  • O(g) is the set of functions f, such
    that f(n) ? c g(n) for all n ? n0
  • O(g) f ? ?c ?n0 f(n) ? c g(n) for all n ?
    n0

11
?(g), ?(g)
  • ?(g) is the set of functions f, such that
  • f(n) ? c g(n) for all n ? n0
  • ?(g) O(g) ? ?(g)
  • asymptotic order of g
  • f ??(g) read as f is asymptotic order g or f
    is order g

12
Comparing asymptotic growth rates
  • Comparing f(n) and g(n) as n approaches infinity,

13
Limit
  • lt ?, including the case in which the limit is 0
    then f ?O(g)
  • gt 0, including the case in which the limit is ?
    then f ? ?(g)
  • c and 0 lt c lt ? then f ? ?(g)
  • 0 then f ? o(g) //read as little oh of g
  • ? then f ? ?(g) //read as little omega of g

14
Properties of O(g), ?(g), ?(g)
  • Transitive If f ?O(g) and g ?O(h), then f
    ?O(h).O is transitive. Also ?, ?, o, ? are
    transitive.
  • Reflexive f ? ?(f)
  • Symmetric If f ? ?(g), then g ? ?(f)

15
?
  • ? defines an equivalence relation on the
    functions.
  • Each set ?(f) is an equivalence class (complexity
    class).
  • f ?O(g) ? g ? ?(f)
  • O(f g) O(max(f, g)) similar equations hold
    for ? and ?

16
Classification of functions
  • lg n ? o(n?) for any ? gt 0, including fractional
    powers
  • nk ? o(cn) for any k gt 0 and any c gt 1
  • powers of n grow more slowly than any
    exponential function cn

17
Classification of functions
  • O(1) denotes the set of functions bounded by a
    constant (for large n)
  • f ? ?(n), f is linear
  • f ? ?(n2), f is quadratic f ? ?(n3), f is cubic
Write a Comment
User Comments (0)