Question

In: Computer Science

Problem 4 (2+2+2+2 marks). Analyze the following recurrence relations using the Master Theorem, and give a...

Problem 4 (2+2+2+2 marks). Analyze the following recurrence relations using the Master Theorem, and give a Θbound for each. (a) T(N) = 2T(N/4) + 1. (b) T(N) = 2T(N/4) + √ N. (c) T(N) = 2T(N/4) + N2 . (d) T(N) = 9T(N/3) + N.

Solutions

Expert Solution

Solution:

(4)

(a)

Given,

=>T(N) = 2T(N/4) + 1

Explanation:

=>T(N) = 2T(N/4) + 1

=>T(N) = 2T(N/4) + (1)...(1)

Master's theorem:

=>T(n) = aT(n/b) + (n^k(logn)^p)....(2)

a 1, b > 1, k 0 and p is any real number.

Compare (1) and (2)

=>a = 2, b = 4, k = 0 and p = 0

Finding b^k:

=>b^k = 4^0

=>b^k = 1

=>a > b^k hence first case of Master's theorem.

=>T(N) = (N^logb(a))

=>T(N) = (N^log4(2))

=>T(N) = ()

(b)

Given,

=>T(N) = 2T(N/4) +

Explanation:

=>T(N) = 2T(N/4) +

=>T(N) = 2T(N/4) + ()....(1)

Master's theorem:

=>T(n) = aT(n/b) + (n^k(logn)^p)....(2)

a 1, b > 1, k 0 and p is any real number.

Compare (1) and (2)

=>a = 2, b = 4, k = 1/2 and p = 0

Finding b^k:

=>b^k = 4^1/2

=>b^k = 2

=>a = b^k hence second case of Master's theorem.

=>T(N) = (N^logb(a)*(logN)^p+1)

=>T(N) = (N^log4(2)*(logN)^0+1)

=>T(N) = (logN)

(c)

Given,

=>T(N) = 2T(N/4) + N^2

Explanation:

=>T(N) = 2T(N/4) + N^2

=>T(N) = 2T(N/4) + (N^2)....(1)

Master's theorem:

=>T(n) = aT(n/b) + (n^k(logn)^p)....(2)

a 1, b > 1, k 0 and p is any real number.

Compare (1) and (2)

=>a = 2, b = 4, k = 2 and p = 0

Finding b^k:

=>b^k = 4^2

=>b^k = 16

=>a < b^k hence third case of Master's theorem.

=>T(N) = (N^k(logN)^p)

=>T(N) = (N^2(logN)^0)

=>T(N) = (N^2)

(d)

Given,

=>T(N) = 9T(N/3) + N

Explanation:

=>T(N) = 9T(N/3) + N

=>T(N) = 9T(N/3) + (N)....(1)

Master's theorem:

=>T(n) = aT(n/b) + (n^k(logn)^p)....(2)

a 1, b > 1, k 0 and p is any real number.

Compare (1) and (2)

=>a = 9, b = 3, k = 1 and p = 0

Finding b^k:

=>b^k = 3^1

=>b^k = 3

=>a > b^k hence first case of Master's theorem.

=>T(N) = (N^logb(a))

=>T(N) = (N^log3(9))

=>T(N) = (N^2)

I have explained each and every part with the help of statements attached to the answer above.


Related Solutions

1 (10 pts) Give a big-θ bound for the solutions of the following recurrence relations. Show...
1 (10 pts) Give a big-θ bound for the solutions of the following recurrence relations. Show work. (a) T(n) = 8T(n/2) + n^3 + 100n (b) T(n) = 5T(n/4) + 3n (c) T(n) = 7T(n/3) + 100n^2 (d) T(n) = 3T(n/3) + 1000√ n (e) T(n) = T(n − 1) + n^2
Give exact solutions for each of the recurrence relations. Find the equilibrium values. Are the equilibrium...
Give exact solutions for each of the recurrence relations. Find the equilibrium values. Are the equilibrium values stable? a. x(n+1) = 1.5x(n) x(0) = 20 b. x(n+1) = -0.75x(n) + 5 x(0) = 10 c. x(n+1) = 1.2x(n) - 5 x(0) = 2
Characterize each of the following recurrence equations using the master method (assuming that T(n) = c...
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). a. T(n) = 2T(n/2) + √n b. T(n) = 8T(n/2) + n2 c. T(n) = 16T(n/2) + n4 d. T(n) = 7T(n/3) + n e. T(n) = 9T(n/3) + n3.1
1. Using domain and range transformations, solve the following recurrence relations: a) T(1) = 1, T(n)...
1. Using domain and range transformations, solve the following recurrence relations: a) T(1) = 1, T(n) = 2T(n/2) + 6n - 1 b) T(1) = 1, T(n) = 3T(n/2) + n^2 - n
Principle Of Discrete Math In a paragraph (4-6 sentences), reflect on how recurrence relations are/can be...
Principle Of Discrete Math In a paragraph (4-6 sentences), reflect on how recurrence relations are/can be used in your discipline.
Solve the given non-homogeneous recurrence relations: an = an-1 + 6an-2 + f(n) a) an =...
Solve the given non-homogeneous recurrence relations: an = an-1 + 6an-2 + f(n) a) an = an-1 + 6an-2 - 2n+1 with a0 = -4, a1= 5 b) an = an-1 + 6an-2 + 5 x 3n with a0 = 2, a1 = 5 c) an = an-1 + 6an-2 - 36n with a0 = 10, a1= 40
Find the closed formula solution to each of the following recurrence relations with the given initial...
Find the closed formula solution to each of the following recurrence relations with the given initial conditions. Use an iterative approach and show your work! What is a_100? a) a_n=a_(n-1)+2,a_0=3 b) a_n=a_(n-1)+2n+3,a_0=4 c) a_n=2a_(n-1)-1,a_0=1 d) a_n=-a_(n-1),a_0=5
Find the closed formula solution to each of the following recurrence relations with the given initial...
Find the closed formula solution to each of the following recurrence relations with the given initial conditions. Use an iterative approach and show your work! What is a100 ? an=an-1+2, a0=3 an=an-1+2n+3, a0=4 an=2an-1-1, a0=1 an=-an-1, a0=5
Give a brief answer to each of the following four (4) questions: (a) (2 marks) Explain...
Give a brief answer to each of the following four (4) questions: (a) Explain the difference between a Type 1 and a Type II error. (b) If you want to reduce the margin of error of an estimate of a mean, what are the two things can you do? (c) Explain the difference between an independent samples t-test and paired t-test. (d) State and explain the Central Limit Theorem (CLT) for the sample mean when the population distribution is (i)...
Solve the following recurrence relations. a. x(n) = x(n − 1) + 3 for n >...
Solve the following recurrence relations. a. x(n) = x(n − 1) + 3 for n > 1, x(1) = 0 b. x(n) = 5x(n − 1) for n > 1, x(1) = 6 c. x(n) = x(n/5) + 1 for n > 1, x(1) = 1 (solve for n = 5k )
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT