Sunteți pe pagina 1din 9

PESIT Bangalore South Campus

10CS56: Formal Languages and Automata Theory

Faculty: Mrs.Pooja Agarwal & Mr.Sajeevan

No Of Hours: 69 sessions

Session Chapter % of Portion Covered


Title/Referen Topics to be covered Reference Cumulative
ce Literature Chapter
INTRODUCTION TO FINITE AUTOMATA
1. Introduction to finite automata
2. The central concepts of Automata theory
3. T1:chapter 1 Deterministic finite automata 13.5% 13.5%
4. Page 37-67 Deterministic finite automata
5. Deterministic finite automata
6. Deterministic finite automata
7. Deterministic finite automata
8. Nondeterministic finite automata
9. Nondeterministic finite automata
10. Nondeterministic finite automata
11. Nondeterministic finite automata
12. Review of the Chapter
FINITE AUTOMATA,REGULAR EXPRESSIONS
13. An application of finite automata
14. Finite automata with Epsilon-Transitions
15. Finite automata with Epsilon-Transitions
16. T1 :chapter 2 Regular expressions
13.5% 27%
17. Page 68-113 Finite automata and regular expressions
18. Finite automata and regular expressions
19. Finite automata and regular expressions
20. Finite automata and regular expressions
21. Applications of Regular expressions
22. Review of the Chapter
Regular languages, Properties of Regular languages
23. Regular languages
24. Proving languages not to be regular languages
25. T1 :chapter 3 Closure properties of regular languages
26. Closure properties of regular languages 11.5% 38.5%3
Page 125-165
27. Decision properties of regular languages
28. Equivalence and minimization of automata
29. Equivalence and minimization of automata
30. Equivalence and minimization of automata
Context-Free Grammars and languages
31. Context-free grammars
32. Context-free grammars
33. Parse trees
34. T1 :chapter 4 Parse trees 11.5% 50%
35. Page 169-215 Applications
36. Applications
37. Ambiguity in Grammars and languages
38. Ambiguity in Grammars and languages
T1 : chapter 5 Pushdown Automata 13.5%
39. Page 219-253 Definition of Pushdown automata
40. Definition of Pushdown automata
41. The languages of a PDA 63.5%
42. The languages of a PDA
43. The languages of a PDA
44. Equivalence of PDA’s and CFG’s
45. The languages of a PDA
46. Deterministic Pushdown automata
47. Deterministic Pushdown automata
48. Review of the Chapter
Properties of Context-Free languages
49. Normal forms for CFGs
50. Normal forms for CFGs
51. Normal forms for CFGs
52. T1 :Chapter 6 The pumping lemma for CFGs
11.5% 75%
53. Page 255-291 The pumping lemma for CFGs
54. Closure properties of CFLs
55. Closure properties of CFLs
56. Closure properties of CFLS
Introduction to Turing machines
57. Problems that computers cannot solve
58. The Turing machine
59. T1 :chapter 7 The Turing machine
60. Programming techniques for turing machines 13.5% 88.5%
Page 307-363
61. Programming techniques for turing machines
62. Extensions to the basic turing machines
63 Turing machine and computers
Undecidability
64 A Language that is not recursively enumerable
65 T1 : chapter 8 A Language that is not recursively enumerable
66 Page 367-411 An undecidable Problem that is RE 11.5% 100%
67 An undecidable Problem that is RE
68 Post’s correspondence Problem
69 Other undecidable problems

Literature:

Publication Info
Book Type Code Title And Author
Edition Publisher Year
Introduction to Automata Theory,
Languages and Computation.
Text Book T1 3rd Pearson education 2007
John E.Hopcroft,
Rajeev Motwani,Jeffrey D.Ullman
Fundamentals of the theory of
Reference
R1 Computation, principles and practice. - Morgan Kaufmann 1998
Book
Raymond Greenlaw,H.James Hoover
Introduction to languages and automata
Reference
R2 theory. 3rd Tata McGraw-Hill 2007
Book
John C Martin
QUESTION BANK
INTRODUCTION TO THEORY OF COMPUTATION AND FINITE AUTOMATA
OBJECTIVE: This chapter introduces automata theory, finite automata, and the class of languages known
as “regular languages.” These languages are the ones that can be described by finite automata.

