CS 4410/7410 Homework #7 Solution (16 points)
1. (6 points) Use the pumping lemma to show that the following languages are not context free.
a) cfw_0 1 0 1 |, 1
Assume this language A is regular. Let p be the pumping length given by the pumping
Name: Last 4 digits of student ID:
CS 4410/7410 Quiz #4 (Total 9 points)
1. (4 points) Consider the following grammar G:
S -+ T+ S | S X S l a
T —+ T+b| a lb
1) TrueorFalse:a+b><a+b E L(G)
2) True or False: grammar G is ambiguous.
3) Give all parse
CS 4410/7410 Homework #6 Solution (16 points)
1. (8 points) Give informal descriptions and state diagrams of pushdown automata for the
a) cfw_w | w contains more as than bs. = cfw_,
Read symbols from the input. At first, push the sym
Homework #2 Solutions
Suppose language B over alphabet has a DFA
= (, , , 1 , )
Then the DFA for is
= (, , , 1 , )
Since they have the same , so they are both deterministic.
Now suppose that , then M will accept , so the final state of is r and r .
Homework #4 Solutions
1. For any regular language A, let 1 be the DFA recognizing it. We need to find a DFA
that recognizes . Since any NFA can be converted to an equivalent DFA, it suffices to
find an NFA 2 that recognizes .
We keep all the states in 1 a
CS 4410/7410 Homework #8 (18 points)
1. (4 points) Give the formal descriptions (i.e. state diagrams) and implementation-level
descriptions of TMs recognizing the following languages. The input alphabet is cfw_, . You
are required to use JFLAP to draw the