Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more ➡
Standard view
Full view
of .
×
0 of .
Results for:
P. 1
r05310501 Formal Languages and Automata Theory

# r05310501 Formal Languages and Automata Theory

Ratings:

5.0

(1)
|Views: 9,254|Likes:

Published by: SRINIVASA RAO GANTA on Aug 21, 2008

### Availability:

Read on Scribd mobile: iPhone, iPad and Android.
See More
See less

03/19/2013

pdf

text

original

Code No: R05310501
Set No. 1
III B.Tech I Semester Supplimentary Examinations, February 2008
FORMAL LANGUAGES AND AUTOMATA THEORY
(Computer Science & Engineering)
Time: 3 hours
Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
\u22c6 \u22c6 \u22c6 \u22c6 \u22c6
1. (a) Design a DFA for the following language. L ={0m1n/m\u2265 0 and n\u2265 1} .
(b) Represent all \ufb01ve tuples for below transition (diagram 1b) and decide whether
it is DFA or NFA.
[8+8]
Figure 1b
2. (a) Design a Moore Machine to determine the residue mod 4 for each binary string
treated as integer.

(b) Design a Mealy machine that uses its state to remember the last symbol read and emits output\u2018y\u2019 whenever current input matches to previous one, and emits n otherwise.

[8+8]
3. Find a Regular expression corresponding to each of the following subsets over
{0,1}*.
(a) The set of all strings containing no three consecutive 0\u2019s.
(b) The set of all strings where the 10th symbol from right end is a 1.
(c) The set of all strings over{0,1} having even number of 0\u2019s & odd number of
1\u2019s.
(d) The set of all strings over{0,1} in which the number of occurrences of is
divisible by 3.
[4\u00d74]
4. (a) Obtain a CFG to generate unequal number of a\u2019s and b\u2019s.
(b) Obtain a CFG to obtain balanced set of parentheses.(i.e every left parentheses
should match with the corresponding right parentheses).
[2\u00d78]
5. (a) What do you mean by ambiguity? Show that the grammar S\u2192 S/S, S\u2192 a is
ambiguous.
1 of 2
Code No: R05310501
Set No. 1
(b) Show that the grammar G with production
S\u2192 a/aAb/abSb
A\u2192aAAb/bS isambiguous.
[8+8]
6. (a) Explain the terms: Push Down Automata and context free language.
(b) Let G be a CFG with the following productions.

S\u2192 a B c
A\u2192 a b c
B\u2192 a A b
C\u2192 A B
C\u2192 c

Construct a PDA M such that the language generated by M and G are equiv-
alent.
[8+8]
7. Give a Turing machine for the following:
(a) That computes ones complement of a binary number
(b) That shifts the input string, over the alphabet (0,1) by one position right by
inserting \u2018#\u2032as the \ufb01rst character.
[8+8]
8. (a) What is decidability? Explain any two undecidable problems.
(b) Show that the following post correspondence problem has a solution and give
the solution.
[8+8]
I List A List B
1
11
11
2
100
001
3
111
11
\u22c6\u22c6 \u22c6 \u22c6 \u22c6
2 of 2
Code No: R05310501
Set No. 2
III B.Tech I Semester Supplimentary Examinations, February 2008
FORMAL LANGUAGES AND AUTOMATA THEORY
(Computer Science & Engineering)
Time: 3 hours
Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
\u22c6 \u22c6 \u22c6 \u22c6 \u22c6
1. (a) Design a DFA that accepts the set{an}U{b/n\u2265 1}
(b) Draw the transition diagram for below FA.
M={ {A,B,C,D},{0,1},\u03b4,C,{A,C} }
\u03b4(A,0) = \u03b4(A,1) ={A,B,C}
\u03b4(B,0) = B, \u03b4(B,1) ={ A, C}
\u03b4(C,0) ={B,C}, \u03b4(C,1) ={ B, D}
\u03b4(D,0) ={ A, B, C, D}
\u03b4(D,1) ={A}.
[10+6]
2. For the following NFA with\u2208 -moves convert it in to an NFA with out\u2208 -moves
and show that NFA with\u2208-moves accepts the same language as shown in \ufb01gure 2.
[16]
Figure 2
3. Construct NFA for the following regular expressions
(a) 0+10* +01*0
(b) (0+1)*(01+110).
[8+8]
4. (a) Obtain a CFG to generate unequal number of a\u2019s and b\u2019s.
(b) Obtain a CFG to obtain balanced set of parentheses.(i.e every left parentheses
should match with the corresponding right parentheses).
[2\u00d78]
5. (a) Show that L ={aibj/j = i2} is not context free language.
(b) List the properties of CFLs.
(c) Find if the given grammar is \ufb01nite or in\ufb01nite.
S\u2192AB, A\u2192BC/a, B\u2192CC/b, C\u2192a.
[8+5+3]
6. (a) Construct the PDA for the following grammar.
S\u2192AA/a A\u2192SA/b
1 of 2

## Activity (35)

### Showing

AllMost RecentReviewsAll NotesLikes
You've already reviewed this. Edit your review.