CSE 3321: Worksheet 5: Friday, February 6
.
1. Use the pumping lemma to show that the language cfw_wwr | w cfw_0, 1 is not regular. Reminder: wr s the reverse of w.
Solution: Assume to the contrary that the language is regular. Let p be the pumping
lengt
CSE 3321: Worksheet 8 : Monday, March 6
.
1. Let A = cfw_< R >: R is a regular expression describing a language containing at least one
string w that has 111 as a substring. Show that A is decidable.
Solution: The following TM X decides A.
X = On input <
CSE 3321: Worksheet 9: Monday, April 20
.
1. Determine if each language below is decidable or undecidable.
(a) A = cfw_ M : M is a Turing machine and M runs for more than 10 steps on some input.
Solution: A is decidable. Given a TM M , A TM R that decides
CSE 3321: Worksheet 9: Monday, April 20
.
1. Determine if each language below is decidable or undecidable.
(a) A = cfw_ M : M is a Turing machine and M runs for more than 10 steps on some input.
(b) B = cfw_ M : M is a Turing machine and M accepts 1010.
(
CSE 3321: Worksheet 10: Monday, April 27
.
1. Determine if each language below is decidable or undecidable.
(a) A = cfw_ G1 , G2 : G1 and G2 are CFGs and L(G1 ) L(G2 ).
(b) B = cfw_ M : M is a Turing machine and the language of M is not empty.
(c) C = cfw
CSE 3321: Worksheet 10 Solutions: Monday, April 27
.
1. Determine if each language below is decidable or undecidable.
(a) A = cfw_ G1 , G2 : G1 and G2 are CFGs and L(G1 ) L(G2 ).
Solution: A is undecidable. We prove this by contradiction. Assume R is a TM
CSE 3321 Homework 4: Due Monday, March 9 at the beginning of
class
.
1. Let G be the grammar over the alphabet cfw_a, b, c with the following productions:
S aSbScS|aScSbS|bSaScS|bScSaS|cSaSbS|cSbSaS|
Does G generate the language cfw_s cfw_a, b, c : Na (x)
CSE 3321 Homework 3: Due Friday, February 13 at the beginning
of class
.
1. Let A = cfw_w cfw_0, 1 | 00 is not a substring of w. Prove that there is no language B
cfw_0, 1 such that B = A. (Hint: write out the rst 10 or so strings in short-lex order that
CSE 3321 Homework 5: Due Friday, April 3 at the beginning of
class
.
1. Find a context-free grammar that generates cfw_ai bj : i j 3i/2, and prove that your answer
is correct.
Solution: S aSb |aaSbbb | S |
2. Use the pumping lemma for context-free languag
CSE 3321 Homework 1: Solutions
1. If set A has a elements and set B has b elements, how many elements are in A B? Explain
your answer. (5 pts)
Solution: Every element in A is paired up with each of the b elements in B, so there
are a total of a b elements
CSE 3321 Homework 2: Due Friday, February 6 at the beginning
of class
.
1. Each of the following languages is the complement of a simpler language. In each part,
construct a DFA for the simpler language, then use it to give the state diagram of a DFA for
CSE 3321: Worksheet 8 : Monday, March 6
.
1. Let A = cfw_< R >: R is a regular expression describing a language containing at least one
string w that has 111 as a substring. Show that A is decidable.
2. Show that if G is a CFG in Chomsky normal form, then
CSE 3321: Worksheet 7: Friday, March 6
.
1. Determine if each of the following languages is context-free:
(a) cfw_an bn am bm : n, m 0
(b) cfw_am bn am bn : n, m 0
(c) cfw_an bn an bn : n, m 0
1
2. Use the languages A = cfw_am bn cn : m, n 0 and B = cfw_a
CSE 3321: Worksheet 7: Friday, March 6
.
1. Determine if each of the following languages is context-free:
(a) L = cfw_an bn am bm : n, m 0
Solution: This is context-free. Proof: Let L1 = cfw_an bn : n, m 0 and L2 = cfw_am bm :
n, m 0. We have previously p
CSE 3321 Worksheet 2: Friday, January 16
1. What is the value of
Solution:
42!
2!40!
=
42
2
4241
2
?
= 861
2. List all strings of length three over the alphabet = cfw_a, b.
Solution: aaa, aab, aba, abb, baa, bab, bba, bbb
3. List the rst 10 strings in sho
CSE 3321: Worksheet 3: Wednesday, January 21
. Construct state diagrams of DFAs for each of the languages below. Each language is over the
alphabet cfw_0, 1.
1. cfw_11, 10, 01
2. cfw_w | the length of w is odd
3. cfw_w | w contains the substring 101
1
4.
CSE 3321: Worksheet 3: Wednesday, January 21
.
Construct state diagrams of DFAs for each of the languages below. Each language is over the
alphabet cfw_0, 1.
1. cfw_11, 10, 01
2. cfw_w | the length of w is odd
3. cfw_w | w contains the substring 101
1
4.
CSE 3321 Worksheet 2: Friday, January 16
1. What is the value of
42
2
?
2. List all strings of length three over the alphabet = cfw_a, b.
3. List the rst 10 strings in shortlex order over the alphabet = cfw_a, b, c.
4. List all of the prexes of the string
CSE 3321 Worksheet 1: Wednesday, January 14
1. What is the power set of the set cfw_, 1, cfw_1 ?
Solution:
cfw_, cfw_, cfw_1, cfw_1, cfw_, 1, cfw_1, cfw_1, cfw_, cfw_1, cfw_, 1, cfw_1
2. Find a bijection between the set of non-negative integers and the se
CSE 3321: Worksheet 4: Wednesday, January 28
.
1. Prove that every NFA with one or more accept states can be converted to an equivalent one
that has a single accept state. Is this also true of DFAs?
2. Create an NFA for the language cfw_01, 1 cfw_10cfw_0
CSE 3321: Worksheet 5: Friday, February 6
.
1. Use the pumping lemma to show that the language cfw_wwr | w cfw_0, 1 is not regular. Reminder: wr s the reverse of w.
2. Show, by giving an example, that if M is an NFA that recognizes language C, swapping t
CSE 3321: Worksheet 4: Wednesday, January 28
.
1. Prove that every NFA with one or more accept states can be converted to an equivalent one
that has a single accept state. Is this also true of DFAs?
Solution:
An NFA M1 with more than one accept state can
CSE 3321: Worksheet 6: Monday, February 23
.
1. Construct an NFA that accepts the language generated by the grammar:
S abA,
A baB,
B aA|bb.
2. Construct a right linear grammar for the language:
L = cfw_an bm : n 2, m 3
1
3. Construct a CFG for the followi
CSE 3321: Worksheet 6: Monday, February 23
.
1. Construct an NFA that accepts the language generated by the grammar:
S abA,
A baB,
B aA|bb.
Solution:
2. Construct a right linear grammar for the language:
L = cfw_an bm : n 2, m 3
Solution:
While not requir
CSE 3321 Worksheet 1: Wednesday, January 14
1. What is the power set of the set cfw_, 1, cfw_1 ?
2. Find a bijection between the set of non-negative integers and the set of integers.
3. Prove or disprove: The empty set is a subset of every set.
4. Which o