1 Sequences and Summations CS/APMA 202 Rosen section 3.2 Aaron Bloomfield.

Slides:



Advertisements
Similar presentations
Chapter 8 Vocabulary. Section 8.1 Vocabulary Sequences An infinite sequence is a function whose domain is the set of positive integers. The function.
Advertisements

Binomial Coefficients
Geometric Sequences Common ratio 9.3.
22C:19 Discrete Math Sequence and Sums Fall 2011 Sukumar Ghosh.
Warm up 1. Determine if the sequence is arithmetic. If it is, find the common difference. 35, 32, 29, 26, Given the first term and the common difference.
CSE115/ENGR160 Discrete Mathematics 02/22/11 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 02/21/12
Sequences & Summations Section 2.4 of Rosen Fall 2008 CSCE 235 Introduction to Discrete Structures Course web-page: cse.unl.edu/~cse235 Questions:
1 Section 3.2 Sequences and Summations. 2 Sequence Function from a subset of Z (usually the set beginning with 1 or 0) to a set S a n denotes the image.
Discrete Mathematics Recursion and Sequences
Copyright © 2007 Pearson Education, Inc. Slide 8-1 Warm-Up Find the next term in the sequence: 1, 1, 2, 6, 24, 120,…
11.3 Geometric Sequences.
1 Set Operations CS/APMA 202, Spring 2005 Rosen, section 1.7 Aaron Bloomfield.
1 The Pigeonhole Principle CS/APMA 202 Rosen section 4.2 Aaron Bloomfield.
1 Integers and Division CS/APMA 202 Rosen section 2.4 Aaron Bloomfield.
Geometric Sequences and Series A sequence is geometric if the ratios of consecutive terms are the same. 2, 8, 32, 128, 512,... Definition of Geometric.
Recursive Definitions and Structural Induction
Sequences & Summations CS 1050 Rosen 3.2. Sequence A sequence is a discrete structure used to represent an ordered list. A sequence is a function from.
Sequences and Summations
Unit 6: Modeling Mathematics 3 Ms. C. Taylor. Warm-Up.
1 Partial Orderings Aaron Bloomfield CS 202 Rosen, section 7.6.
1 Permutations and Combinations CS/APMA 202 Rosen section 4.3 Aaron Bloomfield.
Chapter 6 Sequences And Series Look at these number sequences carefully can you guess the next 2 numbers? What about guess the rule?
2.4 Sequences and Summations
Section 8.1 Sequences & Series. Sequences & Series Definition of Sequence: An infinite sequence is a function whose domain is the set of positive integers.
Section 2.4. Section Summary Sequences. Examples: Geometric Progression, Arithmetic Progression Recurrence Relations Example: Fibonacci Sequence Summations.
1 Proof Strategies CS/APMA 202 Rosen section 3.1 Aaron Bloomfield.
SEQUENCES AND SERIES Arithmetic. Definition A series is an indicated sum of the terms of a sequence.  Finite Sequence: 2, 6, 10, 14  Finite Series:2.
Sequences and Summations
Fall 2002CMSC Discrete Structures1 … and now for… Sequences.
Section 2.4. Section Summary Sequences. Examples: Geometric Progression, Arithmetic Progression Recurrence Relations Example: Fibonacci Sequence Summations.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
Geometric Sequences and Series Section Objectives Recognize, write, and find nth terms of geometric sequences Find the nth partial sums of geometric.
Module #12: Summations Rosen 5 th ed., §3.2 Based on our knowledge on sequence, we can move on to summations easily.
Sequences & Series MATH Precalculus S. Rook.
1 Relations and Their Properties Rosen, section 7.1 CS/APMA 202 Aaron Bloomfield.
1 Algorithms CS/APMA 202 Rosen section 2.1 Aaron Bloomfield.
13.4 Geometric Sequences and Series Example:3, 6, 12, 24, … This sequence is geometric. r is the common ratio r = 2.
Sequences and Summations Section 2.4. Section Summary Sequences. – Examples: Geometric Progression, Arithmetic Progression Recurrence Relations – Example:
Functions Section 2.3. Section Summary Definition of a Function. – Domain, Cdomain – Image, Preimage Injection, Surjection, Bijection Inverse Function.
Unit 5 – Series, Sequences, and Limits Section 5.2 – Recursive Definitions Calculator Required.
Warm up 1. Find the sum of : 2. Find the tenth term of the sequence if an = n2 +1: =
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 09: SEQUENCES Section 3.2 Jarek Rossignac CS1050: Understanding.
1 Basics of Counting CS/APMA 202 Rosen section 4.1 Aaron Bloomfield.
Who was Fibonacci ? Greatest European mathematician of the middle ages Born in Pisa, Italy, the city with the famous Leaning Tower,~ 1175 AD Major contributions.
Math 51/COEN 19. Sequences and Summations - vocab An arithmetic progression is a sequence of the form a, a+d, a+2d, …, a+nd, … with fixed a, d in R and.
Section 3.2: Sequences and Summations. Def: A sequence is a function from a subset of the set of integers (usually the set of natural numbers) to a set.
CS 285- Discrete Mathematics
Lesson 10.1, page 926 Sequences and Summation Notation Objective: To find terms of sequences given the nth term and find and evaluate a series.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 Basic Structure : Sets, Functions, Sequences, and Sums Sequences and Summations.
Section 2.5. Cardinality Definition: A set that is either finite or has the same cardinality as the set of positive integers (Z + ) is called countable.
3/16/20161 … and now for… Sequences. 3/16/20162 Sequences Sequences represent ordered lists of elements. A sequence is defined as a function from a subset.
Chapter 2 1. Chapter Summary Sets The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions and sequences.
1 Recursive Definitions and Structural Induction CS/APMA 202 Rosen section 3.4 Aaron Bloomfield.
22C:19 Discrete Structures Sequence and Sums Fall 2014 Sukumar Ghosh.
Fall 2002CMSC Discrete Structures1 Chapter 3 Sequences Mathematical Induction Recursion Recursion.
CSE15 Discrete Mathematics 03/01/17
Sequences and Series spaces with Summability
Geometric Sequences and Series
Aaron Bloomfield CS 202 Rosen, section 7.4
The sum of the infinite and finite geometric sequence
Discrete Mathematics CS 2610
Permutations and Combinations
Sequences and Summations
Sequences and Summations
Lecture 7 Functions.
Sequences and Series Section 8.1.
ICS 253: Discrete Structures I
CMSC Discrete Structures
Presentation transcript:

