5
A sequence is a function from a subset of the natural numbers (or the positive integers) to some set S. Simply, a sequence is an ordered list of elements. Sequence Notation. Example 2.19 Many sequences that arise in computer science follow specific progressions: geometric or arithmetic. A geometric progression is a sequence of the form: Example 2.20. Geometric Progression on the Natural Numbers. An Arithmetic Progression is a Sequence of the form: Observe. Given an arithmetic sequence, one can find the common ratio by simply comparing consecutive terms in the sequence. Sequences, Summations, and Recurrences Wednesday, October 4, 2017 11:57 AM Math Methods Page 1

Sequences, Summations, and Recurrencesjeremybolton.georgetown.domains/courses/mm/030_10_Notes.pdf · Solving Recurrences. A recurrence is said to be solved when a non-recursive or

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Sequences, Summations, and Recurrencesjeremybolton.georgetown.domains/courses/mm/030_10_Notes.pdf · Solving Recurrences. A recurrence is said to be solved when a non-recursive or

A sequence is a function from a subset of the natural numbers (or the positive integers) to some set S. Simply, a sequence is an ordered list of elements.

Sequence Notation.

Example 2.19

Many sequences that arise in computer science follow specific progressions: geometric or arithmetic.

A geometric progression is a sequence of the form:

Example 2.20. Geometric Progression on the Natural Numbers.

An Arithmetic Progression is a Sequence of the form:

Observe. Given an arithmetic sequence, one can find the common ratio by simply comparing consecutive terms in the sequence.

Sequences, Summations, and RecurrencesWednesday, October 4, 2017 11:57 AM

Math Methods Page 1

Page 2: Sequences, Summations, and Recurrencesjeremybolton.georgetown.domains/courses/mm/030_10_Notes.pdf · Solving Recurrences. A recurrence is said to be solved when a non-recursive or

Example 2.21: Arithmetic Progression Observe. Given an arithmetic sequence, one can find the common difference by simply comparing consecutive terms in the sequence.

Recurrence Relations.

A recurrence relation is an equation that defines the nth term of a sequence using 1 or more of the previous terms. That is, a recurrence relation is an equation that recursively defines a sequence.

Example 2.22

Example 2.23. Fibonacci Sequence.

Math Methods Page 2

Page 3: Sequences, Summations, and Recurrencesjeremybolton.georgetown.domains/courses/mm/030_10_Notes.pdf · Solving Recurrences. A recurrence is said to be solved when a non-recursive or

A recurrence is of order k, when it relies on the kth previous term and not any terms past the kth.

Solving Recurrences.

A recurrence is said to be solved when a non-recursive or closed form formula is found which can be used to compute the terms in the sequence.

Here we discuss solving recurrences via iteration: using either forward substitution or backward substitution.

Observe. Solving recurrences is an important concept that you will use repeatedly in your upcoming curriculum. Deriving and solving recurrences is fundamental to the analysis of algorithms.

Starting with the initial condition, repeatedly apply the recurrence to create the next term in the sequence (Do not simplify the resulting expressions!).

1)

Identify the "pattern" in the resulting expressions for each term in the sequence. It may be arithmetic or geometric.

2)

(Guess) Find the formula that characterizes the observed arithmetic or geometric sequence.

3)

Confirm correctness of guess. 4)

Forward Substitution:

Starting with the nth term, repeatedly apply the recurrence to create the previousterm in the sequence (Do not simplify the resulting expressions!).

1)

Identify the "pattern" in the resulting expressions for each term in the sequence. It may be arithmetic or geometric.

2)

(Guess) Find the formula that characterizes the observed arithmetic or geometric sequence.

3)

Confirm correctness of guess. 4)

Backward Substitution:

Example 2.24

Math Methods Page 3

Page 4: Sequences, Summations, and Recurrencesjeremybolton.georgetown.domains/courses/mm/030_10_Notes.pdf · Solving Recurrences. A recurrence is said to be solved when a non-recursive or

Finite Sums and Products.

The sum of the terms in a sequence is called a series.

Example 2.25

Common Summations.

Sum of Geometric Series (Proof, if time*; otherwise see text.)

Math Methods Page 4

Page 5: Sequences, Summations, and Recurrencesjeremybolton.georgetown.domains/courses/mm/030_10_Notes.pdf · Solving Recurrences. A recurrence is said to be solved when a non-recursive or

Embedded Sums. Embedded sums occur often in many computational scenarios. Like most embedded operations, simply apply each in order of precedence -- apply the inner summation then the enclosing summation.

Math Methods Page 5