Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
aa:intro:computability_theory [2016/07/22 11:31]
malex
aa:intro:computability_theory [2016/08/01 16:36] (current)
malex [1.4.6. Proposition]
Line 325: Line 325:
 Thus, $math[R] and $math[RE] should be interpreted as a "//​scale//"​ for solvability:​ $math[R] membership is complete solvability,​ $math[RE] membership is partial solvability,​ while non-membership in $math[RE] is "//​complete//"​ unsolvability. Thus, $math[R] and $math[RE] should be interpreted as a "//​scale//"​ for solvability:​ $math[R] membership is complete solvability,​ $math[RE] membership is partial solvability,​ while non-membership in $math[RE] is "//​complete//"​ unsolvability.
  
-==== 1.4.1 Remark ​AICI AM RAMAS! ​==== +==== 1.4.1 Remark ==== 
-//We note that $math[R] and $math[RE] are not the only sets of functions which are used in Computability Theory. It has been shown that there are //"​degrees"//​ of unsolvability,​ of //"​higher level"//​ than $math[R] and $math[RE]. These degrees are intuitively obtained as follows: We assume we live in a world where $math[f_h] is decidable (recursive). Now, as before, we ask which problems are recursive and which are recursively-enumerable. It turns out that, also in this ideal case, there still exist recurs +//We note that $math[R] and $math[RE] are not the only sets of functions which are used in Computability Theory. It has been shown that there are //"​degrees"//​ of unsolvability,​ of //"​higher level"//​ than $math[R] and $math[RE]. These degrees are intuitively obtained as follows: We assume we live  
-ive and recursively-enumerable problems, as well +in a world where $math[f_h] is decidable (recursive). Now, as before, we ask which problems are recursive and which are recursively-enumerable. It turns out that, also in this ideal case, there still exist recursive ​and recursively-enumerable problems, as well as some which are neither. This could be imagined as //"​undecidability level 1"//. Now, we take some problem which is in $math[RE] on level 1, and repeat the same assumption: it is decidable. Again, under this assumption, we find problems in $math[R], $math[RE] and outside the two, which form up //"​undecidability level 2"//. This process can be repeated// ad infi nitum.
-as some which are neither. This could be imagined as //"​undecidability level 1"//. Now, we take some problem which is in $math[RE] on level 1, and repeat the same assumption: it is decidable. Again, under this assumption, we find problems in $math[R], $math[RE] and outside the two, which form up //"​undecidability level 2"//. This process can be repeated// ad infi nitum.+
  
 Returning to our simpler classi cation,​ we must observe an interesting feature of recursively-enumerable functions, which is also the reason they are called this way. Returning to our simpler classi cation,​ we must observe an interesting feature of recursively-enumerable functions, which is also the reason they are called this way.
Line 335: Line 334:
 //A function $math[f \in Hom(\mathbb{N},​ \{0, 1\})] is recursively enumerable iff there exists a Turing Machine which can **enumerate/​generate** all elements in $math[A_f = \{w \in \mathbb{N} \mid f(n^w) = 1\}]. Intuitively,​ $math[A_f] is the set of inputs of $math[f] for which the answer at hand is yes.// //A function $math[f \in Hom(\mathbb{N},​ \{0, 1\})] is recursively enumerable iff there exists a Turing Machine which can **enumerate/​generate** all elements in $math[A_f = \{w \in \mathbb{N} \mid f(n^w) = 1\}]. Intuitively,​ $math[A_f] is the set of inputs of $math[f] for which the answer at hand is yes.//
  
-//Proof:// $math[\Longrightarrow] Suppose $math[f] is recursively-enumerable and $math[M] ​accpts ​$math[f]. We write $math[w_i] to refer to the //i//th word from $math[\Sigma^*]. We specify the $math[TM] generating $math[A_f] by the following pseudocode:+//Proof:// $math[\Longrightarrow] Suppose $math[f] is recursively-enumerable and $math[M] ​accepts ​$math[f]. We write $math[w_i] to refer to the //i//th word from $math[\Sigma^*]. We specify the $math[TM] generating $math[A_f] by the following pseudocode:
  
 $algorithm[$math[GEN()]] $algorithm[$math[GEN()]]
