CMPSCI 501: Theory of Computation
David Mix Barrington
Spring, 2016
Homework Assignment #1
Posted Thursday 21 January 2016
Due on paper in class, Wednesday 3 February 2016
There are thirteen
questions for 100 total points plus
10
extra credit.
All but four are from
the textbook, Introduction to the Theory of Computation
by Michael Sipser (third edition, but the second edition numbers
are the same for
all but the last problem). Some problems are
adapted as
indicated.
The number in parentheses following each problem
is its individual point value.
Students are responsible for understanding and following
the academic honesty
policies indicated on this page.
Correction in purple made 22 January 2016.
- Problem A-1 (15): Let G be an undirected graph. Define the
binary
relation P on nodes of G, so the P(x, y) is true if and only if
there
is a path from x to y.
- (a, 5) Argue informally that P is an equivalence relation.
- (b, 10) The equivalence classes of P are called connected
components. Prove that if G is a graph with n nodes, e edges,
and no cycles (no non-trivial simple paths from a node to
itself, where a simple path is one that does not reuse an edge,
and
a trivial path is one with no edges), it has exactly n - e
connected
components. (Hint: Let n be arbitrary and use induction on e.
You
can't have a situation where e ≥ n, but your proof doesn't need
to worry about that.)
- Problem A-2 (15): Prove the three following statements for all
nonnegative integers n by ordinary induction on n. In both cases
let
Σ = {a, b, c}.
- (a, 5)
The number of palindromes of length 2n + 1 over
Σ is exactly 3n+1.
- (b, 5) The number of strings of length n + 1 that never have
the same letter twice in a row is 3(2)n.
- (c, 5) The number of strings of length n where the letters occur in
alphabetical
order (a's before b's before c's) is exactly (n+1)(n+2)/2.
- Problem A-3 (15):
Let G be a directed graph with at least one node,
and no loops, such that for any distinct nodes x and y,
there is an edge either from x to y or from y to x but not both.
Prove that there must be a Hamilton path in G (a simple path
that visits all the nodes). Hint: Use induction on all
positive integers n to show that this is true for all such
graphs with n vertices.
- Problem A-4 (5): As in Problem A-2, let Σ = {a, b,
c} and let X be
the set of all strings that never have the same letter twice in a
row.
Find the "index of X" as defined in Problem 1.52, that is, the
number
of Myhill-Nerode equivalence classes for X. Justify your answer.
- Exercise 1.10 (5). Don't miss the word "star". You may
use
any valid method.
- Exercise 1.20 (5). No proofs needed.
- Exercise 1.28 part c only, but also produce a DFA for the
language.
You may use any valid method (5)
- Problem 1.32 (10).
- Problem 1.48 (10).
- Problem 1.60 (5).
- Problem 1.61 (10).
- Problem 1.70 (10XC). (This is not in the second edition
so I will repeat the question here.)
We define the avoids operation
for
languages A and B to be "A avoids B = {w: w ∈ A and w doesn't
contain
any string in B as a substring}". Prove that the class of regular
languages is closed under the avoids operation. (That is, if A
and
B are regular languages, so is "A avoids B".)
Last modified 22 January 2016