CS281 Spring 2010: Homework 2
Due Wednesday, April 21st SOLUTIONS
1. Exercise 9.1.3: Here are two denitions of languages that are similar to the denition
of Ld , yet dierent from that language. For each, show that the language is not
accepted by a Turing
CMSC 28000: Introduction to Formal Languages
Fall 2012
Homework 6 Solutions
DISCLAIMER: The solutions presented below are incomplete and might
be insucient to get full grade on the homework. They do not model
acceptable solutions, but rather present an id
CMSC 28000: Introduction to Formal Languages
Fall 2012
Homework 6
due Monday Nov 26 in class
1. Deisgn a Turing machine that takes as input a number N and adds 1 to
it in binary. To be precise, the tape initially contains a $ followed by N
in binary. The
CMSC 28000: Introduction to Formal Languages
Fall 2012
Homework 5
due Friday Nov 16 in class
1. Use the CFL pumping lemma to show each of these languages not to be
context-free:
(a) cfw_ai bj ck | i < j < k
(b) cfw_an bn ci | i n
(c) cfw_0p | p is a prim
CMSC 28000: Introduction to Formal Languages
November 27, 2012
Solutions to Homework 5
DISCLAIMER: The solutions presented below are incomplete and might be insucient to
get full grade on the homework. They do not model acceptable solutions, but rather pr
CMSC 28000: Introduction to Formal Languages
Fall 2012
Homework 4
due Friday Nov 2 in class
1. Consider the grammar
S aS | aSbS |
This grammar is ambiguous. Show in particular that the string aab has
two:
(a) parse trees,
(b) leftmost derivations,
(c) rig
CMSC 28000: Introduction to Formal Languages
November 8, 2012
Solutions to Homework 3
DISCLAIMER: The solutions presented below are incomplete and might be insucient to
get full grade on the homework. They do not model acceptable solutions, but rather pre
CMSC 28000: Introduction to Formal Languages
Fall 2012
Homework 3
due Friday Oct 26 in class
1. Suppose L is a regular language with alphabet . Give an algorithm to
tell whether L = , i.e., all strings over its alphabet.
2. Give an algorithm to tell wheth
CMSC 28000: Introduction to Formal Languages
Fall 2012
Homework 3 Solutions
DISCLAIMER: The solutions presented below are incomplete and might
be insucient to get full grade on the homework. They do not model
acceptable solutions, but rather present an id
CMSC 28000: Introduction to Formal Languages
Fall 2012
Homework 7
due Friday Dec 7 in class
1. Let L1 , L2 , . . . , Lk be a collection of languages over alphabet such that:
(a) For all i = j , Li Lj = ; i. e., no string is in two of the languages.
(b) L1
CMSC 28000: Introduction to Formal Languages
Fall 2012
Last Tutorial
Additional Questions
Not to be Handed In
1. Show that N P is closed under the star operation.
2. Let HALF CLIQU E = cfw_ G | G is undirected graph having a clique
of size at least m/2 no
Chapter 3 Test
1. The external audit is aimed at identifying:
B.
key variables that offer actionable responses.
Your answer is correct.
2. Which of the following is not one of the external force categories?
B.
Marketing
Your answer is correct.
3. Accordin
CS281 Spring 2010: Homework 4
Due Wednesday, May 12th SOLUTION
1. (15 points)
We know by Rices theorem that none of the following problems are
decidable. However, are they recursively enumerable, or non-RE?
a) Does L(M ) contain at least two strings?
b) I
CS281 Spring 2010: Homework 4
Due Wednesday, May 12th in class
1. (15 points)
We know by Rices theorem that none of the following problems are
decidable. However, are they recursively enumerable, or non-RE?
a) Does L(M ) contain at least two strings?
b) I
CS281 Spring 2010: Homework 3
Due Wednesday, April 28th SOLUTION
1. (10 points)
Informally but clearly describe a Nondeterministic Turing machine multitape if you like that accepts the following language [Try to take advantage of nondeterminism to avoid i
CS281 Spring 2010: Homework 3
Due Wednesday, April 28th in class
1. (10 points)
Informally but clearly describe a Nondeterministic Turing machine multitape if you like that accepts the following language [Try to take advantage of nondeterminism to avoid i
CS281 Spring 2010: Homework 2
Due Wednesday, April 21st in class
1. Exercise 9.1.3: Here are two denitions of languages that are similar to the denition
of Ld , yet dierent from that language. For each, show that the language is not
accepted by a Turing m
CS281 Spring 2010: Homework 1
Due Wednesday, April 14th in class
1. Exercise 8.2.2: Design Turing machines for the following languages:
(b) cfw_an bn+1 cn | n 1 (10pts)
(c) cfw_w#wR | w is any string of 0s and 1s (10 pts)
2. Exercise 8.2.3: Design a Turin
CMSC 28000: Introduction to Formal Languages
Fall 2012
Homework 2
due Friday Oct 19 in class
1. Convert the following DFA to a regular expression, using the state-elimination
technique.
p
q
r
s
0
s
p
r
q
1
p
s
q
r
2. Convert the following regular express
CMSC 28000: Introduction to Formal Languages
November 3, 2012
Solutions to Homework 2
DISCLAIMER: The solutions presented below are incomplete and might be insucient to
get full grade on the homework. They do not model acceptable solutions, but rather pre
CMSC 28000: Introduction to Formal Languages
Fall 2012
Homework 1
due Friday Oct 12 in class
1. Give DFAs accepting the following languages over the alphabet cfw_0, 1:
(a) The set of all strings ending in 00.
(b) The set of all strings with three consecut
CMSC 281 SPRING 2012
HOMEWORK 5
Homework Questions
(1) Let the complexity class P be the class of all languages decidable in polynomial time.
In other words, P = k1 TIME(nk ). Prove that P = TIME(n3 ).
(2) The number of head reversals of a single-tape Tur
CMSC 281 SPRING 2012
HOMEWORK 4
Definitions
A Turing machine transducer is a Turing machine that outputs strings, rather than accepting or rejecting. That is, if M is a Turing machine, then M computes the function which
takes an input x to the value that
CMSC 281 SPRING 2012
HOMEWORK 3
(1) (HMU 9.3.1) Show that the set of Turing-machine codes for TMs that accept all
inputs that are palindromes (possibly along with other inputs) is undecidable.
(2) (HMU 9.3.2) The Big Computer Corp. has decided to bolster
CMSC 281 SPRING 2012
HOMEWORK 2
(1) (HMU 8.2.2) Design Turing machines for the following languages:
(a) The set of strings with an equal number of 0s and 1s.
(b) cfw_an bn cn |n 1.
(c) cfw_wwR |w is any string of 0s and 1s , where wR is the reverse of a s
CMSC 281 SPRING 2012
HOMEWORK 1
Update Sunday April 1st, 1pm (not an April Fools joke): Question 3 asks for a
polynomial-time algorithm to test if a graph is strongly connected. Question 4 asks for a
polynomial-time algorithm to test if a graph is connect
CS281 Spring 2010: Homework 6
Due Wednesday, May 26th SOLUTION
1. (10 points)
The problem 4T A SAT is dened as follows: Given a boolean expression
E , does E have at least four satisfying truth assignments? Show that
4T A SAT is NP-complete.
Soln. Clearly
CS281 Spring 2010: Homework 6
Due Wednesday, May 26th in class
1. (10 points)
The problem 4T A SAT is dened as follows: Given a boolean expression
E , does E have at least four satisfying truth assignments? Show that
4T A SAT is NP-complete.
2. (10 Points
CS281 Spring 2010: Homework 5
Due Wednesday, May 19th SOLUTIONS
1. (10 points)
Using the Padding Lemma show that
N Space(n8 )
N Space(n9 )
Reasoning. The idea is to use the translation lemma together with Savitchs theorem and the deterministic space hiera