1. Define equivalency of grammars. 5*


2. Define a) Language (L) b) Sentence c) Complement (L’) d) LR e) L1.L2 f) Ln g) L* h) L 10
3. Prove by induction |uv| = |u| + |v| 5*
4. Use induction on the size of S to show that if S is a finite set |2s| = 2|s|
Give the grammar that generates the language 4
5. L = {an bn+1 : n ≥ 0} Derive the string “aaabbbb” from the grammar 5
6. Given the following grammars and corresponding languages, show that the language is
indeed generated by the grammar.
G = ({s}, {a,b}, S, {s -> aSb, S -> λ})
L(G) = {anbn : n ≥ 0}
G = ({s}, {a,b}, S, {S -> SS, S -> λ, S -> aSb, S -> bSa})
L(G) = {w : na (w) = nb(w) } 5*
7. Define equivalency of grammars. 5*
8. Explain different units of automata. Explain the terms 1) Configuration 2) Move
3) Transition functions 6
9. Define acceptors & Transducers. 6
10. Write a note on applications of formal languages and automata. 6
11. Explain the operation of a Deterministic Finite Acceptor (DFA) with a diagram. 5*
12. Give the formal definition of DFA? Explain transition graph? Give an example. 5*
13. Define extended transition function (δ)? Define transition table. 5
14. Define language accepted by DFA? 5*
15. Derive the DFA that accepts the language L = {anb : n >=0} 6
16. Find the DFA that recognizes the set of all string on Σ = {a,b} starting with the
prefix “ab” 5*
17. Find the DFA that accepts all strings on alphabet {0,1} except those containing
Substring 001 5
18. Define a regular language. 4
19. Show that the language L = {awa : wε{a,b}*} is regular ? Also show that L2 is regular? 6
20. Define the transition table, transition diagram, transition function DFA.
Which accepts strings which have odd number of a’s and b’s over the alphabet {a,b}
Which accepts strings which have even number of a’s and b’s over the alphabet {a,b}
Which accepts all strings ending in 00 over {0,1}
Which accepts all strings having 3 consecutive zeros
Which accepts all strings having 5 consecutive zeros
Which accepts all strings having even number of symbols 12
21. What language does grammar with these productions generate? S-> Aa,
A-> B, B-> Aa 5
22. Prove that (L1L2)R = L2RL 5
23. Give the formal definition of NFA. 5
24. Distinguish between NFA & DFA. 5
25. Define extended transition function for NFA. 5
26. Define language accepted by a NFA. 5
27. Define dead configuration in case of NFA. 5
28. What are the advantages of non-determinism? 5
29. Are the two grammars with respective productions
S-> aSb|ab|λ, and S-> aAb|ab, A->aAb|λ, equivalent?
Assume that S is a start symbol in both cases. 8
30. If L is accepted by a DFA prove there is regular expression R for the language L such that L=
L(R). 10
31. Define the equivalence between two finite acceptors? 5
32. Give DFA & NFA which accepts the language {(10)n : n ≥ 0} 5
33. Prove the equivalence between DFA & NFA OR
Let L be the language accepted by NFA MN = (QN, Σ,δN, QN, FN). Then prove that there
exists a deterministic finite acceptor MD = (QD,ΣD,δD,QD,FD) such that L = L(Md). 10
34. Convert the following NFA to DFA 10*
35. Draw NFA for transition table given below :
Input
States a b
q0 {q0,q1) {q2}
q1 {q0} {q1}
q2 -- {q0,q1} 10*
36. Define distinguishable and indistinguishable states. 5
37. Give the procedure to reduce number of states in DFA. 5
38. Reduce the number of states in DFA. 10
39. Construct a DFA and NFA to accept all string in {a,b} such that every “a” has one “b” Technology –
Education for the Real World – Course Information – B.E. 4th Semester CS101031
immediately to its right?

REGULAR LANGUAGES, REGULAR GRAMMARS, PROPERTIES OF REGULAR LANGUAGES


OBJECTIVE: This chapter introduces the notation called “regular expressions” and how they
are capable of defining regular languages.

41. Give the formal definition of a regular expression with example. 6*


