0% found this document useful (0 votes)
18 views10 pages

Flat QB - 0

The document is a tutorial question bank for the course 'Formal Languages and Automata Theory' at the Institute of Aeronautical Engineering, Hyderabad, for the academic year 2016-2017. It includes objectives related to quality assurance in engineering education, along with a comprehensive set of short and long answer questions categorized by units and difficulty levels. The questions cover various topics such as DFA, NFA, regular languages, context-free grammars, and automata theory.

Uploaded by

Gopi Krishna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views10 pages

Flat QB - 0

The document is a tutorial question bank for the course 'Formal Languages and Automata Theory' at the Institute of Aeronautical Engineering, Hyderabad, for the academic year 2016-2017. It includes objectives related to quality assurance in engineering education, along with a comprehensive set of short and long answer questions categorized by units and difficulty levels. The questions cover various topics such as DFA, NFA, regular languages, context-free grammars, and automata theory.

Uploaded by

Gopi Krishna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

INSTITUTE OF AERONAUTICAL

ENGINEERING
DUNDIGAL – 500 043, HYDERABAD

COMPUTER SCIENCE AND

ENGINEERING TUTORIAL QUESTION

BANK

Course Name : FORMAL LANGUAGES AND AUTOMATA THEORY


Course Code : A40509
Class : II B. Tech II Semester
Branch : Computer Science and Engineering
Year : 2016 – 2017
Course Faculty : Dr K Rajendra Prasad , Professor
Ms N Mamatha, Assistant Professor
Ms M Sandhya Rani, Assistant Professor
Ms T Ramya, Assistant Professor

OBJECTIVES

To meet the challenge of ensuring excellence in engineering education, the issue of quality needs to be
addressed, debated and taken forward in a systematic manner. Accreditation is the principal means of quality
assurance in higher education. The major emphasis of accreditation process is to measure the outcomes of
the program that is being accredited.

In line with this, Faculty of Institute of Aeronautical Engineering, Hyderabad has taken a lead in
incorporating philosophy of outcome based education in the process of problem solving and career
development. So, all students of the institute should understand the depth and approach of course to be
taught through this question bank, which will enhance learner’s learning process.

Group - A (Short Answer Questions)

S. No. Questions Blooms Course


Taxonomy Outcomes
Level
UNIT - I
Part- A (Short Answer Questions)
1. Explain transition diagram, transition table with example. Understand 1
2. Define transition function of DFA. Remember 2
3. Define ε –transitions. Remember 2
4. Construct a DFA to accept even number of 0’s. Apply 2
5. Define Kleene closure and positive closure. Remember 1
6. Construct a DFA to accept empty language. Apply 2
7. Explain power of an alphabet (∑*)? Understand 1
8. Write transition diagram for DFA accepting string ending with 00 Apply
2
defined over an alphabet ∑= {0,1}
9. Write transition diagram for DFA to accept exactly one a defined Apply
2
over an alphabet ∑= {a,b}
10. Define NFA with an example. Remember 2
11. Explain the different Operations on the languages. Understand
12. Construct a finite automaton accepting all strings over {0, 1} having Apply
2
even number of 0’s
13. Define Moore Machines. Remember 3
14. Define Mealy Machines. Remember 3
15. Write DFA for odd number of 1’s. Apply 2
16. Write NFA for (0+1)*101(0+1)*. Apply 2
17. Write DFA for (0+1)*10(0+1)*. Apply 2
18. Define ɛ - closure. Remember 2
19. Write NFA for (0+1)*001(0+1)*. Apply 2
20. Write DFA for (0+1)*00(0+1)*. Apply 2
21 Define FSM and its structure with an example. Remember 2
22 Give any two comparisions between NFA and DFA Remember 2
Part- B (Long Answer Questions)
1. Construct a DFA to accept set of all strings ending with 010. Apply
Define language over an alphabet ∑ = { 0,1} and write for the 2
above DFA .
2. Construct a Moore machine to accept the following Apply
3
language. L = { w |w mod 3 = 0} on ∑ = { 0,1,2}
3. Write any six differences between DFA and NFA Apply 2
4. Write NFA with Ɛ to NFA conversion with an example. Understand 2
5. Construct NFA for (0 + 1)*(00 + 11)(0 + 1)* and Convert to Apply
2
DFA.
6. Design DFA for the following languages shown below Apply
∑ = { a,b}
a) L={w/ w does not contain the substring ab}
b) L={w/ w contains neither the substring ab nor ba} 2
c) L={w/ w is any string that doesn’t contain exactly two a}
d) L={w/ w is any string except a and b}

