✏️ Explanatory Question

What is the mathematical idea behind recursion?

👁 14 Views
📘 Detailed Answer
🟢 Easy
💡

Answer with Explanation

What is the mathematical idea behind recursion?

In mathematics, many problems can be written in recursive form. For example, the sum of natural numbers can be expressed using a smaller version of the same problem.

Sum of n natural numbers = n + Sum of (n - 1) natural numbers
Expression Recursive Meaning
Sum(n) n + Sum(n - 1)
Sum(n - 1) (n - 1) + Sum(n - 2)
Sum(n - 2) (n - 2) + Sum(n - 3)