Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
aa:ct:models [2016/10/07 17:47] pdmatei created |
aa:ct:models [2019/10/08 07:55] (current) costin.lupu.almighty |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Background ====== | ||
+ | |||
+ | Most of the concepts presented in the following lectures were developed during the thirties, ironically, almost 30 years **before** the development of the computer, and **by mathematicians and logicians**. | ||
+ | |||
+ | So why was the subject of computation interesting, in the absence of a computer? | ||
+ | |||
+ | Mathematicians were for long struggling with the proof of apparently simple statements such as **Golbach's Conjecture**, or **Fermat's Last Theorem**. It was commonly believed that, at some point, a bright mathematician would eventually prove or disprove such statements. | ||
+ | |||
+ | The issue of **provability** itself came under the scope of interest, for people such as Hilbert or Gödel. This led mathematicians to examine //mathematical systems//, i.e. objects which specify: | ||
+ | * a set of **axioms**, i.e. statements which are taken to be true without prior proof. | ||
+ | * a set of **//instruments of proof//** (e.g. modus ponens), which can be used to //derive// new true statements (starting from the axioms). | ||
+ | |||
+ | One example of a mathematical system is **Euclidean Geometry**, consisting of five axioms and some methods of proof. Euclidean Geometry is powerful in the sense that many mathematical statements (e.g. Pythagoras theorem) can be proven starting from the axioms, and applying the methods of proof. | ||
+ | |||
+ | However, there are areas where Euclidean Geometry does not work: for instance, in Albert Einstein's relativity theory, space is not //euclidean// (consisting of three coordinates only). | ||
+ | For such areas, a new mathematical system is necessary. | ||
+ | |||
+ | Mathematicians from the thirties were also aware of paradoxes, e.g. Russell's paradox (the set containing those sets which do not contain themselves, is a valid construction?) and thus became preoccupied in finding a mathematical system where: | ||
+ | * paradoxes were not possible (all statements which can be proved in the system are actually true - hence the system is **sound**) | ||
+ | * all true statements could be found by a finite step of applications of the instruments of proof (hence the system is **complete**) | ||
+ | |||
+ | Gödel is famous for showing that this quest is impossible. He proved that: | ||
+ | * any mathematical system powerful enough to capture arithmetic is **incomplete**: some true statements cannot be proven. | ||
+ | * any mathematical system which includes **consistency** as an axiom is **inconsistent**. A set of axioms is **consistent** if there is no statement which can be proved **and** disproved at the same time, from the axioms. | ||
+ | |||
+ | Turing took Gödel's result one step further. Imagine the mathematician working in a mathematical system as a //robot// or //computer// which mechanically performs proof steps starting from the axioms. You feed a statement to the machine - it performs a sequence of proof steps, and then outputs a yes/no answer, i.e. whether or not the statement is true. | ||
+ | |||
+ | Turing devised such a machine and showed that //mechanical// proof is actually computation. Consistent to Gödel's results, he also showed that, for certain statements, **no machine** would not be able to provide an answer, but instead enter in an endless loop. Thus, the concept of **undecidability** was born. Undecidability is essentially the recognition that certain problems **cannot be effectively solved**, no matter how many resources (in terms of time and space) would be allocated. | ||
+ | |||
====== Preliminaries ====== | ====== Preliminaries ====== | ||
Line 57: | Line 86: | ||
Let us make a few observations: | Let us make a few observations: | ||
- | - each $math[i \in I] must be, in some sense finite. For instance, the graphs\footnotes{Graphs can also be infinite, however we do not consider them here} are finite objects | + | - each $math[i \in I] must be, in some sense finite. For instance, the graphs ((Graphs can also be infinite, however we do not consider them here)) are finite objects |
- $math[I] must be //countable// (but not necessarily finite). | - $math[I] must be //countable// (but not necessarily finite). | ||
Line 111: | Line 140: | ||
To conclude: | To conclude: | ||
* when trying to solve concrete problems, the encoding issue is fundamental, | * when trying to solve concrete problems, the encoding issue is fundamental, | ||
- | * From the perspective of **Complexity Theory**, **how** the encoding is done is unessential\footnote{There are exponentially-inefficient ways of encoding objects, which we shall discuss in a later lecture}, and can be viewed | + | * From the perspective of **Complexity Theory**, **how** the encoding is done is unessential ((There are exponentially-inefficient ways of encoding objects, which we shall discuss in a later lecture)), and can be viewed |
without “//loss of information//” to a natural number. | without “//loss of information//” to a natural number. | ||
Line 197: | Line 226: | ||
* At the same time, The ''TM'' Definition illustrates an **interpretation procedure** which tells us how to perform the computation specified by a Turing Machine. But what //Machine// is performing this interpretation? | * At the same time, The ''TM'' Definition illustrates an **interpretation procedure** which tells us how to perform the computation specified by a Turing Machine. But what //Machine// is performing this interpretation? | ||
- | Turing's seminal result shows that the interpretation of **any** Turing Machine can be performed a very special Turing Machine which he calls **The Universal Turing Machine** (abbreviated henceforth as UTM): | + | Turing's seminal result shows that the interpretation of **any** Turing Machine can be performed by a very special Turing Machine which he calls **The Universal Turing Machine** (abbreviated henceforth as UTM): |
* The **input** of the UTM is a Turing Machine (any TM); hence, to preserve our formalism, we need a mechanism to encode Turing Machines as **words**; | * The **input** of the UTM is a Turing Machine (any TM); hence, to preserve our formalism, we need a mechanism to encode Turing Machines as **words**; | ||
* The **output** of the UTM is the **word computed by the TM given as input** | * The **output** of the UTM is the **word computed by the TM given as input** | ||
Line 227: | Line 256: | ||
Thus, $math[enc(M)] is a word, which can be fed to another Turing Machine. The latter should have the ability to execute (or to simulate) $math[M]. This is indeed possible: | Thus, $math[enc(M)] is a word, which can be fed to another Turing Machine. The latter should have the ability to execute (or to simulate) $math[M]. This is indeed possible: | ||
- | $proposition[The Universal Turing Machine] | + | $prop[The Universal Turing Machine] |
- | There exists a ''TM'' $math[U] which, for any ''TM'' $math[M], and every word $math[w \in \Sigma^*], takes $math[enc(M)] and $math[w] as input and outputs $math[1] whenever $math[M(w) = 1] and $math[0] whenever $math[M(w) = 0]. We call $math[U], the **Universal Turing Machine**, and say that $math[U] simulates $math[M]. | + | There exists a ''TM'' $math[U] which, for any ''TM'' $math[M] and every word $math[w \in \Sigma^*], takes $math[enc(M)] and $math[w] as input and outputs $math[1] whenever $math[M(w) = 1] and $math[0] whenever $math[M(w) = 0]. We call $math[U] the **Universal Turing Machine** and say that $math[U] simulates $math[M]. |
$end | $end | ||
$proof | $proof | ||
- | Let $math[M] be a ''TM'' and $math[w = c_1c_2 ... c_n] be a word which is built from the alphabet of $math[M]. We build the Universal Turing Machine $math[U], as follows: | + | Let $math[M] be a ''TM'' and $math[w = c_1c_2 ... c_n] be a word which is built from the alphabet of $math[M]. We build the Universal Turing Machine $math[U] as follows: |
- | * The input of $math[U] is $math[enc(M)\#enc(s_0)\#c_1\#c_2 ... c_n]. Note that $math[enc(s_0)] encodes the initial state of $math[M] while $math[c_1] is the first symbol from $math[w]. The portion of the tape $math[enc(s_0)\#c_1\#c_2 ... c_n] will be used to mark the current conguration of $math[M], namely the current state of $math[M] (initially $math[s_0]), the contents of $math[M]'s tape, and $math[M]'s current head position. More generally, this portion of the tape is of the form $math[enc(s_i)\#u\#v], with $math[u, v \in \Sigma_b^*] and $math[s_i] being the current state of $math[M]. The last symbol of $math[u] marks the current symbol, while $math[v] is the word which is to the left of the head. Initially, the current symbol is the first one, namely $math[c_1]. | + | * The input of $math[U] is $math[enc(M)\#enc(s_0)\#c_1\#c_2 ... c_n]. Note that $math[enc(s_0)] encodes the initial state of $math[M] while $math[c_1] is the first symbol from $math[w]. The portion of the tape $math[enc(s_0)\#c_1\#c_2 ... c_n] will be used to mark the current configuration of $math[M], namely the current state of $math[M] (initially $math[s_0]), the contents of $math[M]'s tape, and $math[M]'s current head position. More generally, this portion of the tape is of the form $math[enc(s_i)\#u\#v], with $math[u, v \in \Sigma_b^*] and $math[s_i] being the current state of $math[M]. The last symbol of $math[u] marks the current symbol, while $math[v] is the word which is to the left of the head. Initially, the current symbol is the first one, namely $math[c_1]. |
- | * $math[U] will scan the initial state of $math[M], then it will move on the initial symbol from $math[w], and finally will move on the portion of $math[enc(M)] were transitions are encoded. Once a valid transition is found, it will execute it: | + | * $math[U] will scan the initial state of $math[M], then it will move on the initial symbol from $math[w] and finally will move on the portion of $math[enc(M)] were transitions are encoded. Once a valid transition is found, it will execute it: |
- $math[U] will change the initial state to the current one, according to the transition; | - $math[U] will change the initial state to the current one, according to the transition; | ||
- $math[U] will change the original symbol in $math[w] according to the transition; | - $math[U] will change the original symbol in $math[w] according to the transition; | ||
Line 262: | Line 291: | ||
In what follows, we examine the **Church-Turing Thesis** which is an **argument** for using the Turing Machine as a computational model: | In what follows, we examine the **Church-Turing Thesis** which is an **argument** for using the Turing Machine as a computational model: | ||
- | //Any problem which can be solved byh the Turing Machine is //"universally solvable"//.// | + | //Any problem which can be solved by the Turing Machine is //"universally solvable"//.// |
The term //"universally solvable"// cannot be given a precise mathematical definition. We only know solvability w.r.t. a given model of computation (abstract or concrete). | The term //"universally solvable"// cannot be given a precise mathematical definition. We only know solvability w.r.t. a given model of computation (abstract or concrete). |