7. Illustrate given 2 FA‘s are equivalent or not with an example. Apply

8. Construct Mealy machine for (0 + 1)*(00 + 11) and convert to Apply


3
Moore machine.
9. Convert NFA with Ɛ – a*b* to NFA. Understand 2
10. Construct NFA for (0 + 1)*101 and Convert to DFA. Apply 2
11. Construct a mealy machine that takes binary number as input and Understand
produces 2’s complement of that number as output.Assume the 3
string is read LSB to MSB and end carry is discarded.
12. Explain with the following example the Minimize the DFA . Understand

13. Construct a DFA, the language recognized by the Automaton being L Apply
2
 {anb/n  0}. Draw the transition table.
14. Construct the Minimized DFA Apply

15. Construct the DFA that accepts/recognizes the language L(M) = | Apply
2
w {a, b, c}* and w contains the pattern abac }. Draw the
transition table.
16. Construct NFA for given NFA with Є-moves Apply

17. Differentiate between DFA and NFA with an example. Understand 2


18. Construct a finite automaton accepting all strings over {0, 1} Apply
having 2
even number of 0’s and even number of 1’s.
19. Construct a Moore Machine to determine the residue mod 5 for Apply
3
each binary string treated as integer. Sketch the transition table.
20. Construct the Moore Machine for the given Mealy machine

STATE/I a b output
q0 q1 q2 1 Understand 3
q1 q1 q1 0
q2 q1 q0 1

Part- C (Problem Solving and Critical Thinking)


1 Construct NFA for (0 + 1)*0(0 + 1)0(0 + 1)* and convert to DFA. Apply 2
2 Construct NFA for (0 + 1)*010(0 + 1)* and Convert to DFA. Apply 2
3 Apply
Construct NFA with Ɛ for 0*1*12* and Convert to NFA . 2
4 Construct Mealy Machine for Residue Modulo of 5 for the ternary Apply
2
number system and convert to Moore Machines.
5 Write the DFA that will accept those words from   {a, b} where Apply
the number of a’s is divisible by two and the number of b’s is 2
divisible by three. Sketch the transition table of the finite
6 Automaton DFA
Construct M . for the given NFA as shown in fig. below Apply

UNIT – II
Part- A (Short Answer Questions)
1. Define Regular Languages. Remember 7
2. Define Pumping Lemma for Regular Languages. Remember 7
3. Write the applications of pumping lemma for regular languages. Apply 7
4. List any two applications of regular expression. Remember 7
5. Define Context Free Grammars. Remember 8
6. Define Left linear derivation. Remember 7
7. Write regular expression for denoting language containing empty Apply
7
string.
8. Differentiate left linear and right linear derivations. Understand 8
9. Write the Context free grammar for palindrome. Remember 8
10. Define right linear grammars. Remember 7
11. Define Regular grammars. Remember 7
12. Write regular expressions for the Set of strings over {0, 1} whose Apply
7
last two symbols are the same.
13. Define right linear derivation. Remember 7
14. Define left linear grammars. Remember 7
15. Write the regular language generated by regular expression Apply
7
(0+1)*001(0+1)*.
16. Write the Regular Expression for the set of binary strings. Apply 7
17. Write the derivation of the string aaaa from CFG – Apply 8
S  a S/A A a
18. Write the derivation of the string 110 from CFG – Apply
8
S A0/B A0/12/B B A/11
19. Write the Regular Expression to generate atleast one b over Apply
8
Σ ={a,b}
20. Write the Context free grammar for equal number of a’s and b’s. Apply 8
Part- B (Long Answer Questions)
1. Convert Regular Expression 01* + 1 to Finite Automata. Understand 7
2. Convert given Finite Automata to Regular Expression using Arden’s Understand
theorem with an example.