42. How is language L® denoted by regular expression “R” defined? Give examples. 6*
43. Give the set of notation of language L® denoted by regular expressions given below
a) a* . (a+b)
b) (a+b) * (a+bb)
c) (aa)* (bb)* b 8
44. For Σ = {0,1}, give a regular expression “ ” such that
L(r) = { wε Σ* : w has at least one pair of consecutive zeros} 6*
45. Find all strings in L ((a+b)*b(a+ab)*) of length less that four. 4
46. Show that r = (1+01)*(0+1*) denotes that language L = (w {0, 1)*: w has no pair of
consecutive zeros). Find the other two expressions. 6*
47. Give the set and explain in English the sets denoted by following regular expressions
a) (11+0)(00+1)
b) (1+01+001)(0+00)
c) (0+1)00(0+1)
d) 00 11 22 10
48. Show that the automation generated by procedure reduces is deterministic. 5
49. Prove the following :
If the states qa and qb are indistinguishable, and if qc and qa are distinguishable,
then qb,qc must be indistinguishable. 6*
50. Let r be a regular expression. Then prove that there is some NFA that accepts L(r) &
hence L(r) is a regular language. 8
51. Write the NFA which accepts L(r) where r = (a+bb)*(ba* + λ)
52. Let L be a regular language i.e., there is a NFA that accepts L. Then prove that there
exists a regular expression “r” such that L = L(R) 5
53. Explain generalized transition graphs & how they are used for writing regular expression
denoting same language as given NFA. 6
54. Given the below NFA, write the corresponding regular expression using generalized
transition graphs 6
55. Define regular grammar with example. 4*
56. Denote the regular languages defined by the following grammar as regular expressions
a) G1 = ( {S}, {a,b}, S, {S-> abS|a})
b) G2 = ( {S,S1,S2}, {a,b},S,{S->S1ab, S1->S1ab|S2, S2->a}) 10
57. Define a linear grammar. 4
58. Prove that “Language generated by a right linear grammar is a regular language” 6*
59. Construct the finite automaton that accepts the language generated by grammar
({V0, V1}, {a,b}, {V0}, {V0 -> aV1, V1-> abV0|b}) 6*
60. Write a NFA & right linear grammar for L(aab*a) 5
61. Prove that “A language L is regular if and only if there exists a left linear
grammar G such that L = L(G)”. 5
62. Prove that “A language L is regular if and only if there exists a regular
grammar G such that L = L(G)”. 5
63. Show that the family of regular languages is closed under following operations
a) union b) intersection c) concatenation d) complementation e) star-closure
f) difference g) reversal 10*
64. Let h be a homomorphism & L a regular language. Then prove that
homomorphic image h(L) is also regular. 6
65. If L1 & L2 are regular languages, then prove that L1/L2 is also regular
L1/L2 = right quotient of L1 with L2 = {x:xy ε L1 for some y ε L2} 6*
66. Given a standard representation of any regular language L on ε
a) prove that there exists an algorithm for determining whether or not any w ε Σ*
is in L
b) Prove that there exists an algorithm for determining whether L is empty, finite
or infinite 8
67. Given standard representations of two regular languages L1 & L2, prove that there is an
algorithm to determine whether or not L1 = L2 8
68. Prove that the language L = {an bn : n ≥0} is not regular using pigeonhole principle 8
69. State and prove pumping lemma for regular languages? What is the application of
pumping lemma? 6*
70. Using pumping lemma, prove that following languages are not regular :
a) L = {anbn : n≥ 0}
b) L = {wwr : w ε Σ*} Σ = {a,b}
c) L = {w ε Σ* : na(w) < nb(w)} Σ = {a,b}
d) L = { (ab)nak : n > k, K ≥ 0}
e) L = { an! : n ≥ 0}
f) L = { anbkcn+k : n ≥ 0, k ≥0}
g) L = { anb1 : n ≠ 1} 14
71. Give the regular expression for the following languages on Σ = {a,b,c}
a) all strings containing exactly one a
b) all strings containing no more than three a’s
1. all strings which contain at least one occurrence of each symbol in Σ 10*

CONTEXT FREE GRAMMMARS AND LANGUAGES.


OBJECTIVE: This chapter introduces context-free grammar notation, parse tree and shows
how grammars define languages.
• Context-free grammar: context-free grammars have played a central role in computer
technology since the 1960’s. More recently context-free grammar has been used to
describe document formats that are used in XML for information exchange on the web.
• Parse tree: A picture of the structure that a grammar places on the strings of its
language. The parse tree is the output of a parser for a programming language and is
the way that the structure of programs is normally captured.

