• 沒有找到結果。

Special Integer Sequences

在文檔中 Discrete Mathematics Applications (頁 193-200)

2 Basic Structures: Sets, Functions,Sequences, Sums, and Matrices

2.4 Sequences and Summations

2.4.4 Special Integer Sequences

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:

Are there runs of the same value? That is, does the same value occur many times in a row?

Are terms obtained from previous terms by adding the same amount or an amount that depends on the position in the sequence?

Are terms obtained from previous terms by multiplying by a particular amount?

Are terms obtained by combining previous terms in a certain way?

Are there cycles among the terms?

EXAMPLE 12 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 Extra

Examples

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 con-structed.

EXAMPLE 13 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.

EXAMPLE 14 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

TABLE 1 Some Useful Sequences.

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, … fn 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, …

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, …

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.)

EXAMPLE 15 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. Conse-quently, if Lnis the nth term of this sequence, we guess that the sequence is determined by the recurrence relation Ln= Ln−1+ Ln−2with initial conditions L1= 1 and L2= 3 (the same recur-rence relation as the Fibonacci sequence, but with different initial conditions). This sequence is known as the Lucas sequence, after the French mathematician Franc¸ois ´Edouard 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. Note that we have listed these sequences so that the terms of each sequence grow faster than those in the preceding sequence in the list. The rates of growth of these terms will be studied in Section 3.2.

Courtesy of Neil Sloane

NEIL SLOANE (BORN 1939) Neil Sloane studied mathematics and electrical engineering at the University Links

of Melbourne on a scholarship from the Australian state telephone company. He mastered many telephone-related jobs, such as erecting telephone poles, in his summer work. After graduating, he designed minimal-cost telephone networks in Australia. In 1962 he came to the United States and studied electrical engineering at Cornell University. His Ph.D. thesis was on what are now called neural networks. He took a job at Bell Labs in 1969, working in many areas, including network design, coding theory, and sphere packing. He moved to AT&T Labs in 1996 when it was split off from Bell Labs, working there until his retirement in 2012. One of his favorite problems is the kissing problem (a name he coined), which asks how many spheres can be arranged in n dimensions so that they all touch a central sphere of the same size. (In two dimensions the an-swer is 6, because 6 pennies can be placed so that they touch a central penny. In three dimensions, 12 billiard balls can be placed so that they touch a central billiard ball. Two billiard balls that just touch are said to “kiss,” giving rise to the terminology “kissing problem” and “kissing number.”) Sloane, together with Andrew Odlyzko, showed that in 8 and 24 dimensions, the optimal kissing numbers are, respectively, 240 and 196,560. The kissing number is known in dimensions 1, 2, 3, 4, 8, and 24, but not in any other dimensions. Sloane’s books include Sphere Packings, Lattices and Groups, 3d ed., with John Conway; The Theory of Error-Correcting Codes with Jessie MacWilliams; The Encyclopedia of Integer Sequences with Simon Plouffe (which has grown into the popular OEIS website); and The Rock-Climbing Guide to New Jersey Crags with Paul Nick. The last book demonstrates his interest in rock climbing; it includes more than 50 climbing sites in New Jersey.

EXAMPLE 16 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 Tower of Hanoi puzzle with n disks (Chapter 8), and the number of rabbits on an island after n months (Chapter 8).

Check out the puzzles at

the OEIS site. Integer sequences appear in an amazingly wide range of subject areas besides discrete math-ematics, including biology, engineering, chemistry, and physics, as well as in puzzles. An amaz-Links

ing database of over 250,000 different integer sequences (as of 2017) can be found in the On-Line Encyclopedia of Integer Sequences (OEIS). This database was originated by Neil Sloane in 1964 and is now maintained by the OEIS Foundation. The last printed version of this database was published in 1995 ([SIPI95]); the current encyclopedia would occupy more than 900 vol-umes of the size of the 1995 book with more than 10,000 new submissions a year. You can use a program on the OEIS website to find sequences from the encyclopedia that match initial terms you provide, if there is a match. For instance, when you enter 1, 1, 2, 3, 5, 8, OEIS displays a page that identifies these numbers as successive terms of the Fibonacci sequence, provides the recurrence relation that generates this sequence, lists an extensive set of comments about the many ways the Fibonacci sequence arises including references, and displays information about quite a few other sequences that begin with these same terms.

