Wednesday, May 6, 2009

...On Recursion

DarkKoder:

Where can i get information, on how to develop my own Algorithms, recursion ETC.? Any help will be greatly apreciated :)

RollieBollocks:

You can also check out the Julia set fractals in the examples that come with FreeBASIC.

Recursion proper is a little tricky to work with. I prefer not to use it but to embed calls of different functions in other functions for reasons of practicality.

The most basic example is the factorial.

But the value of learning how to use recursion is that it makes you smarter, not that it is a pragmatic programming technique (in my humble opinion).

The basic interpretive stuff is that the last output becomes the next input, so it creates a self-referential feedback loop. This can be accomplished in other ways, with multiple functions, which give the programmer much more control.

Recursion is a really unwieldy tool. But it's good to learn anyway. Sometimes you just have to learn stuff because it makes you smarter, not because its a viable solution to any problem.

The real key to it all is that biological systems operate in accord with the recursive properties I mentioned above... Growth in living organisms can be expressed recursively.

Also, you may want to check out the Towers of Hanoi. It's a game based and written recursively. Also cryptography can be written recursively because of the way one way encryption works, fractals are drawn recursively and so the property of Self-Similarity or Super-Symmetry is another facet of recursion.

So the key components are not necessarily recursive. That being the input becomes the output ( there is no longer any distinction between subject and object/cause effect/all dichotomies break down and dissolve into one thing ) and self-reference leads to self-similarity, and that needn't be recursive either.

I find it fun to think about, but a burden to use.

Oh yes, self-penetration, and re-entry are buzzwords along these lines.

You should also check Chaos Theory as it warped and spasmed out of Mandlebrot's fractals. What else? Uhhmm... Postmodern philosophy is often written in a self-referential way, where it "grows" much like a recursive function grows toward infinity (if its coded "wrong"). On the flip side, to code a recursive function properly, it generally needs a break case or it has to devour itself down to nothing.

Hope this little excursion in recursion is beneficial to you. For my part I just enjoy thinking about it. I never ever use recursion proper, but everything I work on is based on the properties of recursion I mentioned above.

No comments:

Post a Comment