'''Recursion''' is the repeated application of a procedure or definition.
+
'''Recursion''' is the repeated application of a procedure or definition through reference to itself.
−
===In Computing===
+
==In Mathematics==
+
+
There's a simple procedure for finding out whether a number is divisible by three.
+
#If the number is 3, 6, or 9 then it's divisible by three.
+
#Otherwise, add all the digits of the number; if the sum of the digits is divisible by three, then so is the original number.
+
+
Examples:
+
* 12 => 1 + 2 = 3 (yes)
+
* 14 => 1 + 4 = 5 (no)
+
* 96 => 9 + 6 = 15; 15 => 1 + 5 = 6
+
+
+
==In Computing==
Recursion is a technique whereby a [[function]], in order to accomplish a task, calls itself to accomplish part of the task.
Recursion is a technique whereby a [[function]], in order to accomplish a task, calls itself to accomplish part of the task.
Line 19:
Line 31:
:3. Write a function to compute any number to the power of a non-negative integer.
:3. Write a function to compute any number to the power of a non-negative integer.
−
===In Language===
+
==External links==
−
+
* [http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/unit-1/lecture-6-recursion/ Unit on recursion in free online computer science course from MIT.]
−
Recursion in language enables phrases to be embedded within one another, usually through [[conjunctions]], such that it should be possible to make an infinitely long sentence. For one such example we could take the sentence ''Many atheists are overweight'' and precede it with ''<person> said that'' indefinitely, as follows: ''Blaine said that Barbie said that Ken said that many atheists are overweight.''