72. Define context free grammars formally. Give some examples. 6*


73. Write CFG which generates the following CFL’s
a) L(G) = {wwr : w ε Σ* } Σ = {a,b}
b) L(G) = { ab (bbaa)n bba (ba)n : n ≥ o}
c) L = {anbm : n ≠ m}
d) L = {w ε {a,b}* : na(w) = nb(b) and na(v) ≥ nb(v) where v is any prefix of w}
e) L = { a2nbm : n ≥ 0 ≥ 0} 10*
74. Define leftmost and rightmost derivation with example 4*
75. Define derivation tree, partial derivation tree, and yield. 4*
76. Let G = (V, T, S, P) be a CFG. Then prove that for every w ε l(G),
there exists a derivation tree of G whose yield is w. 6*
77. Prove that yield of any derivation tree is in L (G), where G is a CFG. 6*
78. Prove that is TG is any partial derivation tree for G whose root is labeled S, then the yield
of TG is sentential form of G. 6
79. Define parsing 4
80. Explain exhaustive search parsing? What is the serious flaw in using exhaustive
Search parsing? 6
81. Given a CFG & a string w, prove that exhaustive search parsing method either
produces a parse of w or tells us that no parsing is possible, if P has no rules
of form A -> λ or A -> B? 6

82. Define simple grammar or s-grammar? What are its applications? 4


83. Define a ambiguous CFG 4
84. Show that the following grammars are ambiguous
a) ({S}, {a,b}, S, {S->aSb|SS|λ})
b) ({E,I}, {a b c +*()}, E, {E -> I
E -> E + E,
E -> E * E,
E -> (E),
I -> a|b|c})
Write equivalent unambiguous grammar. 6*
85. Define inherently ambiguous language and give an example. 4
86. Explain the use of CFG in definition of PL. 4
87. What is a normal form & why is it required? 4
88. Prove the substitution rule of context free grammar. 4
89. Define a useful / useless variable. Define a useless production. Explain two cases when a
variable become useless. 10*
90. Eliminate useless symbols and productions from the following grammar
a) G = (V,T,P,S) = ({S,A}, {a,b}, {S-> aSb|λ|A, A->aA}, S)
b) G = (V,T,P,S) = ({S,A,B}, {a,b}, {S->A, A-> aA|λ b->bA}, S) 6
91. Explain dependency graph & its applications in CFG. 5
92. Let G = (V,T,P,S) be a CFG. Then prove that there exists an equivalent grammar
G1 = (V1,T1, S, P1) that does not contain any useless variables or productions. 5
93. Define λ-productions and nullable variable. When can be a λ-production removed from the
grammar? 6*
94. Eliminate λ-production from the following grammar : G = (V,T,,P,S) = ({S,S1}, {a,b},
{S->As1b, S1-> aS1b|λ},S) 10
95. Let G be any context free grammar with λ not in L(G). Then prove that there exists an
equivalent grammar G1 having no λ-productions? 10
96. Find the CFG without λ-production equivalent to grammar defined by the following
productions
S-> AbaC, A -> BC, B -> b|λ, C -> D|λ, D->d 10
97. Define unit production. 4
98. Let G = (V, T, S, P) be any CFG without λ productions. Then prove that there exists a CFG
G1 = (V1, T1, S, P1) that does not have any unit productions and that is equivalent to G
6
99. Remove all unit productions from S->Aa|B, B->A|bb, A-> a|bc|B 8
100. Define CNF of a CFG 6
101. Let G = (V, T, S, P) be a CFG with λ L(G). Then prove that there exists a equivalent
grammar G1 = (V1, T1, s, p1) in CNF. 8
102. Convert the grammar with productions S-> Aba, A-> aab B->Ac to CNF 8
103. Define GNF of a CFG 6
104. Convert the grammar with productions below into GNF
a) S->AB, A->aA|bB|b, b->b
b) S->abSb|aa 6
105. Write the regular expression for all Pascal real numbers 4
106. Find the regular expression for Pascal sets whose elements are integer numbers 4
107. Let L1 = L(a*baa*) and L2 = L(aba*) find L1/L2 5
108. If L is a regular language, prove that the language {uv : UcL, VcLR Is also regular 6
109. Find DFA’s that accepts the following languages
a) L(aa* + aba*b*)
b) L(ab(a+ab)*(a+aa))
1. L((abab)*+(aaa*+b)*) 8
110. Design a CFG which consistes of all the strings having at least one occurences of 000. 10
111. Construct the CFG for the language having any number of a's over the set of E= {a} 8
112. for the grammar S-> A1B, A-> 0A|e, B-> 0B|1B\e give left most and right most derivation of the
following string 00101. 10
PUSHDOWN AUTOMATA
OBJECTIVE: This chapter defines two different versions of the pushdown automaton: one that
accepts by entering an accepting state, like finite automata do, and another version that
accepts by emptying its stack, regardless of the state it is in.
• Pushdown automata: The pushdown automaton is in essence a nondeterministic finite
automaton with Є-transitions permitted and one additional capability: a stack on which it
can store a string of “stack symbols.”

