Substitution Method for Solving Recurrences with example – Programmerbay https://programmerbay.com A Tech Bay for Tech Savvy Tue, 29 Sep 2020 09:14:01 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://programmerbay.com/wp-content/uploads/2019/09/cropped-without-transparent-32x32.jpg Substitution Method for Solving Recurrences with example – Programmerbay https://programmerbay.com 32 32 Substitution Method for Solving Recurrences with example https://programmerbay.com/recurrences-substitution-method/ https://programmerbay.com/recurrences-substitution-method/#respond Sun, 07 Jun 2020 17:18:46 +0000 https://www.programmerbay.com/?p=2821 Recurrence:

The term Recurrence can be defined as any kind of inequality or equation that focuses on the value over the small inputs of the function. The running time of an algorithm with recursive calls can be easily described by recurrence.

This is the reason that recurrence is often used in Divide-and-Conquer problems.

Substitution method

There are 3 ways of solving recurrence:

  • SUBSTITUTION METHOD – A guess for the solution is made, and then we prove that our guess was incorrect or correct using mathematical induction.
  • ITERATION METHOD – We need to draw each and every level of recurrence tree and then calculate the time at each level.
  • MASTER METHOD – In this method, we have some predefined recurrence equation cases, and our focus is to get a direct solution for it.

 

SUBSTITUTION METHOD

  • Firstly, guess a solution for the given equation.
  • Now, using mathematical induction prove that the guess is correct.

An example is given below to show the method in detail.

substitution method 2

Substitution Method

 

]]>
https://programmerbay.com/recurrences-substitution-method/feed/ 0