CSCE 222 Lecture 12

From Notes
Jump to navigation Jump to search

« previous | Wednesday, February 16, 2011 | next »


Summation

Example

for i in (1..n) do
  for j in (1..i) do
    # constant time
  end
end

How many times is the constant time function executed?

Geometric Series

Let be any real number other than 0:

Let be a real number such that 0 < r < 1:


Products


Proof by Induction

Example

Claim:

Proof: For , the left hand side is and the right hand side is

Suppose the claim holds for n-1. We are going to show that the claim holds for n:

And therefore, the claim holds by induction on . ∎