3. Construct Right linear , Left linear Regular Grammars for Apply 7


01*+1.
4. Explain Identity rules . Simplify the Regular Expression - Understand 7
Є + 1*(011)*(1*(011)*)*
5. Construct Regular grammar for the given Finite Automata. Apply 7
(a+b)*ab*.
6. Construct Leftmost Derivation. , Rightmost Derivation, Apply 8
Derivation Tree for the following grammar
S aB bA
A a aS bAA
B b  bS aBB
For the string aaabbabbba .
7. Explain the properties, applications of Context Free Languages Understand 8
8. Construct right linear and left linear grammars for given Regular Apply 7
Expression.
9. Construct a Transition System M accepting L(G) for a given Regular Apply 7
Grammar G.
10. Discuss the properties of Context free Language. Explain the pumping Understand 7
lemma with an example.
11. Write regular expressions for the given Finite Automata Apply 7

12. Construct a NFA with Є equivalent to the regular expression 10 + (0 Apply 7


+
11)0*1
13. Construct Leftmost Derivation. , Rightmost Derivation, Apply 7
Derivation Tree for the following grammar G = (V, T, P, S) with
N = {E}, S = E, T = {id, +,
*(,)} E E+E
EE*
E E
(E)
E id
Obtain id+id*id in right most derivation, left most derivation
14. Write a CFG that generates equal number of a’s and b’s. Apply 8
15. Convert G = ( {S},{a},{ S  aS /a},{S} ) into FA Understand 7
16. Construct a Regular expression for the set all strings of 0’s and Apply 7
1’s
with at least two consecutive 0’s
17. Construct context free grammar which generates palindrome Apply 8
strings
∑={a,b}
18. Construct equivalent NFA with є for the given regular Apply 7
expression 0*(1(0+1))*.
19. Construct the right linear grammar for the following Apply 7

20. Write 12 identity rules for regular expressions Apply 7


Part- C (Problem Solving and Critical Thinking)
1 Understand 7
Convert Regular Expression (11 + 0)*(00 + 1)* to NFA with Ɛ.
2 Convert Regular Expression (a + b)*(aa + bb)(a + b)* to DFA. Understand 7

3 Construct Regular Grammars for Finite Automata 0*(1(0 + 1))* . Apply 7


4 Construct Finite Apply 7
Automata for
A0  a A1
A1

5 b
Construct left linear grammar for the following Apply 7
A1
A1

a
A1  bA0

