0. Asymptotic Notation

Since different computers do operations differently fast, we are interested in how the runtime scales with increasing inputs (how it behaves asymptotically).

Asymptotic Classes

Let be some constant and arbitrary.

  • grows at most as fast as :
  • grows at least as fast as :
  • grows as fast as :

We abuse notation and denote membership in a set by .

For proving theta: and

L’Hôpital’s rule

Problem: or

Solution: - Take the derivate of both sides

Pitfalls:

  • must be differentiable near the point of interest, except possibly at the point itself.
  • Using it even when not getting or

Master Theorem

and a function such that for all even ,

Then for all , :

  1. If , .
  2. If , .
  3. If , .

If the function is increasing, then the condition can be dropped

Explanation

If work goes down every layer work of top layer (lower layers become asymptotically negligible)

If work increases every layer work of bottom layer (top layers become asymptotically negligible)

If work stays constant work of all layers (nothing becomes asymptotically negligible)

Tips and Tricks

Sum Formulas

and

Integrate (not covered in lectures)

The integral of terms behaves identical to the sum of terms asymptotically, up to constants.

Example ( denotes asymptotically equivalent):

Integrating logs Asymptotically, every integral of the form .

Multiplication-Subtraction Trick

Works for geometric series.

Example:

  1. Multiply the series by its base:  
  2. Subtract:   (middle terms cancel)
  3. Factor:  
  4. Divide:

If had constant coefficients, the middle terms would cancel just the same: , meaning the trick still works.