The Growth of Functions (2A) Young Won Lim 4/6/18

Similar documents
Relations (3A) Young Won Lim 3/27/18

Higher Order ODE's (3A) Young Won Lim 12/27/15

Higher Order ODE's (3A) Young Won Lim 7/7/14

Fourier Analysis Overview (0A)

Announcements. CompSci 230 Discrete Math for Computer Science. The Growth of Functions. Section 3.2

Digital Signal Octave Codes (0A)

Fourier Analysis Overview (0A)

Algorithms and Their Complexity

Expected Value (10D) Young Won Lim 6/12/17

Root Locus (2A) Young Won Lim 10/15/14

CT Rectangular Function Pairs (5B)

General CORDIC Description (1A)

Background Trigonmetry (2A) Young Won Lim 5/5/15

Higher Order ODE's (3A) Young Won Lim 7/8/14

Matrix Transformation (2A) Young Won Lim 11/10/12

Introduction to ODE's (0A) Young Won Lim 3/9/15

Digital Signal Octave Codes (0A)

Differentiation Rules (2A) Young Won Lim 1/30/16

Discrete Time Rect Function(4B)

Separable Equations (1A) Young Won Lim 3/24/15

General Vector Space (2A) Young Won Lim 11/4/12

Signal Functions (0B)

Digital Signal Octave Codes (0A)

Discrete Time Rect Function(4B)

Digital Signal Octave Codes (0A)

Fourier Analysis Overview (0B)

Hamiltonian Cycle (3A) Young Won Lim 5/5/18

Matrix Transformation (2A) Young Won Lim 11/9/12

Up-Sampling (5B) Young Won Lim 11/15/12

Digital Signal Octave Codes (0A)

DFT Frequency (9A) Each Row of the DFT Matrix. Young Won Lim 7/31/10

Implication (6A) Young Won Lim 3/17/18

Down-Sampling (4B) Young Won Lim 10/25/12

Higher Order ODE's, (3A)

Detect Sensor (6B) Eddy Current Sensor. Young Won Lim 11/19/09

Group & Phase Velocities (2A)

Digital Signal Octave Codes (0A)

Bayes Theorem (4A) Young Won Lim 3/5/18

Complex Trigonometric and Hyperbolic Functions (7A)

Line Integrals (4A) Line Integral Path Independence. Young Won Lim 10/22/12

Propagating Wave (1B)

Signals and Spectra (1A) Young Won Lim 11/26/12

Resolution (7A) Young Won Lim 4/21/18

Audio Signal Generation. Young Won Lim 1/29/18

ODE Background: Differential (1A) Young Won Lim 12/29/15

Down-Sampling (4B) Young Won Lim 11/15/12

Capacitor Young Won Lim 06/22/2017

Implication (6A) Young Won Lim 3/12/18

Propositional Logic Resolution (6A) Young W. Lim 12/12/16

Capacitor and Inductor

Capacitor and Inductor

Dispersion (3A) 1-D Dispersion. Young W. Lim 10/15/13

Differentiation Rules (2A) Young Won Lim 2/22/16

Propositional Logic Logical Implication (4A) Young W. Lim 4/11/17

Big O Notation. P. Danziger

Propositional Logic Resolution (6A) Young W. Lim 12/31/16

Magnetic Sensor (3B) Magnetism Hall Effect AMR Effect GMR Effect. Young Won Lim 9/23/09

Complex Series (3A) Young Won Lim 8/17/13

Big O Notation. P. Danziger

Linear Equations with Constant Coefficients (2A) Young Won Lim 4/13/15

Phasor Young Won Lim 05/19/2015

Propositional Logic Logical Implication (4A) Young W. Lim 4/21/17

Background ODEs (2A) Young Won Lim 3/7/15

Bayes Theorem (10B) Young Won Lim 6/3/17

Capacitor in an AC circuit

Definitions of the Laplace Transform (1A) Young Won Lim 1/31/15

Audio Signal Generation. Young Won Lim 2/2/18

Line Integrals (4A) Line Integral Path Independence. Young Won Lim 11/2/12

Audio Signal Generation. Young Won Lim 2/2/18

Group Velocity and Phase Velocity (1A) Young Won Lim 5/26/12

Introduction to ODE's (0P) Young Won Lim 12/27/14

Theory of Computation

Growth of Functions (CLRS 2.3,3)

ECOM Discrete Mathematics

