Question

Assume that a problem A cannot be solved in O(n2) time. However, we can transform A into a problem B in O(n2 log n) time...

Assume that a problem A cannot be solved in O(n2) time. However, we can transform A into a problem B in O(n2 log n) time, and then solve B, and finally transform the solution of B in O(n) time into a solution for A.

Prove or Disprove: The above approach shows that B cannot be solved asymptotically less than O(n2) time.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Given:

a) A cannot be solved in O(n2).

b) B can be solved in O(n2logn) and solution from B can be transformed in O(n) time.

Proof:

Total complexity of solution while solving problem using B is: Time complexity of Solution B + Time complexity of solution transformation from B

Time complexity of  solving problem using B = O(n2logn)+O(n) = O(n2logn+n)

Consider the omega notation of time complexity for lower bound

phpiWcEjb.png

(Source: Tutorialpoints)

Ω(f(n)) ≥ { g(n) : there exists c > 0 and n0 such that g(n) ≤ c.f(n) for all n > n0. }

Here f(n) is O(n2logn+n) and g(n) is O(n2logn) which satisfy the above condition at c>=1 and n0 = 0

n2logn < 1*(n2logn+n) for all n>0

So lower bound of solution B is g(n) i.e. O(n2logn)

So B cannot be solved asymptotically less than O(n2logn) time

Therefore B cannot be solved asymptotically less than O(n2) time

Add a comment
Know the answer?
Add Answer to:
Assume that a problem A cannot be solved in O(n2) time. However, we can transform A into a problem B in O(n2 log n) time...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT