CSCE 222 Discrete Structures for Computing Sequences, Sums, and Products Dr. Philip C. Ritchey Sequences β’ A sequence is a function from a subset of the integers to a set π. β’ A discrete structure used to represent an ordered list β’ ππ denotes the sequence π0 , π1 , π2 , β¦ β’ Sometimes the sequence will start at π1 β’ ππ is a term of the sequence β’ Example β’ 1, 2, 3, 5, 8 is a sequence with five terms β’ 1, 3, 9, 27, β¦ , 3π , β¦ is an infinite sequence β’ What is the function which generates the terms of the sequence 5, 7, 9, 11, β¦ ? β’ If π0 = 5 β’ ππ = 5 + 2π β’ If if π1 = 5 β’ ππ = 3 + 2π Geometric Progression β’ A geometric progression is a sequence of the form π, ππ, ππ 2 , ππ 3 , β¦ where the initial term π and the common ratio π are real numbers. β’ Example 1 1 1 β’ 1, , , , β¦ 2 4 8 β’ What is the initial term π and common ratio π? β’ π=1 1 β’ π=2 β’ ππ = ππ π β’ ππ = 1 π 2 Arithmetic Progression β’ An arithmetic progression is a sequence of the form π, π + π, π + 2π, β¦ where the initial term π and the common difference π are real numbers. β’ Example β’ β1, 3, 7, 11, β¦ β’ What is the initial term π and common difference π? β’ β’ β’ β’ π = β1 π=4 ππ = π + ππ ππ = β1 + 4π Exercises List the first several terms of these sequences: β’ the sequence ππ , where ππ = π + 1 β’ 1, 4, 27, 256, 3125,β¦ π+1 . β’ the sequence that begins with 2 and in which each successive term is 3 more than the preceding term. β’ 2, 5, 8, 11, 14, β¦ β’ ππ = 2 + 3π β’ the sequence that begins with 3, where each succeeding term is twice the preceding term. β’ 3, 6, 12 ,24, 48, β¦ β’ ππ = 3 β 2π β’ the sequence where the πth term is the number of letters in the English word for the index n. β’ 4, 3, 3, 5, 4, 4, 3, 5, 5, 4, 3, 6, β¦ Recurrence Relations β’ A recurrence relation for the sequence ππ is an equation that expresses ππ in terms of one or more of the previous terms of the sequence. β’ Geometric progression: ππ = ππ π β’ Recurrence relation: ππ = πππβ1 , π0 = π β’ Arthmetic progression: ππ = π + ππ β’ Recurrence relation: ππ = ππβ1 + π, π0 = π (π0 is the initial condition) β’ Fibonacci Sequence: ππ = 0, 1, 1, 2, 3, 5, 8, 13, β¦ β’ ππ = ππβ1 + ππβ2 , π0 = 0, π1 = 1 β’ Factorials: 1, 1, 2, 6, 24, 120, 720, 5040, β¦ β’ π! = π π β 1 π β 2 β― 2 β 1 β’ ππ = πππβ1 , π0 = 1 Solving Recurrence Relations β’ A sequence is called a solution of a recurrence relation if its terms satisfy the recurrence relation. β’ To solve a recurrence relation, find a closed formula (explicit formula) for the terms of the sequence. β’ Closed formulae do not involve previous terms of the sequence. β’ Example β’ Relations of the form ππ = πππβ1 β’ Geometric progression β’ Closed form: ππ = ππ π β’ Relations of the form ππ = ππβ1 + π β’ Arithmetic progression β’ Closed form: ππ = π + ππ Technique for Solving Recurrence Relations β’ Iteration β’ Forward: work forward from the initial term until a pattern emerges. Then guess the form of the solution. β’ Backward: work backward from an toward π0 until a pattern emerges. The guess the form of the solution. β’ Example: ππ = ππβ1 + 3, β’ Forward β’ β’ β’ β’ β’ π1 = 2 + 3 π2 = 2 + 3 + 3 = 2 + 2 β 3 π3 = 2 + 2 β 3 + 3 = 2 + 3 β 3 β¦ ππ = 2 + 3π π0 = 2 β’ Backward β’ β’ β’ β’ β’ ππ ππ ππ β¦ ππ = ππβ2 + 3 + 3 = ππβ2 + 2 β 3 = ππβ3 + 3 + 2 β 3 = ππβ3 + 3 β 3 = ππβ4 + 3 + 3 β 3 = ππβ4 + 4 β 3 = ππβπ + π β 3 = π0 + 3π = 2 + 3π Exercises β’ Find the first few terms of a solution to the recurrence relation ππ = ππβ1 + 2π + 3, π0 = 4 β’ β’ β’ β’ π1 = 4 + 2 1 + 3 = 9 π2 = 9 + 2 2 + 3 = 16 π3 = 16 + 2 3 + 3 = 25 ... β’ Solve the recurrence relation above. β’ From the first few terms, the pattern seems to be ππ = π + 2 2 β’ This can be proved, but we need techniques we havenβt learned yet. Exercises Continued β’ Find and solve a recurrence relation for the sequence 0, 1, 3, 6, 10, 15,β¦ β’ β’ β’ β’ Take differences: 1 - 0 = 1, 3 - 1 = 2, 6 β 3 = 3, 10 β 6 = 4, 15 β 10 = 5, β¦ Write down the relation: ππ = ππβ1 + π, π0 = 0 Use backwards iteration ππ = ππβ1 + π β’ β’ β’ β’ β’ = ππβ2 + π β 1 + π = ππβ3 + π β 2 + π β 1 + π β¦ = π0 + 1 + 2 + β― + π = 0 + 1 + 2 + β―+ π β’ The sum of the integers from 1 to π is β’ ππ = π π+1 2 π π+1 2 Summations β’ The sum of the π through π-th terms of sequence ππ ππ + ππ+1 + β― + ππ is denoted as π ππ π=π where π is the index of summation, π is the lower limit, and π is the upper limit. Examples β’ Use summation notation to express the sum from 1 to 100 of 100 β’ Evaluate 3 π=0 π=1 1 π 1 : π₯ 2π + 1 3 2π + 1 = 2 β 0 + 1 + 2 β 1 + 1 + 2 β 2 + 1 + 2 β 3 + 1 π=0 = 1 + 3 + 5 + 7 = 16 Manipulations of Summation Notation π πππ = π π π ππ = π=π π π=π π=π π ππ + π = ππ π=π+1 πβπ π=π πβπ ππ+π = π=0 π ππ + π π β π + 1 π=π ππ + ππ = ππ + ππ π π=π π π ππ + π=π ππ = π π π=π ππ π π=0 π ππ = π=π ππβπ πβ1 ππ β π=0 ππ π=0 Exercises β’ Evaluate 10 3 β’ 3+3+3+3+3+3+3+3+3+3 = 30 π=1 β’ Let π = 1,3,5,7 . Evaluate π2 β’ 1+9+25+49 = 84 β’ Evaluate πβπ 8 3 β 2π β’ 3 8 π π=0 2 π=0 = 3 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 = 1533 Summation Identities β’ There are MANY, but here are two you should know: β’ Geometric Series β’ Arithmetic Series π πβ1 π π π = πβ1 π=0 πβ1 πβ1 π=0 π=1 πβ 1 π πβ1 π= 2 Geometric Series Identity Proof π β 1 πβ1 Let πβ1 ππ S= π=0 πβ1 ππ πS = π π=0 πβ1 = ππ + ππ β π0 = π=0 ππ = π + π π β 1 π π β 1 = ππ β 1 π π+1 ππ β 1 π= πβ1 ππ β‘ π=0 π = π=1 Products β’ The product of the π through π-th terms of sequence ππ ππ β ππ+1 β β― β ππ is denoted as π ππ π=π Example: π π! = π π=1 A Product Identity π π πππ = π πβπ+1 π=π π ππ π=π πππ = πππ πππ+1 β― πππ π=π = π π β― π β ππ ππ+1 β― ππ π = π π π=π 1 ππ π=π π = π πβπ+1 ππ π=π
© Copyright 2026 Paperzz