Chapter 3 Growth of Functions Lee HsiuHui Ack

  • Slides: 25
Download presentation
Chapter 3 Growth of Functions Lee, Hsiu-Hui Ack: This presentation is based on the

Chapter 3 Growth of Functions Lee, Hsiu-Hui Ack: This presentation is based on the lecture slides from Hsu, Lih -Hsing, as well as various materials from the web. 20070928 chap 03 Hsiu-Hui Lee

3. 1 Asymptotic notation • Θ-notation g(n) is an asymptotic tight bound for f(n).

3. 1 Asymptotic notation • Θ-notation g(n) is an asymptotic tight bound for f(n). • ``=’’ abuse 20070928 chap 03 Hsiu-Hui Lee 2

 • The definition of requires that every member be asymptotically nonnegative. 20070928 chap

• The definition of requires that every member be asymptotically nonnegative. 20070928 chap 03 Hsiu-Hui Lee 3

EXAMPLE: 20070928 chap 03 Hsiu-Hui Lee 4

EXAMPLE: 20070928 chap 03 Hsiu-Hui Lee 4

Why ? • In general, 20070928 chap 03 Hsiu-Hui Lee 5

Why ? • In general, 20070928 chap 03 Hsiu-Hui Lee 5

O-notation (big –oh; Asymptotic Upper Bound) EXAMPLE: 2 n 2= O(n 3) 20070928 chap

O-notation (big –oh; Asymptotic Upper Bound) EXAMPLE: 2 n 2= O(n 3) 20070928 chap 03 Hsiu-Hui Lee 6

Ω-notation (big –omega; Asymptotic Lower Bound) EXAMPLE: 20070928 chap 03 Hsiu-Hui Lee 7

Ω-notation (big –omega; Asymptotic Lower Bound) EXAMPLE: 20070928 chap 03 Hsiu-Hui Lee 7

Theorem 3. 1 • For any two functions f(n) and g(n), and 20070928 chap

Theorem 3. 1 • For any two functions f(n) and g(n), and 20070928 chap 03 if and only if. Hsiu-Hui Lee 8

O-notation (little-oh) • An upper bound that is not asymptotically tight. • • •

O-notation (little-oh) • An upper bound that is not asymptotically tight. • • • 20070928 chap 03 Hsiu-Hui Lee 9

ω-notation (little-omega) • An lower bound that is not asymptotically tight. • • •

ω-notation (little-omega) • An lower bound that is not asymptotically tight. • • • 20070928 chap 03 Hsiu-Hui Lee 10

Relational properties • Transitivity • Reflexivity • Symmetry 20070928 chap 03 Hsiu-Hui Lee 11

Relational properties • Transitivity • Reflexivity • Symmetry 20070928 chap 03 Hsiu-Hui Lee 11

 • Transpose symmetry 20070928 chap 03 Hsiu-Hui Lee 12

• Transpose symmetry 20070928 chap 03 Hsiu-Hui Lee 12

Trichotomy Although any two real numbers can be compared, not all functions are asymptotically

Trichotomy Although any two real numbers can be compared, not all functions are asymptotically comparable. • a < b, a = b, or a > b. • It may be the case that neither nor holds. • e. g. , are not comparable • 20070928 chap 03 Hsiu-Hui Lee 13

3. 2 Standard notations and common functions • Monotonicity: • • A function f

3. 2 Standard notations and common functions • Monotonicity: • • A function f is monotonically increasing if m n implies f(m) f(n). A function f is monotonically decreasing if m n implies f(m) f(n). A function f is strictly increasing if m < n implies f(m) < f(n). A function f is strictly decreasing if m > n implies f(m) > f(n). 20070928 chap 03 Hsiu-Hui Lee 14

Floor and ceiling 20070928 chap 03 Hsiu-Hui Lee 15

Floor and ceiling 20070928 chap 03 Hsiu-Hui Lee 15

Modular arithmetic • • For any integer a and any positive integer n, the

Modular arithmetic • • For any integer a and any positive integer n, the value a mod n is the remainder (or residue) of the quotient a/n : a mod n =a - a/n n. If (a mod n) = (b mod n). We write a b (mod n) and say that a is equivalent to b, modulo n. • We write a ≢ b (mod n) if a is not equivalent to b modulo n. 20070928 chap 03 Hsiu-Hui Lee 16

Polynomials • Polynomial in n of degree d ≧ 0 If a≧ 0, is

Polynomials • Polynomial in n of degree d ≧ 0 If a≧ 0, is monotonically increasing. • If a≦ 0, is monotonically decreasing. • A function is polynomial bounded • if 20070928 chap 03 for some constant k. Hsiu-Hui Lee 17

Exponentials • Any positive exponential function with a base greater than 1 grows faster

Exponentials • Any positive exponential function with a base greater than 1 grows faster than any polynomial function. 20070928 chap 03 Hsiu-Hui Lee 18

Logarithms • A function f(n) is polylogarithmically bounded if for any constant a >

Logarithms • A function f(n) is polylogarithmically bounded if for any constant a > 0. • Any positive polynomial function grows faster than any polylogarithmic function. 20070928 chap 03 Hsiu-Hui Lee 19

Factorials • Stirling’s approximation where 20070928 chap 03 Hsiu-Hui Lee 20

Factorials • Stirling’s approximation where 20070928 chap 03 Hsiu-Hui Lee 20

Function iteration For example, if , then 20070928 chap 03 Hsiu-Hui Lee 21

Function iteration For example, if , then 20070928 chap 03 Hsiu-Hui Lee 21

The iterative logarithm function 20070928 chap 03 Hsiu-Hui Lee 22

The iterative logarithm function 20070928 chap 03 Hsiu-Hui Lee 22

 • Since the number of atoms in the observable universe is estimated to

• Since the number of atoms in the observable universe is estimated to be about , which is much less than , we rarely encounter a value of n such that. 20070928 chap 03 Hsiu-Hui Lee 23

Fibonacci numbers 20070928 chap 03 Hsiu-Hui Lee 24

Fibonacci numbers 20070928 chap 03 Hsiu-Hui Lee 24

Homework-1 • Problem 3 -1, 3 -2 • Due: 10/5/20070928 chap 03 Hsiu-Hui Lee

Homework-1 • Problem 3 -1, 3 -2 • Due: 10/5/20070928 chap 03 Hsiu-Hui Lee 25