Skip to content

jonathonlefler/recursionLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

recursionLab

Background

The Fibonacci sequence is a famous set of numbers in mathematics. Discovered between 450 B.C. and 200 B.C. by Indian mathematicians trying to enumerate poetic syllables, and late by Leonardo of Pisa for counting rabbits around 1200 A.D.

The sequence

{1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...}

The sequence is constructed by adding the two previous numbers to get the next number. The first two numbers in the sequence are always 1.

Terms

A recursive method is a method that continuously calls itself until it encounters a base case.

Recursion:

Talk about recursive vs. iterative

TODO

Create a recursive method, called fibonacciNumber, that calculates the target fibonacci number.

Extra

The Fibonacci sequence also creates an interesting rectangle, as shown in the figure below:

alt text

Using your fibonacciNumber() method, calculate the area of the rectangle of the target fibonacci number.

Extra 2

Using your fibonacciNumber() method, calculate the perimeter of the rectangle of the target fibonacci number.

Extra 3

Something about why using recursion is bad for extra 2 and 3

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages