CSCE 222 Discrete Structures for Computig Sequeces, Sums, ad Products Dr. Philip C. Ritchey
Sequeces A sequece is a fuctio from a subset of the itegers to a set S. A discrete structure used to represet a ordered list a deotes the sequece a 0, a 1, a 2, Sometimes the sequece will start at a 1 a is a term of the sequece Example 1, 2, 3, 5, 8 is a sequece with five terms 1, 3, 9, 27,, 3, is a ifiite sequece What is the fuctio which geerates the terms of the sequece 5, 7, 9, 11,? If a 0 = 5 a = 5 + 2 If if a 1 = 5 a = 3 + 2
Geometric Progressio A geometric progressio is a sequece of the form a, ar, ar 2, ar 3, where the iitial term a ad the commo ratio r are real umbers. Example 1, 1 2, 1 4, 1 8, What is the iitial term a ad commo ratio r? a = 1 r = 1 2 a = ar a = 1 2
Arithmetic Progressio A arithmetic progressio is a sequece of the form a, a + d, a + 2d, where the iitial term a ad the commo differece d are real umbers. Example 1, 3, 7, 11, What is the iitial term a ad commo differece d? a = 1 d = 4 a = a + d a = 1 + 4
Exercises List the first several terms of these sequeces: the sequece a, where a = + 1 +1. 1, 4, 27, 256, 3125, the sequece that begis with 2 ad i which each successive term is 3 more tha the precedig term. 2, 5, 8, 11, 14, a = 2 + 3 the sequece that begis with 3, where each succeedig term is twice the precedig term. 3, 6, 12,24, 48, a = 3 2 the sequece where the th term is the umber of letters i the Eglish word for the idex. 4, 3, 3, 5, 4, 4, 3, 5, 5, 4, 3, 6,
Recurrece Relatios A recurrece relatio for the sequece a is a equatio that expresses a i terms of oe or more of the previous terms of the sequece. Geometric progressio: a = ar Recurrece relatio: a = ra 1, a 0 = a Arthmetic progressio: a = a + d Recurrece relatio: a = a 1 + d, a 0 = a Fiboacci Sequece: f = 0, 1, 1, 2, 3, 5, 8, 13, f = f 1 + f 2, f 0 = 0, f 1 = 1 Factorials: 1, 1, 2, 6, 24, 120, 720, 5040,! = 1 2 2 1 a = a 1, a 0 = 1 (a 0 is the iitial coditio)
Solvig Recurrece Relatios A sequece is called a solutio of a recurrece relatio if its terms satisfy the recurrece relatio. To solve a recurrece relatio, fid a closed formula (explicit formula) for the terms of the sequece. Closed formulae do ot ivolve previous terms of the sequece. Example Relatios of the form a = ra 1 Geometric progressio Closed form: a = ar Relatios of the form a = a 1 + d Arithmetic progressio Closed form: a = a + d
Techique for Solvig Recurrece Relatios Iteratio Forward: work forward from the iitial term util a patter emerges. The guess the form of the solutio. Backward: work backward from a toward a 0 util a patter emerges. The guess the form of the solutio. Example: a = a 1 + 3, a 0 = 2 Forward a 1 = 2 + 3 a 2 = 2 + 3 + 3 = 2 + 2 3 a 3 = 2 + 2 3 + 3 = 2 + 3 3 a = 2 + 3 Backward a = a 2 + 3 + 3 = a 2 + 2 3 a = a 3 + 3 + 2 3 = a 3 + 3 3 a = a 4 + 3 + 3 3 = a 4 + 4 3 a = a + 3 = a 0 + 3 = 2 + 3
Exercises Fid the first few terms of a solutio to the recurrece relatio a = a 1 + 2 + 3, a 0 = 4 a 1 = 4 + 2 1 + 3 = 9 a 2 = 9 + 2 2 + 3 = 16 a 3 = 16 + 2 3 + 3 = 25... Solve the recurrece relatio above. From the first few terms, the patter seems to be a = + 2 2 This ca be proved, but we eed techiques we have t leared yet.
Exercises Cotiued Fid ad solve a recurrece relatio for the sequece 0, 1, 3, 6, 10, 15, Take differeces: 1-0 = 1, 3-1 = 2, 6 3 = 3, 10 6 = 4, 15 10 = 5, Write dow the relatio: a = a 1 +, a 0 = 0 Use backwards iteratio a = a 1 + = a 2 + 1 + = a 3 + 2 + 1 + = a 0 + 1 + 2 + + a = = 0 + 1 + 2 + + The sum of the itegers from 1 to is +1 2 +1 2
Summatios The sum of the m through -th terms of sequece a k a m + a m+1 + + a is deoted as where i is the idex of summatio, m is the lower limit, ad is the upper limit. a i
Examples Use summatio otatio to express the sum from 1 to 100 of 1 x : 3 Evaluate i=0 2i + 1 100 i=1 1 i 3 i=0 2i + 1 = 2 0 + 1 + 2 1 + 1 + 2 2 + 1 + 2 3 + 1 = 1 + 3 + 5 + 7 = 16
Maipulatios of Summatio Notatio l ca i = c a i a i = a i + a i i i i=l+1 m m a i + b i = a i + b i a i = a j+m = a k j=0 k=0 m 1 a i + c = a i + c m + 1 a i = a i a i i=0 i=0
Exercises Evaluate 3+3+3+3+3+3+3+3+3+3 = 30 Let S = 1,3,5,7. Evaluate 1+9+25+49 = 84 Evaluate 3 8 i=0 10 i=1 j S 3 j 2 3 2 i 8 i=0 2 i = 3 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 = 1533
Summatio Idetities There are MANY, but here are two you should kow: Geometric Series 1 i=0 r i = r 1 r 1 r = 1 r 1 Arithmetic Series 1 i=0 i = 1 2
Geometric Series Idetity Proof r 1 1 Let S = r i i=0 1 = r j j=0 + r r 0 rs = r 1 1 r i i=0 = r i+1 i=0 = r j j=1 rs = S + r 1 S r 1 = r 1 S = r 1 r 1
Products The product of the m through -th terms of sequece a k a m a m+1 a is deoted as a i Example:! = i=1 i
A Product Idetity ca i = c m+1 a i ca i = ca m ca m+1 ca = c c c a m a m+1 a = c 1 a i = c m+1 a i