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

  • Thread starter sta|ker
  • Start date
  • Tags
    Definition
In summary, the conversation discusses the process of proving a function, f(x), is in the Big-O notation of x^3. The Big-O definition is explained and the attempt at solving the problem is discussed, but it is determined that the technique used may not be correct. The idea of proving the inequality for all x > 4 is brought up and the use of limits is mentioned as an alternative method. The conversation ends with a question regarding how to argue that 3xlogx is less than or equal to 2x^3 for x > 4.
  • #1
sta|ker
12
0

Homework Statement


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

Homework Equations


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

The Attempt at a Solution


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

then using 4 for x:
[itex]256 \geq 152[/itex]

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
  • #2
You have to prove it for EVERY x larger than 4, not just when x = 4. Also is your log base 2?
 
  • #3
sta|ker said:

Homework Statement


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

Homework Equations


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

The Attempt at a Solution


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

then using 4 for x:
[itex]256 \geq 152[/itex]

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##.
 
  • #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.
 
  • #5
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##?
 

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

1. What does the Big-O notation represent in this context?

The Big-O notation represents the upper bound or worst-case scenario for the growth rate of a function. In this case, it is used to measure the growth rate of f(x) in relation to x^3.

2. How do you prove that f(x) is in O(x^3) using the Big-O definition?

To prove that f(x) is in O(x^3), we need to show that there exists a constant c and a value x0 such that for all x greater than or equal to x0, f(x) is less than or equal to c*x^3. In other words, the growth rate of f(x) is bounded by the growth rate of x^3.

3. Can you explain the concept of asymptotic complexity in this context?

Asymptotic complexity refers to the behavior of a function as the input size approaches infinity. In this case, we are looking at the growth rate of f(x) as x gets larger and larger. By using the Big-O notation, we can simplify the complexity of the function and compare it to other functions.

4. What is the significance of the constant c in the Big-O definition?

The constant c in the Big-O definition represents the upper bound of the growth rate of f(x) in relation to x^3. It tells us how fast f(x) can grow in comparison to x^3. A smaller value of c indicates a tighter bound and a more efficient algorithm or function.

5. How does proving f(x) ∈ O(x^3) help in analyzing the efficiency of an algorithm?

Proving f(x) ∈ O(x^3) allows us to determine the upper bound of the growth rate of f(x) and compare it to other functions. This helps in analyzing the efficiency of an algorithm as it gives us an idea of how the algorithm will perform as the input size increases. It also allows us to identify any inefficiencies and make improvements to the algorithm if needed.

Back
Top