Question

3. (25 points) Let TA and Te be two function returning the running time of algorithms A and B, defined by the recusions TA(n) T(2 and TR(n) T(2n2. Find the largest integer value of a for which algorithm B is asymptotically faster than A. Show your work and justify your answer in the PDF file. Answer in the MyCourses quiz.

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

TA=7TA(n/2)+n2.

Applying master's methon , solution to this recurrence is : O(nlog27).

Now, consider the second recurrence:

T_B=\alpha T_B(n/4)+n^2.

Now for value of \alpha<16 , solution to this recurrence will be O(n2).

for value of \alpha=16 , solution to this recurrence will be O(n2log2n).

for value of \alpha>16 , solution to this recurrence will be O(n^{log_4\alpha}) , which is asymptotically not faster than

O(nlog27).

So, 16 is the largest integer for \alpha , so that B is faster than A.

Add a comment
Know the answer?
Add Answer to:
3. (25 points) Let TA and Te be two function returning the running time of algorithms...
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
  • 1. Suppose you are given 3 algorithms A1, A2 and A3 solving the same problem. You...

    1. Suppose you are given 3 algorithms A1, A2 and A3 solving the same problem. You know that in the worst case the running times are Ti(n) = 101#nº + n, Ta(n) = 10”, TS(n) = 101 nº logo n10 (a) Which algorithm is the fastest for very large inputs? Which algorithm is the slowest for very large inputs? (Justify your answer.) (b) For which problem sizes is Al the best algorithm to use (out of the three)? Answer the...

  • Analysis of Algorithms Fall 2013 Do any (4) out of the following (5) problems 1. Assume n-3t is a...

    Analysis of Algorithms Fall 2013 Do any (4) out of the following (5) problems 1. Assume n-3t is a power of 3 fork20. Solve accurately the following recursion. If you cannot find the exact solution, use the big-O notation. Tu) T(n)Tin/3)+2 2. Suppose that you have 2 differeut algorithms to solve a giveu probleen Algorithm A has worst-case time complexity e(n2) and Algorithm B has worst-case time complexity e(nlog n). Which of the following statements are true and which are...

  • Write a recurrence relation describing the worst case running time of each of the following algorithms,...

    Write a recurrence relation describing the worst case running time of each of the following algorithms, and determine the asymptotic complexity of the function defined by the recurrence relation. Justify your solution by using substitution or a recursion tree. You may NOT use the Master Theorem. Simplify your answers, expressing them in a form such as O(nk) or (nklog n) whenever possible. If the algorithm takes exponential time, then just give an exponential lower bound using the 2 notation. function...

  • Q6) let T(n) be a running time function defined recursively as 0, n=0 n=1 3T(n -...

    Q6) let T(n) be a running time function defined recursively as 0, n=0 n=1 3T(n - 1)- 2T(n - 2), n> 1 a) Find a non-recursive formula for T(n) b) Prove by induction that your answer in part (a) is correct. c) Find a tight bound for T(n).

  • For each of the following problems write a recurrence relation describing the running time of eac...

    For each of the following problems write a recurrence relation describing the running time of each of the following algorithms and determine the asymptotic complexity of the function defined by the recurrence relation. Justify your solution using substitution and carefully computing lower and upper bounds for the sums. Simplify and express your answer as Θ(n k ) or Θ(n k (log n)) wherever possible. If the algorithm takes exponential time, then just give exponential lower bounds. 5. func5 (A,n) /*...

  • (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...

  • 7. Let X a be random variable with probability density function given by -1 < x < 1 fx(x) otherwise (a) Find the...

    7. Let X a be random variable with probability density function given by -1 < x < 1 fx(x) otherwise (a) Find the mean u and variance o2 of X (b) Derive the moment generating function of X and state the values for which it is defined (c) For the value(s) at which the moment generating function found in part (b) is (are) not defined, what should the moment generating function be defined as? Justify your answer (d) Let X1,...

  • URGENT Question 3 25 pts ArrayMystery: Input: n: a positive integer Pseudocode: Let output be an...

    URGENT Question 3 25 pts ArrayMystery: Input: n: a positive integer Pseudocode: Let output be an empty array For i = 1 to n j = 1 While ij <= n Addj to the end of output j - j + 1 Return output Answer the following questions about the ArrayMystery algorithm above. a) How many times will the inner while loop iterate? You should express your answer in terms of i and n, using Big-Oh notation. Briefly justify your...

  • With exercise 5, the first person did it wrongly. We are to define k to be...

    With exercise 5, the first person did it wrongly. We are to define k to be the largest integer such that root 2+k/n is less than or equal to a. Please an expert should solve this + In Exercise 11 from Tutorial 6, we showed that if is an irrational number and y is a nonzero rational number, then ry is an irrational number. For example, 23 and are both irrational In Tutorial 5, we proved that between any two...

  • 10. Camider the ring of plynicanials z,Ir, and let/ denote the elmmont r4 + 2a +...

    10. Camider the ring of plynicanials z,Ir, and let/ denote the elmmont r4 + 2a + 1 a) (5 points) Show that the quotient rga)/ () is a field. b) (5 points) Let a denote the coset z()Regarding F as a vector space over Z2, find a basis for F coasisting of powers of a c) (5 poluts) How nuany elements dors F have? Justify your answer. d) (5 points) Compute the product afas t a) i.e. expand this product...

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