Sunday, September 9, 2012

Turing Completeness

     To discuss Turing Completeness, one must first explain that it all (it being the term "Turing Completeness" and everything it encompasses) started with a man named Alan Turing. Turing was born in London, England in June 1912. He was a mathematician, logician, cryptanalyst, and a computer scientist. He invented the Turing Machine. It was a theoretical invention, meaning it was never actually built by him, and, until recently, no one had successfully. Those that succeeded used more advanced parts than Turing had in his time. Such as an electronic scanner. One was even built out of Legos which I think is really cool. (http://www.wired.com/underwire/2012/06/lego-turing-machine/) It was a machine that, given it had access to an infinite roll of tape, could read, write, and erase symbols, such as binary, on that infinite strip of tape according to a table of rules. The table of rules included the implementation of any computable algorithm. The machine would read what was written on the tape then, depending on what was written, usually instructions, it would perform the calculation by writing the answer. Or, if the instruction was to change something that was already written it would change it. The following video does a great job showing the the Turing machine and how it works. http://www.youtube.com/watch?v=E3keLeMwfHY
     Which brings us to Turing Completeness. The Turning Machine was originally thought up to represent computing machines, so when something is Turing Complete it means that it can be represented on a Turing Machine. When deciding whether or not something is Turing Complete one does it without regard to run time or memory usage. It's not about the efficiency, only about the capability. Some people are confused and think that being Turing Complete is about being able to do everything, but it is about the ability to do calculations that a Turing Machine can. It is also about the ability to run forever. Since the Turing Machine is designed with an infinite amount of tape to manipulate symbols on whatever is Turing Complete it must have the ability to run forever, although it doesn't have to run forever.
     The majority of things that are Turing Complete are abstract and not physical entities. Nearly all computer programming languages, such as Java, C, C++, and Pascal, are Turing Complete because they can do any calculation. Also, by using loops and GOTOs they can also run forever. These programming languages differ in how the calculation will be performed, such as the number of loops required, and as stated before maybe not as efficiently as another, or the speed. While it could be using a loop it could just be using a GOTO statement or  recursions, they have the ability to run forever. While most programming languages are Turing Complete there are many that aren't. The largest language I found that isn't Turing Complete, while still being general-purpose, is SQL because without recursion, dynamic SQL, or the WHILE loop it is guaranteed to stop and not run forever.
    All of this is important to computer scientists. Turing was the first computer scientist and knowing what it means to be Turing Complete is important because when asked to do calculations you'll know that some languages can't do all of the calculations you may need to do infinitely.

No comments:

Post a Comment