- Related Questions & Answers
- C++ Program to Compute Combinations using Recurrence Relation for nCr
- Why “using namespace std” is considered bad practice in C++
- Why is it considered a bad practice to omit curly braces in C/C++?
- What are the requirements to become a Public Relations Officer?
- What is Cryogenic sleep and can it be put to practice practically?
- What is the way to practice verbal ability for SSC Bank PO examination?
- Discrete Mathematics Relations
- Which are the platform where i could able to execute my codes online (C++) for practice?
- Why the use of "using namespace std' considered bad practice?
- Is it a good practice to end switch with defaults in JavaScript?
- Is it a good practice to place all declarations at the top in JavaScript?
- Why is it not good practice to use date values with two-digits years in MySQL?
- Best practice for variable and method naming in Java
- Are HTML comments inside script tags a best practice?

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

**Recurrence relations** are equations that recursively defines a multidimensional array.

Here we will solve so questions based on recurrence relations.

Solve the recurrence reation:T(n) = 12T(n/2) + 9n^{2}+ 2. T(n) = 12T(n/2) + 9n^{2}+ 2. Here, a = 12 and b = 2 and f(n) = 9(n)^{2}+ 2 It is of the form f(n) = O(n^c), where c = 2

This form its in the master’s theorem condition,

So, logb(a) = log2(12) = 3.58 Using case 1 of the masters theorm, T(n) = θ(n^{3.58}).

Solve the recurrence reation:T(n) = 5T(n/2 + 23) + 5n^{2}+ 7n - 5/3. T(n) = 5T(n/2 + 23) + 5n^{2}+ 7n - 5/3

On simplification, in case of large values, n,n/2 >> 23, so 23 is neglected.

T(n) = 5T(n/2) + 5n^{2}+ 7n - 5/3. Further, we can take 5n2 + 7n - 5 ≃0(n^{2}). So, T(n) = 5T(n/2) + O(n^{2})

This fall under the case 2 of masters theorem,

So, T(n) = O(n^{2}).

Check if the following comes under any case of a master’s theorem.

T(n) = 2T(n/3) + 5^{n}

No, For masters theorem to be applied, the function should be a polynomial function.

T(n) = 2T(n/5) + tan(n)

No, trignometric function do not come under masters theorem.

T(n) = 5T(n+1) + log(n)

No, Logarithmic function do not come under masters theorem.

T(n) = T(n-7) + e^{n}

No, exponential function do not come under masters theorem.

T(n) = 9n(n/2+1 ) + 4(n^{2}) - 17 Yes, as solved above.

Advertisements