Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Chapter 5: Sequences, Mathematical Induction and Recursion 5.1 Sequences Yan Zhang (yzhang16@usf.edu) Department of Computer Science and Engineering, USF
Sequences A sequence is a function. Function 𝑓 : 𝐴 → 𝐵 Not allowed Every element 𝑥 in 𝐴 is mapped to only one element 𝑦 in 𝐵, such that (𝑥, 𝑦)∈𝑓. Domain: A 𝑓 : 𝐴 → 𝐵 Codomain: B Not allowed
Sequences Finite sequences: 𝑎 𝑚 , 𝑎 𝑚+1 , 𝑎 𝑚+2 , ⋯, 𝑎 𝑛 Definition A sequence is a function. Domain is either all the integers between two given integers or all the integers greater than or equal to a given integer. Finite sequences: 𝑎 𝑚 , 𝑎 𝑚+1 , 𝑎 𝑚+2 , ⋯, 𝑎 𝑛 Domain 𝑚 𝑚+1 𝑚+2 ⋯ 𝑛 Codomain 𝑎 𝑚 𝑎 𝑚+1 𝑎 𝑚+2 𝑎 𝑛 Infinite sequences: 𝑎 𝑚 , 𝑎 𝑚+1 , 𝑎 𝑚+2 , ⋯ Domain 𝑚 𝑚+1 𝑚+2 ⋯ Codomain 𝑎 𝑚 𝑎 𝑚+1 𝑎 𝑚+2 𝑎𝑘 (read “𝑎 sub 𝑘”) is called a term. 𝑘 in 𝑎𝑘 is called a subscript or index. Initial term: 𝑎 𝑚 Final term: 𝑎 𝑛
Sequence Example 1 Finding Terms of Sequences Given by Explicit Formulas Define sequences 𝑎1, 𝑎2, 𝑎3,… and 𝑏2, 𝑏3, 𝑏4,… by the following explicit formulas: Compute the first five terms of both sequences. Solution: 𝑎 1 = 1 1+1 = 1 2 , 𝑎 2 = 2 2+1 = 2 3 , 𝑎 3 = 3 3+1 = 3 4 , 𝑎 4 = 4 4+1 = 4 5 , 𝑎 5 = 5 5+1 = 5 6 𝑏 2 = 2−1 2 = 1 2 , 𝑏 3 = 3−1 3 = 2 3 , 𝑏 4 = 4−1 4 = 3 4 , 𝑏 5 = 5−1 5 = 4 5 , 𝑏 6 = 6−1 6 = 5 6 Note: all terms of both sequences are identical.
Sequence Example 2 Finding an Explicit Formulas to Fit Given Initial Terms Find an explicit formula for a sequence that has the following initial terms: 1, − 1 4 , 1 9 , − 1 16 , 1 25 , − 1 36 , ⋯ Solution: Denote the general term of the sequence by 𝑎 𝑘 and suppose the first term is 𝑎 1 . 𝑎 1 = 1 1 2 , 𝑎 2 =(−1) 1 2 2 , 𝑎 3 = 1 3 2 , 𝑎 4 =(−1) 1 4 2 , 𝑎 5 = 1 5 2 , 𝑎 6 =(−1) 1 6 2 An explicit formulator that gives the correct first six terms is: 𝑎 𝑘 = (−1) 𝑘+1 1 𝑘 2
Summation Notation Given a sequence 𝑎 𝑚 , 𝑎 𝑚+1 , 𝑎 𝑚+2 , ⋯, 𝑎 𝑛 , The summation from 𝑘 equals 𝑚 to 𝑛 of 𝑎-sub-𝑘: 𝑘=𝑚 𝑛 𝑎 𝑘 = 𝑎 𝑚 + 𝑎 𝑚+1 + ⋯ +𝑎 𝑛 Domain 𝑚 𝑚+1 𝑚+2 ⋯ 𝑛 Codomain 𝑎 𝑚 𝑎 𝑚+1 𝑎 𝑚+2 𝑎 𝑛 Summation notation Expanded form 𝑘: the index of the summation 𝑚: the lower limit of the summation 𝑛: the upper limit of the summation
Summation Example – Computing Summations Let 𝑎1 = −2, 𝑎2 = −1, 𝑎3 = 0, 𝑎4 = 1, and 𝑎5 = 2. Compute the following: 𝑘=1 5 𝑎 𝑘 𝑘=1 5 𝑎 𝑘 = 𝑎 1 + 𝑎 2 + 𝑎 3 + 𝑎 4 + 𝑎 5 = −2 + −1 +0+1+2=0 𝑘=2 2 𝑎 𝑘 𝑘=2 2 𝑎 𝑘 = 𝑎 2 =−1 𝑘=1 2 𝑎 2𝑘 𝑘=1 2 𝑎 2𝑘 = 𝑎 2 + 𝑎 4 = −1 +1=0
Summation Example – Changing from Summation Notation to Expanded Form Write the following summation in expanded form: Solution:
Summation Example – Changing from Expanded Form to Summation Notation Express the following using summation notation: Solution: The general term of this summation can be expressed as for integers k from 0 to n. Hence
Summation Notation - Recursive Definition If 𝑚 is any integer and 𝑚<𝑛, then Recursive definition is useful to rewrite a summation, by separating off the final term of a summation by adding a final term to a summation. 𝑘=𝑚 𝑚 𝑎 𝑘 = 𝑎 𝑚 𝑘=𝑚 𝑚+1 𝑎 𝑘 = 𝑘=𝑚 𝑚 𝑎 𝑘 + 𝑎 𝑚+1 𝑘=𝑚 𝑚+2 𝑎 𝑘 = 𝑘=𝑚 𝑚+1 𝑎 𝑘 + 𝑎 𝑚+2 ⋯ 𝑘=𝑚 𝑛 𝑎 𝑘 = 𝑘=𝑚 𝑛−1 𝑎 𝑘 + 𝑎 𝑛
Recursive Definition Example – Separating Off a Final Term and Adding On a Final Term a. Rewrite by separating off the final term. b. Write as a single summation. Solution: a. b.
Summation Notation - A Telescoping Sum In certain sums each term is a difference of two quantities. For example: 𝑎 𝑘 = 1 𝑘 − 1 𝑘+1 , 𝑘=𝑚, ⋯,𝑛 When you write such sums in expanded form, you sometimes see that all the terms cancel except the first and the last. 𝑎 𝑘 + 𝑎 𝑘+1 + 𝑎 𝑘+2 = 1 𝑘 − 1 𝑘+1 + 1 𝑘+1 − 1 𝑘+2 + 1 𝑘+2 − 1 𝑘+3 Successive cancellation of terms collapses the sum like a telescope.
A Telescoping Sum Example Some sums can be transformed into telescoping sums, which then can be rewritten as a simple expression. For instance, observe that Use this identity to find a simple expression for
Product Notation Given a sequence 𝑎 𝑚 , 𝑎 𝑚+1 , 𝑎 𝑚+2 , ⋯, 𝑎 𝑛 , The product from 𝑘 equals 𝑚 to 𝑛 of 𝑎-sub-𝑘: 𝑘=𝑚 𝑛 𝑎 𝑘 = 𝑎 𝑚 ∙ 𝑎 𝑚+1 ∙ ⋯ ∙𝑎 𝑛 Domain 𝑚 𝑚+1 𝑚+2 ⋯ 𝑛 Codomain 𝑎 𝑚 𝑎 𝑚+1 𝑎 𝑚+2 𝑎 𝑛 A recursive definition for the product notation is the following: If 𝑚 is any integer, then
Product Notation Example – Computing Products Compute the following products: a. b. Solution:
Properties of Summations and Products
Properties of Summation & Product Exercise Let 𝑎𝑘 = 𝑘 + 1 and 𝑏𝑘 = 𝑘 − 1 for all integers 𝑘. Write each of the following expressions as a single summation or product: a. b.
Properties of Summation & Product Exercise Solution: a.
Properties of Summation & Product Exercise Solution: b.
𝑖=𝑚 𝑛 𝑎 𝑖 = 𝑗=𝑚 𝑛 𝑎 𝑗 and 𝑖=𝑚 𝑛 𝑎 𝑖 = 𝑗=𝑚 𝑛 𝑎 𝑗 Change of Variable The index symbol in a summation or product is internal to summation or product. The index symbol can be replaced by any other symbol as long as the replacement is made in each location where the symbol occurs. 𝑖=𝑚 𝑛 𝑎 𝑖 = 𝑗=𝑚 𝑛 𝑎 𝑗 and 𝑖=𝑚 𝑛 𝑎 𝑖 = 𝑗=𝑚 𝑛 𝑎 𝑗 As a consequence, the index of a summation or a product is called a dummy variable. A dummy variable is a symbol that derives its entire meaning from its local context. Outside of that context, the symbol may have another meaning entirely.
Change of Variable Exercise 1 summation: change of variable:
Change of Variable Exercise 1 - Solution First calculate the lower and upper limits of the new summation: Thus the new sum goes from j = 1 to j = 7. Next calculate the general term of the new summation by replacing each occurrence of k by an expression in j : Finally, put the steps together to obtain
Factorial Notation A recursive definition for factorial is the following: Given any nonnegative integer 𝑛,
Factorials Exercise Simplify the following expressions: a. b. c. d. e. Solution: a. b. d. e.
Factorials Exercise Solution
“n Choose r ” Notation Chose 2 objects from {a,b,c,d}: {a, b}, {a, c}, {a, d}, {b, c}, {b,d}, and {c, d}.
“n Choose r” Exercise Use the formula for computing to evaluate the following expressions: a. b. c. Solution: a.
“n Choose r” Exercise b. c.
n Choose r Properties 𝑛 𝑘 = 𝑛 𝑛−𝑘 for 0≤ 𝑘≤ 𝑛 𝑛 0 = 𝑛 𝑛 =1 𝑛 0 = 𝑛 𝑛 =1 𝑛 𝑘 = 𝑛 𝑘−1 𝑛−𝑘+1 𝑘 for 𝑘>0 𝑛 𝑘 = 𝑛−1 𝑘 𝑛 𝑛−𝑘 for 𝑘<𝑛 𝑛 𝑘 = 𝑛−1 𝑘−1 𝑛 𝑘 for 𝑛,𝑘>0
Exercise Prove that for all nonnegative integers 𝑛 and 𝑟 with 𝑟+1≤𝑛, 𝑛 𝑟+1 = 𝑛−𝑟 𝑟+1 𝑛 𝑟 .
Exercise Prove that for all nonnegative integers 𝑛 and 𝑟 with 𝑟+1≤𝑛, 𝑛 𝑟+1 = 𝑛−𝑟 𝑟+1 𝑛 𝑟 . Hint: 𝑛−𝑟 𝑟+1 𝑛 𝑟 = 𝑛−𝑟 𝑟+1 ∙ 𝑛! 𝑟! 𝑛−𝑟 ! = 𝑛−𝑟 𝑟+1 ∙ 𝑛! 𝑟! 𝑛−𝑟 ∙ 𝑛−𝑟−1 ! = 𝑛! (𝑟+1)! 𝑛−𝑟−1 ! = 𝑛 𝑟+1