N 4 DD 4 Aadae 1466
N 4 DD 4 Aadae 1466
TECHNOLOGY , TANGORI
1) Prove that how all the languages classified by the Chomsky are closed under
union, concatenation and transpose.
2) Let M be a push down automata accepting a language L by empty stack, then
prove that there is context free grammar G with L(G) = L
3) What is the significance of converting a grammar to GNF? Convert the following
grammar to GNF
S ASB | ε
A aAS | a
B SbS | A | bb
4) a) Turing machines are simplified representation of a general computer.
Explain
b) Design a Turing Machine to accept the language L of palindromes over
{a,b}.
5) How can you say that Turing Machines are more capable than finite state
machines. Explain.
6) Consider the grammar:
S A , A BA | ε , BaB | b.
Construct NFA and its equivalent DFA for LR(1) items of above grammar.
7) Write the machine description for a Turing machine, including delta transition
table for the specific machine that starts with a number n on the tape and finishes with
n squared on the tape. n on the input is just n zeros followed by blank tape.
(tape 000#b)
8) If L is a context free Language, then there exists a PDA M which accepts L. Prove.
9) Construct an NFA for the following regular expression:
10 + (0+11) 0 * 1.
10) L = { ww | w in Sigma star } is not a CFL. L is recognized by a Turing machine.
What essential feature does a Turing machine have that a NPDA did not have to be
able to recognize L ?
11) Prove that for any CFG G there is a CFG G1 in Chomsky Normal Form such that
L(Gl) = L(G) where L is the language accepted by the grammar.
12) Design a Turing Machines which generates a set of string with equal numbers of
0's and 1's.
13) Convert the following regular expression to NFA :
( i ) ( 0 + 1 )1 ( 0 + 1 )
(ii) 00 (0 + 1)
(iii) 01*
(iv) (0 + 1) 01
14) If L is a context free language, then there exists a PDA M which accepts L. Prove.
15) Construct an NFA for the following regular expression:
10 + (0+11) 0*1.
16) Given two regular expressions, how to prove that they are equal, or in other
words they match exactly the same language?
17) Prove that if L is regular then LT is also regular.
18) We can use Pumping Lemma to prove a language is not regular by contradiction.
Are there cases when we cannot find a string that cannot be pumped to prove a
language is not regular?
19) How do the three constraints of "special form GNFA" definition make sense in
the procedure converting DFA to regular expression?
20) The pumping lemma states that all regular languages have a special property. Is
there any nonregular language having this special property?
21) Discuss in brief Griebach Normal Form. Reduce the following grammar into
GNF :
S A0 , A 0B , B A0 , B 1.
22) Identify and remove the unit productions from following grammar
S A | bb,
A B | b,
B S | a.
23) Consider the following grammar G and remove the null productions :
SABAC , A aA | Λ , B bB | Λ , C c.
24) Find the reduced grammar that is equivalent to the CFG given below:
SaC | SB , AbSCa , BaSB | bBC, CaBC | ad.
25) Construct the DFA for the regular expression (0+1)*1 (0+1).
26) Build a Turing Machine that accepts the language ODD PALINDROME.
27) Are the following true or false? Support your answer by giving proofs or counter-
examples.
a) If L1 U L2 is regular and L1 is regular, then L2 is regular.
b) If L1L2 is regular and L1 is regular, then L2 is regular.
c) If L* is regular, then L is regular.
28) a) Construct a regular grammar which can generate the set of all strings starting
with a letter ( A to Z) followed by a string of letters or digits ( 0 to 9).
b) Show that a deterministic finite automaton with n states accepting a nonempty
set accepts a string of length m, m < n.
29) What are the linear grammars? Explain its various types. Also prove the
following:
a) A right – linear or left-linear grammar is equivalent to a regular grammar.
b) A linear grammar is not necessarily equivalent to a regular grammar.
30) A context free grammar G is said to be self-embedding if there exists some useful
variable A such that A can derive uAv, where u,v belongs to terminal set and they are
not empty/ Show that a context-free language is regular iff it is generated by a
nonselfembedding grammar.
31) Show that a regular set accepted by a deterministic finite automaton with n states
is accepted to final state by a deterministic pda with n states and one pushdown
symbol. Deduce that every regular set is a deterministic context-free language.
32) Why are all regular languages context-free? How can we prove it?
33) What's the difference between the language recognized by deterministic and
nondeterministic ones? Can we make a pushdown automaton deterministic?
34) What do you want to minimize, the number of rules, the total length of right-hand
sides, the maximum length of right-hand side?
35) Are Context Free Languages closed under union, intersection, complement,
concatenation?
36) The state diagram of a TM seems to be tricky. Are there any tips how to draw the
diagram?
37) Let A,B,C be languages, and C = A concat B. If C and A are both regular,
whether B is regular? Or under which circumstance would the conclusion be true?
38) We can construct a CFG for a regular language by constructing a DFA for that
language. What kind of CFG can be constructed this way? Do these CFGs have some
attributes? Is there a clear way to know whether the language is regular by only the
context-free grammars?
39) If we already know some CFG is ambiguous, is there some algorithm to eliminate
the ambiguity?
40) If two DFAs M1 and M2 have been transformed to their minimal forms, how can
we easily check whether these two minimal DFAs are isomorphic?
41) Why do Turing recognizable/decidable languages not have a pumping lemma? Is
it because they have not enough structure information like CFL and regular language?
42) Which of the following grammars generates the string
$$
X $ | X$$ | $$X
X $ | $$X | XX$
X $ | $$$ | XX
X $ | $$X | X$X
X $ | $X$ | $$X
43) For each language below, design a Deterministic Finite Automata, DFA.
a) Draw the state transition diagram.
b) Write the state transition table.
c) Write a regular expression.
Languages:
1) The set of strings over sigma={ 0, 1} ending in 11
2) The set of strings over sigma={ 0, 1} that contain three consecutive
ones.
3) The set of strings over sigma={ a, b, c} that contains the empty string and
strings that have a length that is a multiple of three with every block of three
containing one a, one b and one c.
44) Convert the NFA to an equivalent DFA
| 0 | 1 F = { q2, q4 }
----+----------+----------
q0 | {q0,q3} | {q0,q1}
q1 | phi | {q2}
q2 | {q2} | {q2}
q3 | {q4} | phi
q4 | {q4} | {q4}