22.01.2014 Views

IEOR 269, Spring 2010 Integer Programming and Combinatorial ...

IEOR 269, Spring 2010 Integer Programming and Combinatorial ...

IEOR 269, Spring 2010 Integer Programming and Combinatorial ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>IEOR</strong><strong>269</strong> notes, Prof. Hochbaum, <strong>2010</strong> 27<br />

15.2 Growth of functions<br />

n ⌈log n⌉ n − 1 2 n n!<br />

1 0 0 2 1<br />

3 2 2 8 6<br />

5 3 4 32 120<br />

10 4 9 1024 3628800<br />

70 7 69 2 70 ≈ 2 332<br />

We are interested in the asymptotic behavior of the running time.<br />

15.3 Definitions for asymptotic comparisons of functions<br />

We define for functions f <strong>and</strong> g,<br />

f, g : Z + → [0, ∞) .<br />

1. f(n) ∈ O(g(n)) if ∃ a constant c > 0 such that f(n) ≤ cg(n), for all n sufficiently large.<br />

2. f(n) ∈ o(g(n)) if, for any constant c > 0, f(n) < cg(n), for all n sufficiently large.<br />

3. f(n) ∈ Ω(g(n)) if ∃ a constant c > 0 such that f(n) ≥ cg(n), for all n sufficiently large.<br />

4. f(n) ∈ ω(g(n)) if, for any constant c > 0, f(n) > cg(n), for all n sufficiently large.<br />

5. f(n) ∈ Θ(g(n)) if f(n) ∈ O(g(n)) <strong>and</strong> f(n) ∈ Ω(g(n)).<br />

Examples:<br />

• Bubble sort has complexity O(n 2 )<br />

• Matrix multiplication has complexity O(n 3 )<br />

• Gaussian elimination O(n 3 )<br />

• 2 n /∈ O(n 3 )<br />

• n 3 ∈ 0(2 n )<br />

• n 3 ∈ o(2 n )<br />

• n 4 ∈ Ω(n 3 .5)<br />

• n 4 ∈ Ω(n 4 )<br />

15.4 Properties of asymptotic notation<br />

We mention a few properties that can be useful when analyzing the complexity of algorithms.<br />

Proposition 15.2. f(n) ∈ Ω(g(n)) if <strong>and</strong> only if g(n) ∈ O(f(n)).<br />

The next property is often used in conjunction with L’hôpital’s Rule.<br />

Proposition 15.3. Suppose that lim n→∞<br />

f(n)<br />

g(n) exists:<br />

f(n)<br />

lim<br />

n→∞ g(n)<br />

= c .<br />

Then,<br />

1. c < ∞ implies that f(n) ∈ O(g(n)).<br />

2. c > 0 implies that f(n) ∈ Ω(g(n)).<br />

3. c = 0 implies that f(n) ∈ o(g(n)).<br />

4. 0 < c < ∞ implies that f(n) ∈ Θ(g(n)).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!