1. A simple programming exercise: Write the quintuples for a
Turing machine that transforms a unary string into its binary
representation. Initially the input tape contains the number n in
unary notation (alphabet: cfw_1). When the machine stops, the
inpu
1. We have seen that a grammar where all productions are of the
form:
A -> aB, A -> c (A, B non-terminals, a,c terminals)
defines a regular language, and that from the grammar we can
build directly an FSA that recognizes the corresponding
language. Show t
1. Consider the grammar:
S => ( L ) | a
L => L, S | S
where the terminals are cfw_ ( ) , a
Build parse trees for the following sentences in the language:
a) (a, (a, a)
b) (a, (a, a), (a, a)
c) Describe informally the language generated by this grammar.
2.
1. Prove that the sum of the cubes of the integers from 1 to N is
N^2 (N+1)^2 / 4,
where "^" denotes exponentiation.
2. Give the DFA accepting the following language over the
alphabet cfw_0, 1: the set of strings that include 011 as a
substring.
3. Same q
Theory of Computation
Homework 11.
Due Date: Wednesday, November 23.
Chapter 5, Nos. 2, 3, 5, 6, 8.
7. Let G-UHP be the following problem.
Input: G = (V, E ), an undirected graph.
Question: Does G have vertices u and v such that there is a Hamiltonian Pat
Theory of Computation
Homework 10.
Due Date: Wednesday, November 29.
1. Let L be a listing of programs, i.e. L(i) = Qi for some program Qi , where Qi (i) halts for
all i, and further if Qi (x) halts, its output, denoted Qi (x), is an integer. Prove that t
1. Consider the following DFA over the binary alphabet:
Q = cfw_p, q, r, s, start state p, accepting state p.
With the following transition table:
d (p,0) = s, d (p,1) = p
d (q,0) = p, d (q,1) = s
d (r,0) = r, d (r,1) = q
d (s,0) = q, d (s,1) = r
Write th