Can someone help me understand this question? I may have it on my tomorrow exam but I can't find similar question on internet or in my lectures.
4 Answers
First, you have to calculate the Theta notations by determing the growths-class of each function, e.G. 1, log(n), n, n log(n) and so on. To do that you have of course to expand those functions. Having the growths-class of each function you have to order them by their goodness. Last, you have to put these functions into relations, like g1 = omega(g2). Therefore just keep in mind that a function t(n) is said to be in omega(g(n)) if t(n) is bounded below by some multiple of g(n), e.G. n³ >= n² and therefore n³ is elemnt of omega(n²). This can also be written as n³ = omega(n²)

- 57
- 4
-
How exactly I calculate theta? Is that correct? i. Θ(n^3) ii. Θ(logn) iii. Θ(3^n) iv. Θ(n) v. Θ(n^2) vi. Θ(n^9) vii. Θ(nlogn) viii. 1 – a1204773 Jan 20 '13 at 14:50
First you need to express each function as a Theta(something)
.
For instance, for the first one: Theta((1-n)(n^3-17)) = Theta(n^4 + ...) = Theta(n^4)
.
For the second one: Theta(30+log(n^9)) = Theta(30 + 9logn) = Theta(logn)
.
These are sorted as g1, g2
, because n^4 = Omega(logn)
.
And so on.
For the sorting: saying that g1 = Omega(g2)
means that g1
grows at least as fast as g2
, that is we are defining a lower bound. So, sort them from the worst (slowest, with fastest growth), to the best (NB: it is strange that the exercise want "the first to be to most preferable", but the definition of Omega leaves no doubt).
Btw: if you want to be more formal, here is the definition of the Omega notation:
f = Omega(g) iff exist c and n0 > 0 such that forall n >= n0 we have 0 <= c*g(n) <= f(n)
(in words: f grows at least as fast as g).

- 5,070
- 5
- 33
- 59
-
-
@Loclip Edited. Just sort them using their growth. If you are not sure about the comparison between some of them, use wolframalpha to plot them and see which one grows faster. – Simon Jan 20 '13 at 15:18
-
but n^4 grows much faster than logn so how we can say that `n^4 = Omega(logn)?` – a1204773 Jan 20 '13 at 15:29
-
@Loclip ? That's the definition of Omega: `n^4 = Omega(logn)` means exactly that `n^4` grows faster than `logn`. So, what's the problem? – Simon Jan 20 '13 at 15:34
-
oh sorry i didn't read "at least" i read it as "g1 grows as fast as g2" – a1204773 Jan 20 '13 at 15:36
For theta, this answer and that one summarize what is to be found in your problem. Which g function can you find such that (say f is one of your 8 functions above)
- multiplied by a constant bounds asymptotically above f (called
O(g(n))
) - multiplied by (usually) another constant bounds asymptotically below f (called
omega(g(n))
For instance, for the iv
: 10^5n
, Θ(n)
fits, as you can easily find two constants where k1.n bounds below 10^5n
and k2.n to bounds it above, asymptotically. (here f is O(n)
and Omega(n)
as f, the iv.
is an easy one).
You need to understand that all big O and Big Omega and Big theta apply for worse/best/average case
for some function: Big O -> O(..) is the upper limit this function will never exceed .. e.g. for higher values Big Omega -> is the lower pound the function never goes below it .e.g in small values Big theta is like: there are 2 constants such that: Big omega * c < Big Theta < Big O *c2
so going to your sample: i) its of order n^4 for both Big Omega, and O(n^ + n). viii) its constant so both Obig O and big Omega the same.. thus big Theta the same

- 242
- 1
- 10