Chapter 1: Problem 21
Discuss the reflexive, symmetric, and transitive properties for asymptotic comparisons \((O, \Omega, \Theta, o)\)
Chapter 1: Problem 21
Discuss the reflexive, symmetric, and transitive properties for asymptotic comparisons \((O, \Omega, \Theta, o)\)
All the tools & learning materials you need for study success - in one app.
Get started for freeGive a \(\Theta(n \text { lg } n)\) algorithm that computes the reminder when \(x^{n}\) is divided by \(p .\) For simplicity, you may assume that \(n\) is a power of 2 That is, \(n=2^{k}\) for some positive integer \(k\)
Write an algorithm that finds both the smallest and largest numbers in a list of \(n\) numbers. Try to find a method that does at most \(1.5 n\) comparisons of array items.
Justify the correctness of the following statements assuming that \(f(n)\) and \(g(n)\) are asymptotically positive functions. a. \(f(n)+g(n) \in O(f(n)), g(n))\) b. \(f^{2}(n) \in \Omega(f(n))\) c. \(f(n)+o(f(n)) \in \Theta(f(n), \text { where of } o(f(n))\) means any function \\[g(n) \in o(f(n))\\]
There are two algorithms called Algl and Alg2 for a problem of size n. Algl runs in \(n^{2}\) microseconds and Alg2 runs in 100 n log \(n\) microseconds. Algl can be implemented using 4 hours of programmer time and needs 2 minutes of CPU time. On the other hand, Alg2 require 15 hours of programmer time and 6 minutes of CPU time. If programmers are paid 20 dollars per hour and CPU time costs 50 dollars per minute, how many times must a problem instance of size 500 be solved using Alg2 in order to justify its development cost?
Suppose you have a computer that requires 1 minute to solve problem instances of size \(n=1,000 .\) Suppose you buy a new computer that runs 1,000 times faster than the old one. What instance sizes can be run in 1 minute, assuming the following time complexities \(T(n)\) for our algorithm? a. \(T(n)=n\) b. \(T(n)=n^{3}\) c. \(T(n)=10^{n}\)
What do you think about this solution?
We value your feedback to improve our textbook solutions.