Problem 01

. Show that is co-Turing recognizable.

To show that is recognizable, we will use the fact that:

  • we can decide if a word is in
  • we can list all strings as is enumerable

First we design a recognizer Turing machine :

Pseudocode:

If Turing machine accepts, then we have found a such that only one grammar generates it, meaning .

If this is the case then there is at least a string for the symmetric difference. the language is fully exhausted, and thus the string must be some . Once it is reached, the two membership tests are in disagreement and thus the Turing machine accepts. And thus, halts for every input in the CFG

In the other case where , this means that every string returns an identical membership answer, and the Turing machine will run forever as the if block is never reached.

And thus recognizes as required


Problem 02

Let . Show that is a decidable language.

This is essentially the same as saying , where .

Because these are both regular, we can make a DFA for the intersecction to test if that DFA has any reachable accept state given that we can decide on the emptiness of intersection.

We will make a new DFA for finding even number of 0’s, where is start and accept for when it has seen an even number of 0’s, and is otherwise.

Pseudocode:

if this machine rejects, that means that an accepting state for the dfa is reachable, and therefore M does not accept string wtih even number of 0’s.

If this machine accepts, that means no accept state is reachable, and thus our claim holds. M does not accept a string with an even number of 0’s.

Given that this is a DFA and there are only 2 states, the machine halts on every input.

Given that this turing machine decided the membership for all , the language is decidable


Problem 03

Consider this Turing Machine ( adapted from Turing’s 1936 paper):

Assume for the following questions that this Turing Machine starts wtih an entirely blank tape.

  1. Describe the behavior of this machine in plain English (but be precise!).
  2. Will this machine ever halt? Why or why not?
  3. Give the first five configurations of this machine.

Problem 04

Consider this context-free grammar:

\begin{align*} S &\to A | B \ A &\to 11A | B | \epsilon \ B &\to 11A | 0B | \epsilon \end{align*}

1. Describe the language of this CFG in plain English (but be precise!). Given a grammar $G=\{ w \in \{ 0,1 \}^{*} |\text{ every maximal block of consecutive 1's in w has an even length} \}$ This grammar is essentially meaning that there is no word in $L$ has a string of an odd number of consecutive ones, aka a single, triple, or 5 ones in a row. 2. Is this grammar ambiguous? If so, prove it. We know that a CFG is ambigious if a string has two seperate parse trees. This grammar is ambigous because there are many different parse trees, even for an empty word:

S \to A \to \epsilon

S \to B \to \epsilon

are both derivations for $\epsilon$, meaning they both have two different productions, and thus the parse trees are different. --- ## Problem 05 Consider this DFA: ![[Screenshot 2025-05-01 at 10.01.01 AM.png]] 1. Give a description of the language of this machine in set builder notation. 2. Give a complete formal definition of this machine, with complete specification of all elements in the tuple, including $\delta$. --- ## Problem 06 Consider this NFA: ![[Screenshot 2025-05-01 at 10.01.53 AM.png]] 1. Give a regular expression that describes the language of this machine. 2. Explain in plain English what occurs in this machine on input `001`. Be sure to account for all branches of computation. Draw a tree if it helps.