functional-programming

Enter the vast world of programming languages by following the tutorials provided here to learn about functional programming in Haskell.


Project maintained by jd-anabi Hosted on GitHub Pages — Theme by mattgraham

Back to main

Recurrence Relations

To understand functions in Haskell, it is necessary to understand recurrence relations. Recurence relations are functions that are defined in terms of themselves. To understand this, we will do multiple examples.

Examples

Summing from 0 to N, where N is a non-negative integer

S(0) = 0
S(N) = N + S(N-1)

Factorial of N

0! = 1
N! = N * (N-1)!

Fibonacci Sequence

F(0) = 0
F(1) = 1
F(N) = F(N-1) + F(N-2)

Logistic Map (given a constant r and initial x0)

xn+1 = rxn(1 - xn)

Hopefully now you are more comfortable with recursion and recurrence relations.