Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Sequences Rosen 6 th ed., §2.4 2 Sequences A sequence represents an ordered list of elements.A sequence represents an ordered list of elements. e.g.,

Similar presentations


Presentation on theme: "1 Sequences Rosen 6 th ed., §2.4 2 Sequences A sequence represents an ordered list of elements.A sequence represents an ordered list of elements. e.g.,"— Presentation transcript:

1

2 1 Sequences Rosen 6 th ed., §2.4

3 2 Sequences A sequence represents an ordered list of elements.A sequence represents an ordered list of elements. e.g., {a n } = 1, 1/2, 1/3, 1/4, … e.g., {a n } = 1, 1/2, 1/3, 1/4, … Formally: A sequence or series {a n } is identified with a generating function f:S  A for some subset S  N (often S=N or S=N  {0}) and for some set A.Formally: A sequence or series {a n } is identified with a generating function f:S  A for some subset S  N (often S=N or S=N  {0}) and for some set A. e.g., a n = f(n) = 1/n. e.g., a n = f(n) = 1/n. The symbol a n denotes f(n), also called term n of the sequence.The symbol a n denotes f(n), also called term n of the sequence.

4 3 Example with Repetitions Consider the sequence b n = (  1) n.Consider the sequence b n = (  1) n. {b n } = 1,  1, 1,  1, …{b n } = 1,  1, 1,  1, … {b n } denotes an infinite sequence of 1’s and  1’s, not the 2-element set {1,  1}.{b n } denotes an infinite sequence of 1’s and  1’s, not the 2-element set {1,  1}.

5 4 Recognizing Sequences Sometimes, you’re given the first few terms of a sequence, and you are asked to find the sequence’s generating function, or a procedure to enumerate the sequence.Sometimes, you’re given the first few terms of a sequence, and you are asked to find the sequence’s generating function, or a procedure to enumerate the sequence.

6 5 Recognizing Sequences Examples: What’s the next number?Examples: What’s the next number? –1,2,3,4,… –1,3,5,7,9,… –2,3,5,7,11,... 5 (the 5th smallest number >0) 11 (the 6th smallest odd number >0) 13 (the 6th smallest prime number)

7 6 The Trouble with Recognition The problem of finding “the” generating function given just an initial subsequence is not well defined.The problem of finding “the” generating function given just an initial subsequence is not well defined. This is because there are infinitely many computable functions that will generate any given initial subsequence.This is because there are infinitely many computable functions that will generate any given initial subsequence.

8 7 The Trouble with Recognition (cont’d) We implicitly are supposed to find the simplest such function but, how should we define the simplicity of a function?We implicitly are supposed to find the simplest such function but, how should we define the simplicity of a function? –We might define simplicity as the reciprocal of complexity, but… –There are many plausible, competing definitions of complexity, and this is an active research area. So, these questions really have no objective right answer!So, these questions really have no objective right answer!

9 8 Summations Rosen 6 th ed., §2.4

10 9 Summation Notation Given a series {a n }, the summation of {a n } from j to k is written and defined as follows:Given a series {a n }, the summation of {a n } from j to k is written and defined as follows: Here, i is called the index of summation.Here, i is called the index of summation.

11 10 Generalized Summations For an infinite series, we may write:For an infinite series, we may write: To sum a function over all members of a set X={x 1, x 2, …}:To sum a function over all members of a set X={x 1, x 2, …}: Or, if X={x|P(x)}, we may just write:Or, if X={x|P(x)}, we may just write:

12 11 Simple Summation Example

13 12 More Summation Examples An infinite series with a finite sum:An infinite series with a finite sum: Using a predicate to define a set of elements to sum over:Using a predicate to define a set of elements to sum over:

14 13 Summation Manipulations Some handy identities for summations:Some handy identities for summations: (Index shifting.)

15 14 More Summation Manipulations (Grouping.) (Order reversal.) (Series splitting.)

16 15 Example: Impress Your Friends Boast, “I’m so smart; give me any 2-digit number n, and I’ll add all the numbers from 1 to n in my head in just a few seconds.”Boast, “I’m so smart; give me any 2-digit number n, and I’ll add all the numbers from 1 to n in my head in just a few seconds.” I.e., Evaluate the summation:I.e., Evaluate the summation: There is a simple closed-form formula for the result, discovered by Euler at age 12!There is a simple closed-form formula for the result, discovered by Euler at age 12! Leonhard Euler ( )

17 16 Euler’s Trick, Illustrated Consider the sum (assume n is even): 1+2+…+(n/2)+((n/2)+1)+…+(n-1)+nConsider the sum (assume n is even): 1+2+…+(n/2)+((n/2)+1)+…+(n-1)+n n/2 pairs of elements, each pair summing to n+1, for a total of (n/2)(n+1).n/2 pairs of elements, each pair summing to n+1, for a total of (n/2)(n+1). … n+1

18 17 Symbolic Derivation of Trick (k=n/2) order reversal index shifting Suppose n is even, that is, n=2k

19 18 Concluding Euler’s Derivation Also works for odd n (prove this at home).Also works for odd n (prove this at home).

20 19 Example: Geometric Series A geometric series is a series of the formA geometric series is a series of the form a, ar, ar 2, ar 3, …, ar k, where a,r  R. a, ar, ar 2, ar 3, …, ar k, where a,r  R. The sum of such a series is given by:The sum of such a series is given by: We can reduce this to closed form via clever manipulation of summations...We can reduce this to closed form via clever manipulation of summations...

21 20 Here we go...Here we go... Geometric Sum Derivation

22 21 Derivation example cont...

23 22 Concluding long derivation...

24 23 More Series Infinite Geometric

25 24 More Series Geometric series Arithmetic Series (Euler’s trick) Quadratic series Cubic series

26 25 Example Evaluate. Evaluate. –Use series splitting. –Solve for desired summation. –Apply quadratic series rule. –Evaluate.

27 26 Nested Summations These have the meaning you’d expect.These have the meaning you’d expect. Note issues of free vs. bound variables, just like in quantified expressions, integrals, etc.Note issues of free vs. bound variables, just like in quantified expressions, integrals, etc.


Download ppt "1 Sequences Rosen 6 th ed., §2.4 2 Sequences A sequence represents an ordered list of elements.A sequence represents an ordered list of elements. e.g.,"

Similar presentations


Ads by Google