Example #3: The Fibonacci sequence is a classic example of a recursively defined sequence in mathematics, where each term is the sum of the two preceding terms.
It is defined by the base cases \( F(0) = 0 \) and \( F(1) = 1 \), and the recurrence \( F(n) = F(n - 1) + F(n - 2) \) for \( n \geq 2 \).
For example, $F(4) = \;$$F(3)$$ \,+\, $$F(2)$$ \;=\;$$F(2) + F(1)$$ \,+\, $$F(1) + F(0)$$ \;=\; $$F(1) + F(0) + F(1)$$ \,+\, $$F(1) + F(0)$$ \;=\; $$1 + 0 + 1$$ \,+\, $$1 + 0$$ \;= 3$.
Here is the definition: \( F(n) = \begin{cases} 0 & \text{if } n = 0 \\ 1 & \text{if } n = 1 \\ F(n - 1) + F(n - 2) & \text{if } n \geq 2 \end{cases} \).
$$F(n) = \begin{cases} 0 & \text{if } n = 0 \\ 1 & \text{if } n = 1 \\ F(n - 1) + F(n - 2) & \text{if } n \geq 2 \end{cases}$$