113. Give two reasons why finite automata cannot be used to recognize all CFL and why PDA is
required for that purpose. 5
114. Explain the operations of a NPDA with diagram. 6
115. Give the formal definition of NPDA. Explain clearly the transition function? 6
116. Write a NPDA that accepts the language L = {anbn : n ≥ 0 }U {a} 6*
117. Define the instantaneous description of a NPDA 4
118. When do we say a CFL is accepted by NPDA? Define
a) acceptance by final state
b) acceptance by empty stack 6
119. Construct a NPDA for the following languages
a) L = {w ε {a,b}* : na(w) = nb(w)}
b) L = {wwr : w ε {a,b}+} 10
120. Prove that for any CFL L(specified as CFG without λ productions), there exists a NPDA M
such that L = L(M) 6
121. Construct a NPDA that accepts that language generated by grammar with productions
a) S -> aA
b) S -> Aabc|bB|a
c) B -> b
d) C -> c 8
122. Write the CFG for language accepted by NPDA whose transitions are given below:
δ(q0,a,z) = {(Q0,Az)}
δ(q0,a,A) = {(q0,A)}
δ(q0,b,A) = { {q1,λ)}
δ(q1,λ,z) = {q2,λ)} 8*
123. If L = L(M) for some NPDA M, then prove that L is CFL. 5
124. Give the formal definition of DPDA and deterministic CFL. 6
125.Construct the PDA that accepts the language accepted by the grammar
S-> 0S1 | e
A-> aAS | a
B-> SbS | A | bb
126.If L = N(P) for some DPDA, then L has an unambiguous context free grammar.

PROPERTIES OF CONTEXT-FREE LANGUAGES


OBJECTIVE: This chapter introduces some of the properties of context-free languages. We will
learn normal forms for CFG. We will prove the “pumping lemma” for CFL’s.

127. State and prove pumping lemma for CFL? What is its application? 8
128. Define linear CFL. State pumping lemma for Linear CFL. 5
129. Prove that family of CFL is closed under union, concatenation and star closure. 6
120. Prove that family of CFL is not closed under intersection and complementation 6
131. Let L1 be a CFL and L2 be a regular language. Then prove that L1 intersection
L2 is context free. 6
132. Show that the language L = {w ε {a,b,c}* : na(w) = nb(w) = nc(w) is not context free 6
133. Show that the language L = {anbn : n ≥ 0, n ≠ 100} is context free 6
134. Determine whether or not the following language is context-free.
L={an bj an bj : n ≥ 0 , j ≥ 0} 4
135. Show that the complement of the language L = { an2 : n ≥ 0} is not context-free. 5
136. Determine whether or not the following language is context-free.
L={an w wR: n ≥ 0, w Є {a, b}*} 4
137. Is the language context-free? L = { anm : n and m are prime numbers } 4
138. Show that following languages are not context free using pumping lemma
a) L = {anbncn : n≥ 0}
b) L = {ww : w ε {a,b}*}
c) L = {an! : n≥ 0}
d) L = {anbj : n = i2} 10
139. Show that language L = {w : na(w)} is not linear 5

INTRODUCTION TO TURING MACHINES


