Idea: divide the problem into several (equal) parts (recursively) conquer/solve each of the sub problems combine sub problem solutions

Substitution method

Guess the solution, then find the constants using induction
Prove solution validity with induction

Example


Assume:
Prove:
Inductive assumption:
Base case: not, but yes

Recursive tree

Draw recursive tree, then sum complexity level-wise and altogether
Prove solution validity with induction

Example


Assume: ,
Draw tree:

Proof by induction:

Master theorem

  1. Get , and from:
  1. Calculate
  2. Use it to determine the asymptotic bounds of :
    Less / more leafs in recursion tree peak dominates (1. rule) / bottom dominates (3. rule)

Example

, ,

,

Akra-Bazzi theorem

  1. Get all , and which must be polinomially limited
  2. Calculate in
  3. Use it to determine the asymptotic bounds of :

Example

, , , ,

Solving linear recurrances with annihilators

Linear reccurance: is a linear combination of nearby values , , …
Operator: higher order function, taking other functions as arguments (eg. integral, differential, … )

OperatorDefinition
Addition
Substraction
Multiplication
Shift
-fold shift
Composition

Distribution
Annihilator: nontrivial operator transforming function to 0, every polinomial/exponential function has a unique minimal annihilator
OperatorFunction annihilated
  • annihilates annihilates
  • annihilates annihilates for any constant
  • annihilates and annihilates
  • annihilates and annihilates annihilates

Annihilating recurrances:

  1. Write recurrance in operator form
  2. Extract an annihilator for the recurrance
  3. Factor the annihilator (if necessary and possible)
  4. Extract the generic solution from the annihilator
  5. Solve for coefficients using the base cases (if known)

Example





… generic solution