does anyone knows how to perform such calculations
Example:
O(n^2) + THETA(n) + OMEGA(n^3) = ?
or
O(n^2) * THETA(n) * OMEGA(n^3) = ?
In general, how to add and multiply different asymptotic notations?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Ogives an upper bound;Ωgives a lower bound;Θgives an asymptotic bound;Wikipedia has a nice chart to explain these.
Therefore these really aren’t comparable in general.
For your first case,
Let’s first tackle
O. The first term tells usO(n^2), and the second term tells usO(n). Based on just these two, we know so far we haveO(n^2)for an upper bound. However, the third term tells us nothing whatsoever about an upper bound! So we really cannot conclude anything aboutO.The point here is that
OandΘgives you information aboutOonly, andΩandΘgives you information aboutΩonly. This is becauseΘ(g(n))implies bothO(g(n))andΩ(g(n)), so we can changeΘinto whichever ofOandΩis appropriate for the given analysis.However, the three together, or even just
OandΩ, leaves you clueless since neitherOnorΩimplies anything about the other.