Line 372: Line 371:
 $math[\mathbf{while} \mbox{ } w \notin A_f \mbox{ } \mathbf{do}] $math[\mathbf{while} \mbox{ } w \notin A_f \mbox{ } \mathbf{do}]
  
-$math[\quad ​w=GEN();]+$math[\quad ​v=GEN();]
  
-$math[\quad A_f = A_f \cup \{ \};]+$math[\quad A_f = A_f \cup \{ \};]
  
 $math[\mathbf{end}] $math[\mathbf{end}]
Line 395: Line 394:
 The technique we use to show $math[f_{all} \notin R] is called a //​reduction//​ (from $math[f_h]). It proceeds as follows. We assume $math[f_{all} \in R]. Starting from the $math[TM \mbox{ } M_{all}] which decides $math[f_{all}] we built a $math[TM] which decides $math[f_h]. Thus, if $math[f_{all}] is decidable then $math[f_h] is decidable, which leads to contradiction. The technique we use to show $math[f_{all} \notin R] is called a //​reduction//​ (from $math[f_h]). It proceeds as follows. We assume $math[f_{all} \in R]. Starting from the $math[TM \mbox{ } M_{all}] which decides $math[f_{all}] we built a $math[TM] which decides $math[f_h]. Thus, if $math[f_{all}] is decidable then $math[f_h] is decidable, which leads to contradiction.
  
-First, for each fixed $math[TM \mbox{ } M] and fi xed input $math[w \in \Sigma^*],​ we build the $math[TM \mbox{ } \Pi_{M,​w}(\omega) = ]//"​Replace $math[\omega] by $math[w] and then simulate $math[M(w)]"//​. It is easy to see that $math[(\forall \omega \in \Sigma^* : \Pi_{M,​w}(\omega) \mbox{ halts})] iff $math[M(w)] halts. Now, we build the $math[TM \mbox{ } M_h] which decides $math[f_h]. The input of $math[M_h] is $math[enc(M)\_w]. We construct $math[\Pi_{M,​w}] and run $math[M_{all}(enc(\Pi_{M,​w}))]. By assumption $math[M_{all}] must always halt. If the output is $math[1], then $math[\Pi_{M,​w}(\omega)] halts for all inputs, hence $math[M(w)] halts. We output $math[1]. If the output is $math[0], then $math[\Pi_{M,​w}(\omega)] does not halt for all inputs, hence $math[M(w)] does not halt. We output $math[0].+First, for each fixed $math[TM \mbox{ } M] and fi xed input $math[w \in \Sigma^*],​ we build the $math[TM \mbox{ } \Pi_{M,​w}(\omega) = ]//"​Replace $math[\omega] by $math[w] and then simulate $math[M(w)]"//​. It is easy to see that $math[(\forall \omega \in \Sigma^* : \Pi_{M,​w}(\omega) \mbox{ halts})] iff $math[M(w) 
 +] halts. Now, we build the $math[TM \mbox{ } M_h] which decides $math[f_h]. The input of $math[M_h] is $math[enc(M)\_w]. We construct $math[\Pi_{M,​w}] and run $math[M_{all}(enc(\Pi_{M,​w}))]. By assumption $math[M_{all}] must always halt. If the output is $math[1], then $math[\Pi_{M,​w}(\omega)] halts for all inputs, hence $math[M(w)] halts. We output $math[1]. If the output is $math[0], then $math[\Pi_{M,​w}(\omega)] does not halt for all inputs, hence $math[M(w)] does not halt. We output $math[0].
  
 We have built a reduction from $math[f_{all}] to $math[f_h]: Using the $math[TM] which decides $math[f_{all}] we have constructed a machine which decides $math[f_h]. Since $math[f_h] is not recursive, we obtain a contradiction. We have built a reduction from $math[f_{all}] to $math[f_h]: Using the $math[TM] which decides $math[f_{all}] we have constructed a machine which decides $math[f_h]. Since $math[f_h] is not recursive, we obtain a contradiction.
