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
JNTU old question papers 2007

# JNTU old question papers 2007

Ratings:

4.8

(1)
|Views: 3,674|Likes:

### Availability:

See more
See less

08/20/2013

pdf

text

original

Code No: R05310501
Set No. 1
III B.Tech I Semester Regular Examinations, November 2007FORMAL LANGUAGES AND AUTOMATA THEORY(Computer Science & Engineering)Time: 3 hours Max Marks: 80Answer any FIVE QuestionsAll Questions carry equal marks
⋆ ⋆ ⋆ ⋆ ⋆
1. Construct NFAs for the following languages(a) The set of strings over alphabet
{
0,1,.........,9
}
such that the ﬁnal digit hasappeared before.(b) The set of strings over alphabet
{
0,1,........,9
}
such that the ﬁnal digit has notappeared before.(c) The set of strings of 0’s and 1’s such that there are two 0’s separated by anumber of positions that is a multiple of 4. Note that 0 is an allowable multipleof 4. [4+4+8]2. For the following NFA with
-moves convert it in to an NFA with out
-movesand show that NFA with
-moves accepts the same language as shown in ﬁgure 2.[16]Figure 23. 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’s.(b) The set of all strings where the 10
th
symbol from right end is a 1.(c) The set of all strings over
{
0,1
}
having even number of 0’s & odd number of 1’s.(d) The set of all strings over
{
0,1
}
in which the number of occurrences of isdivisible by 3. [4
×
4]4. (a) Obtain a CFG to generate unequal number of a’s and b’s.(b) Obtain a CFG to obtain balanced set of parentheses.(i.e every left parenthesesshould match with the corresponding right parentheses). [2
×
8]1 of 2

Code No: R05310501
Set No. 1
5. (a) Simplify the grammar=
{ {
S,A, B, C, E
}
,
{
a,b,c
}
, P, S
}
Where, P is S
ABA
aB
bB
CE
c/
(b) Prove that the following language is not context-free languageL =
{
www
|
w
{
a
,
b
}
}
is not context free. [8+8]6. (a) Construct the PDA for the following grammar.S
AA/a A
SA/b(b) Design a PDA for the following grammar.S
0A A
0AB/1 B
1. [8+8]7. Deﬁne Turing machine formally; explain how Turing machine can be used to com-pute integer functions. Design the Turing machine to compute following function,Show its transition diagram also f(x,y)=xy where x and y are positive integersrepresented in unary. [16]8. Give LR(0) items for the grammar S
aAB, A
aAb/ab, B
aB/a. Find its equiv-alent DFA. Check the parsing by taking a suitable string. [16]
⋆ ⋆ ⋆ ⋆ ⋆
2 of 2

Code No: R05310501
Set No. 2
III B.Tech I Semester Regular Examinations, November 2007FORMAL LANGUAGES AND AUTOMATA THEORY(Computer Science & Engineering)Time: 3 hours Max Marks: 80Answer any FIVE QuestionsAll Questions carry equal marks
⋆ ⋆ ⋆ ⋆ ⋆
1. Construct NFAs for the following languages(a) The set of strings over alphabet
{
0,1,.........,9
}
such that the ﬁnal digit hasappeared before.(b) The set of strings over alphabet
{
0,1,........,9
}
such that the ﬁnal digit has notappeared before.(c) The set of strings of 0’s and 1’s such that there are two 0’s separated by anumber of positions that is a multiple of 4. Note that 0 is an allowable multipleof 4. [4+4+8]2. Construct DFA for given (ﬁgure 2) NFA with
-moves. [16]Figure 23. Construct a DFA accepting language represented by 0*1*2*. [16]4. (a) Obtain regular grammar for the following FA as shown in ﬁgure 4a.Figure 4a(b) What is the language accepted by above FA? [2
×
8]5. (a) What do you mean by Greibach Normal Form (GNF).(b) When is a CFG said to be in GNF?1 of 2