SET-1
Code No: 35025 JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD R05 III B.Tech. I Semester Supplementary Exams, May/June – 2009
b)
Design a Finite State Acceptor to accept the language of all binary strings that do not include the substring 1011. [6M] Reduce the Moore machine: [10M]
or ld
2.a)
.in
FORMAL LANGUAGES AND AUTOMATA THEORY (Computer Science and Engineering) Time: 3 hours Max. Marks.80 Answer any Five questions All questions carry equal marks --1.a) Define DFA and NFA. Explain the difference between them with example. [6M] b) Construct a smallest DFA over ∑ = {a,b} accepting all strings which have number of a’s divisible by 6 and number of b’s divisible by 8. [10M]
Given that A is regular and (A U B) is regular, does it follow that B is necessarily regular? Justify your answer.
4.a) b)
Define Regular grammar, right linear and left linear grammars. Give examples. [6] Find DFA and CFG for the following language: L={odd-length strings in {a,b}* with middle symbol a. [10M]
5.a) b)
Define ambiguous grammar and give example. Find an unambiguous CFG equivalent to the grammar with productions S → aaaaS │aaaaaaaS│Λ
nt
uW
3.
7.
8.a) b)
[10M]
Define Push Down Automata and explain its model with a neat diagram. [6M] Construct PDA for L={x ε {a,b}* │na(x) > nb(x)}. [10M]
Aj
6.a) b)
[6M]
Define Turing Machine and give example. Also explain different types of TM’s. [16M] Explain Chomsky hierarchy of languages with a neat diagram. [8M] Define LR(0) grammar and give example. [8M] x-x-x
Code No: 35025 JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD R05 III B.Tech. I Semester Supplementary Exams, May/June – 2009
SET-2
.in
FORMAL LANGUAGES AND AUTOMATA THEORY (Computer Science and Engineering) Time: 3 hours Max. Marks.80 Answer any Five questions All questions carry equal marks --1. (a) Define a finite state machine and explain model of finite automaton. [8M] (b) Provide an NFA with at most six states for the following language: [8M] L={w | w contains an even number of 0’s , or exactly two 1’s}.
or ld
2. Give an example of a regular language L containing Λ that cannot be accepted by any NFA having only one accepting state, and show that your answer is correct.[16] 3. (a)Draw NFA-Λ recognizing regular expression 010*+0(01+10)*11 over {0,1} [8M] (b) Explain Pumping lemma for regular sets. [8M]
5.
uW
4. (a) Define and distinguish regular grammar and context free grammar. (b) Describe the language of the following grammar S → A1B A → 00A|Λ B → 000B|Λ Also find whether the language is regular or not? What is Chomsky Normal Form? Explain in detail.
[8M] [8M]
[16] [16]
7. (a) What is recursively enumerable language? Explain with example. (b) Explain counter machine in detail.
[6M] [10M]
8. (a) Describe linear bounded automata. (b) Explain Universal Turing Machine.
[8M] [8M]
Aj
nt
6. Show the equivalence of CFL and PDA.
x-x-x
SET-3
Code No: 35025
[8M] [8M]
or ld
2. (a) What is the significance of NFA with Λ transitions? Explain. (b) Show the equivalence between NFA with and without Λ transitions.
.in
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD R05 III B.Tech. I Semester Supplementary Exams, May/June – 2009 FORMAL LANGUAGES AND AUTOMATA THEORY (Computer Science and Engineering) Time: 3 hours Max. Marks.80 Answer any Five questions All questions carry equal marks --1. (a) Write the differences between DFA and NFA. [8M] (b) Provide DFA recognizing [8M] L={w ε {0,1}* | w contains at least two 0’s and at most one 1}
3. (a) Define regular expression and find regular expression for the following: L={w | every odd position of w is a 1} defined over ∑ = {0,1} (b) Convert the following regular expression into NFA: (((00)*(11))U01)*
[8M]
4. (a) Define the following and give examples: (i)CFG (ii) Derivation Tree (iii) Sentential form (iv)Right most and left most derivation of strings (b) Find regular grammar for the following finite automata:
[8M]
[8M]
nt
uW
[8M]
Aj
5. (a) For each of the following languages over ∑ = {0, 1}, write a context-free grammar with the minimal number of variables that generates the language: [6M] R R (i) {w | w = w } (w denotes the reverse of w). (ii) {w | w ≠ wR}. (b) What is Greibach normal form? Explain. [10M]
6. Draw a pushdown automaton, and describe a context-free grammar for the language i j k L = {a b c : i < j or j < k}. [16] Contd…2
Set-3 7. (a) Describe the TM that accepts the language L = {w ε{a,b,c} | w contains equal number of a’s, b’s, and c’s}. (b) Explain in detail Church’s hypothesis.
[8+8]
Aj
nt
uW
or ld
x-x-x
.in
8. Define P and NP problems. Also write notes on NP complete and NP hard problems. [16]
SET-4
Code No: 35025
or ld
.in
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD R05 III B.Tech. I Semester Supplementary Exams, May/June – 2009 FORMAL LANGUAGES AND AUTOMATA THEORY (Computer Science and Engineering) Time: 3 hours Max. Marks.80 Answer any Five questions All questions carry equal marks --1 (a) Find the language accepted by following finite automaton: [8M]
(b) Construct DFA and NFA for L={w ε {0,1}* | w contains the substring 0101} [8M]
nt
uW
2 (a) Draw an equivalent deterministic finite automaton for the following automaton: [8M]
[8M]
Aj
(b) Minimize the following finite automat on:
Contd…2
Set-4
[8M]
or ld
(b) Using pumping lemma, show the following language is not regular: L={w ε {0,1}* | the number of 0’s in w is a perfect square}
[8M]
.in
3 (a) Convert the following finite automata to regular expressions:
4 (a) Convert the following grammar into regular grammar that generates same language: S → AB A → aAa | bAb | a | b B → aB | bB | Λ [8M] (b) Find the language generated by the following CFG: [8M] S → aSbScS | aScSbS | bSaScS | bScSaS | cSaSbS | cSbSaS | Λ 5. Explain pumping lemma for Context Free Languages and Prove that the following language is context-free: L= {xy | x, y {0, 1} , |x| = |y| and x ≠ y}. [16]
uW
6. Define formally the model of pushdown automata with two stacks, and prove that it is equivalent to standard TM’s. 7. (a) Define Turing machine and explain its model. (b) Describe Church’s hypothesis.
[8M] [8M]
8. (a) Write notes on decidability of problems. (b) Explain linear bounded automata and context sensitive language.
[8M] [8M]
Aj
nt
x-x-x