2.4.5 Summations

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

n j= m

aj,n

j= maj, or ∑

m≤j≤naj

(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,

n j= m

aj=

n i= m

ai=

n k= m

ak.

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∑n

j=1(axj+ byj) = an

y=1xj+ bn

j=1yj, where x1, x2, … , xnand 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.

EXAMPLE 17 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 Extra

Examples

this sum as

100 j=1

1 j.

EXAMPLE 18 What is the value of∑5 j=1j2? Solution:We have

5 j=1

j2= 12+ 22+ 32+ 42+ 52

= 1 + 4 + 9 + 16 + 25

= 55.

EXAMPLE 19 What is the value of∑8

k = 4(−1)k? Solution:We have

8 k = 4

(−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.

EXAMPLE 20 Suppose we have the sum

5 j=1

j2

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 − 0 = 0 when j = 1) to 4 (because k = 5 − 1 = 4 when j = 5), and the term j2becomes (k + 1)2. Hence,

Extra Examples

5 j=1

j2 =

4 k = 0

(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.

THEOREM 1 If a and r are real numbers and r≠ 0, then

n j= 0

arj=

⎧⎪

⎨⎪

arn+1− a

r − 1 if r≠ 1 (n + 1)a if r = 1.

Proof:Let Sn=

n j= 0

arj.

To compute S, first multiply both sides of the equality by r and then manipulate the resulting sum as follows:

rSn = r

n j= 0

arj substituting summation formula for S

=

n j= 0

arj+1 by the distributive property

=

n+1 k =1

ark shifting the index of summation, with k = j + 1

= ( n

k = 0

ark )

+ (arn+1− a) removing k = n + 1 term and adding k = 0 term

= Sn+ (arn+1− a) substituting S for summation formula

From these equalities, we see that rSn = Sn+ (arn+1− a).

Solving for Sn shows that if r≠ 1, then Sn= arn+1− a

r − 1 . If r = 1, then the Sn=∑n

j=0arj =∑n

j=0a = (n + 1)a.

EXAMPLE 21 Double summations arise in many contexts (as in the analysis of nested loops in computer pro-grams). An example of a double summation is

4 i=1

3 j=1

ij.

To evaluate the double sum, first expand the inner summation and then continue by computing the outer summation:

4 i=1

3 j=1

ij =

4 i=1

(i + 2i + 3i)

=

4 i=1

6i

= 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.

EXAMPLE 22 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 for-mulae for such sums can be useful; Table 2 provides a small table of forfor-mulae for commonly occurring sums.

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 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.

EXAMPLE 23 Find∑100 k = 50k2.

Solution:First note that because∑100

k = 1k2=∑49

k = 1k2+∑100

k = 50k2, we have

100 k = 50

k2 =

100 k = 1

k2

49 k = 1

k2.

TABLE 2 Some Useful Summation Formulae.

Sum Closed Form

n k = 0

ark(r≠ 0) arn+1− a r − 1 , r≠ 1

n k = 1

k n(n + 1)

2

n k = 1

k2 n(n + 1)(2n + 1)

6

n k = 1

k3 n2(n + 1)2

4

k = 0

xk,|x| < 1 1 1 − x

k = 1

kxk−1,|x| < 1 1 (1 − x)2

Using the formula∑n

k = 1k2= n(n + 1)(2n + 1)∕6 from Table 2 (and proved in Exercise 38), we see that

100 k = 50

k2 = 100⋅ 101 ⋅ 201

6 −49⋅ 50 ⋅ 99

6 = 338,350 − 40,425 = 297,925.

SOME INFINITE SERIES 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 calcu-lus, 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 mathe-matics, we will find the closed forms for the infinite series in Examples 24 and 25 to be quite useful.

EXAMPLE 24 (Requires calculus) Let x be a real number with|x| < 1. Find n = 0xn. Solution:By Theorem 1 with a = 1 and r = x we see thatk

n = 0xn =xk+1− 1

x − 1 . Because|x| < 1, Extra

Examples xk+1approaches 0 as k approaches infinity. It follows that

n = 0

xn= lim

k→∞

xk+1− 1

x − 1 = 0 − 1 x − 1 = 1

1 − x.

We can produce new summation formulae by differentiating or integrating existing formulae.

EXAMPLE 25 (Requires calculus) Differentiating both sides of the equation

k = 0

xk = 1 1 − x,

from Example 24 we find that

k = 1

kxk−1= 1 (1 − x)2.

(This differentiation is valid for|x| < 1 by a theorem about infinite series.)

Exercises

5. List the first 10 terms of each of these sequences.

a) the sequence that begins with 2 and in which each successive term is 3 more than the preceding term b) the sequence that lists each positive integer three