Signal Processing. Young Won Lim 2/20/18

Complex Functions (1A) Young Won Lim 2/22/14

Propositional Logic Arguments (5A) Young W. Lim 11/30/16

First Order Logic Implication (4A) Young W. Lim 4/6/17

Sequential Circuit Timing. Young Won Lim 11/6/15

Logic Background (1A) Young W. Lim 5/14/18

Hilbert Inner Product Space (2B) Young Won Lim 2/7/12

Group Delay and Phase Delay (1A) Young Won Lim 7/19/12

CLTI Differential Equations (3A) Young Won Lim 6/4/15

General Vector Space (3A) Young Won Lim 11/19/12

FSM Examples. Young Won Lim 11/6/15

Propositional Logic Arguments (5A) Young W. Lim 10/11/16

Surface Integrals (6A)

Performance and Scalability. Lars Karlsson

Growth of Functions. As an example for an estimate of computation time, let us consider the sequential search algorithm.

Finite State Machine (1A) Young Won Lim 6/9/18

Computer Science Section 3.2

Discrete Mathematics CS October 17, 2006

Capacitor in an AC circuit

Capacitor in an AC circuit

Background Complex Analysis (1A) Young Won Lim 9/2/14

Bandpass Sampling (2B) Young Won Lim 3/27/12

Second Order ODE's (2A) Young Won Lim 5/5/15

Asymptotic Analysis. Thomas A. Anastasio. January 7, 2004

Capacitor in an AC circuit

Signal Processing. Young Won Lim 2/22/18

Transcription:

Copyright (c) 2015-2018 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions) to youngwlim@hotmail.com. This document was produced by using LibreOffice and Octave.

Functions and Ranges x 2 +2 x+1 A 1 = [0,5] x 2 2 x A 2 = [0,100] A 3 = [0,500] 1 3

Small Range A1 All are distinguishable x 2 +2 x+1 x 2 2 x 1 Zoom Out for x > 0.5 x 2 < x 2 +2 x+1 4

Medium Range A2 similar x 2 +2 x+1 x 2 10000+201 10000 2 x Zoom Out More for x > 0.5 x 2 < x 2 +2 x+1 5

Large Range A3 Indistinguishable x 2 +2 x+1 x 2 250000+1001 250000 for x > 0.5 x 2 < x 2 +2 x+1 6

Functions and Ranges 2 x 2 x 2 +2 x+1 2 x B 1 = [0,5] B 2 = [0,100] B 3 = [0,500] 1 7

Small Range, 2x 2 B1 distinguishable 2 x 2 50 x 2 +2 x+1 25+11 2 x 1 Zoom Out for x > 2.414 x 2 +2 x+1 < 2 x 2 for x > k f (n) < C g(n) 8

Medium Range, 2x 2 B2 distinguishable 2 x 2 20000 x 2 +2 x+1 10000+201 2 x 1 Zoom Out for x > 2.414 x 2 +2 x+1 < 2 x 2 for x > k f (n) < C g(n) 9

Large Range, 2x 2 B3 distinguishable 2 x 2 500000 x 2 +2 x+1 250000 +1001 2 x 1 Zoom Out for x > 2.414 x 2 +2 x+1 < 2 x 2 for x > k f (n) < C g(n) 10

Functions and Ranges 10 x 2 x 2 +2 x+1 2 x C 1 = [0,5] C 2 = [0,100] C 3 = [0,500] 1 11

Small Range, 10x 2 C1 distinguishable 10 x 2 250 x 2 +2 x+1 2 x 1 25+11 Zoom Out for x > 0.462 x 2 +2 x+1 < 10 x 2 for x > k f (n) < C g(n) 12

Medium Range, 10x 2 C2 distinguishable 10 x 2 100000 x 2 +2 x+1 10000+201 Zoom Out for x > 0.462 x 2 +2 x+1 < 10 x 2 for x > k f (n) < C g(n) 13

Large Range, 10x 2 C3 distinguishable 10 x 2 2500000 x 2 +2 x+1 250000 +1001 for x > 0.462 x 2 +2 x+1 < 10 x 2 for x > k f (n) < C g(n) 14

Functions and Ranges 10 x x 2 +2 x+1 x 2 D 1 = [0,5] D 2 = [0,100] D 3 = [0,500] 1 15

