3.Growth of Functions. 2 3.1 Asymptotic notation  g(n) is an asymptotic tight bound for f(n). ``=’’ abuse.

Slides:



Advertisements
Similar presentations
Introduction to Algorithms
Advertisements

Master Theorem Chen Dan Dong Feb. 19, 2013
Analysis of Algorithms
 The running time of an algorithm as input size approaches infinity is called the asymptotic running time  We study different notations for asymptotic.
Discrete Structures & Algorithms Functions & Asymptotic Complexity.
CSE332: Data Abstractions Lecture 2: Math Review; Algorithm Analysis Tyler Robison Summer
CS Section 600 CS Section 002 Dr. Angela Guercio Spring 2010.
Chapter 3 Growth of Functions
The Growth of Functions
Asymptotic Growth Rate
Cutler/HeadGrowth of Functions 1 Asymptotic Growth Rate.
Growth of Functions CIS 606 Spring 2010.
Lecture 2: Math Review and Asymptotic Analysis. Common Math Functions Floors and Ceilings: x-1 < └ x ┘ < x < ┌ x ┐ < x+1. Modular Arithmetic: a mod n.
1 Data Structures A program solves a problem. A program solves a problem. A solution consists of: A solution consists of:  a way to organize the data.
25 June 2015Comp 122, Spring 2004 Asymptotic Notation, Review of Functions & Summations.
3.Growth of Functions Hsu, Lih-Hsing.
1 Discrete Mathematics Summer 2004 By Dan Barrish-Flood originally for Fundamental Algorithms For use by Harper Langston in D.M.
Data Structures and Algorithms1 Basics -- 2 From: Data Structures and Their Algorithms, by Harry R. Lewis and Larry Denenberg (Harvard University: Harper.
CSE 373 Data Structures and Algorithms Lecture 4: Asymptotic Analysis II / Math Review.
Introduction to Algorithms (2 nd edition) by Cormen, Leiserson, Rivest & Stein Chapter 3: Growth of Functions (slides enhanced by N. Adlai A. DePano)
CS 473Lecture X1 CS473-Algorithms I Lecture X Ackermann’s Function and Its Inverse.
Time Complexity Dr. Jicheng Fu Department of Computer Science University of Central Oklahoma.
Algorithm Efficiency CS 110: Data Structures and Algorithms First Semester,
1 Computer Algorithms Lecture 3 Asymptotic Notation Some of these slides are courtesy of D. Plaisted, UNC and M. Nicolescu, UNR.
CS 3343: Analysis of Algorithms
1 COMP3040 Tutorial 1 Analysis of algorithms. 2 Outline Motivation Analysis of algorithms Examples Practice questions.
Chapter 2 Mathematical preliminaries 2.1 Set, Relation and Functions 2.2 Proof Methods 2.3 Logarithms 2.4 Floor and Ceiling Functions 2.5 Factorial and.
Asymptotic Analysis-Ch. 3
CMPT 438 Algorithms Chapter 3 Asymptotic Notations.
Algorithms Growth of Functions. Some Notation NNatural numbers RReal numbers N + Positive natural numbers R + Positive real numbers R * Non-negative real.
Program Efficiency & Complexity Analysis. Algorithm Review An algorithm is a definite procedure for solving a problem in finite number of steps Algorithm.
1 o-notation For a given function g(n), we denote by o(g(n)) the set of functions: o(g(n)) = {f(n): for any positive constant c > 0, there exists a constant.
Nattee Niparnan Dept. of Computer Engineering, Chulalongkorn University.
Growth of Functions. 2 Analysis of Bubble Sort 3 Time Analysis – Best Case The array is already sorted – no swap operations are required.
Asymptotic Analysis (based on slides used at UMBC)
Time Complexity of Algorithms
Time Complexity of Algorithms (Asymptotic Notations)
Big-O. Algorithm Analysis Exact analysis: produce a function f(n) measuring how many basic steps are needed for a given inputs n On any input of size.
Chapter 2 Computational Complexity. Computational Complexity Compares growth of two functions Independent of constant multipliers and lower-order effects.
Analysis of Algorithm. Why Analysis? We need to know the “behavior” of algorithms – How much resource (time/space) does it use So that we know when to.
Asymptotics and Recurrence Equations Prepared by John Reif, Ph.D. Analysis of Algorithms.
Recurrences – II. Comp 122, Spring 2004.
ADVANCED ALGORITHMS REVIEW OF ANALYSIS TECHNIQUES (UNIT-1)
David Meredith Growth of Functions David Meredith
CSE 373: Data Structures and Algorithms Lecture 4: Math Review/Asymptotic Analysis II 1.
13 February 2016 Asymptotic Notation, Review of Functions & Summations.
Asymptotic Notation Faculty Name: Ruhi Fatima
Kompleksitas Waktu Asimptotik CSG3F3 Lecture 5. 2 Intro to asymptotic f(n)=an 2 + bn + c RMB/CSG3F3.
DR. Gatot F. Hertono, MSc. Design and Analysis of ALGORITHM (Session 2)
1 Chapter 2 Algorithm Analysis Reading: Chapter 2.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 2.
Asymptotic Complexity
Number-Theoretic Algorithms
Introduction to Algorithms: Asymptotic Notation
Chapter 3 Growth of Functions Lee, Hsiu-Hui
nalisis de lgoritmos A A
Introduction to Algorithms (2nd edition)
CS 3343: Analysis of Algorithms
Growth of functions CSC317.
Asymptotic Notations Algorithms Lecture 9.
Asymptotic Growth Rate
Fundamentals of Algorithms MCS - 2 Lecture # 9
Chapter 2: Fundamentals of the Analysis of Algorithm Efficiency
CS 3343: Analysis of Algorithms
Ch 3: Growth of Functions Ming-Te Chi
Advanced Algorithms Analysis and Design
Chapter 3 Growth of Functions
Analysis of Algorithms Big-Omega and Big-Theta
Intro to Theory of Computation
Presentation transcript:

3.Growth of Functions

2 3.1 Asymptotic notation  g(n) is an asymptotic tight bound for f(n). ``=’’ abuse

3 The definition of required every member of be asymptotically nonnegative.

4 Example: In general,

5 asymptotic upper bound

6 asymptotic lower bound

7 Theorem 3.1. For any two functions f(n) and g(n), if and only if and

8

9 Transitivity Reflexivity Symmetry

10 Transpose symmetry

11 Trichotomy a b. e.g., does not always hold because the latter oscillates between

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).

13 Floor and ceiling For any integer n For any real x For any real n>=0, and integers a, b >0

14 Proof of Ceiling

15 Proof of Floor

16 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.

17 Exponential Basics

18 Polynomials v.s. Exponentials Polynomials: A function is polynomial bounded if f(n)=O(n k ) Exponentials: Any positive exponential function grows faster than any polynomial.

19 Prove: n b =o(a n )

20 Logarithm Notations

21 Logarithm Basics

22 Logarithms A function f(n) is polylogarithmically bounded if for any constant a > 0. Any positive polynomial function grows faster than any polylogarithmic function.

23 Prove: lg b n=o(n a )

24 Factorials Stirling’s approximation where

25 Function iteration For example, if, then

26 The iterative logarithm function h

27 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.

28 Fibonacci numbers