chaptergvmath.weebly.com/uploads/5/6/5/3/56539921/chapter.08.01... · chapter lesson 8.1...

12
R ecursion is a process that creates new objects from existing ones that were created by the same process. The recurrence relations you wrote in previous chapters are an example: They enable you to calculate new values from existing ones that were calculated with the same formula. Recursive processes can be geometric; although the computer programs used to implement geometric recursion do so by performing numerical calculations. Fractal images are among the best-known examples of geometric recursion. For example, fractal techniques are used to create artificial landscapes for movies. However, the results produced by recursive processes can change from regular and predictable to chaotic when only slight modifications are made. This fact has given rise to a branch of mathematics called chaos theory, which has been used to provide a theoretical explanation for the unexpected collapse of stable systems such as large power grids. How can recursion be used to create appealing images? How can recursion help people plan their financial futures? How can slight changes in a recursive process change behavior from predictable to chaotic? In this chapter, you will use recursive modeling to answer these and many other important questions. Recursion 8 CHAPTER Lesson 8.1 Introduction to Recursive Modeling Lesson 8.2 Finite Differences Lesson 8.3 Arithmetic and Geometric Recursion Lesson 8.4 Mixed Recursion, Part 1 Lesson 8.5 Mixed Recursion, Part 2 Lesson 8.6 Cobweb Diagrams Chapter Extension Fractal Dimensions Chapter 8 Review

Upload: hoangque

Post on 13-May-2018

216 views

Category:

Documents


2 download

TRANSCRIPT

Recursion is a process that creates new objects fromexisting ones that were created by the same process.The recurrence relations you wrote in previous

chapters are an example: They enable you to calculate newvalues from existing ones that were calculated with thesame formula.

Recursive processes can be geometric; although thecomputer programs used to implement geometricrecursion do so by performing numerical calculations.Fractal images are among the best-known examples ofgeometric recursion. For example, fractal techniques areused to create artificial landscapes for movies.

However, the results produced by recursive processescan change from regular and predictable to chaotic whenonly slight modifications are made. This fact has given riseto a branch of mathematics called chaos theory, which hasbeen used to provide a theoretical explanation for theunexpected collapse of stable systems such as large powergrids.

• How can recursion be used to create appealingimages?

• How can recursion help people plan their financialfutures?

• How can slight changes in a recursive process changebehavior from predictable to chaotic?

In this chapter, you will use recursive modeling to answerthese and many other important questions.

Recursion 8

CHAPTER

Lesson 8.1Introduction to RecursiveModeling

Lesson 8.2Finite Differences

Lesson 8.3Arithmetic and GeometricRecursion

Lesson 8.4Mixed Recursion, Part 1

Lesson 8.5Mixed Recursion, Part 2

Lesson 8.6CobwebDiagrams

ChapterExtensionFractalDimensions

Chapter 8Review

DM08_Final.qxp:DM08.qxp 5/10/14 9:03 AM Page 443

The simplest recursive processes are numerical: one number in a list isdetermined by applying simple mathematical calculations to one or moreof the preceding numbers. This is the type of recursion you haveconsidered in previous chapters and is also the type with which thischapter begins.

Reconsider a problem that you first saw in Lesson 2.6. Luis and Brittexamine the number of handshakes that occur when every person in agroup shakes hands with every other person. The following is a tablesimilar to the one you made in Lesson 2.6.

Number of People Number ofin the Group Handshakes

1 02 13 34 65 10

When a new person enters a group in which everyone has shakenhands, the new person has to shake hands with each of the people whoare already in the group. Thus, the number of handshakes in a group ofn people is n – 1 more than the number of handshakes in a group of n – 1people. If Hn represents the number of handshakes in a group of n people,this recurrence relation can be expressed symbolically as Hn = Hn–1 + (n – 1).

Lesson 8.1

Introduction to Recursive Modeling

DM08_Final.qxp:DM08.qxp 5/10/14 9:03 AM Page 444

