28.7 KB · commit a9602da
Sequences are ordered lists of elements, used in discrete mathematics in many ways. For example, they can be used to represent solutions to certain counting problems, as we will see in Chapter 8. They are also an important data structure in computer science. We will often need to work with sums of terms of sequences in our study of discrete mathematics. This section reviews the use of summation notation, basic properties of summations, and formulas for the sums of terms of some particular types of sequences.
The terms of a sequence can be specified by providing a formula for each term of the sequence. In this section we describe another way to specify the terms of a sequence using a recurrence relation, which expresses each term as a combination of the previous terms. We will introduce one method, known as iteration, for finding a closed formula for the terms of a sequence specified via a recurrence relation. Identifying a sequence when the first few terms are provided is a useful skill when solving problems in discrete mathematics. We will provide some tips, including a useful tool on the Web, for doing so.
A sequence is a discrete structure used to represent an ordered list. For example, 1,2,3,5,8 is a sequence with five terms and 1,3,9,27,81,…,3n,… is an infinite sequence.
We use the notation {an} to describe the sequence. (Note that an represents an individual term of the sequence {an}. Be aware that the notation {an} for a sequence conflicts with the notation for a set. However, the context in which we use this notation will always make it clear when we are dealing with sets and when we are dealing with sequences. Moreover, although we have used the letter a in the notation for a sequence, other letters or expressions may be used depending on the sequence under consideration. That is, the choice of the letter a is arbitrary.)
We describe sequences by listing the terms of the sequence in order of increasing subscripts.
Consider the sequence {an}, where an=n1. The list of the terms of this sequence, beginning with a1, namely, a1,a2,a3,a4,…, starts with 1,21,31,41,…. ◀
The sequences {bn} with bn=(−1)n, {cn} with cn=2⋅5n, and {dn} with dn=6⋅(1/3)n are geometric progressions with initial term and common ratio equal to 1 and −1; 2 and 5; and 6 and 1/3, respectively, if we start at n=0. The list of terms b0,b1,b2,b3,b4,… begins with 1,−1,1,−1,1,…; the list of terms c0,c1,c2,c3,c4,… begins with 2,10,50,250,1250,…; and the list of terms d0,d1,d2,d3,d4,… begins with 6,2,32,92,272,…. ◀
The sequences {sn} with sn=−1+4n and {tn} with tn=7−3n are both arithmetic progressions with initial terms and common differences equal to −1 and 4, and 7 and −3, respectively, if we start at n=0. The list of terms s0,s1,s2,s3,… begins with −1,3,7,11,…, and the list of terms t0,t1,t2,t3,… begins with 7,4,1,−2,…. ◀
Sequences of the form a1,a2,…,an are often used in computer science. These finite sequences are also called strings. This string is also denoted by a1a2…an. (Recall that bit strings, which are finite sequences of bits, were introduced in Section 1.1.) The length of a string is the number of terms in this string. The empty string, denoted by λ, is the string that has no terms. The empty string has length zero.
The string abcd is a string of length four. ◀
In Examples 1–3 we specified sequences by providing explicit formulas for their terms. There are many other ways to specify a sequence. For example, another way to specify a sequence is to provide one or more initial terms together with a rule for determining subsequent terms from those that precede them.
Let {an} be a sequence that satisfies the recurrence relation an=an−1+3 for n=1,2,3,…, and suppose that a0=2. What are a1,a2, and a3?
Solution: We see from the recurrence relation that a1=a0+3=2+3=5. It then follows that a2=5+3=8 and a3=8+3=11. ◀
Let {an} be a sequence that satisfies the recurrence relation an=an−1−an−2 for n=2,3,4,…, and suppose that a0=3 and a1=5. What are a2 and a3?
Solution: We see from the recurrence relation that a2=a1−a0=5−3=2 and a3=a2−a1=2−5=−3. We can find a4,a5, and each successive term in a similar way. ◀
The initial conditions for a recursively defined sequence specify the terms that precede the first term where the recurrence relation takes effect. For instance, the initial condition in Example 5 is a0=2, and the initial conditions in Example 6 are a0=3 and a1=5. Using mathematical induction, a proof technique introduced in Chapter 5, it can be shown that a recurrence relation together with its initial conditions determines a unique solution.
Next, we define a particularly useful sequence defined by a recurrence relation, known as the Fibonacci sequence, after the Italian mathematician Fibonacci. We will study this sequence in depth in Chapters 5 and 8, where we will see why it is important for many applications, including modeling the population growth of rabbits.
Find the Fibonacci numbers f2,f3,f4,f5, and f6.
Solution: The recurrence relation for the Fibonacci sequence tells us that we find successive terms by adding the previous two terms. Because the initial conditions tell us that f0=0 and f1=1, using the recurrence relation in the definition we find that f2=f1+f0=1+0=1, f3=f2+f1=1+1=2, f4=f3+f2=2+1=3, f5=f4+f3=3+2=5, f6=f5+f4=5+3=8. ◀
Suppose that {an} is the sequence of integers defined by an=n!, the value of the factorial function at the integer n, where n=1,2,3,…. Because n!=n((n−1)(n−2)⋯2⋅1)=n(n−1)!=nan−1, we see that the sequence of factorials satisfies the recurrence relation an=nan−1, together with the initial condition a1=1. ◀
We say that we have solved the recurrence relation together with the initial conditions when we find an explicit formula, called a closed formula, for the terms of the sequence.
Determine whether the sequence {an}, where an=3n for every nonnegative integer n, is a solution of the recurrence relation an=2an−1−an−2 for n=2,3,4,…. Answer the same question where an=2n and where an=5.
Solution: Suppose that an=3n for every nonnegative integer n. Then, for n≥2, we see that 2an−1−an−2=2(3(n−1))−3(n−2)=3n=an. Therefore, {an}, where an=3n, is a solution of the recurrence relation.
Suppose that an=2n for every nonnegative integer n. Note that a0=1, a1=2, and a2=4. Because 2a1−a0=2⋅2−1=3=a2, we see that {an}, where an=2n, is not a solution of the recurrence relation.
Suppose that an=5 for every nonnegative integer n. Then for n≥2, we see that 2an−1−an−2=2⋅5−5=5=an. Therefore, {an}, where an=5, is a solution of the recurrence relation. ◀
Many methods have been developed for solving recurrence relations. Here, we will introduce a straightforward method known as iteration via several examples. In Chapter 8 we will study recurrence relations in depth. In that chapter we will show how recurrence relations can be used to solve counting problems and we will introduce several powerful methods that can be used to solve many different recurrence relations.
Solve the recurrence relation and initial condition in Example 5.
Solution: We can successively apply the recurrence relation in Example 5, starting with the initial condition a1=2, and working upward until we reach an to deduce a closed formula for the sequence. We see that a2=2+3 a3=(2+3)+3=2+3⋅2 a4=(2+2⋅3)+3=2+3⋅3 … an=an−1+3=(2+3⋅(n−2))+3=2+3(n−1).
We can also successively apply the recurrence relation in Example 5, starting with the term an and working downward until we reach the initial condition a1=2 to deduce this same formula. The steps are an=an−1+3 =(an−2+3)+3=an−2+3⋅2 =(an−3+3)+3⋅2=an−3+3⋅3 … =a2+3(n−2)=(a1+3)+3(n−2)=2+3(n−1).
At each iteration of the recurrence relation, we obtain the next term in the sequence by adding 3 to the previous term. We obtain the nth term after n−1 iterations of the recurrence relation. Hence, we have added 3(n−1) to the initial term a1=2 to obtain an. This gives us the closed formula an=2+3(n−1). Note that this sequence is an arithmetic progression. ◀
The technique used in Example 10 is called iteration. We have iterated, or repeatedly used, the recurrence relation. The first approach is called forward substitution – we found successive terms beginning with the initial condition and ending with an. The second approach is called backward substitution, because we began with an and iterated to express it in terms of earlier terms of the sequence until we found it in terms of a1. Note that when we use iteration, we essentially guess a formula for the terms of the sequence. To prove that our guess is correct, we need to use mathematical induction, a technique we discuss in Chapter 5.
In Chapter 8 we will show that recurrence relations can be used to model a wide variety of problems. We provide one such example here, showing how to use a recurrence relation to find compound interest.
Suppose that a person deposits \10,000inasavingsaccountatabankyielding11%$ per year with interest compounded annually. How much will be in the account after 30 years?
Solution: To solve this problem, let Pn denote the amount in the account after n years. Because the amount in the account after n years equals the amount in the account after n−1 years plus interest for the nth year, we see that the sequence {Pn} satisfies the recurrence relation Pn=Pn−1+0.11Pn−1=(1.11)Pn−1. The initial condition is P0=10,000.
We can use an iterative approach to find a formula for Pn. Note that P1=(1.11)P0 P2=(1.11)P1=(1.11)2P0 P3=(1.11)P2=(1.11)3P0 … Pn=(1.11)Pn−1=(1.11)nP0. When we insert the initial condition P0=10,000, the formula Pn=(1.11)n10,000 is obtained. Inserting n=30 into the formula Pn=(1.11)n10,000 shows that after 30 years the account contains P30=(1.11)3010,000=$228,922.97. ◀
A common problem in discrete mathematics is finding a closed formula, a recurrence relation, or some other type of general rule for constructing the terms of a sequence. Sometimes only a few terms of a sequence solving a problem are known; the goal is to identify the sequence. Even though the initial terms of a sequence do not determine the entire sequence (after all, there are infinitely many different sequences that start with any finite set of initial terms), knowing the first few terms may help you make an educated conjecture about the identity of your sequence. Once you have made this conjecture, you can try to verify that you have the correct sequence.
When trying to deduce a possible formula, recurrence relation, or some other type of rule for the terms of a sequence when given the initial terms, try to find a pattern in these terms. You might also see whether you can determine how a term might have been produced from those preceding it. There are many questions you could ask, but some of the more useful are:
Find formulae for the sequences with the following first five terms: (a) 1,1/2,1/4,1/8,1/16 (b) 1,3,5,7,9 (c) 1,−1,1,−1,1.
Solution: (a) We recognize that the denominators are powers of 2. The sequence with an=1/2n, n=0,1,2,… is a possible match. This proposed sequence is a geometric progression with a=1 and r=1/2. (b) We note that each term is obtained by adding 2 to the previous term. The sequence with an=2n+1, n=0,1,2,… is a possible match. This proposed sequence is an arithmetic progression with a=1 and d=2. (c) The terms alternate between 1 and −1. The sequence with an=(−1)n, n=0,1,2,… is a possible match. This proposed sequence is a geometric progression with a=1 and r=−1. ◀
Examples 13–15 illustrate how we can analyze sequences to find how the terms are constructed.
How can we produce the terms of a sequence if the first 10 terms are 1,2,2,3,3,3,4,4,4,4?
Solution: In this sequence, the integer 1 appears once, the integer 2 appears twice, the integer 3 appears three times, and the integer 4 appears four times. A reasonable rule for generating this sequence is that the integer n appears exactly n times, so the next five terms of the sequence would all be 5, the following six terms would all be 6, and so on. The sequence generated this way is a possible match. ◀
How can we produce the terms of a sequence if the first 10 terms are 5,11,17,23,29,35,41,47,53,59?
Solution: Note that each of the first 10 terms of this sequence after the first is obtained by adding 6 to the previous term. (We could see this by noticing that the difference between consecutive terms is 6.) Consequently, the nth term could be produced by starting with 5 and adding 6 a total of n−1 times; that is, a reasonable guess is that the nth term is 5+6(n−1)=6n−1. (This is an arithmetic progression with a=5 and d=6.) ◀
How can we produce the terms of a sequence if the first 10 terms are 1,3,4,7,11,18,29,47,76,123?
Solution: Observe that each successive term of this sequence, starting with the third term, is the sum of the two previous terms. That is, 4=3+1, 7=4+3, 11=7+4, and so on. Consequently, if Ln is the nth term of this sequence, we guess that the sequence is determined by the recurrence relation Ln=Ln−1+Ln−2 with initial conditions L1=1 and L2=3 (the same recurrence relation as the Fibonacci sequence, but with different initial conditions). This sequence is known as the Lucas sequence, after the French mathematician François Édouard Lucas. Lucas studied this sequence and the Fibonacci sequence in the nineteenth century. ◀
Another useful technique for finding a rule for generating the terms of a sequence is to compare the terms of a sequence of interest with the terms of a well-known integer sequence, such as terms of an arithmetic progression, terms of a geometric progression, perfect squares, perfect cubes, and so on. The first 10 terms of some sequences you may want to keep in mind are displayed in Table 1.
| nth Term | First 10 Terms |
|---|---|
| n2 | 1,4,9,16,25,36,49,64,81,100,… |
| n3 | 1,8,27,64,125,216,343,512,729,1000,… |
| n4 | 1,16,81,256,625,1296,2401,4096,6561,10000,… |
| 2n | 2,4,8,16,32,64,128,256,512,1024,… |
| 3n | 3,9,27,81,243,729,2187,6561,19683,59049,… |
| n! | 1,2,6,24,120,720,5040,40320,362880,3628800,… |
| fn | 1,1,2,3,5,8,13,21,34,55,89,… |
Conjecture a simple formula for an if the first 10 terms of the sequence {an} are 1,7,25,79,241,727,2185,6559,19681,59047.
Solution: To attack this problem, we begin by looking at the difference of consecutive terms, but we do not see a pattern. When we form the ratio of consecutive terms to see whether each term is a multiple of the previous term, we find that this ratio, although not a constant, is close to 3. So it is reasonable to suspect that the terms of this sequence are generated by a formula involving 3n. Comparing these terms with the corresponding terms of the sequence {3n}, we notice that the nth term is 2 less than the corresponding power of 3. We see that an=3n−2 for 1≤n≤10 and conjecture that this formula holds for all n. ◀
We will see throughout this text that integer sequences appear in a wide range of contexts in discrete mathematics. Sequences we have encountered or will encounter include the sequence of prime numbers (Chapter 4), the number of ways to order n discrete objects (Chapter 6), the number of moves required to solve the famous Tower of Hanoi puzzle with n disks (Chapter 8), and the number of rabbits on an island after n months (Chapter 8).
Integer sequences appear in an amazingly wide range of subject areas besides discrete mathematics, including biology, engineering, chemistry, and physics, as well as in puzzles. An amazing database of over 200,000 different integer sequences can be found in the On-Line Encyclopedia of Integer Sequences (OEIS). This database was originated by Neil Sloane in the 1960s. The last printed version of this database was published in 1995 ([SIPI95]); the current encyclopedia would occupy more than 750 volumes of the size of the 1995 book with more than 10,000 new submissions a year. There is also a program accessible via the Web that you can use to find sequences from the encyclopedia that match initial terms you provide.
Next, we consider the addition of the terms of a sequence. For this we introduce summation notation. We begin by describing the notation used to express the sum of the terms am,am+1,…,an
from the sequence {an}. We use the notation j=m∑naj,j=m∑naj,orm≤j≤n∑aj (read as the sum from j=m to j=n of aj) to represent am+am+1+⋯+an.
Here, the variable j is called the index of summation, and the choice of the letter j as the variable is arbitrary; that is, we could have used any other letter, such as i or k. Or, in notation, j=m∑naj=i=m∑nai=k=m∑nak.
Here, the index of summation runs through all integers starting with its lower limit m and ending with its upper limit n. A large uppercase Greek letter sigma, ∑, is used to denote summation.
The usual laws for arithmetic apply to summations. For example, when a and b are real numbers, we have ∑j=1n(axj+byj)=a∑j=1nxj+b∑j=1nyj, where x1,x2,…,xn and y1,y2,…,yn are real numbers. (We do not present a formal proof of this identity here. Such a proof can be constructed using mathematical induction, a proof method we introduce in Chapter 5. The proof also uses the commutative and associative laws for addition and the distributive law of multiplication over addition.)
We give some examples of summation notation.
Use summation notation to express the sum of the first 100 terms of the sequence {aj}, where aj=1/j for j=1,2,3,….
Solution: The lower limit for the index of summation is 1, and the upper limit is 100. We write this sum as j=1∑100j1. ◀
What is the value of ∑j=15j2?
Solution: We have j=1∑5j2=12+22+32+42+52=1+4+9+16+25=55. ◀
What is the value of ∑k=48(−1)k?
Solution: We have k=4∑8(−1)k=(−1)4+(−1)5+(−1)6+(−1)7+(−1)8=1+(−1)+1+(−1)+1=1. ◀
Sometimes it is useful to shift the index of summation in a sum. This is often done when two sums need to be added but their indices of summation do not match. When shifting an index of summation, it is important to make the appropriate changes in the corresponding summand. This is illustrated by Example 20.
Suppose we have the sum j=1∑5j2 but want the index of summation to run between 0 and 4 rather than from 1 to 5. To do this, we let k=j−1. Then the new summation index runs from 0 (because k=1−1=0 when j=1) to 4 (because k=5−1=4 when j=5), and the term j2 becomes (k+1)2. Hence, j=1∑5j2=k=0∑4(k+1)2. It is easily checked that both sums are 1+4+9+16+25=55. ◀
Sums of terms of geometric progressions commonly arise (such sums are called geometric series). Theorem 1 gives us a formula for the sum of terms of a geometric progression.
To compute Sn, first multiply both sides of the equality by r and then manipulate the resulting sum as follows: rSn=rj=0∑narj=j=0∑narj+1=k=1∑n+1ark=(k=0∑nark)+(arn+1−a)=Sn+(arn+1−a)substituting summation formula for Snby the distributive propertyshifting the index of summation, with k=j+1removing k=n+1 term and adding k=0 termsubstituting Sn for summation formula From these equalities, we see that rSn=Sn+(arn+1−a). Solving for Sn shows that if r=1, then Sn=r−1arn+1−a. If r=1, then Sn=∑j=0narj=∑j=0na=(n+1)a.
Double summations arise in many contexts (as in the analysis of nested loops in computer programs). An example of a double summation is i=1∑4j=1∑3ij. To evaluate the double sum, first expand the inner summation and then continue by computing the outer summation: i=1∑4j=1∑3ij=i=1∑4(i+2i+3i)=i=1∑46i=6+12+18+24=60. ◀
We can also use summation notation to add all values of a function, or terms of an indexed set, where the index of summation runs over all values in a set. That is, we write s∈S∑f(s) to represent the sum of the values f(s), for all members s of S.
What is the value of ∑s∈{0,2,4}s?
Solution: Because ∑s∈{0,2,4}s represents the sum of the values of s for all the members of the set {0,2,4}, it follows that s∈{0,2,4}∑s=0+2+4=6. ◀
Certain sums arise repeatedly throughout discrete mathematics. Having a collection of formulae for such sums can be useful; Table 2 provides a small table of formulae for commonly occurring sums.
| Sum | Closed Form |
|---|---|
| k=0∑nark (r=0) | r−1arn+1−a, r=1 |
| k=1∑nk | 2n(n+1) |
| k=1∑nk2 | 6n(n+1)(2n+1) |
| k=1∑nk3 | 4n2(n+1)2 |
| k=0∑∞xk, ∥x∥<1 | 1−x1 |
| k=1∑∞kxk−1, ∥x∥<1 | (1−x)21 |
We derived the first formula in this table in Theorem 1. The next three formulae give us the sum of the first n positive integers, the sum of their squares, and the sum of their cubes. These three formulae can be derived in many different ways (for example, see Exercises 37 and 38). Also note that each of these formulae, once known, can easily be proved using mathematical induction, the subject of Section 5.1. The last two formulae in the table involve infinite series and will be discussed shortly.
Example 23 illustrates how the formulae in Table 2 can be useful.
Find ∑k=50100k2.
Solution: First note that because ∑k=1100k2=∑k=149k2+∑k=50100k2, we have k=50∑100k2=k=1∑100k2−k=1∑49k2. Using the formula ∑k=1nk2=n(n+1)(2n+1)/6 from Table 2 (and proved in Exercise 38), we see that k=50∑100k2=6100⋅101⋅201−649⋅50⋅99=338,350−40,425=297,925. ◀
Although most of the summations in this book are finite sums, infinite series are important in some parts of discrete mathematics. Infinite series are usually studied in a course in calculus and even the definition of these series requires the use of calculus, but sometimes they arise in discrete mathematics, because discrete mathematics deals with infinite collections of discrete elements. In particular, in our future studies in discrete mathematics, we will find the closed forms for the infinite series in Examples 24 and 25 to be quite useful.
(Requires calculus) Let x be a real number with ∣x∣<1. Find ∑n=0∞xn.
Solution: By Theorem 1 with a=1 and r=x we see that ∑n=0kxn=x−1xk+1−1. Because ∣x∣<1, xk+1 approaches 0 as k approaches infinity. It follows that n=0∑∞xn=k→∞limx−1xk+1−1=x−10−1=1−x1. ◀
We can produce new summation formulae by differentiating or integrating existing formulae.
(Requires calculus) Differentiating both sides of the equation k=0∑∞xk=1−x1, from Example 24 we find that k=1∑∞kxk−1=(1−x)21. (This differentiation is valid for ∣x∣<1 by a theorem about infinite series.) ◀