Small Range, 10x D1 10 x x 2 +2 x+1 distinguishable x 2 1 Zoom Out for 0.127 < x < 7.873 x 2 +2 x+1 < 10 x 16

Medium Range, 10x D2 x 2 +2 x+1 x 2 indistinguishable 10 x Zoom Out for x > 7.873 10 x < x 2 +2 x+1 for x > k C g(n) < f (n) 17

Large Range, 10x D3 x 2 +2 x+1 x 2 indistinguishable 10 x for x > 7.873 10 x < x 2 +2 x+1 for x > k C g(n) < f (n) 18

Big-O Definition Let f and g be functions (Z R or R R) from the set of integers or the set of real numbers to the set of real numbers. We say f(x) is O(g(x)) f(x) is big-oh of g(x) If there are constants C and k such that f(x) C g(x) whenever x > k. g(x) : upper bound of f(x) 19

Big-Ω Definition Let f and g be functions (Z R or R R) from the set of integers or the set of real numbers to the set of real numbers. We say f(x) is Ω(g(x)) f(x) is big-omega of g(x) If there are constants C and k such that C g(x) f(x) whenever x > k. g(x) : lower bound of f(x) 20

Big-O Definition for k < x f (x) C g(x) C g(n) f (n) f (x) is O(g(x)) x=k x g(x) : upper bound of f(x) g(x) has a simpler form than f(x) is usually a single term 21

Big-Ω Definition for k < x f (x) C g(x) f (x) C g(x) f (x) is Ω(g(x)) g(x) : lower bound of f(x) x=k x g(x) has a simpler form than f(x) is usually a single term 22

Big-Θ definition for k < x C g(x) f (x) f (x) C g(x) C 1 g(x) f (x) C 2 g(x) f (x) is O(g(x)) f (x) is Ω(g(x)) f (x) is Θ(g(x)) 23

Big-Θ = Big-Ω Big-O for k < x O(g(x)) C 1 g(x) f (x) C 2 g(x) f (x) is Θ(g(x)) Ω(g(x)) Ω(g(x)) O(g(x)) Θ (g(x)) 24

Θ(x) and Θ(1) for 0 < k < x f (x) C x f (x) f (x) C x C 1 x f (x) C 2 x f (x) is O(x) f (x) is Ω(x) f (x) is Θ (x) C 1 f (x) f (x) C 1 C 1 1 f (x) C 2 1 f (x) is O(1) f (x) is Ω(1) f (x) is Θ (1) f (x) 25

Big-O, Big-Ω, Big-Θ Examples for x > 0.5 1 x 2 < x 2 +2 x+1 lower bound upper bound x 2 +2 x+1 is Ω(x 2 ) x 2 +2 x+1 is Θ( x 2 ) for x > 2.414 x 2 +2 x+1 < 2 x 2 x 2 +2 x+1 is O(x 2 ) upper bound for x > 0.462 x 2 +2 x+1 < 10 x 2 x 2 +2 x+1 is O(x 2 ) for x > 7.873 10 x < x 2 +2 x+1 x 2 +2 x+1 is Ω(x) lower bound 26

Many Larger Upper Bounds x 4 x 2 +2 x+1 is O(x 2 ) x 2 +2 x+1 is O(x 3 ) x 2 +2 x+1 is O(x 4 ) x 3 2 x 2 x 2 +2 x+1 the least upper bound? 27

Many Smaller Lower Bound x 2 +2 x+1 x 2 +2 x+1 is Ω (x 2 ) x 2 +2 x+1 is Ω(x) x 2 +2 x+1 is Ω( x) x 2 +2 x+1 is Ω(log x) x x log x the greatest lower bound? 28

Many Upper and Lower Bounds x 2 +2 x+1 is O(x 2 ) x 2 +2 x+1 C x 2 upper bound the least x 2 +2 x+1 is O(x 3 ) x 2 +2 x+1 C x 3 upper bound x 2 +2 x+1 is O(x 4 ) x 2 +2 x+1 C x 4 upper bound x 2 +2 x+1 is O(x 2 ) x 2 +2 x+1 C x 2 lower bound x 2 +2 x+1 is Ω(x) x 2 +2 x+1 C x x 2 +2 x+1 is Ω( x) x 2 +2 x+1 C x x 2 +2 x+1 is Ω(log x) x 2 +2 x+1 C log x lower bound lower bound lower bound the greatest 29