times, in increasing order

c) the sequence that lists the odd positive integers in in-creasing order, listing each odd integer twice d) the sequence whose nth term is n! − 2n

e) the sequence that begins with 3, where each succeed-ing term is twice the precedsucceed-ing term

f ) the sequence whose first term is 2, second term is 4, and each succeeding term is the sum of the two pre-ceding terms

g) the sequence whose nth term is the number of bits in the binary expansion of the number n (defined in Section 4.2)

h) the sequence where the nth term is the number of let-ters in the English word for the index n

6. List the first 10 terms of each of these sequences.

a) the sequence obtained by starting with 10 and obtain-ing each term by subtractobtain-ing 3 from the previous term b) the sequence whose nth term is the sum of the first n

positive integers

c) the sequence whose nth term is 3n− 2n d) the sequence whose nth term is⌊√

n

e) the sequence whose first two terms are 1 and 5 and each succeeding term is the sum of the two previous terms

f ) the sequence whose nth term is the largest integer whose binary expansion (defined in Section 4.2) has n bits (Write your answer in decimal notation.)

g) the sequence whose terms are constructed sequen-tially as follows: start with 1, then add 1, then mul-tiply by 1, then add 2, then mulmul-tiply by 2, and so on h) the sequence whose nth term is the largest integer k

such that k!≤ n

7. Find at least three different sequences beginning with the terms 1, 2, 4 whose terms are generated by a simple for-mula or rule.

8. Find at least three different sequences beginning with the terms 3, 5, 7 whose terms are generated by a simple for-mula or rule.

9. Find the first five terms of the sequence defined by each of these recurrence relations and initial conditions.

a) an= 6an−1, a0= 2 b) an= a2n−1, a1= 2

c) an= an−1+ 3an−2, a0= 1, a1= 2 d) an= nan−1+ n2an−2, a0= 1, a1= 1 e) an= an−1+ an−3, a0= 1, a1= 2, a2= 0

10. Find the first six terms of the sequence defined by each of these recurrence relations and initial conditions.

a) an= −2an−1, a0= −1

12. Show that the sequence {an} is a solution of the recur-rence relation an= −3an−1+ 4an−2if

a) an= 0. b) an= 1.

c) an= (−4)n. d) an= 2(−4)n+ 3.

13. Is the sequence {an} a solution of the recurrence relation an= 8an−1− 16an−2if

a) an= 0? b) an= 1?

c) an= 2n? d) an= 4n?

e) an= n4n? f ) an= 2⋅ 4n+ 3n4n? g) an= (−4)n? h) an= n24n?

14. For each of these sequences find a recurrence relation satisfied by this sequence. (The answers are not unique

在文檔中 Discrete Mathematics Applications (頁 193-200)