Is x^3 O(x^4) but x^4 not O(x^3)?

In summary, to establish a big-O relationship, we need to find witnesses C and k such that |f(x)| <= C|g(x)| whenever x > k. Using this concept, it can be shown that x^3 is O(x^4) with witnesses C = 1 and k = 1, but x^4 is not O(x^3) as there is no witness C that satisfies the inequality for all values of x. This can be seen by considering x^3 ≤ Cx^4 if and only if x ≥ 1/C, highlighting the need for careful consideration when finding witnesses in big-O problems.
  • #1
nicnicman
136
0

Homework Statement


To establish a big - O relationship, find witnesses C and k such that |f(x)| <= C|g(x)| whenever x > k.

Show that x^3 is O(x^4) but that x^4 is not O(x^3).


Homework Equations


If f(x) is O(g(x)) then there is a C such that f(x) <= Cg(x).


The Attempt at a Solution



If f(x) is O(g(x)) then there is a C such that f(x) <= Cg(x).
Thus, if x^3 is O(x^4), then x^3 <= C(x^4).
This is true for all C > 0 when C is a real number.

Similarly, if x^4 is O(x^3) then
x^4 <= Cx^3.
x <= C (divide both sides by x^3)
However, x <= C can not be true for any C. Thus x^4 is not O(x^3).

I'm not sure about this proof because I didn't provide witnesses C and k as the instructions called for. Big-O problems confuse me and I'm not sure if this proof is correct. Any suggestions are appreciated.
 
Physics news on Phys.org
  • #2
Any suggestions?
 
  • #3
nicnicman said:
If f(x) is O(g(x)) then there is a C such that f(x) <= Cg(x).
Thus, if x^3 is O(x^4), then x^3 <= C(x^4).
This is true for all C > 0 when C is a real number.
What is true? x3≤Cx4 if and only if x ≥ 1/C. Perhaps this can help you to find some values of k and C.
 

FAQ: Is x^3 O(x^4) but x^4 not O(x^3)?

1. What is the Big-O relationship proof?

The Big-O relationship proof is a mathematical technique used to analyze the complexity of algorithms. It helps determine how the time or space requirement of an algorithm grows as the input size increases.

2. Why is the Big-O relationship proof important?

The Big-O relationship proof allows us to compare the efficiency of different algorithms and choose the most efficient one for a given problem. It also helps in predicting the performance of an algorithm for larger input sizes.

3. How is the Big-O relationship proof calculated?

The Big-O relationship proof is calculated by analyzing the number of operations performed by an algorithm as the input size increases. The dominant term in this analysis is then used to determine the Big-O notation.

4. What is the difference between Big-O, Big-Omega, and Big-Theta notation?

Big-O notation represents the upper bound of an algorithm's time or space complexity, while Big-Omega notation represents the lower bound. Big-Theta notation represents both the upper and lower bounds, indicating that the algorithm's complexity is a tight bound.

5. How do we prove the Big-O relationship for an algorithm?

To prove the Big-O relationship for an algorithm, we need to analyze its code and determine the number of operations performed as the input size increases. We then find the dominant term and use it to determine the Big-O notation.

Back
Top