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.
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
(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
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...
Which of the following could be false? A. n2/(log(n)) = O(n2). B. (log n)1000 = O(n1//1000). C. 1/n = O(1/(log(n))). D. 2(log(n))^2 = O(n2). E. None of the above.
Suppose a problem can be solved by an algorithm in O(n2) as well as another algorithm in O(2n). Will one algorithm always outperform the other? Give an example of a polynomial problem. Give an example of a nonpolynomial problem. Give an example of an NP problem that as yet has not been shown to be a polynomial problem. If the time complexity of algorithm X is greater than that of algorithm Y, is algorithm X necessarily harder to understand than...
Problem 1 (5+15 points) Consider the set P of n points and suppose we are given the points of P one point at a time. After receiving each point, we compute the convex hull of the points seen so far. (a) As a naive approach, we could run Graham’s scan once for each point, with a total running time of O(n2 log n). Write down the pesuedocode for this algorithm. (b) Develop an O(n2) algorithm to solve the problem. Write...
Q5 Match the following operations to their corresponding worst case time complexities Operations Finding the nert larger item in a Hash Table Time Complexities од) O (log n) O(n) O(n log n) O(n2) o(n3) O(n + m) O(m logn) O((n +m) log n) O(n2+nm) Trying to remove a non-eristing item from a Hash Table 2 3Finding the previous smaller item in a possibly unbalanced BST Updating a previous value into a new value in an AVL Tree Sorting m edges...
if possible solve part d in detail.
a) fi(n) n2+ 45 n log n b) f:(n)-1o+ n3 +856 c) f3(n) 16 vn log n 2. Use the functions in part 1 a) Isfi(n) in O(f(n)), Ω(fg(n)), or Θ((6(n))? b) Isfi(n) in O(f(n)), Ω(f,(n)), or Θ((fs(n))? c) Ísf3(n) in O(f(n)), Ω(f(n)), or Θ(f(n))? d) Under what condition, if any, would the "less efficient" algorithm execute more quickly than the "more efficient" algorithm in question c? Explain Give explanations for your answers...
Tutorial Exercise Use the Laplace transform to solve the given initial-value problem. y' + 5y = et (0) = 2 Step 1 To use the Laplace transform to solve the given initial value problem, we first take the transform of each member of the differential equation + 6y et The strategy is that the new equation can be solved for ty) algebraically. Once solved, transforming back to an equation for gives the solution we need to the original differential equation....
We know that binary search on a sorted array of size n takes O(log n) time. Design a similar divide-and-conquer algorithm for searching in a sorted singly linked list of size n. Describe the steps of your algorithm in plain English. Write a recurrence equation for the runtime complexity. Solve the equation by the master theorem.
Fill in the last line of the three empty rows, which shows the size of a problem can be solved in the same amount of time for each complexity class on a new machine that runs nine as fast as the old one. Solve by hand when you can, use Excel or a calculator when you must: I used a calculator only for O(N Log_2 N) and solved it to 3 significant digits. Solving a problem in the same amount...
Weird recursion tree analysis. Suppose we have an algorithm that on problems of size n, recursively solves two problems of size n/2, with a “local running time” bounded by t(n) for some function t(n). That is, the algorithm’s total running time T(n) satisfies the recurrence relation T(n) ≤ 2T(n/2) + t(n). For simplicity, assume that n is a power of 2. Prove the following using a recursion tree analysis (a) If t(n) = O(n log n), then T(n) = O(n(log...
oase Theorem suggests one way in which the problem of externalities can be solved. However, the theorem has its practical limitations. From the scenarios given below, which is the best candidate for Coase-like solution? Paul is annoyed by the loud music played by his neighbor. Manufacturing plants in the Midwest emit sulfur dioxide which causes acid rain in Canada. Carbon emissions from coal power plants in China contribute to climate change of the planet. All of the above are equally...