Sunday 6 June 2010

Recursion Defined


Why is this page here?

Recursion is a common concept in the fields of Maths, IT and Linguistics.  Nonetheless, I have been surprised by the number of people who, on hearing the title of the novel have asked "Is that a real word?"  For those who are interested, here is a brief overview.  It is not by any means intended  to be comprehensive. If you want to find out more, get Googling!

Recursion Defined

An internet search gives lots of definitions for recursion, depending on what recursion is applied to.  For the moment, however, a couple  of working definitions could be:
Defining something in terms of itself
or
Repetition of concept within itself

Discussion

A simple example of recursion can be seen on The Simpsons, when Bart and Lisa sit down to watch Itchy and Scratchy on the TV.  Here you sit in the real world and mentally drop down to the Simpson level to watch Bart and Lisa, who drop down to the Itchy and Scratchy Level to watch their cartoon.  (On some episodes Itchy and Scratchy watch TV too, dropping down a further level.)  Here the concept of watching TV is repeated within itself.
We keep a mental stack of where we are as we watch the program.  If we don't, we might get confused as to what is going on.  For example, we probably realise that Bart Simpson does not live in the same world as we do, it is also not too difficult to realise that Itchy and Scratchy live in a different world to Bart and Lisa.  
However, If we were to extended the level of recursion, it is likely that we would run the risk of forgetting who goes where. 
We can represent this recursive relationship as follows:
You(Bart and Lisa(Itchy and Scratchy)))
A computer programmer may try to make things a bit clearer by writing this out as follows
You 
(
            Bart and Lisa
            (
                        Itchy and Scratchy
                        (

                        )
                )
)


Next: Recursive Functions


No comments:

Post a Comment