445Lesson 8.1 • Introduction to Recursive Modeling

Your work with this recurrence relationincluded writing a formula called a solution to therecurrence relation and using mathematicalinduction to prove the formula correct. In this case,the solution, which is also called a closed-form solution, is Hn = .

Closed-form solutions are useful because, unlikerecurrence relations, they calculate a value directly.For example, you can find the number ofhandshakes in a group of ten people withoutknowing the number of handshakes in a group ofnine people. However, closed-form solutions can be difficult to find. If such solutionsare found by trial and error,mathematical induction can be usedto prove their validity.

There are techniques other thantrial and error that can be used to findclosed-form solutions. For example,the counting methods in Chapter 6are useful for certain kinds ofrecurrence relations. The handshakeproblem requires that every pair ofpeople shake hands. In a group of npeople, there are C(n, 2) ways ofselecting a pair, and so there are

C(n, 2) = handshakes. But n! =

n(n – 1)(n – 2)!, so the counting solutionis equivalent to the solution youhypothesized and proved in Chapter 2.

The closed-form calculation ofthe number of handshakes in a groupof, say, 100 people is a simple one:

100 × = 4,950. Obtaining this

solution with a recurrence relationrequires extending the table on page444 to 100 rows.

992

n

n

!( )! !− 2 2

n n( )−12

Handshakes Matter for FirstImpressions, Brain Study Confirms

HealthDay NewsNovember 2, 2012

A new study providesscientific evidencethat a handshakehelps you make agood first impression.

University of Illinoisresearchers usedfunctional MRI scansto monitor brainactivity in volunteerswho watched andrated videos of peopleinteracting in abusiness setting. Thescans showed apositive “socialevaluation” brainresponse when thevolunteers saw thepeople in the videosshake hands.

It’s not just ahandshake thatpromotes positivefeelings, but a firm,confident, yet friendlyhandshake, notedstudy co-leader FlorinDolcos. “In a businesssetting this is whatpeople expect,” hesaid. “Not a very longtime ago you couldget a loan based on ahandshake. So itconveys somethingvery important, verybasic. Yet the scienceunderlying this is sofar behind. We knewthese thingsintuitively but now wealso have thescientific support.”

DM08_Final.qxp:DM08.qxp 5/10/14 9:03 AM Page 445

446 Chapter 8 • Recursion

Extending a table to 100 or more rows is a tedious task when done byhand. Fortunately, there are several ways to apply technology to theproblem. Indeed, the speed of computers has made recursive methodsmuch more useful today than they were a few decades ago.

One type of technology that is very useful for recursive modeling isa computer spreadsheet. A spreadsheet is a matrix consisting of columnslabeled with the letters A, B, C, . . . and rows labeled with the numerals 1,2, 3, . . . . A particular location in the spreadsheet is called a cell and isdenoted by its column letter and row number, such as A1 or C5. Cells maycontain verbal information, numeric values, or formulas that refer toother cells. Spreadsheets have copy features that allow formulas to becopied so that tables can be generated rapidly.

Another way technology can be used in recursive modeling is bydeveloping a calculator or computer program that generates values fromthe relation. Programming requires that an appropriate algorithm beadapted to the language used by the calculator or computer. Thefollowing is an algorithm for the handshake problem that can be adaptedto a calculator or computer. The variable N represents the number ofpeople in the group, and H represents the number of handshakes.

1. Store the number 1 for variable N and the number 0 for variable H.

2. Display N and H.

3. Add 1 to N and store the result as the new value of N.

4. Add N – 1 to H and store the result as the new value of H.

5. Repeat steps 2 through 4.

Step 4 of this algorithm uses the recurrence relation to calculate thenumber of handshakes. The closed form can also be used in this step. To

do so, replace step 4 with “store as the new value of H.”

Some calculators have special functions designed to generate valuesfrom recurrence relations.

N N( )−12

DM08_Final.qxp:DM08.qxp 5/10/14 9:03 AM Page 446

