Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Turing Complete?

What does the expression "Turing Complete" mean?

Can you give a simple explanation, without going into too many theoretical details?

like image 344
dlinsin Avatar asked Aug 10 '08 18:08

dlinsin


People also ask

What means Turing-complete?

Practically, what you need to know is that a Turing-complete language (also called a universal language) is one where you can compute anything that any other computational method can compute. In other words, a language that's non-universal—or Turing incomplete—has some limits on the set of things that it can compute.

What is required for Turing-complete?

In general, for an imperative language to be Turing-complete, it needs: A form of conditional repetition or conditional jump (e.g., while , if + goto ) A way to read and write some form of storage (e.g., variables, tape)

Is Minecraft Turing-complete?

With the formal definition Minecraft is not Turing complete. But neither is your computer or any other real device because you need infinite memory for that. In the more common sense that Turing complete is being used, meaning it is a universal computer then yes, Minecraft is Turing complete.

Are humans Turing-complete?

If computers are Turing complete, then humans are, too. Computers do not have infinite memory, yet they are usually considered Turing complete because theoretically you could keep adding additional memory when needed. The same holds for humans: you can use paper as tape, or even in HDD (eg.


2 Answers

Here's the briefest explanation:

A Turing Complete system means a system in which a program can be written that will find an answer (although with no guarantees regarding runtime or memory).

So, if somebody says "my new thing is Turing Complete" that means in principle (although often not in practice) it could be used to solve any computation problem.

Sometimes it's a joke... a guy wrote a Turing Machine simulator in vi, so it's possible to say that vi is the only computational engine ever needed in the world.

like image 58
Mark Harrison Avatar answered Oct 14 '22 22:10

Mark Harrison


Here is the simplest explanation

Alan Turing created a machine that can take a program, run that program, and show some result. But then he had to create different machines for different programs. So he created "Universal Turing Machine" that can take ANY program and run it.

Programming languages are similar to those machines (although virtual). They take programs and run them. Now, a programing language is called "Turing complete", if it can run any program (irrespective of the language) that a Turing machine can run given enough time and memory.

For example: Let's say there is a program that takes 10 numbers and adds them. A Turing machine can easily run this program. But now imagine that for some reason your programming language can't perform the same addition. This would make it "Turing incomplete" (so to speak). On the other hand, if it can run any program that the universal Turing machine can run, then it's Turing complete.

Most modern programming languages (e.g. Java, JavaScript, Perl, etc.) are all Turing complete because they each implement all the features required to run programs like addition, multiplication, if-else condition, return statements, ways to store/retrieve/erase data and so on.

Update: You can learn more on my blog post: "JavaScript Is Turing Complete" — Explained

like image 45
Raja Rao Avatar answered Oct 14 '22 23:10

Raja Rao