Line 414: Line 414:
 $math[\Pi_{M,​w}(\omega) = \mbox{ if } \omega = 111 \mbox{ then } M(w) \mbox{ else loop }] $math[\Pi_{M,​w}(\omega) = \mbox{ if } \omega = 111 \mbox{ then } M(w) \mbox{ else loop }]
  
-We observe that (i) the transformation from $math[enc(M)\_w] to $math[enc(\Pi_{M,​w})] is decidable since it involves adding precisely three states to $math[M]: these states check the input $math[\omega],​ and if it is $math[111] - replace it with $math[w] and run $math[M]; (ii) $math[M_{111}(\Pi_{M,​w}) = 1 \mbox{ iff } M(w)halts. The reduction is complete. $math[f_{111} \notin R].+We observe that (i) the transformation from $math[enc(M)\_w] to $math[enc(\Pi_{M,​w})] is decidable since it involves adding precisely three states to $math[M]: these states check the input $math[\omega],​ and if it is $math[111] - replace it with $math[w] and run $math[M]; (ii) $math[M_{111}(\Pi_{M,​w}) = 1 \mbox{ iff } M(w) \mbox{halts}]. The reduction is complete. $math[f_{111} \notin R].
  
 **Halting on some input** **Halting on some input**
Line 434: Line 434:
 $math[f_{eq}(n^{enc(M_1)\_enc(M_2)}) = \left\{ \begin{array}{ll} 1 & \mbox{for all } w \in \Sigma^* \mbox{ : } M_1(w) \mbox{ halts iff } M_2(w) \mbox{ halts} \\ 0 & \mbox{otherwise} \end{array} \right.] $math[f_{eq}(n^{enc(M_1)\_enc(M_2)}) = \left\{ \begin{array}{ll} 1 & \mbox{for all } w \in \Sigma^* \mbox{ : } M_1(w) \mbox{ halts iff } M_2(w) \mbox{ halts} \\ 0 & \mbox{otherwise} \end{array} \right.]
  
-We reduce $math[f_{all}] to $math[f_{eq}]. Let $math[M_{triv}] be a one-state Turing Machine which halts on every input, and $math[M_{eq}] be the Turing Machine which decides $math[f_{eq}]. Then $math[M_{eq}(enc(M)\_enc(M_{triv}) = 1 \mbox{ iff } M] halts on all inputs. We have shown we can use $math +We reduce $math[f_{all}] to $math[f_{eq}]. Let $math[M_{triv}] be a one-state Turing Machine which halts on every input, and $math[M_{eq}] be the Turing Machine which decides $math[f_{eq}]. Then $math[M_{eq}(enc(M)\_enc(M_{triv})) = 1 \mbox{ iff } M] halts on all inputs. We have shown we can use $math[M_{eq}] in order to build a machine which decides $math[f_{all}]. Contradiction. $math[f_{eq} \notin R].
-[M_{eq}] in order to build a machine which decides $math[f_{all}]. Contradiction. $math[f_{eq} \notin R].+
  
 So far, we have used reductions in order to establish problem nonmembership in $math[R]. There are other properties of $math[R] and $math[RE] which can be of use for this task. First we defi ne: So far, we have used reductions in order to establish problem nonmembership in $math[R]. There are other properties of $math[R] and $math[RE] which can be of use for this task. First we defi ne:
Line 460: Line 459:
 $math[RE \cap coRE = R]. $math[RE \cap coRE = R].
  
-//Proof:// Assume $math[f \in RE \cap coRE]. Hence, there exists a Turing Machine $math[M] which ccepts ​$math[f] ​ +//Proof:// Assume $math[f \in RE \cap coRE]. Hence, there exists a Turing Machine $math[M] which accepts ​$math[f] and a Turing Machine $math[\overline{M}] which accepts $math[\overline{f}]. We build the Turing Machine:
-and a Turing Machine $math[\overline{M}] which accepts $math[\overline{f}]. We build the Turing Machine:+
  
-$math[M^*(w) = \mbox{ for } i \in \mathbb{N} \left\{ \begin{array}{ll} \mbox{ run } M(w) \mbox{ for } i \mbox{steps.}\\ \mbox{ If } M(w) = 1 \mbox{, return } 1 \mbox{. Otherwise:​}\\ \mbox{ run } \overline{M}(w) \mbox{ for } i \mbox{steps.}\\ \mbox{ If } \overline{M}(w) = 1 \mbox{, return } 0 \mbox{.} \end{array} \right.]+$math[M^*(w) = \mbox{ for } i \in \mathbb{N} \left\{ \begin{array}{ll} \mbox{ run } M(w) \mbox{ for } i \mbox{ steps.}\\ \mbox{ If } M(w) = 1 \mbox{, return } 1 \mbox{. Otherwise:​}\\ \mbox{ run } \overline{M}(w) \mbox{ for } i \mbox{ steps.}\\ \mbox{ If } \overline{M}(w) = 1 \mbox{, return } 0 \mbox{.} \end{array} \right.]
  
 Since $math[M] and $math[\overline{M}] will always halt when expected result is 1, they can be used together to decide $math[f]. Hence $math[f \in R]. Since $math[M] and $math[\overline{M}] will always halt when expected result is 1, they can be used together to decide $math[f]. Hence $math[f \in R].
Line 471: Line 469:
  
 //Proof:// The proposition follows immediately since the Turing Machine which decides $math[f] can be used to decide $math[\overline{f}],​ by simply switching it's output from $math[0] to $math[1] and $math[1] to $math[0]. The same holds for the other direction. //Proof:// The proposition follows immediately since the Turing Machine which decides $math[f] can be used to decide $math[\overline{f}],​ by simply switching it's output from $math[0] to $math[1] and $math[1] to $math[0]. The same holds for the other direction.
- +
 We conclude this chapter with a very powerful result which states that an //​category/​type//​ of problems does not belong in $math[R]. We conclude this chapter with a very powerful result which states that an //​category/​type//​ of problems does not belong in $math[R].
  
Line 477: Line 475:
 //Let $math[\mathcal{C} \subseteq RE]. Given a Turing Machine $math[M], we ask:// "The problem accepted by $math[M] is in $math[\mathcal{C}]?"​. //Answering this question is not in $math[R].// //Let $math[\mathcal{C} \subseteq RE]. Given a Turing Machine $math[M], we ask:// "The problem accepted by $math[M] is in $math[\mathcal{C}]?"​. //Answering this question is not in $math[R].//
  
-//Proof:// We consider that the trivial problem $math[f(n) = 0] is not in $math[\mathcal{C}]. Since $math[\mathcal{C}] is non-empty, suppose $math[f^* \in \mathcal{C}],​ and since $math[f^*] is recursively-enumerable,​ let $math[M] be the Turing Machine which accepts $math[f^*].+//Proof:// We consider that the trivial problem $math[f(n) = 0] is not in $math[\mathcal{C}]. Since $math[\mathcal{C}] is non-empty, suppose $math[f^* \in \mathcal{C}],​ and since $math[f^*] is recursively-enumerable,​ let $math[M^*] be the Turing Machine which accepts $math[f^*].
  
 We apply a reduction from a variant of $math[f_{111}],​ namely $math[f_x]. $math[f_x] asks if a Turing Machine halts for input $math[x]. We assume we can decide the membership $math[f \in \mathcal{C}] by some Turing Machine. Based on the latter, we construct a Turing Machine which decides $math[f_x] (i.e. solves the halting problem for a particular input). Let $math[M_x] be the Turing Machine which //accepts// $math[fx]. We apply a reduction from a variant of $math[f_{111}],​ namely $math[f_x]. $math[f_x] asks if a Turing Machine halts for input $math[x]. We assume we can decide the membership $math[f \in \mathcal{C}] by some Turing Machine. Based on the latter, we construct a Turing Machine which decides $math[f_x] (i.e. solves the halting problem for a particular input). Let $math[M_x] be the Turing Machine which //accepts// $math[fx].