447Lesson 8.1 • Introduction to Recursive Modeling

Using Computer Spreadsheets with Recurrence RelationsTo model the handshake problem with a spreadsheet, type suitable labelsin the first row. In cell A2, type initial value of 1 for the number of people.In cell B2, type the initial value of 0 for the number of handshakes. In cellA3, type the formula A2 + 1. In cell B3, type the formula B2 + A2, which isequivalent to the recurrence relation Hn = Hn–1 + (n – 1). You can fill theremaining rows by copying row 3. Note that most spreadsheets require theinitial character of a formula to be either = or +. The completed spreadsheetis shown here in two ways: with formulas and with numeric results.

A B C1 Number of people Number of handshakes Closed form2 1 0 = A2*(A2 – 1)/23 = A2 + 1 = A2 + B2 = A3*(A3 – 1)/24 = A3 + 1 = A3 + B3 = A4*(A4 – 1)/25 = A4 + 1 = A4 + B4 = A5*(A5 – 1)/26 = A5 + 1 = A5 + B5 = A6*(A6 – 1)/27 = A6 + 1 = A6 + B6 = A7*(A7 – 1)/28 = A7 + 1 = A7 + B7 = A8*(A8 – 1)/29 = A8 + 1 = A8 + B8 = A9*(A9 – 1)/210 = A9 + 1 = A9 + B9 = A10*(A10 – 1)/2

A B C1 Number of people Number of handshakes Closed form2 1 0 03 2 1 14 3 3 35 4 6 66 5 10 107 6 15 158 7 21 219 8 28 2810 9 36 36

DM08_Final.qxp:DM08.qxp 5/10/14 9:03 AM Page 447

448 Chapter 8 • Recursion

Writing Programs for Recurrence RelationsOn the left is a computer algorithm written in BASIC that generates atable for the handshake problem. On the right is a similar calculatoralgorithm for Texas Instruments graphing calculators.

10 N = 1:H = 0 1 → N:0 → H

20 PRINT N, H Lbl A

30 N = N + 1 Disp N, H

40 H = H + N – 1 N + 1 → N:H + N – 1 → H

50 GO TO 20 Goto A

Because these algorithms do not end, a statement should be addedto terminate the table at some value. For example, to stop the programafter calculation of the number of handshakes in a group of ten people,add the line 45 IF N>10 THEN STOP to the BASIC algorithm or the twolines If N>10 and Stop before the last line of the calculator algorithm.Note that the calculator algorithm does not display paired values of Nand H on a single line. One way to remedy this inconvenience is to storethe values in a 1 × 2 matrix and display the matrix.

Calculators with Recursion FeaturesThe following screens demonstrate the recursion features of one type ofgraphing calculator. The left screen shows the entry of the handshakerecurrence relation, which is done after the calculator is placed in itssequence mode. The right screen shows the resulting table, which appearsafter the table’s initial value and increment have been set.

DM08_Final.qxp:DM08.qxp 5/10/14 9:03 AM Page 448

449Lesson 8.1 • Introduction to Recursive Modeling

Exercises1. Consider a variation of this lesson’s handshake problem. There are

an equal number of men and women in Luis and Britt’s group andeach person shakes hands with all members of the opposite sex.

a. Draw a graph for a group of four men and four women in whichthe vertices represent the men and women in the group and theedges represent the handshakes. Recall your work in graphtheory. What kind of a graph is this?

b. If there is only one man and one woman in the group, howmany handshakes are made? With two couples? With threecouples?

c. Complete the following table to investigate the number ofhandshakes that are made.

Number of Number of RecurrenceCouples Handshakes Relation

12345

d. Assume that there are Hn–1 handshakes for n – 1 couples andthat another couple joins the party. How many additionalhandshakes are now possible?

e. Write a recurrence relation that describes the relationshipbetween the number of handshakes (Hn) for n couples and thenumber of handshakes (Hn–1) for n – 1 couples.

2. Consider another variation of the handshake problem in whicheach man shakes hands with each of the women except his date.

