Asymptotic Analysis Big-‐Oh: Basic Examples Design and Analysis of Algorithms I... Example #1then Claim : if Proof : Choose Need to show that We have, for every and Nextcore AI -Gopal Sh
Trang 1Asymptotic Analysis
Big-‐Oh: Definition
Design and Analysis
of Algorithms I
Trang 2Nextcore AI -Gopal Shangari
Trang 3Nextcore AI -Gopal Shangari
Trang 4Asymptotic Analysis
Big-‐Oh: Basic Examples
Design and Analysis
of Algorithms I
Trang 5Example #1
then Claim : if
Proof : Choose
Need to show that
We have, for every
and
Nextcore AI -Gopal Shangari
Trang 6Claim : for every
Example #2
is not
Proof : by contradiction Suppose
Then there exist constants such that
But then [cancelling from both sides]:
Which is clearly False [contradict i o n ]
Nextcore AI -Gopal Shangari
Trang 7Nextcore AI -Gopal Shangari
Asymptotic Analysis
Big Oh: Relatives (Omega & Theta)
Design and Analysis
of Algorithms I
Trang 8OMEGA NOTATION
Definition :
If and only if there exist
constants such that
Picture
Nextcore AI -Gopal Shangari
Trang 9Theta Notation
if and only if
Defini4on :
and
Equivalent : there exist constants such that
Nextcore AI -Gopal Shangari
Trang 10WHICH IS TRUE? CHECK ALL
Trang 11LIMLE8OH NOTA4ON
Defini4on : if and only if for all constants c>0, there exists a constant
such that
Exercise :
Trang 12Where Does Notation Come From?
•
Trang 13Asymptotic Analysis
Additional Examples
Design and Analysis
of Algorithms I
Trang 14EXAMPLE #1
Nextcore AI -Gopal Shangari
Claim :
Proof : need to pick constants
Note :
So if we choose
Q.E.D
such that
then (*) holds
Trang 15Claim :
Proof : by contradiction If
constants such that
then there exist
But then [cancelling ]
Which is certainly false
Q.E.D
EXAMPLE #2
Nextcore AI -Gopal Shangari
Trang 16Example #3
Claim : for every pair of (posi( veti func( ons f(nti,
g(nti,
Nextcore AI -Gopal Shangari
Trang 17EXAMPLE #3 (CON( NUEDTI
Nextcore AI -Gopal Shangari
Proof :
For every n, we have
And
Thus
Q.E.D