Skip to main content
GameDev.net gamedev.net
🔒 Locked

complexity question

Started by jag_oes Oct 6, 2002 at 4:01 PM 1 replies 250+ views
Original Post
jag_oes
jag_oes
if you have two algorithms with known complexity: f(n) = Q(g(n)) h(n) = Q(t(n)) -- (where Q is ''big theta'' notation, although I believe big O is used in its play for most use) is it true that f(n) - h(n) = Q(g(n) - t(n)) ? im unable to prove it or find a counterexample.
mongrelprogrammer
mongrelprogrammer
This sounds like a homework question... in fact, I know it is a homework problem. It is problem #50 in the Chapter 3 exercises in ''Discrete Mathematics, Fifth Edition'' by Richard Johnsonbaugh.

Despite this I will help you a little. Big-O notation is _very_ different than big-Theta notation. Big-O notation is an _upper bound_ (ie. if f(x) = 3x^2 + 5x then O(f(x)) = O(x^2) = O(x^3)) while big-Theta is the exact bound (ie. if f(x) = 3x^3 + 5x then big-theta(f(x)) = big-theta(x^2) != big-theta(x^3)). There is also big-omega which is lower bound (the opposite of big-O). Big-theta could also be thought of as the funciton where big-O = big-Omega for a function.

And, yes, there is a counterexample (many of them) for the equality you have listed. If you ask for more help I will give it but I will _not_ just give you a counterexample.

- mongrelprogrammer
I hate these user ratings. Please rate me down. (Seriously) -
Shannon Barber
Shannon Barber
quote:
Original post by mongrelprogrammer
This sounds like a homework question... in fact, I know it is a homework problem. It is problem #50 in the Chapter 3 exercises in ''Discrete Mathematics, Fifth Edition'' by Richard Johnsonbaugh.



hehe, good enough for me, thread terminated.


- Magmai Kai Holmlor

"Oh, like you''ve never written buggy code" - Lee

[Look for information | GDNet Start Here | GDNet Search Tool | GDNet FAQ | MSDN RTF[L] | SGI STL Docs | STFW | Asking Smart Questions ]

[Free C++ Libraries | Boost | ACE | Loki | MTL | Blitz++ | wxWindows| Spirit(xBNF)]
[Free C Libraries | zlib ]

The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.