Lecture2

Lecture2 - Lecture 2 Sept 23 2010 Theta notation Theta f(n...

This preview shows pages 1–4. Sign up to view the full content.

1 20 Theta notation Theta: Often confused with Big-Oh notation ! Example: Claim: Low order terms do not matter. Needs a proof ! (HW?) f n g n c c n n n c g n f n c g n ( ) ( ( )) , , . : ( ) ( ) ( )   const s.t 1 2 1 2 0 0 0 2 2 0 0 2 2 2 2 2 2 2 2 2 2 1 2 /2 2 ( ) Proof: take 8, then for : /2 2 /4 /4 2 /4 8 /4 2 /4 On the other hand, we have: /2 2 /2 Thus: /4 /2 2 /2 i.e. 1/4, 1/2. n n n n n n n n n n n n n n n n n n n n n n c c  Lecture 2, Sept. 23, 2010 21 Simple Theorem Claim: f(n) = O(g(n)) and g(n) = O(f(n)) f(n) = (g(n)) 1 1 1 1 2 2 2 2 1 2 1 2 Proof: , s.t. n n : 0 ( ) ( ) , s.t. n n : 0 ( ) ( ) 1 max( , ): 0 ( ) ( ) ( ) QED n c f n c g n n c g n c f n n n n g n f n c g n c  

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 22 Summary Remember the definitions. Formally prove from definitions. Use intuition from the properties of ”, “ “, etc. Consider behavior of f(n)/g(n) as n → ∞ Example of an algorithm Stable Marriage n man and n women Each woman ranks all men and each man ranks all women Find a way to match (marry) all men and women such that there are no two pairs (m,w) and (m’,w’) that are married and such that » m prefers w’ to w » w’ prefers m to m’ In other words, m will “steal” w’ from m’ and w’ will agree Red line shows “instability” 23 m m’ w w’