Lecture2

Lecture2 - Lecture 2, Sept. 23, 2010 Theta notation Theta:...

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

View Full Document Right Arrow Icon
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 nc c n n n c g n f nc g n () (() ) , , . :  const s.t 12 1 2 00 0 22 2 2 /2 2 ( ) Proof: take 8, then for : /4 /4 2 /4 8 /4 2 On the other hand, we have: /2 Thus: /2 i.e. 1/4, 1/2. nn 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)) 11 1 1 2 2 1 2 Proof: , s . t . n n:0 s . t . 1 m a x ( , ) :0 QED fn cgn gn cfn n g n f n c g n c   
Background image of page 1

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

View Full DocumentRight Arrow Icon
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’
Background image of page 2
3 Discussion Bipartite graph Matching = legal set of marriages (no polygamy) Perfect matching = all men/women married Looking for perfect matching with “stability” constraint
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/08/2011 for the course CS 161 at Stanford.

Page1 / 8

Lecture2 - Lecture 2, Sept. 23, 2010 Theta notation Theta:...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online