Fibonacci via Recursion and Iteration

1 616 Download(s)

Lesson synopsis

shellThis lesson introduces how to calculate an arithmetic series, specifically Fibonacci. In the first of two hour-long sessions, using a spreadsheet (e.g. Microsoft Excel or Google Drive Sheets), students are shown how to calculate a series based on two prior values (the iterative solution), and by using a user-defined function (the recursive solution). With a large enough domain, most computers will exhibit real delays in calculating the recursion for values greater than 30. In the second session, they will explore why the iterative solution is faster, and why the recursive solution significantly slows down for large values. This lesson assumes that the teacher is well versed in using spreadsheets, including copy-down formulas.

Age Levels

14 - 18 years

Objectives

Introduce students to:
How series occur in nature
Recursive algorithms for arithmetic series, not just Fibonacci
Iterative solutions that rely on stored data to make recursive solutions more efficient
Informal ideas about time complexity

Anticipated learner outcomes

Students will be able to describe how to solve a class of problems like Fibonacci:
With recursion
With iteration that exploits data
And articulate that when an imbedded recursive solution can be recast as an iterative one, effort (e.g. time) can be significantly reduced

Optional Writing Activity

This activity introduces the idea of how to efficiently calculate an arithmetic series, such as Fibonacci. There are other interesting series out there, so research one on the Internet and explain how it compares to Fibonacci. Is the recursive solution just as efficient? Is there a way to describe it using data storage?
RISC processor
John Hennessy
John Hennessy

Have you ever wondered how computers can execute complex commands in mere seconds? John Hennessy is a pioneer of reduced instruction set computing (RISC) architecture which employs small, highly-optimized sets of instructions to greatly enhance computer performance. He was instrumental in transferring the technology, specifically MIPS RISC architecture, to industry. He co-founded MIPS Technologies and co-authored the classic textbook with David A. Patterson, on Computer Architecture.

As Stanford faculty he rose to be the Chairman of the Computer Science Department, Dean of the School of Engineering, then Provost and finally the President of Stanford in 2000 (and till date). Hennessy holds a Master’s and Ph.D. in Computer Science from SUNY Stony Brook. He is an IEEE Fellow and was selected to receive the IEEE Medal of Honor in 2012. Hennessey also launched significant activities that helped to foster interdisciplinary research in the biosciences and bioengineering at Stanford.

@ symbol
Ray Tomlinson
Ray Tomlinson

Have you ever considered that someone, at some point, was in a position to choose what symbol would be used separate the user from their location in an email address? That person, it turns out, was Ray Tomlinson, and in 1971 he chose "@". Tomlinson is credited with demonstrating the first email sent between computers on a network, and when asked what inspired him to make this selection he said, “Mostly because it seemed like a neat idea.”

After completing his Master’s degree at MIT in 1965, Ray joined the Information Sciences Division of Bolt Beranek and Newman Inc. of Cambridge, Massachusetts. Since then he has made many notable contributions to the world of network computing. He was a co-developer of the TENEX computer system that was popular in the earliest days of the Internet; he developed the packet radio protocols used in the earliest internetworking experiments; he created the first implementation of TCP; and he was the principle designer of the first workstation attached to the Internet.

King's Quest
Roberta Williams

Video games immerse users in a world of high tech thrills, stunning visuals, unique challenges, and interactivity. They enable users to become a warrior princess or a gruesome ghoul, create a virtual persona, or even develop worlds that other gamers can play on. But before the games of today became reality, they were the dreams of a few innovative individuals.

Roberta Williams is considered one of the pioneers of gaming as we know it today. During the 80’s and 90’s along with husband Ken Williams through their company On-Line Systems, she developed some of the first graphical adventure games. These included such titles as Mystery House, Wizard and the Princess and the popular King’s Quest series. Williams also helped introduce more girls and women to the world of gaming by bringing games developed from a woman’s perspective to mainstream market.

Gordon and SenseCam QUT
Gordon Bell
Gordon and SenseCam QUT

Gordon Bell is a pioneering computer designer with an influential career in industry, academia and government. He graduated from MIT with a degree in electrical engineering. From 1960, at Digital Equipment Corporation (DEC), he designed the first mini- and time-sharing computers and was responsible for DEC's VAX as Vice President of R&D, with a 6 year sabbatical at Carnegie Mellon University. In 1987, as NSF’s first, Ass't Director for Computing (CISE), he led the National Research Network panel that became the Internet. Bell maintains three interests: computing, lifelogging, and startup companies—advising over 100 companies. He is a Fellow of the, Association of Computing Machinery, Institute of Electrical and Electronic Engineers, and four academies. He received The 1991 National Medal of Technology. He is a founding trustee of the Computer History Museum, Mountain View, CA. and is an Researcher Emeritus at Microsoft. His 3 word descriptor: Computing my life; computing, my life.

CGA palette
Mark Dean

If you have ever used a PC with a color display you have been acquainted with the work of Mark Dean. After achieving a Bachelor’s degree in electrical engineering from the University of Tennessee, Dean began his career at IBM. Dean served as the chief engineer on the team that developed the first IBM PC, for which he currently holds one third of the patents. With colleague Dennis Moeller, he developed the Industry Standard Architecture (ISA) systems bus, which enabled peripheral devices such as printers, keyboards, and modems to be directly connected to computers, making them both affordable and practical. He also developed the Color Graphics Adapter which allowed for color display on the PC. Most recently, Dean spearheaded the team that developed the one-gigahertz processor chip. Dean went on to obtain a MSEE from Florida Atlantic University and a Ph.D. in electrical engineering from Stanford University. He is a member of the National Academy of Engineering, has been inducted into the National Inventors Hall of Fame, and is the first African-American IBM Fellow.

Image credits