chapter 5: sequences, mathematical induction and recursion discrete mathematics and applications yan...
TRANSCRIPT
Chapter 5: Sequences, Mathematical Induction and Recursion
Discrete Mathematics and Applications
Yan Zhang ([email protected])
Department of Computer Science and Engineering, USF
5.1 Sequences
Sequences
2
• A sequence is a function.
• Function – Every element in is mapped to only one element in , such that .
Domain: A Codomain: B𝑓 : 𝐴→𝐵
Not allowed
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.
Sequences
3
Domain
Codomain
Domain
Codomain
Finite sequences:
Infinite sequences:
(read “ sub ”) is called a term. in is called a subscript or index.
Initial term: Final term:
Sequence Example 1Finding Terms of Sequences Given by Explicit Formulas
Define sequences and by the following explicit formulas:
Compute the first five terms of both sequences.
Solution:
,,,
Note: all terms of both sequences are identical.
4
Sequence Example 2Finding an Explicit Formulas to Fit Given Initial Terms
Find an explicit formula for a sequence that has the following initial terms:
Solution:
• Denote the general term of the sequence by and suppose the first term is .
,• An explicit formulator that gives the correct first six terms is:
5
Summation Notation
6
Domain
Codomain
Given a sequence ,
The summation from equals to of -sub-:
: the index of the summation: the lower limit of the summation: the upper limit of the summation
Summation notation Expanded form
Summation Example – Computing Summations
Let and . Compute the following:
a.
b.
c.
7
Summation Example – Changing from Summation Notation to Expanded Form
Write the following summation in expanded form:
Solution:
8
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
9
Summation Notation - Recursive DefinitionIf 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.
10
∑𝑘=𝑚
𝑛
𝑎𝑘=∑𝑘=𝑚
𝑛−1
𝑎𝑘+𝑎𝑛
∑𝑘=𝑚
𝑚
𝑎𝑘=𝑎𝑚
∑𝑘=𝑚
𝑚+1
𝑎𝑘=∑𝑘=𝑚
𝑚
𝑎𝑘+𝑎𝑚+1
∑𝑘=𝑚
𝑚+2
𝑎𝑘=∑𝑘=𝑚
𝑚+1
𝑎𝑘+𝑎𝑚+2
⋯
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.
11
Summation Notation - A Telescoping Sum
• In certain sums each term is a difference of two quantities.
For example:
• When you write such sums in expanded form, you sometimes see that all the terms cancel except the first and the last.
• Successive cancellation of terms collapses the sum like a telescope.
12
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
13
Product Notation
14
Domain
Codomain
Given a sequence ,
The product from equals to of -sub-:
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:
a.
b.15
Properties of Summations and Products
16
Properties of Summation & Product Exercise
Let and for all integers . Write each of the following expressions as a single summation or product:
a. b.
17
Properties of Summation & Product Exercise
Solution:
a.
18
Properties of Summation & Product Exercise
Solution:
b.
19
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.
20
Change of Variable Exercise 1
summation: change of variable:
21
Change of Variable Exercise 1 - Solution
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
22
Factorial Notation
A recursive definition for factorial is the following: Given any nonnegative integer ,
23
Simplify the following expressions:
a. b. c.
d. e.
Solution:
a.
b.
Factorials Exercise
24
d.
e.
Factorials Exercise Solution
c.
25
“n Choose r ” Notation
26
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.
27
b.
c.
“n Choose r” Exercise
28
n Choose r Properties
• for
• for • for • for
29
ExerciseProve that for all nonnegative integers and with ,
.
30
ExerciseProve that for all nonnegative integers and with ,
.
Hint:
31