1 Sequences and Summations CS/APMA 202 Rosen section 3.2 Aaron Bloomfield

2 Definitions Sequence: an ordered list of elements Like a set, but: Like a set, but: Elements can be duplicated Elements are ordered

3 Sequences A sequence is a function from a subset of Z to a set S Usually from the positive or non-negative ints Usually from the positive or non-negative ints a n is the image of n a n is the image of n a n is a term in the sequence {a n } means the entire sequence The same notation as sets! The same notation as sets!

4 Sequence examples a n = 3n The terms in the sequence are a 1, a 2, a 3, … The terms in the sequence are a 1, a 2, a 3, … The sequence {a n } is { 3, 6, 9, 12, … } The sequence {a n } is { 3, 6, 9, 12, … } b n = 2 n The terms in the sequence are b 1, b 2, b 3, … The terms in the sequence are b 1, b 2, b 3, … The sequence {b n } is { 2, 4, 8, 16, 32, … } The sequence {b n } is { 2, 4, 8, 16, 32, … } Note that sequences are indexed from 1 Not in all other textbooks, though! Not in all other textbooks, though!

5 Geometric vs. arithmetic sequences The difference is in how they grow Arithmetic sequences increase by a constant amount a n = 3n a n = 3n The sequence {a n } is { 3, 6, 9, 12, … } The sequence {a n } is { 3, 6, 9, 12, … } Each number is 3 more than the last Each number is 3 more than the last Of the form: f(x) = dx + a Of the form: f(x) = dx + a Geometric sequences increase by a constant factor b n = 2 n b n = 2 n The sequence {b n } is { 2, 4, 8, 16, 32, … } The sequence {b n } is { 2, 4, 8, 16, 32, … } Each number is twice the previous Each number is twice the previous Of the form: f(x) = ar x Of the form: f(x) = ar x

6 Fibonacci sequence Sequences can be neither geometric or arithmetic F n = F n-1 + F n-2, where the first two terms are 1 F n = F n-1 + F n-2, where the first two terms are 1 Alternative, F(n) = F(n-1) + F(n-2) Each term is the sum of the previous two terms Each term is the sum of the previous two terms Sequence: { 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, … } Sequence: { 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, … } This is the Fibonacci sequence This is the Fibonacci sequence Full formula: Full formula:

