Recursion
From RationalWiki
Recursion is essentially repeating the same process over and over again, using the results of the last iteration as the input for the next one.
In mathematics, recursive techniques or algorithms are often used to derive more precise versions of numbers, such as π. At a simpler level, long division is a recursive algorithm, as is the process for manually deriving square roots. On an artistic level, all fractals are made using a recursive geometric function.
There is, normally, a "get out clause" included in a recursion which stops the activity under certain specified conditions, as otherwise the recursion would continue ad infinitum. This end point can be either a number of recursive events (say, "stop after 100 iterations" or the reaching of a certain value or level of precision (such as calculating pi until the 3000th significant figure doesn't change after a few iterations).
Contents |
[edit] Iteration count limiting method
Set counter to value 'n' Set 'm' to limit value Recursive event: add value to counter do something (optional) if value of counter is less than 'm' then: do recursive event do something else (optional) End Recursive event report value of 'n'
[edit] Target value method
Create variable 'n' Recursive event: Amend value of 'n' if property 'm' of variable 'n' not outside parameters i, j, k, ... then: do recursive event End Recursive event report value of 'n'
[edit] Less effective methods
"Lather, rinse, repeat" is an erroneously recursive algorithm that if followed faithfully will result in running out of shampoo.
Some people's idea of teh lulz !!!111one1!one!! is to have the article named "recursion" redirect to itself.
[edit] Teh lulz !!!111one1!one!!
Recursion is essentially repeating the same process over and over again, using the results of the last iteration as the input for the next one.
In mathematics, recursive techniques or algorithms are often used to derive more precise versions of numbers, such as π. At a simpler level, long division is a recursive algorithm, as is the process for manually deriving square roots.
There is, normally, a "get out clause" included in a recursion which stops the activity under certain specified conditions, as otherwise the recursion would continue ad infinitum. This end point can be either a number of recursive events or the reaching of a certain value.
[edit] Iteration count limiting method
Set counter to value 'n' Set 'm' to limit value Recursive event: add value to counter do something (optional) if value of counter is less than 'm' then: do recursive event do something else (optional) End Recursive event report value of 'n'
[edit] Target value method
Create variable 'n' Recursive event: Amend value of 'n' if property 'm' of variable 'n' not outside parameters i, j, k, ... then: do recursive event End Recursive event report value of 'n'
[edit] Less effective methods
"Lather, rinse, repeat" is an erroneously recursive algorithm that if followed faithfully will result in running out of shampoo.
Some people's idea of teh lulz !!!111one1!one!! is to have the article named "recursion" redirect to itself.
[edit] Teh lulz !!!111one1!one!!
Recursion is essentially repeating the same process over and over again, using the results of the last iteration as the input for the next one.
In mathematics, recursive techniques or algorithms are often used to derive more precise versions of numbers, such as π. At a simpler level, long division is a recursive algorithm, as is the process for manually deriving square roots.
There is, normally, a "get out clause" included in a recursion which stops the activity under certain specified conditions, as otherwise the recursion would continue ad infinitum. This end point can be either a number of recursive events or the reaching of a certain value.
[edit] Iteration count limiting method
Set counter to value 'n' Set 'm' to limit value Recursive event: add value to counter do something (optional) if value of counter is less than 'm' then: do recursive event do something else (optional) End Recursive event report value of 'n'
[edit] Target value method
Create variable 'n' Recursive event: Amend value of 'n' if property 'm' of variable 'n' not outside parameters i, j, k, ... then: do recursive event End Recursive event report value of 'n'
[edit] Less effective methods
"Lather, rinse, repeat" is an erroneously recursive algorithm that if followed faithfully will result in running out of shampoo.
Some people's idea of teh lulz !!!111one1!one!! is to have the article named "recursion" redirect to itself.
| Mathematics Articles on RationalWiki | ||
|---|---|---|
| - Calculus - Complex numbers - Conservapedian mathematics - Probability (Conservapedia) - Fermat's last theorem - Fibonacci sequence - 40gon (Fun) - Phli (fun) - Golden Ratio - Gödel's incompleteness theorems - Irrational number - Mathematics - Metric system - Pentagon - Pyramid - Rene Descartes - Statistics - TeX - Zero - | ||

