Question: Problem 1 . a ) Algorithm X uses 1 0 n l o g n operations, and algorithm Y uses n 2 operations. Determine the

Problem 1.
a) Algorithm X uses 10nlogn operations, and algorithm Y uses n2 operations. Determine the value of n0 such that x is faster than Y for nn0.
b) Repeat part (a) assuming that Y uses n sqrt(n) operations
c) Show that 2n+3 is O(2n) by finding the values of n0 and c such that 2n+3c2n for nn0. Explain why these values are correct.
NOTE: you may want to review logarithms and exponents first, in ch.1 of the textbook
d) Show that 23n is not O(2n) by showing that such values of n0 and c do not exist. Alternately, you can do it by showing that for any positive constant c,limn(23n2n)>c
Problem 2.
a) Order the following functions by the big-O notation. If two functions are each is big-O of the other, list them together.
17nlogn,217,loglogn,log17n,2logn,sqrt(n),n0.017,17n
4n32,3n0.5,17n,2nlog2n,2n,nlog17n,17n,17logn
Example (with different functions):
1,317
logn,log2n
nsqrt(n)
n5
b) For each function, explain why it has a larger rate of growth (or the same rate of growth, if on the same line) as the one before it.
HINTS:
review logs and exponents section of chapter 1 in textbook, if needed
remember that n2 is the same as n0.5
when in doubt about two functions f(n) vs.g(n), consider logf(n) vs.logg(n) or 2f(n) vs.2g(n)
a) Algorithm X uses 10nlogn operations, and algorithm Y uses n2 operations. Determine the value of n0 such that x is faster than Y for nn0.
b) Repeat part (a) assuming that Y uses nn2 operations
c) Show that 2n+3 is O(2n) by finding the values of n0 and c such that 2n+3c2n for nn0. Explain why these values are correct.
NOTE: you may want to review logarithms and exponents first, in ch.1 of the textbook
d) Show that 23n is not O(2n) by showing that such values of n0 and c do not exist. Alternately, you can do it by showing that for any positive constant c,limn(23n2n)>c
Problem 2.
a) Order the following functions by the big-O notation. If two functions are each is big-O of the other, list them together.
17nlogn,217,loglogn,log17n,2logn,sqrt(n),n0.017,17n
4n32,3n0.5,17n,2nlog2n,2n,nlog17n,17n,17logn
Example (with different functions):
1,317
logn,log2n
nn2
n5
b) For each function, explain why it has a larger rate of growth (or the same rate of growth, if on the same line) as the one before it.
HINTS:
review logs and exponents section of chapter 1 in textbook, if needed
remember that sqrt(n) is the same as n0.5
when in doubt about two functions f(n) vs.g(n), consider logf(n) vs.logg(n) or vs.2g(n)
Problem 1 . a ) Algorithm X uses 1 0 n l o g n

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!