a. Make a table showing the number of handshakes that occurwhen there is one couple. Two couples. Three couples. Fourcouples.

b. Assume that you know the number of handshakes with n – 1couples. How many additional handshakes are made when thenth couple arrives?

DM08_Final.qxp:DM08.qxp 5/10/14 9:03 AM Page 449

450 Chapter 8 • Recursion

c. Write a recurrence relation for the total number of handshakes(Hn) when there are n couples.

3. a. Write a recurrence relation to describe each of the followingpatterns. (Note: Do not give closed-form formulas.)

i. 1, 4, 7, 10, 13, . . .ii. 1, 2, 4, 8, 16, 32, . . .iii. 1, 3, 6, 10, 15, 21, 28, . . .iv. 1, 2, 6, 24, 120, 720, . . .

b. What is the next term in each of the patterns in part a?

4. The ability to recognize patterns isconsidered a mark of intelligence.Thus, most IQ tests include questionsabout numerical patterns. Forexample, a question on an IQ testgives the sequence 1, 2, 3, 5, 8, 11and asks which of the numbers doesnot belong.

a. Explain why the correct answer isthat the last number, 11, does notfit the pattern.

b. Write a recurrence relation that describes the pattern.

5. You cannot use a recurrence relation to generate terms unless youhave an initial value. For example, tn = 2tn–1 – 3 has terms 5, 7, 11,19, . . . if the initial value t1 is 5. But if the initial value is 6, then theterms are 6, 9, 15, 27, . . . . Notice, however, if the initial value is 3,then all the terms are 3. An initial value for which all the terms ofthe recurrence relation are the same is called a fixed point.

Find the fixed point for each of the following recurrence relations ifone exists.

a. tn = 2tn–1 – 4

b. tn = 3tn–1 + 2

c. tn = 2tn–1d. tn = tn–1 + 3

Leonardo of Pisa, an Italianmathematician who livedfrom about 1170 to about1250 and is also known asFibonacci, popularized thesequence in Exercise 4 in hiswritings. Today, the sequenceis famous for its manyapplications.

Mathematician of Note

DM08_Final.qxp:DM08.qxp 5/10/14 9:03 AM Page 450

451Lesson 8.1 • Introduction to Recursive Modeling

6. If two rays have a common endpoint, one angle is formed. If a thirdray is added, three angles are formed. See the following figure.

a. How many angles are formed if a fourth ray is added? A fifth ray?

b. Write a recurrence relation for the number of angles formedwith n rays.

c. Write a closed-form solution.

d. Use your closed-form solution to find the number of anglesformed by ten rays.

7. For the original handshake problem in which everyone shakeshands with everyone else, construct a table for one through eightpeople in the following manner.

First column: term number

Second column: number of handshakes

Third column: differences of successive numbers from column 2

Fourth column: differences of successive numbers from column 3

a. What do you notice about the fourth column?

b. What degree is the polynomial that was obtained for the closed-form solution of the handshake problem? Compare your answerwith the number of difference columns in your table.

8. Consider the closed-form polynomial Sn = 4n3 – 3n + 2.

a. Make a table, as in Exercise 7, for n = 1, . . . , 8. Includedifference columns until the numbers in the last differencecolumn are equal.

b. How many difference columns did you need?

c. How does the number of difference columns compare with thedegree of the closed-form polynomial?

1 3

DM08_Final.qxp:DM08.qxp 5/10/14 9:03 AM Page 451

452 Chapter 8 • Recursion

9. Let Vn be the number of vertices in a complete binary tree. (A binarytree is complete if each vertex of the tree has either two or nochildren.) Level 0 is the root of the tree. The first three trees follow.

a. Make a table for V0, . . . , V6.

b. Write a recurrence relation to describe Vn.

In Exercise 9, it is convenient to begin the table with V0 because theroot of the tree is considered level 0. There are other cases in which theinitial value of the recurrence relation is labeled with the subscript 0. It is,for example, a useful practice when working with time intervals as inExercises 10 and 11.

