Download - Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang ([email protected]) Department of Computer Science.

Transcript
Page 1: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

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

Page 2: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

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

Page 3: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

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:

Page 4: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

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

Page 5: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

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

Page 6: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

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

Page 7: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

Summation Example โ€“ Computing Summations

Let and . Compute the following:

a.

b.

c.

7

Page 8: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

Summation Example โ€“ Changing from Summation Notation to Expanded Form

Write the following summation in expanded form:

Solution:

8

Page 9: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

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

Page 10: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

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

โ‹ฏ

Page 11: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

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

Page 12: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

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

Page 13: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

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

Page 14: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

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

Page 15: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

Product Notation Example โ€“ Computing Products

Compute the following products:

a.

b.

Solution:

a.

b.15

Page 16: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

Properties of Summations and Products

16

Page 17: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

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

Page 18: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

Properties of Summation & Product Exercise

Solution:

a.

18

Page 19: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

Properties of Summation & Product Exercise

Solution:

b.

19

Page 20: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

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

Page 21: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

Change of Variable Exercise 1

summation: change of variable:

21

Page 22: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

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

Page 23: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

Factorial Notation

A recursive definition for factorial is the following: Given any nonnegative integer ,

23

Page 24: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

Simplify the following expressions:

a. b. c.

d. e.

Solution:

a.

b.

Factorials Exercise

24

d.

e.

Page 25: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

Factorials Exercise Solution

c.

25

Page 26: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

โ€œ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}.

Page 27: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

โ€œn Choose rโ€ Exercise

Use the formula for computing to evaluate the following expressions:

a. b. c.

Solution:

a.

27

Page 28: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

b.

c.

โ€œn Choose rโ€ Exercise

28

Page 29: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

n Choose r Properties

โ€ข for

โ€ข for โ€ข for โ€ข for

29

Page 30: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

ExerciseProve that for all nonnegative integers and with ,

.

30

Page 31: Chapter 5: Sequences, Mathematical Induction and Recursion Discrete Mathematics and Applications Yan Zhang (yzhang16@usf.edu) Department of Computer Science.

ExerciseProve that for all nonnegative integers and with ,

.

Hint:

31