Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
1. Department of Mathematics and Statistics, I.I.T. Kanpur
MTH401 Theory of Computation - Problem Set 3
(1) Design a Turing machine for each language listed below. Note that you may choose
not to provide official details (e.g., the transition diagram, etc.) of your machine
but in that case you must clearly explain what constitutes your machine (e.g.,
alphabet/symbols, tapes/tracks, etc) along with how your machine works (e.g., a
step by step description of the working of your Turing machine).
(a) {0n
1n2
: n > 0}.
(b) The language of odd integers written in binary.
(c) {a#b#c : a, b, c ∈ {0, 1}+
and val(a) + val(b) = val(c)}. (Note that val(α) is
defined to be the non-negative integer that has binary representation α)
(2) For each of the language below, indicate the smallest complexity class that contains
it (e.g., Regular, Deterministic Context Free, Context Free, Recursive, Recursively
Enumerable, Not Recursively Enumerable). You should provide sufficient justifica-
tions for your judgments.
(a) {1n
0m
1m
0n
: n, m > 0}.
(b) The language L of all strings α over {a, b, c} such that α contain an equal
number of occurrences of a’s, b’s and c’s.
(c) The complement of the language L in part (b).
(d) {0m
: m = 2k + 1 where k > 0}.
(e) {0m
10m!
: m > 0}.
(3) Prove that the problem of determining if the languages generated by two CFG’s
are equal is undecidable.
(4) For each of the following languages, state whether the language is or is not re-
cursively enumerable and whether the complement of the language is or is not
recursively enumerable. Justify for your answers.
(a) {M : M is a Turing machine with L(M) = ∅}.
(b) {M : M is a Turing machine with L(M) = Σ∗
}.
(c) {M : M is a Turing machine where L(M) is a regular set}.
(d) {M : M is a finite state machine with L(M) = Σ∗
}.
(e) {G : G is an ambiguous context free grammar }.
1
2. 2
(5) Prove that the Post Correspondence Problem is decidable for strings over the al-
phabet {0}.
(6) The Japanese game go-moku is played by two players, “X” and “O”, on a 19 × 19
grid. Players take turns placing markers, and the first player to achieve 5 of his
markers consecutively in a row, column, or diagonal, is the winner. Consider this
game generalized to an n by n board. Let
GM = {P : P is a position in generalized go-moku
where player “X” has a winning strategy}.
A position means a board with markers on it , such as ones that may occur in the
middle of a play of the game. Show that GM is in PSPACE.
(7) (a) A literal is either a variable or the negation of a variable.
(b) A clause is an OR of literals.
(c) A Boolean formula is in Conjunctive Normal Form (CNF) if it the AND
of clauses.
(d) The problem CSAT refers to the yes/no question “Is a Boolean formula in
CNF satisfiable?”
Show that CSAT is NP-Complete.
Hint : One can easily modify the proof of Cook’s theorem to product a Boolean
expression in CNF.
(8) If a Boolean expression is in CNF and every clause consists of exactly k literals, we
say that the Boolean formula is in k-CNF and its satisfiability question an instance
of k-SAT.
(a) Prove that 2-SAT is in P.
(b) Show that 3-SAT is NP-complete.
(9) Consider the following solitaire game. You are given an m × m board where each
one of the m2
positions may be empty or occupied by either a red stone or a blue
stone. Initially, some configuration of stones is placed on the board. Then, for each
column you must remove either all of the red stones in that column or all of the blue
stones in that column. (If a column already has only red stones or only blue stones
in it then you do not have to remove any further stones from that column.) The
objective is to leave at least one stone in each row. Finding a solution that achieves
this objective may or may not be possible depending upon the initial configuration.
3. 3
Let
SOLITAIRE = {G : G is a game configuration with a solution}.
Prove that SOLITAIRE is NP-complete.
Hint : Show that 3-SAT ≤P SOLITAIRE.