Due: March 14 at 5pm (no penalty late submission until 8am next morning), via Gradescope
In this assignment, You will practice analyzing, designing, and working with Turing machines. You will use general constructions and specific machines to explore the classes of recognizable and decidable languages. You will explore various ways to encode machines as strings so that computational problems can be recognized.
Resources: To review the topics for this assignment, see the class material from Weeks 7-10. We will post frequently asked questions and our answers to them in a pinned Piazza post.
Reading and extra practice problems: Sipser Sections 4.2, 5.3, 5.1. Chapter 4 problems 4.9, 4.12. Chapter 5 exercises 5.4, 5.5, 5.6, 5.7. Chapter 5 problems 5.22, 5.23, 5.24, 5.28
For all HW assignments: Weekly homework may be done individually or in groups of up to 3 students. You may switch HW partners for different HW assignments. Please ensure your name(s) and PID(s) are clearly visible on the first page of your homework submission and then upload the PDF to Gradescope. If working in a group, submit only one submission per group: one partner uploads the submission through their Gradescope account and then adds the other group member(s) to the Gradescope submission by selecting their name(s) in the “Add Group Members" dialog box. You will need to re-add your group member(s) every time you resubmit a new version of your assignment. Each homework question will be graded either for correctness (including clear and precise explanations and justifications of all answers) or fair effort completeness. For “graded for correctness” questions: collaboration is allowed only with CSE 105 students in your group; if your group has questions about a problem, you may ask in drop-in help hours or post a private post (visible only to the Instructors) on Piazza. For “graded for completeness” questions: collaboration is allowed with any CSE 105 students this quarter; if your group has questions about a problem, you may ask in drop-in help hours or post a public post on Piazza.
All submitted homework for this class must be typed. You can use a word processing editor if you like (Microsoft Word, Open Office, Notepad, Vim, Google Docs, etc.) but you might find it useful to take this opportunity to learn LaTeX. LaTeX is a markup language used widely in computer science and mathematics. The homework assignments are typed using LaTeX and you can use the source files as templates for typesetting your solutions. To generate state diagrams of machines, we recommend using Flap.js or JFLAP. Photographs of clearly hand-drawn diagrams may also be used. We recommend that you submit early drafts to Gradescope so that in case of any technical difficulties, at least some of your work is present. You may update your submission as many times as you’d like up to the deadline.
Integrity reminders
Problems should be solved together, not divided up between the partners. The homework is designed to give you practice with the main concepts and techniques of the course, while getting to know and learn from your classmates.
You may not collaborate on homework questions graded for correctness with anyone other than your group members. You may ask questions about the homework in office hours (of the instructor, TAs, and/or tutors) and on Piazza (as private notes viewable only to the Instructors). You cannot use any online resources about the course content other than the class material from this quarter – this is primarily to ensure that we all use consistent notation and definitions (aligned with the textbook) and also to protect the learning experience you will have when the ‘aha’ moments of solving the problem authentically happen.
Do not share written solutions or partial solutions for homework with other students in the class who are not in your group. Doing so would dilute their learning experience and detract from their success in the class.
You will submit this assignment via Gradescope (https://www.gradescope.com) in the assignment called “hw5CSE105W24”.
Assigned questions
Computational problems (14 points): For each of the following statements, determine if it is true or false. Clearly label your choice by starting your solution with True or False and then provide a justification for your answer.
(Graded for completeness) 1 True or False: The language \[\{\langle N_1, N_2 \rangle \mid N_1, N_2 \text{ are both NFAs over $\{0,1\}$ and } L(N_1) \subseteq L(N_2)\}\] is recognizable.
(Graded for correctness) 2 True or False: The language \[\{\langle D \rangle \mid D \text{ is a DFA over $\{0,1\}$ and } L(D) = L(0^*) \}\] is decidable.
(Graded for correctness) True or False: The language \[\{\langle M \rangle \mid M \text{ is a Turing machine and its start state equals its reject state} \}\] is decidable.
(Graded for completeness) True or False: The language \[\{\langle M \rangle \mid M \text{ is a Turing machine and } L(M) = \emptyset \}\] is decidable.
Challenge; not graded: what’s the difference between (c) and (d)?
What’s wrong with these reductions? (13 points): Suppose your friends are practicing coming up with mapping reductions \(A \leq_m B\) and their witnessing functions \(f: \Sigma^* \to \Sigma^*\). For each of the following attempts, determine if it is has error(s) or is correct. Do so by labelling each attempt with all and only the labels below that apply, and justifying this labelling.
Error Type 1: The given function can’t witness the claimed mapping reduction because there exists an \(x \in A\) such that \(f(x) \not\in B\).
Error Type 2: The given function can’t witness the claimed mapping reduction because there exists an \(x \not\in A\) such that \(f(x) \in B\).
Error Type 3: The given function can’t witness the claimed mapping reduction because the specified function is not computable.
Correct: The claimed mapping reduction is true and is witnessed by the given function.
Clearly present your answer by providing a brief (3-4 sentences or so) justification for whether each of these labels applies to each example.
(Graded for completeness) \(A_{\mathrm{TM}} \le_m HALT_{\mathrm{TM}}\) and \[f(x) = \begin{cases} \scalebox{.5}{$\langle$ \hspace{-.5cm} \raisebox{-.4cm}{ \begin{tikzpicture}[->,>=stealth',shorten >=1pt, auto, node distance=2cm, semithick] \tikzstyle{every state}=[text=black, fill=yellow!40] \node[initial,state,accepting] (q0) {$q_{\mathrm{acc}}$}; ; \end{tikzpicture}} $\rangle$} & \text{if } x = \langle M, w \rangle \text{ for a Turing machine $M$ and string $w$}\\ & \qquad \qquad \text{ and } w \in L(M) \\ \scalebox{.5}{$\langle$ \hspace{-.5cm} \raisebox{-.4cm}{ \begin{tikzpicture}[->,>=stealth',shorten >=1pt, auto, node distance=2cm, semithick] \tikzstyle{every state}=[text=black, fill=yellow!40] \node[initial,state] (q0) {$q_0$}; \node[state,accepting] (qacc) [right of = q0, xshift = 20]{$q_{acc}$}; \path (q0) edge [loop above] node {$0, 1, \scalebox{1.5}{\textvisiblespace}\to R$} (q0) ; \end{tikzpicture}} $\rangle$} & \text{otherwise} \end{cases}\]
Hint: There are two errors with this attempt.
(Graded for correctness) \(\{ w \mid w \in \{0,1\}^* \} \le_m \{w w \mid w \in \{0,1\}^* \}\) and \(f(x) = xx\) for each \(x \in \{0,1\}^*\).
(Graded for correctness) \(HALT_{\mathrm{TM}} \le_m EQ_{\mathrm{TM}}\) with \[f(x) = \begin{cases} \scalebox{.7}{$\langle$ \hspace{-.5cm} \raisebox{-.4cm}{ \begin{tikzpicture}[->,>=stealth',shorten >=1pt, auto, node distance=2cm, semithick] \tikzstyle{every state}=[text=black, fill=yellow!40] \node[initial,state,accepting] (q0) {$q_{\mathrm{acc}}$}; ; \end{tikzpicture}} , $M_w \rangle$} & \text{if } x = \langle M, w \rangle \text{ for a Turing machine $M$ and string $w$}\\\\ \scalebox{.7}{$\langle$ \hspace{-.5cm} \raisebox{-.4cm}{ \begin{tikzpicture}[->,>=stealth',shorten >=1pt, auto, node distance=2cm, semithick] \tikzstyle{every state}=[text=black, fill=yellow!40] \node[initial,state,accepting] (q0) {$q_{\mathrm{acc}}$}; ; \end{tikzpicture}}} , ~~~ \scalebox{.7}{\hspace{-.5cm} \raisebox{-.4cm}{\begin{tikzpicture}[->,>=stealth',shorten >=1pt, auto, node distance=2cm, semithick] \tikzstyle{every state}=[text=black, fill=yellow!40] \node[initial,state] (qrej) {$q_{\mathrm{rej}}$}; \node[state,accepting] (qacc) [right of=qrej] {$q_{\mathrm{acc}}$}; ; \end{tikzpicture}}$\rangle$ } & \text{otherwise}. \end{cases}\] Where for each Turing machine \(M\), we define \[\begin{aligned} M_w = ``&\text{On input y} \\ &1. \text{ Simulate $M$ on $w$.}\\ &2. \text{ If it accepts, accept.}\\ &3. \text{ If it rejects, reject."} \end{aligned}\]
Using mapping reductions (14 points): Consider the following computational problems we’ve discussed \[\begin{aligned} A_{TM} &= \{ \langle M, w \rangle \mid M \text{ is a Turing machine, } w \text{ is a string and $M$ accepts $w$}\} \\ HALT_{TM} &= \{ \langle M, w \rangle \mid M \text{ is a Turing machine, } w \text{ is a string and $M$ halts on $w$}\} \\ E_{TM} &= \{ \langle M \rangle \mid M \text{ is a Turing machine and } L(M) = \emptyset\} \\ EQ_{TM} &= \{ \langle M_1, M_2 \rangle \mid M_1, M_2 \text{ are both Turing machines and } L(M_1) = L(M_2) \} \end{aligned}\] and the new computational problem \[One_{TM} = \{ \langle M \rangle \mid M \text{ is a Turing machine and $M$ accepts exactly one string} \}\]
(Graded for correctness) Give an example of a string that is an element of \(One_{TM}\) and a string that is not an element \(One_{TM}\) and briefly justify your choices.
(Graded for completeness) Prove that \(One_{TM}\) is not decidable by showing that \(A_{TM} \leq_m One_{TM}\).
(Graded for correctness) Give a different proof that \(One_{TM}\) is not decidable by showing that \(HALT_{TM} \leq_m One_{TM}\).
(Graded for completeness) Is \(One_{TM}\) recognizable? Justify your answer.
Examples of languages (9 points):
For each part of the question, use precise mathematical notation or English to define your examples and then briefly justify why they work.
(Graded for correctness) Two undecidable languages \(L_1\) and \(L_2\) over the same alphabet whose union \(L_1 \cup L_2\) is decidable, or write NONE if there is no such example (and explain why).
(Graded for correctness) A regular language \(L_3\) and an unrecognizable language \(L_4\) over the same alphabet whose intersection \(L_3 \cap L_4\) is unrecognizable, or write NONE if there is no such example (and explain why).
(Graded for correctness) A co-recognizable language \(L_5\) that is NP-complete, or write NONE if there is no such example (and explain why). Recall the definition: A language \(L\) over an alphabet \(\Sigma\) is called co-recognizable if its complement, defined as \(\Sigma^* \setminus L = \{ x \in \Sigma^* \mid x \notin L \}\), is Turing-recognizable.
This means you will get full credit so long as your submission demonstrates honest effort to answer the question. You will not be penalized for incorrect answers. To demonstrate your honest effort in answering the question, we expect you to include your attempt to answer *each* part of the question. If you get stuck with your attempt, you can still demonstrate your effort by explaining where you got stuck and what you did to try to get unstuck.↩︎
This means your solution will be evaluated not only on the correctness of your answers, but on your ability to present your ideas clearly and logically. You should explain how you arrived at your conclusions, using mathematically sound reasoning. Whether you use formal proof techniques or write a more informal argument for why something is true, your answers should always be well-supported. Your goal should be to convince the reader that your results and methods are sound.↩︎