Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
aa:lab:tm [2016/10/07 17:46] pdmatei created |
aa:lab:tm [2019/10/31 13:34] (current) cpeticila [Turing Machines] |
||
---|---|---|---|
Line 8: | Line 8: | ||
Let $$ f(w) = \left\{\begin{array}{cc}1 & w=0^*100 \\ 0 & \text{otherwise} \end{array}\right. $$ | Let $$ f(w) = \left\{\begin{array}{cc}1 & w=0^*100 \\ 0 & \text{otherwise} \end{array}\right. $$ | ||
- | Observe the difference between a mathematical function such as $f$, which is merely a mapping between entities, and a Turing Machine, which is a computational procedure illustrating how to determine an output value starting from an input value. | + | Observe the difference between a mathematical function such as $math[f], which is merely a mapping between entities, and a Turing Machine, which is a computational procedure illustrating how to determine an output value starting from an input value. |
The notation $0^*100$ is a [[https://en.wikipedia.org/wiki/Regular_expression|regular expression]]. An excellent reference for details on regular expressions is [[http://cdn.oreillystatic.com/oreilly/booksamplers/9780596528126_sampler.pdf|[1] ]]. | The notation $0^*100$ is a [[https://en.wikipedia.org/wiki/Regular_expression|regular expression]]. An excellent reference for details on regular expressions is [[http://cdn.oreillystatic.com/oreilly/booksamplers/9780596528126_sampler.pdf|[1] ]]. | ||
Line 14: | Line 14: | ||
We observe that $math[f] is the problem of establishing if a word is the binary encoding of the value $math[4]. The Turing Machine $math[M_1] accepts $math[f], while $math[M_2] decides $math[f]. The notions of acceptance and decision will be formally defined in the following lecture. Until then, we observe that: | We observe that $math[f] is the problem of establishing if a word is the binary encoding of the value $math[4]. The Turing Machine $math[M_1] accepts $math[f], while $math[M_2] decides $math[f]. The notions of acceptance and decision will be formally defined in the following lecture. Until then, we observe that: | ||
$$ \forall w\in\Sigma^*: M(w) = f(w) $$ | $$ \forall w\in\Sigma^*: M(w) = f(w) $$ | ||
- | captures the intuitive notion of '//solvability//'. A Turing Machine '//solves//' f, if M always halts, and the output of $M$ any problem instance $w$ coincides with the answer assigned to $w$ by $f$. The informal notion of '//solvability//' will be replaced by **decision** and **acceptance**, in the following lecture. | + | captures the intuitive notion of '//solvability//'. A Turing Machine '//solves//' $math[f], if $math[M] always halts, and the output of $math[M] for any problem instance $math[w] coincides with the answer assigned to $math[w] by $math[f]. The informal notion of '//solvability//' will be replaced by **decision** and **acceptance**, in the following lecture. |
=== More problems === | === More problems === | ||
Line 21: | Line 21: | ||
- Checking if a binary string has the same number of ones and zeros (lecture) | - Checking if a binary string has the same number of ones and zeros (lecture) | ||
- Checking if a number is a palindrome (you may assume, for simplicity, that the $|w|$ is even) | - Checking if a number is a palindrome (you may assume, for simplicity, that the $|w|$ is even) | ||
- | - **Identify a function which //cannot// be computed by a Turing Machine** {{## f(w) is 1 if sqrt(|w|) is a rational number and 0 otherwise ##}} | + | - **Identify a function whic |
+ | h //cannot// be computed by a Turing Machine** {{## f(w) is 1 if sqrt(|w|) is a rational number and 0 otherwise ##}} | ||
- Reversing a string | - Reversing a string | ||
| |