Prove f(x) ∈ O(x^3) Using Big-O Definition: Homework

  • Thread starter Thread starter sta|ker
  • Start date Start date
  • Tags Tags
    Definition
sta|ker
Messages
12
Reaction score
0

Homework Statement


Let f(x) = 2x^{3} + 3x\log{x}, prove f \in O(x^{3}) using the Big-O Definition.

Homework Equations


Big-O definition:
f(x) \in O(g(x)) if |f(x)| \leq C|g(x)| and x \geq k where C and k are both positive integers.

The Attempt at a Solution


I basically set C=4 and k=4, then wrote it out:
|2x^{3}+3x\log{x}| \leq 4|x^{3}| where x \geq 4

then using 4 for x:
256 \geq 152

According to the definition this proves it. It just seems to simple for an assignment (not the only problem on it, but still). Did I prove this correctly? Or do I completely not understand? I can prove it using limits, but she wants us to use the Big-O therom.
 
Physics news on Phys.org
You have to prove it for EVERY x larger than 4, not just when x = 4. Also is your log base 2?
 
sta|ker said:

Homework Statement


Let f(x) = 2x^{3} + 3x\log{x}, prove f \in O(x^{3}) using the Big-O Definition.

Homework Equations


Big-O definition:
f(x) \in O(g(x)) if |f(x)| \leq C|g(x)| and x \geq k where C and k are both positive integers.

The Attempt at a Solution


I basically set C=4 and k=4, then wrote it out:
|2x^{3}+3x\log{x}| \leq 4|x^{3}| where x \geq 4

then using 4 for x:
256 \geq 152

According to the definition this proves it. It just seems to simple for an assignment (not the only problem on it, but still). Did I prove this correctly? Or do I completely not understand? I can prove it using limits, but she wants us to use the Big-O therom.

So saying ##|2x^{3}+3x\log{x}| \leq 4|x^{3}|## when ##x>4## you are observing that ##3x\log x \le 2x^3## when ##x\ge 4##. I would think you would need to give an argument for that or at least explain why you already know that after checking ##x=4##.
 
Office_Shredder said:
You have to prove it for EVERY x larger than 4, not just when x = 4. Also is your log base 2?
Yes, the log base is assumed to be 2. Sorry, I forgot about that.

LCKurtz said:
So saying ##|2x^{3}+3x\log{x}| \leq 4|x^{3}|## when ##x>4## you are observing that ##3x\log x \le 2x^3## when ##x\ge 4##. I would think you would need to give an argument for that or at least explain why you already know that after checking ##x=4##.
Hmm, I guess I don't understand that technique then. I can do it using limits, but I guess I'll just have to review it until I get it.
 
LCKurtz said:
So saying ##|2x^{3}+3x\log{x}| \leq 4|x^{3}|## when ##x>4## you are observing that ##3x\log x \le 2x^3## when ##x\ge 4##. I would think you would need to give an argument for that or at least explain why you already know that after checking ##x=4##.

sta|ker said:
Hmm, I guess I don't understand that technique then. I can do it using limits, but I guess I'll just have to review it until I get it.

It's just an ordinary calculus question now. How could you argue that ##3x\log_2 x \le 2x^3## if ##x>4##?
 
Thread 'Use greedy vertex coloring algorithm to prove the upper bound of χ'
Hi! I am struggling with the exercise I mentioned under "Homework statement". The exercise is about a specific "greedy vertex coloring algorithm". One definition (which matches what my book uses) can be found here: https://people.cs.uchicago.edu/~laci/HANDOUTS/greedycoloring.pdf Here is also a screenshot of the relevant parts of the linked PDF, i.e. the def. of the algorithm: Sadly I don't have much to show as far as a solution attempt goes, as I am stuck on how to proceed. I thought...
Back
Top