Simultaneously being lower and upper bound f (x) = x 2 +2 x+1 lower bounds Ω (g( x)) O(g(x)) upper bounds x x log x Θ( g( x)) tight bound x 2 x 2 log x x 3 x 4 x 3 x 30

Big-Θ Examples (1) 2 x 2 x 2 +2 x+1 is O(x 2 ) x 2 +2 x+1 1 x 2 x 2 +2 x+1 is Θ( x 2 ) 0.5 x 2 x 2 +2 x+1 is Ω (x 2 ) Zoom Out 31

Big-Θ Examples (2) 2 x 2 x 2 +2 x+1 1 x 2 x 2 +2 x+1 is Θ( x 2 ) 0.5 x 2 32

Big-Θ Examples (3) 5 x 3 6 x 3 +2 x 2 +4 7 x 3 7 x 3 6 x 3 +2 x 2 +4 6 x 3 5 x 3 indistinguishable 6 x 3 +2 x 2 +4 is Θ( x 3 ) 6 x 3 +2 x 2 +4 6 x 3 33

Tight bound Implications f (x) is Θ(g(x)) f (x) is Θ(g(x)) f (x) is O(g(x)) f (x) is Ω(g(x)) f (x) is Θ(g(x)) f (x) is Θ(g(x)) f (x) is O(g(x)) f (x) is Ω(g(x)) Ω(g( x)) O(g( x)) Θ( g( x)) 34

Common Growth Functions x 2 x log x x x log x 35

Upper bounds x 2 x log x x x log x f 1 ( x) f 1 (x) is O(log x) O( x) O(x) O(x log x) O(x 2 ) 36

Lower bounds f 2 ( x) x 2 x log x x x log x f 2 (x) is Ω (x 2 ) Ω(x log x) Ω(x) Ω( x) Ω(log x) 37

Example 1 f (n)=n 6 +3 n f (n)=2 n +12 f (n)=2 n +3 n f (n)=n n +n f (n)=o(n 6 ) f (n)=o(2 n ) f (n)=o(3 n ) f (n)=o(n n ) f (n)=ω(n) f (n)=ω(1) f (n)=ω(2 n ) f (n)=ω(n) https://discrete.gr/complexity/ 38

Example 2 f (n)=n 6 +3 n f (n)=2 n +12 f (n)=2 n +3 n f (n)=n n +n f (n)=o(n 6 ) f (n)=o(2 n ) f (n)=o(3 n ) f (n)=o(n n ) f (n)=ω(n 6 ) f (n)=ω(2 n ) f (n)=ω(3 n ) f (n)=ω(n n ) f (n)=θ(n 6 ) f (n)=θ(2 n ) f (n)=θ(3 n ) f (n)=θ(n n ) https://discrete.gr/complexity/ 39

Example 3 Θ(n) Θ(n) Θ(n 2 ) Θ(n) O(1) O(n) O(n) O(n 2 ) O(n 3 ) O(1) Θ(1) Θ(1) Θ(n) O(n) O(n 2 ) Θ(n 2 ) O(n 2 ) O(n 3 ) Θ(n) Ω(n) O(1) Θ(1) Ω(1) O(1) log(n) : O(log n) O(n) log(n) : Ω(log n) O(1) https://discrete.gr/complexity/ 40

Example 4 Θ(n) O(n) upper bound tight Θ(n 2 ) Θ(1) Θ(n) O(n 3 ) O(n) O(1) Θ(n) O(2 n) upper bound upper bound upper bound upper bound wrong tight Θ(n) Ω(n) O(1) O(2 n) = O(n) https://discrete.gr/complexity/ 41

Example 5 Θ(1) Θ( n) Θ(n) O(1) O( n) O(n) Θ(n 2 ) O(n 2 ) Θ(n 3 ) O(n 3 ) tight tight tight tight tight upper bound upper bound upper bound upper bound upper bound O(n) O(n) O(n 2 ) O(n 3 ) O(n 4 ) upper bound upper bound upper bound upper bound upper bound Θ(1) Ω(1) tight lower bound Θ( n) Θ(n) Θ(n 2 ) Ω( n) Ω(n) Ω(n 2 ) tight tight tight lower bound lower bound lower bound Ω(1) Ω( n) Ω(n) lower bound lower bound lower bound Θ(n 3 ) Ω(n 3 ) tight lower bound Ω(n 2 ) lower bound https://discrete.gr/complexity/ 42

References [1] http://en.wikipedia.org/ [2]