On this page:
1 Computing Whether Two Languages are Equivalent:   Is it a CFL?
2 Turing Machine Computation
3 A Turing-Recognizable Language
4 Are Turing-Recognizable Languages Are Closed under the OPPO operation?

Homework 7

Last updated: Sun, 2 Apr 2023 12:46:42 -0400

Out: Mon Mar 27, 00:00 EST Due: Sun Apr 02 Tue Apr 04, 23:59 EST (NOTE: extended)

This assignment begins to explore Turing Machines.

Homework Problems

  1. Computing Whether Two Languages are Equivalent: Is it a CFL? (9 points)

  2. Turing Machine Computation (10 points)

  3. A Turing-Recognizable Language (10 points)

  4. Are Turing-Recognizable Languages Are Closed under the OPPO operation? (10 points)

  5. README (1 point)

Total: 40 points

Submitting

Submit your solution to this assignment in Gradescope hw7. Please assign each page to the correct problem and make sure your solutions are legible.

A submission must also include a README containing the required information.

1 Computing Whether Two Languages are Equivalent: Is it a CFL?

In this class, we have talked a lot about equivalent representations of languages, where two things, e.g., a DFA and an NFA, are equivalent if they recognize the same language.

Of course, the most basic representation of a language is a set of strings.

Now imagine we wish to compute whether two sets of strings (i.e., languages) are equivalent. This computation can be formulated as a (meta)language, call it \textrm{EQ}_\textsf{L}:

\textrm{EQ}_\textsf{L} = \left\{\ell_1\texttt{=}\ell_2\mid \ell_1,\ell_2\textrm{ are strings that, when viewed as sets, are equivalent}\right\}

More specifically, \ell_1 and \ell_2 are strings of the form \texttt{\{}w,\ldots\texttt{\}} where w\in\left\{\texttt{a},\texttt{b},\texttt{c}\right\}^*. In other words, \ell_1 and \ell_2 are strings written with the braces set notation, where elements in the set are separated by commas.

So overall, the alphabet of \textrm{EQ}_\textsf{L} is \left\{\texttt{=},\texttt{\{},\texttt{\}},\texttt{,},\texttt{a},\texttt{b},\texttt{c}\right\} (seven characters total—an equal sign, open and close brace, a comma, and the letters a, b, and c—written here with a code font to distinguish them from the surrounding mathematical notation).

Some strings in \textrm{EQ}_\textsf{L}:
  • \texttt{\{\}=\{\}}

  • \texttt{\{a\}=\{a\}}

  • \texttt{\{a,b\}=\{a,b\}}

  • \texttt{\{a,b\}=\{b,a\}}

Some strings not in \textrm{EQ}_\textsf{L}:
  • \texttt{abc}

  • \texttt{a=a}

  • \texttt{,}

  • \texttt{\{\}}

  • \texttt{\{a,b,c\}}

  • \texttt{\{a,b\}=\{a,c\}}

Prove the computation expressed by \textrm{EQ}_\textsf{L} cannot be computed by a PDA.

In other words, prove that \textrm{EQ}_\textsf{L} is not a context-free language.

Your proof should be a proof by contradiction and should use the Pumping lemma for CFLs.

2 Turing Machine Computation

Here is a Turing Machine state diagram from class (Figure 3.10 in the Sipser Textbook):

UPDATE (2023-03-31): You may assume that transitions that go to q_{reject} do not change the tape contents and move the head to the right.

Remember that from each state, there are implicit transitions to an implicit q_{reject} state, for any alphabet characters that are not explicitly shown. Also, if a transition omits the "write" character, then the tape contents stay the same (i.e., it "writes" the same character that was there).

Using this machine, answer the following questions (if your answer includes TM configurations, they must be the textual representation of a configuration).

  1. What is the start configuration of this machine for an input string with characters \texttt{000111100}?

  2. Give two concrete strings accepted by this TM. Then, for each of these strings, give a sequence of configurations that starts in the start configuration and ends in a configuration containing q_{accept}. The two sequences of configurations that you submit must together use every (shown) transition in the machine. Make sure that the head is pointing at the correct character at each step.

  3. Give two concrete strings rejected by this TM. Then, for each of these strings, give a sequence of configurations that starts in the start configuration and ends in a configuration containing q_{reject}.

  4. When a Turing Machine is given an input string and begins computation on that string, what are the possible results of the computation?

3 A Turing-Recognizable Language

In class we showed that the language \left\{\texttt{a}^n\texttt{b}^n\mid n\geq 0\right\} is not a regular language, but is a CFL.

Now prove that this language is a Turing-recognizable language.

Your proof must of course be in the form of a Statements and Justifications table.

Any Turing Machine you create should be a high-level description. In addition, the criteria to show that a Turing machine recognizes some language is to give three example strings that are both accepted by the machine and in the language, and three examples that are both not accepted by the machine and not in the language.

4 Are Turing-Recognizable Languages Are Closed under the OPPO operation?

Say we want to prove that the set of Turing-recognizable languages is closed under the \mathrm{OPPO} operation (from the Closed Operation Practice problem in Homework 3).

Answer the following:

  1. Give the If-Then statement that must be proved.

  2. Sketch out a potential proof by giving a table of Statements and Justifications, where the last statement is the If-Then statement to be proved from above.

    If your proof requires constructing a TM that calls (an)other TM(s), the TM definition must use a table of possible TM outcomes, like the ones from lecture, that show all possible combinations of results from all of the Turing machines involved in your answer. (If you do this, you don’t need to include the "show examples" step in your proof.)

    UPDATE (2023-03-31): It would be easiest to create two such outcome tables. One that shows what the TM does, and another to show what the TM should do.

  3. Based on what you have done so far the two tables you created, comment on why Turing-recognizable languages might not be closed under the \mathrm{OPPO} operation..