SLIDE 1
CS-270 Algorithms 2013/14 Solution to Coursework I
Oliver Kullmann Swansea University Computer Science January 8, 2014
1 Rules
Formulate, in your own words (really important) a kind of “framework” for working
- ut Θ-expressions:
- 1. These rules should be tailored to the task at hand: not a general theory, but some-
thing workable which suffices for the task (Section 2).
- 2. Try to be as precise as possible. In Section 2, you need to state which rules you
applied, and the application should be always obvious.
- 3. Give examples for each rule.
- 4. You need to justify these rules, but it definitely doesn’t need to be a mathematical
explanation: you might cite the book, or even some Internet sources might be used (only if they are really authoritative — sorry, but other students don’t count here). Here are basic rules with examples; if you have problems reading such language, then at least make sure that you can handle the simplifications as in Section 2.1
1.1 Simplification
First two rules for removing some parts of a term. We can drop constant factors: α · f(n) = Θ(f(n)) (1) for a constant number α > 0. So for example 5n2 = Θ(n2). We can also drop smaller addends: f(n) + g(n) = Θ(g(n)) (2) for f(n) = O(g(n)). So for example we have n = O(n2), and thus n + n2 = Θ(n2).
1It might be that reflecting on all that gives you headaches — in that case don’t worry too much about it,