Question

a) Prove that running time T(n)=n3+30n+1 is O(n3) [1 mark] b) Prove that running time T(n)=(n+30)(n+5)...

a) Prove that running time T(n)=n3+30n+1 is O(n3) [1 mark]

b) Prove that running time T(n)=(n+30)(n+5) is O(n2) [1 mark]

c) Count the number of primitive operation of algorithm unique1 on page 174 of textbook, give a big-Oh of this algorithm and prove it. [2 mark]

d) Order the following function by asymptotic growth rate [2 mark]

a. 4nlogn+2n

b. 210

c. 3n+100logn

d. n2+10n

e. n3 f. nlogn

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


f(n) = O(g(n)) means there are positive constants c and n0, such that 0 ≤ f(n) ≤ cg(n) for all n ≥ n0

n^3+30n+1 is O(n^3)

=>  n^3+30n+1 <= c(n^3)

Let's assume c = 2
=>  n^3+30n+1 <= c(n^3)
=>  n^3+30n+1 <= 2(n^3)
=>  30n+1 <= n^3

n^3 is greater than 30n+1 for all n >= 6

so, n^3+30n+1 is O(n^3) for all c = 2 and n0 = 6 

Add a comment
Know the answer?
Add Answer to:
a) Prove that running time T(n)=n3+30n+1 is O(n3) [1 mark] b) Prove that running time T(n)=(n+30)(n+5)...
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
  • Question2 0/5 pts If exact running time of an algorithm is T(n)-5n3+ n2 + 3n -5...

    Question2 0/5 pts If exact running time of an algorithm is T(n)-5n3+ n2 + 3n -5 where n is the input size, then which of the following is true? T(n)- O(n) RCOECEQuestion 3 0/5 pts Which of the following is the correct ranking of the functions listed below: logn. n2 n2n, 2. 1500. nlogn, 5 Question 4 5/5 pts to search

  • 1 question) Arrange the following in the order of their growth rates, from least to greatest:...

    1 question) Arrange the following in the order of their growth rates, from least to greatest: (5 pts) n3                     n2         nn        lg n     n!       n lg n              2n                     n 2 question)Show that 3n3 + n2 is big-Oh of n3. You can use either the definition of big-Oh (formal) or the limit approach. Show your work! (5 pts.) 3 question)Show that 6n2 + 20n is big-Oh of n3, but not big-Omega of n3. You can use either the definition of big-Omega...

  • 1. a) Let f(n) = 6n2 - 100n + 44 and g(n) = 0.5n3 . Prove...

    1. a) Let f(n) = 6n2 - 100n + 44 and g(n) = 0.5n3 . Prove that f(n) = O(g(n)) using the definition of Big-O notation. (You need to find constants c and n0). b) Let f(n) = 3n2 + n and g(n) = 2n2 . Use the definition of big-O notation to prove that f(n) = O(g(n)) (you need to find constants c and n0) and g(n) = O(f(n)) (you need to find constants c and n0). Conclude that...

  • Question 3: Given the following two code fragments [2 Marks] (i)Find T(n), the time complexity (as...

    Question 3: Given the following two code fragments [2 Marks] (i)Find T(n), the time complexity (as operations count) in the worst case? (ii)Express the growth rate of the function in asymptotic notation in the closest bound possible. (iii)Prove that T(n) is Big O (g(n)) by the definition of Big O (iv)Prove that T(n) is (g(n)) by using limits

  • Exercise 1 Use Top-Down Design to “design” a set of instructions to write an algorithm for...

    Exercise 1 Use Top-Down Design to “design” a set of instructions to write an algorithm for “travel arrangement”. For example, at a high level of abstraction, the algorithm for “travel arrangement” is: book a hotel buy a plane ticket rent a car Using the principle of stepwise refinement, write more detailed pseudocode for each of these three steps at a lower level of abstraction. Exercise 2 Asymptotic Complexity (3 pts) Determine the Big-O notation for the following growth functions: 1....

  • Please use java language to answer these qustions, and then test the code if it need...

    Please use java language to answer these qustions, and then test the code if it need code (like qustion 2) to make suer the code work fine and type the answer please 1- Order the following functions by asymptotic growth rate. Explain your answer. 4n log n 210          2log n       3n + 100 log n 4n 2n n2 + 10n n3   n log n 2-Implement a method with signature transfer (S, T) that transfers all elements? Please use java language...

  • Let f(n) = 5n^2. Prove that f(n) = O(n^3). Let f(n) = 7n^2. Prove that f(n)...

    Let f(n) = 5n^2. Prove that f(n) = O(n^3). Let f(n) = 7n^2. Prove that f(n) = Ω(n). Let f(n) = 3n. Prove that f(n) =ꙍ (√n). Let f(n) = 3n+2. Prove that f(n) = Θ (n). Let k > 0 and c > 0 be any positive constants. Prove that (n + k)c = O(nc). Prove that lg(n!) = O(n lg n). Let g(n) = log10(n). Prove that g(n) = Θ(lg n). (hint: ???? ? = ???? ?)???? ?...

  • 1. (10 points) Write an efficient iterative (i.e., loop-based) function Fibonnaci(n) that returns the nth Fibonnaci...

    1. (10 points) Write an efficient iterative (i.e., loop-based) function Fibonnaci(n) that returns the nth Fibonnaci number. By definition Fibonnaci(0) is 1, Fibonnaci(1) is 1, Fibonnaci(2) is 2, Fibonnaci(3) is 3, Fibonnaci(4) is 5, and so on. Your function may only use a constant amount of memory (i.e. no auxiliary array). Argue that the running time of the function is Θ(n), i.e. the function is linear in n. 2. (10 points) Order the following functions by growth rate: N, \N,...

  • Need help with 1,2,3 thank you. 1. Order of growth (20 points) Order the following functions...

    Need help with 1,2,3 thank you. 1. Order of growth (20 points) Order the following functions according to their order of growth from the lowest to the highest. If you think that two functions are of the same order (Le f(n) E Θ(g(n))), put then in the same group. log(n!), n., log log n, logn, n log(n), n2 V, (1)!, 2", n!, 3", 21 2. Asymptotic Notation (20 points) For each pair of functions in the table below, deternme whether...

  • 7. What is the worst-case running time complexity of an algorithm with the recurrence relation T(N)...

    7. What is the worst-case running time complexity of an algorithm with the recurrence relation T(N) = 2T(N/4) + O(N2)? Hint: Use the Master Theorem.

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