10. Since the 1980s, residents ofthe southwestern UnitedStates have been concernedabout an influx of African“killer” bees. In 1987, thenumber of African bees wasestimated at 5,000. It wasalso estimated that thepopulation would increase ata rate of 12% annually. Let Bnbe the number of Africanbees in Texas each year,where n = 0 corresponds tothe beginning of the year1987. Then B1 indicates “theend of year 1.”

a. Make a table with entriesfor B0, . . . , B4.

b. Write a recurrence relationfor Bn.

0 = 1

1 = 3

2 = 7V

V

V

Africanized Bees Found in EastTennessee

Associated PressApril 10,2012

Tennessee agriculturalofficials say a colony ofpartially Africanizedbees, which are moreaggressive thandomestic honeybees,have been found in EastTennessee.

The TennesseeAgriculture Departmentsaid that the bees werefound last week in acolony belonging to a

beekeeper in MonroeCounty. State ApiaristMike Studer said thesebees have been found inother states, but this isthe first time they havebeen found inTennessee.

The biggest differencebetween Africanizedhoneybees andEuropean honey bees istheir behavior, whichincludes fiercelydefending their nests.

DM08_Final.qxp:DM08.qxp 5/10/14 9:03 AM Page 452

453Lesson 8.1 • Introduction to Recursive Modeling

c. Use a spreadsheet or calculator to determine when thepopulation of African bees is predicted to exceed 100,000. Inwhat year is this predicted to occur?

11. Susie puts $800 in a bank account that pays 5% interest per year,compounded yearly. Let n be the number of years she leaves themoney in the bank, let A0 be the initial amount of money ($800),and let An be the amount of money in the bank at the end of n years.

a. By creating a table, find out how many years it takes for Susie’smoney to double.

b. Write a recurrence relation for this situation.

12. The term fractal was invented in the 1970s by Benoit Mandelbrot todescribe a class of geometric objects with unusual properties. Oneof those properties is that a fractal contains parts that resemble thewhole. The following sequence of figures demonstrates theconstruction of such a “self-similar” object.

A short algorithm describes the process used to create the figures:

1. Draw a line segment.

2. For each line segment in the current figure, erase the middlethird and draw a “peak” by constructing an equilateraltriangle having the erased portion as a base.

3. Repeat step 2.

a. How does the length of a segment in onefigure of the sequence compare with thelength of a segment in the precedingfigure?

b. How does the number of segments in onefigure of the sequence compare with thenumber of segments in the precedingfigure?

c. Write a recurrence relation that describesthe relationship between the total length ofthe segments in figures n and n – 1.

BenoitMandelbrot(1924–2010)

Mandelbrotwas SterlingProfessor ofMathematicalSciences at Yale University.

Mathematician of Note

DM08_Final.qxp:DM08.qxp 5/10/14 9:03 AM Page 453

454 Chapter 8 • Recursion

Computer/Calculator Explorations13. Some computer drawing utilities such as Geometer’s Sketchpad

support recursion. Use a utility with recursion features to constructfigures like those in Exercise 12.

14. The Logo computer language supports recursion. Use Logo toconstruct figures like those in Exercise 12.

15. Perform this spreadsheet experiment: Type the number 1 in cell A1.In cell A2 type the formula A1, and in cell B2 type the formula A1 + B1. Copy the formula in cell A2 into cell A3; copy the formulain cell B2 into cells B3, C3, D3, . . . . (Stop at a convenient cell inrow 3.) Copy row 3 into several of the rows that follow it. Identifythe results and explain why they are produced by this procedure.

Projects16. Research and report on several current examples of recursive

modeling not discussed in this chapter. (You may want to beginyour research now and continue it as this chapter progresses.)

17. Research the Fibonaccii sequence (see Exercise 4). Prepare a reporton its history and several of its current modeling applications.

DM08_Final.qxp:DM08.qxp 5/10/14 9:03 AM Page 454