How to determine if function f is in theta (g)

Full disclosure: This is a homework problem. I honestly burst out laughing that he had deviated from me for so long when it seemed so simple.

Well, the question is f (n) = n ^ 2 * log (n), g (n) = n ^ 2.1. Is f in aunt (g)?

I just need to come up with constants c 1 , c 2 , so the past is some n 0 , f (n) <= c 1 g (n) <= c 2 f (n). But I'm not even sure that f is in the aunt (g). I am embarrassed.

+4
source share
2 answers

From what I remember, to prove that f (n) is in theta (g (n)), you can use two different approaches:

  • Prove f in O (g) and prove that g is in O (f).

  • Prove f in O (g) and prove that f is in BigOmega (g).

+1
source

First, pay attention to the wording. "Is f in theta (g)." This means that they want you to first understand if this is true or not.

Counter question: is theta (n) the same as theta (n * log (n))? We know the answer to this question ... no, they are not (since otherwise sorting based on comparison would be linear, for example). What does this say about your question?

To prove this, follow Mahler's next answer. For completeness, in order to try to refute the statement, suppose that the enemy came up with the constants c1 and c2. Now our goal is to show that, despite what constant enemies have come up with (i.e., for all c1 and c2), n0 does not perform the assessment. In other words, show that you cannot select c1 and c2. The focus in your case is probably centered around the factor log (n) in the function f. log (n) monotonically increases, indicating that we can make this factor arbitrarily large by connecting a larger n-value.

Hope this makes you work a little while still having the satisfaction of solving the problem yourself. If I am completely mistaken, I am sure that other readers will correct me.

0
source

All Articles