UNIT – III
Part- A (Short Answer Questions)
1. Define Greibach normal form. Remember 9
2. Define nullable Variable. Remember 8
3. Write the minimized CFG for the following grammar Remember 9
SABCa | bD
ABC |b
Bb | ε CĐ
| ε Dd
4. Convert the grammar to CNF - S bA/aB AaS/a BbS/b. Understand 8
5. Explain the elimination of UNIT production. Understand 8
6. Explain the elimination of useless symbols in productions. Understand 8
7. Define CNF. Remember 9
8. Write the minimization of CFG – S  a S/A A a B  aa Understand 8
9. Define the ambiguity in CFG. Remember 8
10. What is the use of CNF and GNF. 8
11. Write the minimization of CFG - S  aS1b S1aS1b/ɛ. Understand 8
12. Write the minimization of CFG - S  A A aA/ ɛ. Understand 8
13. Write the minimization of CFG - S AB / a A  a. Understand 8
14. Write the minimization of CFG - SaS/A/C A a B aa C Understand 8
aCb.
15. Write the minimization of CFG - SAbA AAa/ ɛ. Understand 8
16. Write the minimization of CFG - SaSa S bSb Sa/b/ ɛ. Understand 8
17. Write the minimization of CFG - S A0/B A0/12/B Understand 8
B A/11.
18. Convert the grammar to CNF - SaSa/aa SbSb/bb S a/b. Understand 8
19. Convert the grammar to CNF - SaAbB AaA/a BbB/a. Understand 8
20. Define PDA. Remember 10
21. Define NPDA. Remember 10
22. Differentiate between deterministic and nondeterministic PDA. Understand 10
23. Define the language of DPDA. Remember 10
24. List the steps to convert CFG to PDA. Remember 11
25. Explain – acceptance of PDF by final state. Understand 10
26. Explain – acceptance of PDF by empty stack. Understand 10
27. Convert the following PDA to CFG Apply 11
δ(q0,b,z0)={q0,zz0)
28. Convert the following PDA to CFG Apply 11
δ(q0, b, z)=(q0,zz)
29. Convert the following PDA to CFG Apply 11
δ(q0, ϵ ,z0)=(q0,ϵ)
30. Convert the following PDA to CFG Apply 11
δ(q0,a,z) = (q1,z)
31. Convert the following PDA to CFG δ(q1,b,z)=(q1,ϵ) Apply 11
32. Convert the following PDA to CFG Apply 11
δ(q1,a,z0)=(q0,z0)
33. Convert the following PDA to CFG Apply 11
δ(q0,0,z0)={q0,xz0)
34. Convert the following PDA to CFG Apply 11
δ(q0,0,x)=(q0,xx)
35. Convert the following PDA to CFG δ(q0,1,x)=(q1,ϵ) Apply 11
36. Convert the following PDA to CFG Apply 11
δ(q1,1,x) = (q1,ϵ)
37. Convert the following PDA to CFG Apply 11
δ(q1,ϵ,x)=(q1,ϵ)
38. Convert the following PDA to CFG δ(q1,ϵ,z0)=(q1,ϵ) Apply 11
39. Convert the following PDA to CFG Apply 11
δ(q1,ϵ,z)=(q0,ϵ)
40. Convert the following CFG to PDA Apply 11
S ABC | BbB
41. Convert the following CFG to PDA Apply 11
A aA | BaC|aaa
42. Convert the following CFG to PDA Apply 11
B bBb| a|D
43. Convert the following CFG to PDA Apply 11
C CA|AC
44. Convert the following CFG to PDA Apply 11
S a S/A
Part- B (Long Answer Questions)
1. Write a short notes on Chomsky Normal Form and Griebach Normal Apply 9
Form.
2. Show that the following grammar is ambiguous with respect to the Understand 8
string aaabbabbba.
S aB | bA
A aS| bAA|a
B bS | aBB | b
3. Use the following grammar : Apply 9
S ABC | BbB
A aA |BaC|aaa
B bBb| a|D
CCA|AC
D ε
Eliminate ε-productions.
Eliminate any unit productions in the resulting grammar.
Eliminate any useless symbols in the resulting grammar.
Convert the resulting grammar into Chomsky Normal Form
4. Illustrate the construction of Griebach normal form with an example. Apply 9
5. Show that the following CFG ambiguous. Apply 8
S iCtS | iCtSeS | a
C b
6. Discuss the Pumping lemma for Context Free Languages concept with Understand 9
example {anbncn where n>=0}
7. Write the simplified CFG productions in S  a S1b Apply 8
S1  a S1b/ Є
8. Convert the following CFG into GNF. Understand 8
SAA/a A  SS/b
9. Explain unit production? Explain the procedure to eliminate unit Understand 8
production.
10. Explain the procedure to eliminate ϵ-productions in grammar. Understand 8
11. Convert the following grammar into GNF Understand 8
G=({A1,A2,A3},{a,b},P,A)
A1->A2A3
A2->A3A1/b
A3->A1A2/a
12. Write simplified CFG productions from the following grammar Apply 8
A->aBb/bBa
B->aB/bB/ϵ
13. Convert the following grammar into GNF Understand 8
S->ABA/AB/BA/AA/B
A->aA/a B->bB/b
Part- C (Problem Solving and Critical Thinking)
1 Construct PDA for equal number of x’s and y’s Apply 10

