15.08.2013 Views

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

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.

(f ≤a g), iff there is an n0 ∈ N, such that f(n) ≤ g(n) for all n > n0.<br />

Definition 259 The three Landau sets O(g), Ω(g), Θ(g) are defined as<br />

O(g) = {f | ∃k > 0.f ≤a k · g}<br />

Ω(g) = {f | ∃k > 0.f ≥a k · g}<br />

Θ(g) = O(g) ∩ Ω(g)<br />

Intuition: The Landau sets express the “shape of growth” of the graph of a function.<br />

If f ∈ O(g), then f grows at most as fast as g. (“f is in the order of g”)<br />

If f ∈ Ω(g), then f grows at least as fast as g. (“f is at least in the order of g”)<br />

If f ∈ Θ(g), then f grows as fast as g. (“f is strictly in the order of g”)<br />

Commonly used Landau Sets<br />

<br />

c○: Michael Kohlhase 145<br />

Landau set class name rank Landau set class name rank<br />

O(1) constant 1 O(n 2 ) quadratic 4<br />

O(log 2(n)) logarithmic 2 O(n k ) polynomial 5<br />

O(n) linear 3 O(k n ) exponential 6<br />

Theorem 260 These Ω-classes establish a ranking (increasing rank increasing growth)<br />

O(1)⊂O(log2(n))⊂O(n)⊂O(n 2 )⊂O(n k′<br />

)⊂O(k n )<br />

where k ′ > 2 and k > 1. The reverse holds for the Ω-classes<br />

Ω(1)⊃Ω(log2(n))⊃Ω(n)⊃Ω(n 2 )⊃Ω(n k′<br />

)⊃Ω(k n )<br />

Idea: Use O-classes for worst-case complexity analysis and Ω-classes for best-case.<br />

Examples<br />

c○: Michael Kohlhase 146<br />

Idea: the fastest growth function in sum determines the O-class<br />

Example 261 (λn.263748) ∈ O(1)<br />

Example 262 (λn.26n + 372) ∈ O(n)<br />

Example 263 (λn.7n 2 − 372n + 92) ∈ O(n 2 )<br />

Example 264 (λn.857n 10 + 7342n 7 + 26n 2 + 902) ∈ O(n 10 )<br />

Example 265 (λn.3 · 2 n + 72) ∈ O(2 n )<br />

Example 266 (λn.3 · 2 n + 7342n 7 + 26n 2 + 722) ∈ O(2 n )<br />

c○: Michael Kohlhase 147<br />

With the basics of complexity theory well-understood, we can now analyze the cost-complexity of<br />

Boolean expressions that realize Boolean functions. We will first derive two upper bounds for the<br />

cost of Boolean functions with n variables, and then a lower bound for the cost.<br />

78

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

Saved successfully!

Ooh no, something went wrong!