Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
aa:decidability [2016/10/14 10:53] pdmatei created |
aa:decidability [2019/10/15 06:53] (current) costin.lupu.almighty |
||
---|---|---|---|
Line 27: | Line 27: | ||
$proof | $proof | ||
- | It is sufficient to show that $math[\mathbb{H}\text{om}(\mathbb{N}, \{0, 1\})] is uncountably infinite. We build a proof by contraposition. We assume $math[\mathbb{H}\text{om}(\mathbb{N}, \{0, 1\})] is countably infinite. Hence, each natural number $math[n \in \mathbb{N}] corresponds to a function $math[f_n \in \mathbb{H}\text{om}(\mathbb{N}, \{0, 1\})]. We build a matrix as follows: Columns describe functions $math[f_n : n \in \mathbb{N}]. Rows describe inputs $math[k \in \mathbb{N}]. Each matrix content $math[m_{i,j}] is the value of $math[f_j(i)] (hence, the expected output for input $math[i], from function $math[f_j]). | + | It is sufficient to show that $math[\mathbb{H}\text{om}(\mathbb{N}, \{0, 1\})] is uncountably infinite. We build a proof by contraposition. We assume $math[\mathbb{H}\text{om}(\mathbb{N}, \{0, 1\})] is countably infinite. Hence, each natural number $math[n \in \mathbb{N}] corresponds to a function $math[f_n \in \mathbb{H}\text{om}(\mathbb{N}, \{0, 1\})]. We build a matrix as follows: Columns describe functions $math[f_n : n \in \mathbb{N}]. Rows describe inputs $math[k \in \mathbb{N}]. Each matrix content $math[m_{i,j}] is the value of $math[f_j(i)] (hence, the expected output for input $math[i], from function $math[f_j]). |
We illustrate the matrix building process below: | We illustrate the matrix building process below: | ||
Line 33: | Line 33: | ||
$math[\begin{array}{ll} \mbox{ } & f_0 & f_1 & f_2 & \ldots & f_n & \ldots \\ 0 & 1 & 1 & 0 & \ldots & 0 & \ldots \\ 1 & 0 & 1 & 1 & \ldots & 0 & \ldots \\ 2 & 1 & 0 & 1 & \ldots & 1 & \ldots \\ \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \\ n & 1 & 1 & 0 & \ldots & 1 & \ldots \\ \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \end{array} \\] | $math[\begin{array}{ll} \mbox{ } & f_0 & f_1 & f_2 & \ldots & f_n & \ldots \\ 0 & 1 & 1 & 0 & \ldots & 0 & \ldots \\ 1 & 0 & 1 & 1 & \ldots & 0 & \ldots \\ 2 & 1 & 0 & 1 & \ldots & 1 & \ldots \\ \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \\ n & 1 & 1 & 0 & \ldots & 1 & \ldots \\ \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \end{array} \\] | ||
- | The value $math[m_{i,j}] have been filled out purely for the illustration. We now devise a problem $math[f^*] as follows: | + | The value $math[m_{i,j}] have been filled out purely for the illustration. We now devise a problem $math[f^*] as follows: |
$math[f^*(x)=\left\{\begin{array}{ll}1 & \mbox{iff } f_x(x)=0 \\ 0 & \mbox{iff } f_x(x)=1 \end{array} \right.] | $math[f^*(x)=\left\{\begin{array}{ll}1 & \mbox{iff } f_x(x)=0 \\ 0 & \mbox{iff } f_x(x)=1 \end{array} \right.] | ||
- | Since $math[f^* \in Hom(\mathbb{N}, \{0, 1\})] it must also have a number assigned to it: $math[f^* = f_\alpha] for some $math[\alpha \in \mathbb{N}]. Then $math[f^*(\alpha) = 1] if $math[f_\alpha(\alpha) = 0]. But $math[f_\alpha(\alpha) = f^*(\alpha)]. Contradiction. On the other hand $math[f^*(\alpha) = 0] if $math[f_\alpha(\alpha) = 1]. As before we obtain a contradiction. | + | Since $math[f^* \in Hom(\mathbb{N}, \{0, 1\})] it must also have a number assigned to it: $math[f^* = f_\alpha] for some $math[\alpha \in \mathbb{N}]. Then $math[f^*(\alpha) = 1] if $math[f_\alpha(\alpha) = 0]. But $math[f_\alpha(\alpha) = f^*(\alpha)]. Contradiction. On the other hand $math[f^*(\alpha) = 0] if $math[f_\alpha(\alpha) = 1]. As before we obtain a contradiction. |
$end | $end | ||
Line 55: | Line 55: | ||
$def[Decision, acceptance] | $def[Decision, acceptance] | ||
Let $math[M] be a Turing Machine and $math[f \in Hom(\mathbb{N}, \{0, 1\})]. | Let $math[M] be a Turing Machine and $math[f \in Hom(\mathbb{N}, \{0, 1\})]. | ||
- | * $math[M] **decides** $math[f], iff for all $math[n \in \mathbb{N}]: $math[M(w) = 1] whenever $math[f(n^w) = 1] and $math[M(w) = 0] whenever $math[f(n^w) = 0]. | + | * $math[M] **decides** $math[f] iff for all $math[n \in \mathbb{N}]: $math[M(w) = 1] whenever $math[f(n^w) = 1] and $math[M(w) = 0] whenever $math[f(n^w) = 0]. |
- | * $math[M] **accepts** $math[f] iff for all $math[n \in \mathbb{N}]: $math[M(w) = 1] iff $math[f(n^w) = 1], and $math[M(w) = \perp] iff $math[f(n)=0]. | + | * $math[M] **accepts** $math[f] iff for all $math[n \in \mathbb{N}]: $math[M(w) = 1] iff $math[f(n^w) = 1], and $math[M(w) = \perp] iff $math[f(n)=0]. |
$end | $end | ||
Line 147: | Line 147: | ||
Let $math[M] be a Turing Machine and $math[w \in \Sigma^*] be a word. | Let $math[M] be a Turing Machine and $math[w \in \Sigma^*] be a word. | ||
- | * We build the Turing Machine $math[\Pi_{M,w}(\omega) = ]//"Replace $math[\omega] by $math[w] and then simulate $math[M(w)]"//. | + | * We build the Turing Machine $math[\Pi_{M,w}(\omega) = ]//"Replace $math[\omega] by $math[w] and then simulate $math[M(w)]"//. |
* The construction of $math[\Pi_{M,w}] depends on $math[M] and $math[w], as suggested by the indices. | * The construction of $math[\Pi_{M,w}] depends on $math[M] and $math[w], as suggested by the indices. | ||
* Note that building $math[\Pi_{M,w}] can be easily derived from the Universal Turing Machine. | * Note that building $math[\Pi_{M,w}] can be easily derived from the Universal Turing Machine. | ||
Line 155: | Line 155: | ||
* run $math[M_{all}] with input $math[enc(\Pi_{M,w})], and return the output. | * run $math[M_{all}] with input $math[enc(\Pi_{M,w})], and return the output. | ||
* it is easy to see that: | * it is easy to see that: | ||
- | * $math[(\forall \omega \in \Sigma^* : \Pi_{M,w}(\omega) \mbox{ halts})] iff $math[M(w)] halts. | + | * $math[(\forall \omega \in \Sigma^* : \Pi_{M,w}(\omega) \mbox{ halts})] iff $math[M(w)] halts. |
=== Step 2 (contraposition) === | === Step 2 (contraposition) === | ||
Line 162: | Line 162: | ||
The relationship between $math[f_{all}] and $math[f_h] is called **Turing-reducibility**, and is written: | The relationship between $math[f_{all}] and $math[f_h] is called **Turing-reducibility**, and is written: | ||
- | $math[f_h \leq_T f_{all}] | + | $math[f_h \leq_T f_{all}] |
- | This relation indicates a strong bond between the two problems which can be interpreted as //$math[f_h] is at least as hard as $math[f_{all}]//, in the sense that if we can decide $math[f_all] using a Turing Machine, then it is trivial to decide $math[f_h]. | + | This relation indicates a strong bond between the two problems which can be interpreted as //$math[f_{all}] is at least as hard as $math[f_{h}]//, in the sense that if we can decide $math[f_{all}] using a Turing Machine, then it is trivial to decide $math[f_h]. |
More formally: | More formally: | ||
$def[Turing-reducibility] | $def[Turing-reducibility] | ||
- | //Let $math[f_A, f_B \in Hom(\mathbb{N}, \{0, 1\})]. We say $math[f_A] is// Turing-reducible //to $math[f_B], and write $math[f_A \leq_T f_B] iff there exists a// decidable transformation// $math[T \in Hom(\mathbb{N},\mathbb{N})] such that $math[f_A(n) = 1] iff $math[f_B(T(n)) = 1].// | + | //Let $math[f_A, f_B \in Hom(\mathbb{N}, \{0, 1\})]. We say $math[f_A] is// Turing-reducible //to $math[f_B], and write $math[f_A \leq_T f_B] iff there exists a// decidable transformation// $math[T \in Hom(\mathbb{N},\mathbb{N})] such that $math[f_A(n) = 1] iff $math[f_B(T(n)) = 1].// |
$end | $end | ||
Line 211: | Line 211: | ||
{{## | {{## | ||
- | We reduce $math[f_h] to $math[f_{111}]. Assume $math[M_{111}] decides $math[f_{111}]. Given a Turing Machine $math[M] and word $math[w], we construct the machine: | + | We show $math[f_h \leq_T f_{111}]. Assume $math[M_{111}] decides $math[f_{111}]. Given a Turing Machine $math[M] and word $math[w], we construct the machine: |
$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 }] | ||
Line 228: | Line 228: | ||
{{## | {{## | ||
- | We reduce $math[f_{111}] to $math[f_{any}]. We assume $math[f_{any}] is decided by $math[M_{any}]. We construct: | + | We show $math[f_{111} \leq_T f_{any}]. We assume $math[f_{any}] is decided by $math[M_{any}]. We construct: |
$math[\Pi_M(\omega) = \mbox{ Replace } \omega \mbox{ by } 111 \mbox{ and } M(111)] | $math[\Pi_M(\omega) = \mbox{ Replace } \omega \mbox{ by } 111 \mbox{ and } M(111)] | ||
Line 244: | Line 244: | ||
{{## | {{## | ||
- | 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]. | + | We show $math[f_{all}\leq_T 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]. |
##}} | ##}} | ||