Theory of Computation
Smith Computer Science
Problems as Languages
In this class, we have converted "finding a solution to a problem" to "Learning to accept words from a Language".
In our world, Answering a question means building a machine that recognizes the language-version of that question.
Example problem:
"Can you come up with a binary string with a pattern of 0s and 1s such that the string is a palindrome"
Example Language-Version:
\[ L = \{ w \in \Sigma^* | w^R = w \} \]
Example solution:
(See the CMF, PDA, or TM solutions to this problem)
Questions about Machines
Often we'll ask questions about the machines we've seen so far.
Again, answering a question means building a machine that recognizes the language-version of that question.
So, a problem like:
"Find the set of Turing Machines that have up to 5 states",
can be rephrased as finding the Language:
\[ L = \{ < M > | M \text{ is a TM and } M \text{ has fewer than 5 states} \} \]
Answering with an Algorithm
How would you "Solve" the problem for:
\[ L = \{ < M > | M \text{ is a TM and } M \text{ has fewer than 5 states} \} \]
(Wait; then Click)
Another Turing Machine!! ... A Decider for \(L\) we'll call \(D_L\)
\[
\begin{align*}
& D_L :\\
& \text{On INPUT } < M >\\
& \quad \text{Inspect the description of } M \\
& \quad \quad \text{IF $M$ is not a valid TM: REJECT} \\
& \quad \quad \text{ELSE IF $M$ has fewer than 5 states: ACCEPT} \\
& \quad \quad \text{ELSE: REJECT} \\
\end{align*}
\]
CAN we get stuck on a loop?
(Note that we know something about description \(M\) that helps us answer this question)
Questions about Machines
Discuss if you could build \(D_L\) for the following language:
\[ L = \{ < M, w > | TM M \text{ accepts } w \text{ in fewer than 10 steps} \} \]
Questions about Machines
Discuss if you could build \(D_L\) for the following language:
\[ L = \{ < A > | \text{DFA $A$ accepts an infinite number of words (L(A) is infinite)} \} \]
Questions about Machines
Discuss if you could build \(D_L\) for the following language:
\[ A_{TM} = \{ < M, w> | \text{TM $M$ accepts } w \} \]