Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
aa:lab:decidability [2016/10/14 10:55] pdmatei created |
aa:lab:decidability [2016/11/01 12:07] (current) pdmatei |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== Decidability ===== | ===== Decidability ===== | ||
- | We recall a few basic definitions. Let $M$ be a Turing Machine over $\Sigma^*$ and $f:\Sigma^*\rightarrow\{0,1\}$ be a decision problem. Then: | + | We recall a few basic definitions. Let $math[M] be a Turing Machine over $\Sigma^*$ and $math[f:\Sigma^*\rightarrow\{0,1\}] be a decision problem. Then: |
- | * $M$ accepts $f$ iff $\forall w\in\Sigma^*: M(w) = 1 \iff f(w) = 1$ | + | * $math[M] accepts $math[f] $math[\iff] $math[\forall w\in\Sigma^*: M(w) = 1 \iff f(w) = 1] and $math[M(w) = \bot \text{ otherwise }] |
- | * $M$ decides $f$ iff $M$ accepts $f$ and $M$ halts for all inputs. | + | * $math[M] decides $math[f] $math[\iff] $math[M] accepts $math[f] and $math[M] halts for all inputs. |
We say: | We say: | ||
- | * $f$ is **recursively enumerable** if $f$ is accepted by some Turing Machine; | + | * $math[f] is **recursively enumerable** if $math[f] is accepted by some Turing Machine; |
- | * $f$ is **recursive** if $f$ is decided by some Turing Machine; | + | * $math[f] is **recursive** if $math[f] is decided by some Turing Machine; |
- | Let $RE$ and $R$ be the sets of recursively-enumerable and recursive functions, respectively. We say: | + | Let $math[RE] and $math[R] be the sets of recursively-enumerable and recursive functions, respectively. We say: |
- | * $f$ is **decidable** iff it is **recursive** | + | * $math[f] is **decidable** $math[\iff] $math[f] it is **recursive** |
- | * $f$ is **semi-decidable** iff it is **recursively-enumerable** but **not recursive** | + | * $math[f] is **semi-decidable** $math[\iff] $math[f] it is **recursively-enumerable**, but **not recursive** |
- | * $f$ is **undecidable** iff it is **not recursive** | + | * $math[f] is **undecidable** $math[\iff] $math[f] it is **not recursive** |
- | We note that the former ('semi-decidable'/'undecidable') may appear in the literature with slightly different meanings. Whenever we want no ambiguity, we prefer the terms recursive/recursively-enumerable. | + | We note that the former (//semi-decidable// / //undecidable//) may appear in the literature with slightly different meanings. Whenever we want no ambiguity, we prefer the terms recursive / recursively-enumerable. |
==== Recursive / Recursively-enumerable problems ==== | ==== Recursive / Recursively-enumerable problems ==== | ||
Line 23: | Line 23: | ||
==== Proving a problem is NOT recursive ==== | ==== Proving a problem is NOT recursive ==== | ||
- | The widely-known technique is called **Turing-reduction**. Suppose $f:\Sigma^* \rightarrow \{0,1\}$ is a studied problem. The reduction technique implies the following: | + | The widely-known technique is called **Turing-reduction**. Suppose $math[f:\Sigma^* \rightarrow \{0,1\}] is a studied problem. The reduction technique implies the following: |
- | - select a problem $g:\Sigma^* \rightarrow \{0,1\}$ which is not recursive | + | - select a problem $math[g:\Sigma^* \rightarrow \{0,1\}] which is not recursive (we know this a priori) |
- | - construct a transformation $T:\Sigma^*\rightarrow\Sigma^*$ such that: | + | - construct a transformation $math[T:\Sigma^*\rightarrow\Sigma^*] such that: |
- | - $T$ can be implemented as a Turing Machine which always halts | + | - $math[T] can be implemented as a Turing Machine which always halts |
- | - $\forall w\in\Sigma^*: g(w) = 1 \iff f(T(w))=1$ (this double implication must be proven in steps) | + | - $math[\forall w\in\Sigma^*: g(w) = 1 \iff f(T(w))=1] **(this double implication must be proven in steps)** |
- | Once such a transformation is shown to exist for a particular $g$, we say: | + | Once such a transformation is shown to exist for a particular $math[g], we say: |
- | * $g$ is **Turing-reducible** to $f$, and write $g\leq_T f$ | + | * $math[g] is **Turing-reducible** to $math[f], and write $math[g\leq_T f] |
- | The informal intuition is that problem $f$ is **at least as hard** as problem $g$, since, if we can solve (decide) $f$, we are **guaranteed** to solve (decide) $g$. The argument is as follows: | + | The informal intuition is that problem $math[f] is **at least as hard** as problem $math[g], since, if we can solve (decide) $math[f], we are **guaranteed** to solve (decide) $math[g]. The argument is as follows: |
- | * suppose $M_f$ decides $f$. | + | * suppose $math[M_f] decides $math[f]. |
- | * we construct $M_g(w) = M_f(T(w))$. Then: | + | * we construct $math[M_g(w) = M_f(T(w))]. Then: |
- | * $M_g$ always halts, since: (i) $T$ always halts (ii) $M_f$ always halts (since it decides $f$) | + | * $math[M_g] always halts, since: (i) $math[T] always halts (ii) $math[M_f] always halts (since it decides $math[f]) |
- | * $M_g(w) = 1 \iff g(w) = 1$, due to the above properties of $T$ (see above) | + | * $math[M_g(w) = 1 \iff g(w) = 1], due to the above properties of $math[T] (see above) |
- | * we have shown $M_g$ decides $g$. | + | * we have shown $math[M_g] decides $math[g]. |
- | Finally, having shown $g\leq_T f$, we have constructed a //reductio-ad-absurdum// argument. If we recall point 1: $g$ is not decidable. However, by assuming $f$ is decidable, we have shown we can decide $g$. Contradiction! | + | Finally, having shown $math[g\leq_T f], we have constructed a //reductio-ad-absurdum// argument. If we recall point 1: $math[g] is not decidable. However, by assuming $math[f] is decidable, we have shown we can decide $math[g]. Contradiction! |
- | ==== How to choose $T$ and $g$ ==== | + | ==== How to choose $math[T] and $math[g] ==== |
- | There is no general rule on how to choose $g$ and how to construct $T$, when studying a particular problem $f$. As in any other activity, a lot of practice helps. Sometimes, reductions from similar problems seem to be easier. | + | There is no general rule on how to choose $math[g] and how to construct $math[T], when studying a particular problem $math[g]. As in any other activity, a lot of practice helps. Sometimes, reductions from similar problems seem to be easier. |
- | One general observation is that $T$ and $g$ must be thought of in tandem, such that condition b. can be proven (usually, the trickiest part of a reduction) | + | One general observation is that $math[T] and $math[g] must be thought of in tandem, such that condition b. can be proven (usually, the trickiest part of a reduction) |
==== Some undecidable problems ==== | ==== Some undecidable problems ==== | ||
Line 87: | Line 87: | ||
==== More stuff ==== | ==== More stuff ==== | ||
- | * When discussing the reduction scheme, we assumed both problems ($f$ and $g$) are defined over the same alphabet. Should this generally be the case? Can we bypass this restriction? | + | * When discussing the reduction scheme, we assumed both problems ($math[f] and $math[g]) are defined over the same alphabet. Should this generally be the case? Can we bypass this restriction? |
* Mathematically, $\leq_T \subseteq \mathbb{H}om(\mathbb{N},\{0,1\}) \times \mathbb{H}om(\mathbb{N},\{0,1\})$, i.e. $\leq_T$ is a relation over decision problems. What properties does $\leq_T$ have? | * Mathematically, $\leq_T \subseteq \mathbb{H}om(\mathbb{N},\{0,1\}) \times \mathbb{H}om(\mathbb{N},\{0,1\})$, i.e. $\leq_T$ is a relation over decision problems. What properties does $\leq_T$ have? | ||
Line 93: | Line 93: | ||
* how can we use these properties in real-life? | * how can we use these properties in real-life? | ||
- | * In a lot of literature, a decision problem is also modelled as a **language**, that is, a set $L$ of words - a subset of $\Sigma^*$. The words in $L$ are the set of //yes//-instances of the problem, while those outside $L$ - the set of //no//-instances. This is very similar in spirit with our dual definition for interpretations (as functions, or as sets). This definition for problems will be employed in the 3-rd year lecture on **formal languages** (LFA). | + | * In a lot of literature, a decision problem is also modelled as a **language**, that is, a set $math[L] of words - a subset of $math[\Sigma^*]. The words in $math[L] are the set of //yes//-instances of the problem, while those outside $math[L] - the set of //no//-instances. This is very similar in spirit with our dual definition for interpretations (as functions, or as sets). This definition for problems will be employed in the 3-rd year lecture on **formal languages** (LFA). |