OBJECTIVE: In this chapter we shall start looking at the question of what languages can be
defined by any computational device. We begin with an informal argument, using an assumed
knowledge of C programming, to show that there are specific problems we cannot solve using a
computer. We then introduce a venerable formalism for computers called Turing machine.
• Turing machine: It has been recognized as an accurate model for what any physical
computing device is capable of doing.
140. Explain with diagram the operation of Turing machines? Give formal definition of Turing 6
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester
CS 35
machine.
141. Consider the Turing machine defined as follows
Q = {q0,q1} Σ = {a,b} = a,b,} F = q1}
δ(q0,a) = (q0,b,R)
δ(q0,b) = (q0,b,R)
δ(q0, ) = (q1, L)
Starting with state, draw the different stages of the processing the string “aa”.
Write also the instantaneous descriptions? 10*
142. Give an example of TM that never halts i.e., that goes to infinite loop.
How is that represented in instantaneous description? 5
143. Summarize the features of standard Turing machine. 4
144. Explain what is meant by instantaneous description of a TM. 6
145. Define computations of a TM. 5
146. Define language accepted by TM. 5
147. When do we say that a language is not accepted by TM? 5
148. For Σ = {0,1} design a TM that accepts language denoted by the
regular expression 00 5
149. For Σ = (a,b} design a TM that accepts L = {anbn : n≥ 1} 6
150. Design a TM that accepts L = {anbncn : n≥1} 6*
151. Define the operation of TM as transducers? Define a Turing computable function? 6
152. Given two positive integers x and y, design a TM that computes x+y 6
153. Design a TM that copies strings of 1’s 5
154. Design a Turing machine that halts at a final state if x≥y and at a nonfinal state x<y 6
155. Design a TM that computes the function
x+y if x≥ y
F(x,y) 0 if x<y 10
156. Design a TM to implement the macroinstruction
If a
Then qj
Else qk 8
157. Design a TM that multiplies two +VE integers in unary notation. 6
158. Write a note on Turing Thesis. Define algorithm in terms of TM. 6
159. Define equivalence of automata? Demonstrate the equivalence of TM using simulation. 6
160. Define TM with stay on option. Prove that they are equivalent to class os standard TM? 6
162. Define TM with semi-infinite tape & prove that they are equivalent to
class of standard Turing machine. 6
163. Define offline TM & prove that they are equivalent to class of standard TM. 5
164. Write a note on multitape TM. 5
165. Write a note on multidimensional TM. 5
166. Define formally non-deterministic TM. 5
167. Prove that class of deterministic TM & class of non-deterministic TM are equivalent 6*
168. Write a note on universal TM. 6
169. Explain what you mean by countable, uncountable sets and enumeration procedure.6*
170. Prove that set of all TM, although infinite is countable. 8

UNDECIDABILITY
OBJECTIVE: This chapter begins by repeating, in the context of Turing machines, a plausibility
argument for the existence of problems that could not be solved by computer. The chapter gives a formal
proof of the existence of the problem about Turing machines that no Turing machine can solve.We then
divide problems that can be solved by a Turing machine into two classes: those that have an algorithm, and
those that are only solved by Turing machines that may run forever on inputs they do not accept.
171. Show that the halting problem, the set of (M, w) pairs such that M halts (with or with out
accepting) when given input is RE but not recursive. 6
172. Let L1, L2, …, Lk be a collection of languages over alphabet Σ such that:
1. For all i ≠ j, Li ∩ Lj = Ø; i.e., no string is in two of the languages.
2. L1 υ L2 υ …. υ L k = Σ*; i.e., every string is in one of the languages.
3. Each of the languages Li, for I = 1,2,…, k is recursively enumerable.
Prove that each of the languages is therefore recursive. 10
173. What strings are:
a) w37?
b) W100? 6Technology –
Education for the Real World – Course Information – B.E. 4th Semester CS 36
174. Prove “if L is a recursive language, so is L¯ ”. 5
175. Informally describe multi tape Turing machines that enumerate the following sets of
integers, in the sense that started with blank tapes, it prints one of its tapes 10i210i21...
to represent the set { i1, i2,..}.
a) The set of all perfect squares {1, 4, 9…}.
b) The set of all primes {2, 3, 5, 7, 11…..}. 8
176. What are Recursive languages? What is the relationship between the recursive,
RE, and non RE languages?

S-ar putea să vă placă și