diff --git a/algorithms/dp/fib.py b/algorithms/dp/fib.py index 6762e90db..7a6fd7140 100644 --- a/algorithms/dp/fib.py +++ b/algorithms/dp/fib.py @@ -1,3 +1,17 @@ +''' +In mathematics, the Fibonacci numbers, commonly denoted Fn, form a sequence, called the Fibonacci sequence, +such that each number is the sum of the two preceding ones, starting from 0 and 1. +That is, + F0=0 , F1=1 +and + Fn= F(n-1) + F(n-2) +The Fibonacci numbers are the numbers in the following integer sequence. + 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……. + +In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation + +Here, given a number n, print n-th Fibonacci Number. +''' def fib_recursive(n): """[summary] Computes the n-th fibonacci number recursive.