7 Fibonacci sequence in nature

8 Reproducing rabbits You have one pair of rabbits on an island The rabbits repeat the following: The rabbits repeat the following: Get pregnant one month Give birth (to another pair) the next month This process repeats indefinitely (no deaths) This process repeats indefinitely (no deaths) Rabbits get pregnant the month they are born Rabbits get pregnant the month they are born How many rabbits are there after 10 months?

9 Reproducing rabbits First month: 1 pair The original pair The original pair Second month: 1 pair The original (and now pregnant) pair The original (and now pregnant) pair Third month: 2 pairs The child pair (which is pregnant) and the parent pair (recovering) The child pair (which is pregnant) and the parent pair (recovering) Fourth month: 3 pairs “Grandchildren”: Children from the baby pair (now pregnant) “Grandchildren”: Children from the baby pair (now pregnant) Child pair (recovering) Child pair (recovering) Parent pair (pregnant) Parent pair (pregnant) Fifth month: 5 pairs Both the grandchildren and the parents reproduced Both the grandchildren and the parents reproduced 3 pairs are pregnant (child and the two new born rabbits) 3 pairs are pregnant (child and the two new born rabbits)

10 Reproducing rabbits Sixth month: 8 pairs All 3 new rabbit pairs are pregnant, as well as those not pregnant in the last month (2) All 3 new rabbit pairs are pregnant, as well as those not pregnant in the last month (2) Seventh month: 13 pairs All 5 new rabbit pairs are pregnant, as well as those not pregnant in the last month (3) All 5 new rabbit pairs are pregnant, as well as those not pregnant in the last month (3) Eighth month: 21 pairs All 8 new rabbit pairs are pregnant, as well as those not pregnant in the last month (5) All 8 new rabbit pairs are pregnant, as well as those not pregnant in the last month (5) Ninth month: 34 pairs All 13 new rabbit pairs are pregnant, as well as those not pregnant in the last month (8) All 13 new rabbit pairs are pregnant, as well as those not pregnant in the last month (8) Tenth month: 55 pairs All 21 new rabbit pairs are pregnant, as well as those not pregnant in the last month (13) All 21 new rabbit pairs are pregnant, as well as those not pregnant in the last month (13)

11 Reproducing rabbits Note the sequence: { 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, … } The Fibonacci sequence again

12 Fibonacci sequence Another application: Fibonacci references from

13 Fibonacci sequence As the terms increase, the ratio between successive terms approaches This is called the “golden ratio” Ratio of human leg length to arm length Ratio of human leg length to arm length Ratio of successive layers in a conch shell Ratio of successive layers in a conch shell Reference:

14 The Golden Ratio

15

16 Determining the sequence formula Given values in a sequence, how do you determine the formula? Steps to consider: Is it an arithmetic progression (each term a constant amount from the last)? Is it an arithmetic progression (each term a constant amount from the last)? Is it a geometric progression (each term a factor of the previous term)? Is it a geometric progression (each term a factor of the previous term)? Does the sequence it repeat (or cycle)? Does the sequence it repeat (or cycle)? Does the sequence combine previous terms? Does the sequence combine previous terms? Are there runs of the same value? Are there runs of the same value?

17 Determining the sequence formula Rosen, question 9 (page 236) a)1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, … The sequence alternates 1’s and 0’s, increasing the number of 1’s and 0’s each time b)1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 8, 8, … This sequence increases by one, but repeats all even numbers once c)1, 0, 2, 0, 4, 0, 8, 0, 16, 0, … The non-0 numbers are a geometric sequence (2 n ) interspersed with zeros d)3, 6, 12, 24, 48, 96, 192, … Each term is twice the previous: geometric progression a n = 3*2 n-1

18 Determining the sequence formula e)15, 8, 1, -6, -13, -20, -27, … Each term is 7 less than the previous term a n = n f)3, 5, 8, 12, 17, 23, 30, 38, 47, … The difference between successive terms increases by one each time a 1 = 3, a n = a n-1 + n a n = n(n+1)/2 + 2 g)2, 16, 54, 128, 250, 432, 686, … Each term is twice the cube of n a n = 2*n 3 h)2, 3, 7, 25, 121, 721, 5041, Each successive term is about n times the previous a n = n! + 1 My solution: a n = a n-1 * n - n + 1

19 OEIS: Online Encyclopedia of Integer Sequences Online at

20 Useful sequences n 2 = 1, 4, 9, 16, 25, 36, … n 3 = 1, 8, 27, 64, 125, 216, … n 4 = 1, 16, 81, 256, 625, 1296, … 2 n = 2, 4, 8, 16, 32, 64, … 3 n = 3, 9, 27, 81, 243, 729, … n! = 1, 2, 6, 24, 120, 720, … Listed in Table 1, page 228 of Rosen

21 Quick survey I felt I understood sequences… I felt I understood sequences… a) Very well b) With some review, I’ll be good c) Not really d) Not at all

22 Geeky Tattoos

23 Summations A summation: or is like a for loop: int sum = 0; for ( int j = m; j <= n; j++ ) sum += a(j); index of summation upper limit lower limit

24 Evaluating sequences Rosen, question 13, page = 20 (-2) 0 + (-2) 1 + (-2) 2 + (-2) 3 + (-2) 4 = = 30 ( ) + ( ) + ( ) + … ( ) = 511 Note that each term (except the first and last) is cancelled by another term Note that each term (except the first and last) is cancelled by another term

25 Evaluating sequences Rosen, question 14, page 3.2 S = { 1, 3, 5, 7 } S = { 1, 3, 5, 7 } What is  j  S j = = 16 What is  j  S j = = 84 What is  j  S (1/j) 1/1 + 1/3 + 1/5 + 1/7 = 176/105 1/1 + 1/3 + 1/5 + 1/7 = 176/105 What is  j  S = = 4

26 Sum of a geometric series: Example: Summation of a geometric series

27 Proof of last slide If r = 1, then the sum is:

28 Double summations Like a nested for loop Is equivalent to: int sum = 0; for ( int i = 1; i <= 4; i++ ) for ( int j = 1; j <= 3; j++ ) sum += i*j;

29 Useful summation formulae Well, only 1 really important one:

30 All your base are belong to us Flash animation Flash animation Flash animation Flash animation Reference: us Reference: us

31 End of lecture on 17 March 2005

32 Cardinality For finite (only) sets, cardinality is the number of elements in the set For finite and infinite sets, two sets A and B have the same cardinality if there is a one-to-one correspondence from A to B

33 Cardinality Example on finite sets: Let S = { 1, 2, 3, 4, 5 } Let S = { 1, 2, 3, 4, 5 } Let T = { a, b, c, d, e } Let T = { a, b, c, d, e } There is a one-to-one correspondence between the sets There is a one-to-one correspondence between the sets Example on infinite sets: Let S = Z+ Let S = Z+ Let T = { x | x = 2k and k  Z+ } Let T = { x | x = 2k and k  Z+ } One-to-one correspondence: One-to-one correspondence: 1 ↔ 2 2 ↔ 4 3 ↔ 6 4 ↔ 2 5 ↔ 10 6 ↔ 12 7 ↔ 14 8 ↔ 16 Etc. Note that here the ‘↔’ symbol means that there is a correspondence between them, not the biconditional

34 More definitions Countably infinite: elements can be listed Anything that has the same cardinality as the integers Anything that has the same cardinality as the integers Example: rational numbers, ordered pairs of integers Example: rational numbers, ordered pairs of integers Uncountably infinite: elements cannot be listed Example: real numbers Example: real numbers

35 Showing a set is countably infinite Done by showing there is a one-to-one correspondence between the set and the integers Examples Even numbers Even numbers Shown two slides ago Rational numbers Rational numbers Shown in Rosen, page Ordered pairs of integers Ordered pairs of integers Shown next slide

36 Showing ordered pairs of integers are countably infinite A one-to-one correspondence

37 Quick survey I felt I understood the material in this slide set… I felt I understood the material in this slide set… a) Very well b) With some review, I’ll be good c) Not really d) Not at all

38 Quick survey The pace of the lecture for this slide set was… The pace of the lecture for this slide set was… a) Fast b) About right c) A little slow d) Too slow

39 Quick survey How interesting was the material in this slide set? Be honest! How interesting was the material in this slide set? Be honest! a) Wow! That was SOOOOOO cool! b) Somewhat interesting c) Rather borting d) Zzzzzzzzzzz

40 Today’s demotivators