O-notation€¦ · Theta (“as”) Notation : !!=!!!!. Intuition : f grows like g, i.e. between !...

1
f(n) n 0 c 1 g(n) c 2 g(n) n O-notation O, big Oh (upper limit) Notation : = . Intuition : f is smaller than g . When : () . Definition : > , > () . Omega (lower limit) Notation : = . Intuition : f is larger than g . When : () . Definition : > , > () . Theta (“as”) Notation : = . Intuition : f grows like g, i.e. between and . When : () () . Definition : , > , ( > ) () () . o, little oh Notation : = . Intuition : f is a lot smaller than g . When : () . Definition : ! () = . More correctly, asymptotic notation. Onotation might not be asymptotically tight:2n 2 = O(n 2 ) is asymptotically tight, but 2n = O(n 2 ) is not. We use onotation (little oh) to indicate that our analysis is untight. n 0 f(n) cg(n) n n 0 f(n) cg(n) n

Transcript of O-notation€¦ · Theta (“as”) Notation : !!=!!!!. Intuition : f grows like g, i.e. between !...

Page 1: O-notation€¦ · Theta (“as”) Notation : !!=!!!!. Intuition : f grows like g, i.e. between ! ... (n2)is#asymptotically#tight,#but2n#=O(n2)is#not.#We#use#o@notation(little# oh)#toindicate#that#our#analysis#is#un@tight.#

f(n)  

n0  

c1  g(n)  

c2  g(n)  

n  

 

O-notation†

O, big Oh (upper limit) Notation : 𝒇 𝒏 =  𝑶 𝒈 𝒏 .

Intuition : f is smaller than g .

When 𝑛 → ∞ : 𝒇 𝒏 ≤ 𝒄 ∙ 𝒈(𝒏) .

Definition : ∃ 𝒄 > 𝟎 ,𝒏𝟎 ∶  ∀   𝒏 >  𝒏𝟎  𝒇 𝒏 ≤ 𝒄   ∙ 𝒈(𝒏) .

Omega (lower limit)

Notation : 𝒇 𝒏 =  𝛀 𝒈 𝒏 .

Intuition : f is larger than g .

When 𝑛 → ∞ : 𝒇 𝒏 ≥ 𝒄 ∙ 𝒈(𝒏) .

Definition : ∃ 𝒄 > 𝟎 ,𝒏𝟎 ∶  ∀   𝒏 >  𝒏𝟎  𝒇 𝒏 ≥ 𝒄   ∙ 𝒈(𝒏) .

Theta (“as”) Notation : 𝒇 𝒏 =  𝚯 𝒈 𝒏 .

Intuition : f grows like g, i.e. between 𝒄𝟏 ∙ 𝒈 and 𝒄𝟐 ∙ 𝒈 .

When 𝑛 → ∞ : 𝒄𝟏 ∙ 𝒈(𝒏) ≤ 𝒇 𝒏 ≤ 𝒄𝟐 ∙ 𝒈(𝒏) .

Definition : ∃ 𝒄𝟏, 𝒄𝟐 > 𝟎 ,𝒏𝟎 ∶  ∀  (𝒏 >  𝒏𝟎)  𝒄𝟏 ∙ 𝒈(𝒏) ≤ 𝒇 𝒏 ≤ 𝒄𝟐 ∙ 𝒈(𝒏) .

o, little oh ‡ Notation : 𝒇 𝒏 =  𝒐 𝒈 𝒏 .

Intuition : f is a lot smaller than g .

When 𝑛 → ∞ : 𝒇 𝒏 ≪ 𝒈(𝒏) .

Definition : 𝐥𝐢𝐦𝒏→!𝒇 𝒏𝒈(𝒏)

= 𝟎 .

                                                                                                                         †  More  correctly,  asymptotic  notation.  ‡  O-­‐notation  might  not  be  asymptotically  tight:  2n2  =  O(n2)  is  asymptotically  tight,  but  2n  =  O(n2)  is  not.  We  use  o-­‐notation  (little  oh)  to  indicate  that  our  analysis  is  un-­‐tight.  

n0  

f(n)  

c  g(n)  

n  

n0  

f(n)  

c  g(n)  

n