2 Convert the following grammar Understand 9


into GNF
A1 A2 A3
A2 A3 A1 /b
A3 A1 A2 /a
3 Construct DPDA for L = { W#WR /W ϵ ( X + Y)*} Apply 10

4 Convert the following PDA to CFG Understand 11


δ(q0,0,z0)={q0,xz0) and
δ(q0,0,x)=(q0,xx)
δ(q0,1,x)=(q1,ϵ)
δ(q1,1,x) = (q1,ϵ)
δ(q1,ϵ,x)=(q1,ϵ)
δ(q1,ϵ,z0)=(q1,ϵ)
5 Write the PDA that accepts the language{a^m b^n/n>m} Apply 10

6 Design a PDA for the following grammar Create 10


S->0A
A->0AB/1
B->1
7 Convert the following PDA to CFG Understand 11
M=({q0,q1},{a,b},{z0,za},μ,q0,z0,Ф) and
δ is given by, δ(q0,a,z0)=(q0,zz)
δ(q0,a,z)=(q0,zz0)
δ(q0,b,z)=(q1,ϵ)
δ(q1,b,z)=(q1,ϵ)
δ(q1,ϵ,z0)=(q1,ϵ)
UNIT - IV

Part- A (Short Answer Questions)


1. Define Turing Machine Apply 12
2. Explain the moves in Turing Machine. Understand 12
3. Define an Instantaneous Description of a Turing Machine. Remember 12
4. Define the Language of Turing Machine. Remember 12
5. List types of TM. Remember 12
6. Define Computable Functions by Turing Machines . Remember 12
7. Write the difference between Pushdown Automata and Turing Apply 12
Machine.
8. Explain Church’s Hypothesis. Understand 12
9. Define Context sensitive language. Remember 12
10. Define multi head Turing Machine. Remember 12
11. Define multi dimensional Turing Machine. Remember 12
12. Define multiple tapes Turing Machine. Remember 12
13. Define Recursive languages. Remember 12
14. Define Recursively enumerable languages. Remember 12
15. Define Two way infinite Turing Machine. Remember 12
16. Define Non deterministic Turing Machine. Remember 12
17. Define Counter machine. Remember 12
18. Explain the model of Turing machine. Remember 12
19. Construct Turing Machine for 1’s complement for binary numbers. Remember 12
20. Differentiate Recursive languages and Recursively enumberable Remember 12
languages.
Part- B (Long Answer Questions)
1. Define a Turing Machine. With a neat diagram explain the working of Remember 12
a Turing Machine.
2. Differentiate Turing Machine with other automata. Apply 12
3. Construct a Transition diagram for Turing Machine to accept Apply 12
the following language. L = { 0n1n0n | n ≥1}
4. Construct Transition diagram for Turing Machine that accepts the Apply 12
language L = {0n1n | n ≥1}. Give the transition diagram for the
Turing Machine obtained and also show the moves made by the
Turing machine for the string 000111.
5. Construct a Transition diagram for Turing Machine to accept the Apply 12
language L= { w#wR | w ϵ ( a + b ) *}
6. Write short notes on Recursive and Recursively Enumerable Apply 12
languages.
7. Write the properties of recursive and recursively enumerable Apply 12
languages.
8. Construct a Turing Machine to accept strings formed with 0 Apply 12
and 1 and having substring 000.
9. Construct a Turing Machine that accepts the language Apply 12
L = {1n2n3n | n ≥1}. Give the transition diagram for the Turing
Machine obtained and also show the moves made by the Turing
machine for the string 111222333.
10. Define Linear bounded automata and explain its model? Apply 12
11. Explain the power and limitations of Turing machine. Create 12
12. Construct Transition diagram for Turing Machine - L={anbncn/n>=1} Apply 12
13. Construct a Transition diagram for Turing Machine to implement Apply 12
addition of two unary numbers(X+Y).
14. Construct a Linear Bounded automata for a language where Apply 12
L={anbn/n>=1}
15. Explain the types of Turing machines. Apply 12
16. Write briefly about the following Apply 12
a)Church’s Hypothesis
b)Counter machine
17. Construct a Transition table for Turing Machine to accept the Apply 12
following language. L = { 0n1n0n | n ≥1}
18. Construct a Transition diagram for Turing Machine to accept the Apply 12
language L= { wwR | w ϵ ( a + b ) *}
19. Construct Transition table for TM - L={anbncn/n>=1} Apply 12
20. Construct a Linear Bounded automata for a language where Apply 12
L={anbncn/n>=1}
Part- C (Problem Solving and Critical Thinking)
1 Construct a Turing Machine that accepts the language Apply 12
L = {a2nbn| n ≥0}. Give the transition diagram for the
Turing Machine obtained.
2 Construct a Turing Machine that gives two’s compliment for the Apply 12
given binary representation.
3 Construct a Turing Machine to accept the following Apply 12
language. L = { wnxnynzn | n ≥1}
UNIT - V
Part- A (Short Answer Questions)
1. Define Chomsky hierarchy of languages. Knowledge 4
2. Define Universal Turing Machine Knowledge 12
3. Define Context sensitive language. Knowledge 5
4. Define decidability. Knowledge 13
5. Define P problems. Knowledge 13
6. Define Universal Turing Machines Knowledge 13
7. Give examples for Undecidable Problems Understand 13
8. Define Turing Machine halting problem. Knowledge 13
9. Define Turing Reducibility Knowledge 13
10. Define Post’s Correspondence Problem. Knowledge 13
11. Define Type 0 grammars . Knowledge 4
12. Define Type 1 grammars . Knowledge 4
13. Define Type 2 grammars . Knowledge 4
14. Define Type 3 grammars . Knowledge 4
15. Define NP problems. Knowledge 13
16. Define NP complete problems Knowledge 13
17. Define NP Hard problems Knowledge 13
18. Define undecidability problem. Knowledge 13
19. Define turing Reducibility. Knowledge 13
20. List the types of grammars. Knowledge 13
Part- B (Long Answer Questions)
1. Explain the concept of decidable and undecidability problems Understand 12
about Turing Machines.
2. Write briefly about Chomsky hierarchy of languages.. Apply 13
3. Explain individually classes P and NP Understand 13
4. Write a shot notes on post's correspondence problem Apply 13
and check the following is PCP or not.
I A B
1 11 111
2 100 001
3 111 11
5. Explain the Halting problem and Turing Reducibility. Understand 13
6. Write a short notes on universal Turing machine. Apply 12
7. Write a short notes on Chomsky hierarchy. Apply 4
8. Write a short notes on Context sensitive language and linear bounded Apply 4
automata.
9. Write a short note on NP complete Apply 13
10. Write a short note on NP hard problems. Apply 13
11. Write a shot notes on post's correspondence problem Apply 13
and check the following is PCP or not.
I A B
1 100 1
2 0 100
3 1 0
12. Write a shot notes on post's correspondence problem Apply 13
and check the following is PCP or not.
I A B
1 00 0
2 001 11
3 1000 011
UNIT - V
1 Explain PCP and MPCP with examples. Understand 13
2 Explain Turing theorem ,Halting problems, Turing Reducibility. Understand 13
3 Explain Type 3 and Type 2 grammars with example. Apply 4
4 Explain Type 1 and Type 0 grammars with example. Apply 4

You might also like