Question

Read the slides on logarithms in lecture 02_big0. Demonstrate the three cases of the Master Theorem by solving the following

Master Theorem: a= b= f(n)-00 Now solve using repeated substitution:

0 0
Add a comment Improve this question Transcribed image text
Answer #1
a = 2, b = 2, d = log_2(2) = 1
f(n) = O(n^2)

f(n)
= 2f(n/2) + n^2
= 2(2f(n/4) + n^2/4) + n^2
= 2(2(2f(n/8) + n^2/16) + n^2/4) + n^2
= 8f(n/8) + n^2/4 + n^2/2 + n^2
...
= 1 + ... + n^2/4 + n^2/2 + n^2
= n^2(1 + 1/2 + 1/4 + 1/8 + ...)
we know that 1 + 1/2 + 1/4 + 1/8 + ... is <= 2
so, n^2(1 + 1/2 + 1/4 + 1/8 + ...) is <= n^2(2) = 2n^2
so, f(n) O(n^2)
Add a comment
Know the answer?
Add Answer to:
Read the slides on logarithms in lecture 02_big0. Demonstrate the three cases of the Master Theorem...
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
  • Algorithms: Please explain each step! Thanks! (20 points) Use the Master Theorem to solve the following...

    Algorithms: Please explain each step! Thanks! (20 points) Use the Master Theorem to solve the following recurrence relations. For each recurrence, either give the asympotic solution using the Master Theorem (state which case), or else state the Master Theorem doesn't apply (d) T(n) T() + T (4) + n2 (20 points) Use the Master Theorem to solve the following recurrence relations. For each recurrence, either give the asympotic solution using the Master Theorem (state which case), or else state the...

  • Using the Master Theorem discussed in class, solve the following recurrence relations asymptotically. Assume T(1) =...

    Using the Master Theorem discussed in class, solve the following recurrence relations asymptotically. Assume T(1) = 1 in all cases. (a) T(n) = T(9n/10) + n (b) T(n) = 16T(n/4) + n^2 (c) T(n) = 7T(n/3) + n^2 (d) T(n) = 7T(n/2) + n^2 (e) T(n) = 2T(n/4) + √n log^2n.

  • 1. Solve the recurrence relation T(n) = 2T(n/2) + n, T(1) = 1 and prove your...

    1. Solve the recurrence relation T(n) = 2T(n/2) + n, T(1) = 1 and prove your result is correct by induction. What is the order of growth? 2. I will give you a shortcut for solving recurrence relations like the previous problem called the Master Theorem. Suppose T(n) = aT(n/b) + f(n) where f(n) = Θ(n d ) with d≥0. Then T(n) is: • Θ(n d ) if a < bd • Θ(n d lg n) if a = b...

  • Question 1. Solving Recursive Relations [3 mark]. A naive multiplication of two matrices of order n...

    Question 1. Solving Recursive Relations [3 mark]. A naive multiplication of two matrices of order n requires O(nᵒ) additions. By using a divide and conquer approach, Strassen devised another algorithm that requires T(n) additions where T(n) = 7T(n/2)+cna, where c is a constant independent of n and T(1) = 0 (as multiplying two numbers re- quires no additions). Use the method of backward substitution (introduced in Week 2's lecture) to show that Strassen’s algorithm requires O(nlog27) = O(n2.81) additions, which...

  • Recurrence equations using the Master Theorem: Characterize each of the following recurrence equations using the master...

    Recurrence equations using the Master Theorem: Characterize each of the following recurrence equations using the master method (assuming that T(n) = c for n < d, for constants c > 0 and d > = 1). T(n) = c for n < d, for constants c > 0 and d greaterthanorequalto 1). a. T(n) = 2T(n/2) + log n b. T(n) = 8T(n/2) + n^2 c. T(n)=16T(n/2) + (n log n)^4 d. T(n) = 7T(n/3) + n

  • 1. [12 marks] For each of the following recurrences, use the “master theorem” and give the...

    1. [12 marks] For each of the following recurrences, use the “master theorem” and give the solution using big-O notation. Explain your reasoning. If the “master theorem” does not apply to a recurrence, show your reasoning, but you need not give a solution. (a) T(n) = 3T(n/2) + n lg n; (b) T(n) = 9T(3/3) + (n? / 1g n); (c) T(n) = T([n/41) +T([n/4])+ Vn; (d) T(n) = 4T([n/7])+ n.

  • A bead with a hole through it slides on a wire track. The wire is threaded...

    A bead with a hole through it slides on a wire track. The wire is threaded through the hole in the bead, and the bead slides without friction around a loop- the-loop (see figure below). The bead is released from rest at a height h = 4.00R. h 00 physPad Operations Symbols VO (a) What is its speed at point A? (Use the following as necessary: the acceleration due to gravity g, and R.) Relations V = Sets Vectors In...

  • - Approach and show your work in exactly the same way as demonstrated in the example...

    - Approach and show your work in exactly the same way as demonstrated in the example below -    Use the Master Theorem to characterize and solve the following recurrence equations by stating at the end which case was used and why: T(n) = 25T(n/5) + n T(n) = 36T(n/6) + (n log n)2 T(n) = 8T(n/3) + n2 Theorem        T(n) = c                          if n = 1        T(n) = a T(n/b) + f(n)     if n > 1...

  • CLIMATE CHANGE ECONOMICS AND POLICY Read: The lecture slides and required readings in Module 3 Week...

    CLIMATE CHANGE ECONOMICS AND POLICY Read: The lecture slides and required readings in Module 3 Week 12. Reflect: This week the topic we explore relates to effective business strategies to address the climate change challenge including the ‘No Regrets’ strategy. An effective response requires understanding the carbon exposure of the firm, various business and operational risks (including reputational risks) as well as opportunities provided by the physical impacts and the policy environment. The factors that influence corporate positions on climate...

  • (a) Your company participates in a competition and the fastest algorithm wins. You know of two...

    (a) Your company participates in a competition and the fastest algorithm wins. You know of two different algorithms that can solve the problem in the competition. • Algorithm I solves problems by dividing them into five subproblems of half the size, recursively solving each subproblem, and then combining the solutions in linear time. • Algorithm 2 solves problems of size n by dividing them into 16 subproblems of size n/4, recursively solving each subproblem, and then combining the solutions in...

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