Work Book - Formal Language and Automata Theory - CS402-1 PDF
Work Book - Formal Language and Automata Theory - CS402-1 PDF
Work Book - Formal Language and Automata Theory - CS402-1 PDF
and Automata
Theory
CS402
For
B.Tech CSE 2nd year Students
WORK BOOK
Module – 1 :
Fundamentals: Basic definition of sequential circuit, block diagram, mathematical representation,
concept of transition table and transition diagram (Relating of Automata concept to sequential circuit
concept) Design of sequence detector, Introduction to finite state model.
Finite state machine: Definitions, capability & state equivalent, kth- equivalent concept, Merger graph,
Merger table, Compatibility graph, Finite memory definiteness, testing table & testing graph.
Deterministic finite automaton and non deterministic finite automaton. Transition diagrams and
Language recognizers.
Finite Automata: NFA with Î transitions - Significance, acceptance of languages. Conversions and
Equivalence: Equivalence between NFA with and without Î transitions. NFA to DFA conversion.
Minimization of FSM, Equivalence between two FSM’s , Limitations of FSM. Application of finite
automata, Finite Automata with output- Moore & Melay machine.
Module – 2 :
Regular Languages : Regular sets. Regular expressions, identity rules. Arden’s theorem state and prove.
Constructing finite Automata for a given regular expressions, Regular string accepted by NFA/DFA.
Pumping lemma of regular sets. Closure properties of regular sets (proofs not required).
Grammar Formalism: Regular grammars-right linear and left linear grammars. Equivalence between
regular linear grammar and FA. Inter conversion, Context free grammar. Derivation trees, sentential
forms. Right most and leftmost derivation of strings. (Concept only)
Module – 4 :
Turing Machine : Turing Machine, definition, model. Design of TM, Computable functions. Church’s
hypothesis, counter machine. Types of Turing machines (proofs not required). Universal Turing Machine,
Halting problem.
1. Design a two input two output sequence detector which generates an output ‘1’ every time the
sequence 1001 is detected. And for all other cases output ‘0’ is generated. Overlapping
sequences are counted.
2. Design a two input two output sequence detector which generates an output ‘1’ every time the
sequence 1010 is detected. And for all other cases output ‘0’ is generated. Overlapping
sequences are counted.
3. Design a sequential circuit which performs following
A B O/P Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
4. Design a full binary subtractor.
5. What do you mean by finite state machine?
7. What do you mean by state equivalence and state distinguishable? Explain with example.
8. What is distinguishable state and distinguishable sequence?
9. What is k - distinguishable?
C
D
C
G
C
12. What is incompletely specified FSM?
C
B
C
C
C
19. Construct Merger table and compatibility graph
C
B
C
C
C
20. What is Testing Table and Testing Graph?
C
B
C
C
C
D
C
E
C
F
C
24. What is Definite Machine?
C
B
C
C
C
D
C
E
C
F
C
27. Test whether the following machine information lossless or not. If lossless find its order.
C
B
C
C
C
D
C
E
C
F
C
G
C
28. Define inverse machine and construct inverse machine for the following machines.
C
B
C
29. Explain Chomsky Classification.
32. How many strings are possible over the alphabet set {a, b} of length n?
39. How can we find out whether a given program is in the language or not?
40. How can we say a string is accepted by finite automata?
45. Construct a DFA that accept all strings over the alphabets {a, b} where the string length is
divisible by two.
48. Construct a DFA that accept all strings over the alphabets {a, b} where number of ‘a’ in the string
at most two.
49. Construct a DFA that accept all strings over the alphabets {a, b} where number of ‘a’ in the string
is even.
50. Construct a DFA that accept all strings over the alphabets {a, b} where number of ‘a’ in the string
is odd.
51. Construct a DFA that accept all strings over the alphabets {a, b} where number of ‘a’ and
number of ‘b’ in the string is divisible by 3.
52. Construct a minimal DFA which accepts all strings over {0,1}, which when interpreted as binary
number is divisible by 4.
53. Construct a minimal DFA which accepts all strings over {0,1}, which when interpreted as binary
number is .
54. Construct a minimal DFA which accepts all strings over {0,1}, which when interpreted as binary
number is .
55. Construct a minimal DFA which accepts all strings over {0,1,2}, which when interpreted as
ternary number is divisible by 4.
56. Construct a minimal DFA which accepts set of all strings over {a, b} where each string starts with
an ‘a’.
57. Construct a minimal DFA which accepts set of all strings over {a, b} where each string ends with
an ‘a’.
58. Construct a DFA that accept all strings over the alphabets {a, b} where number of ‘a’ is even and
number of ‘b’ is odd in the string.
59. Construct a DFA that accept all strings over the alphabets {a, b} where number of ‘a’ is odd and
number of ‘b’ is even in the string.
60. Construct a DFA that accept all strings over the alphabets {a, b} such that ( )
( ) .
61. Construct a minimal DFA which accepts all strings over Octal number system, which when
interpreted as binary number
62. Construct a minimal DFA which accepts set of all strings over {a, b} where each string start with
“ab”
63. Construct a minimal DFA which accepts set of all strings over {a, b} where each string contains
“ab” as a sub string.
64. Construct a minimal DFA which accepts set of all strings over {a, b} where each string starts with
‘a’ and ends with ‘b’ or vice versa.
65. Construct a minimal DFA which accepts set of all strings over {a, b} which accepts strings in
which every 'a' is followed by 'b'.
A NS
PS
0 1
A B A
B C B
C E D
D C C
E E E
B
C
C
D
C
82. Convert epsilon - NFA to NFA
C
B
C
83. Define Moore Machine.
86. Construct a Mealy machine that accepts binary number as input and produces 2’s complement
of that number as output. Assume the string is read LSB to MSB and end carry is discarded.
87. Construct a Moore machine that takes set of all string over {a, b} as input and prints ‘1’ as
output for every occurrence of ‘ab’ as a substring
88. Construct a Moore machine that takes binary numbers as in and produces residue modulo ‘3’ as
output.
89. Convert Moore Machine to Mealy Machine.
A
B
90. Convert Mealy Machine to Moore Machine.
A
B
91. Define Regular Expression.
97. Find regular expression over the alphabet set {a, b} where string length is exactly two.
98. Find regular expression over the alphabet set {a, b} where string length is exactly three.
99. Find regular expression over the alphabet set {a, b} where string length is at least two.
100. Find regular expression over the alphabet set {a, b} where string length is at most two.
101. Find regular expression over the alphabet set {a, b} where string length even.
102. Find regular expression over the alphabet set {a, b} where string length odd.
103. Find regular expression over the alphabet set {a, b} where string length is divisible by 3.
104. Find regular expression over the alphabet set {a, b} where string is .
105. Find regular expression over the alphabet set {a, b} where number of a’s are exactly two.
106. Find regular expression over the alphabet set {a, b} where number of a’s are at least two.
107. Find regular expression over the alphabet set {a, b} where number of a’s are at most two.
108. Find regular expression over the alphabet set {a, b} where number of a’s are even.
109. Find regular expression over the alphabet set {a, b} where each string starts with ‘a’.
110. Find regular expression over the alphabet set {a, b} where each string ends with ‘a’.
111. Find regular expression over the alphabet set {a, b} where each string containing an ‘a’.
112. Find regular expression over the alphabet set {a, b} where each string starting and ending with
different symbol.
113. Find regular expression over the alphabet set {a, b} where each string starting and ending with
same symbol.
119. How many strings of length less than 4 contains the language described by the regular
expression ( ) ( )
120. Prove that ( ) ( )( )( ) ( )