Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
494 views8 pages

r05310501 Formal Languages and Automata Theory

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 8

Code No: R05310501 Set No.

1
III B.Tech I Semester Regular Examinations, November 2008
FORMAL LANGUAGES AND AUTOMATA THEORY
(Computer Science & Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. (a) Define NFA and explain with an example.


(b) Conclude what type of strings will be accepted by the below Finite automata
as shown in figure 1b. [6+10]

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 ‘y’ whenever current input matches to previous one, and
emits n otherwise. [8+8]

3. Construct an NFA for the following:

(a) R=01[((10)*+111)*+0]*1
(b) ((01+10)*00)*. [8+8]

4. (a) Find the left most and right most derivations for the word abba in the gram-
mar
S →AA
A→aB
B→bB/∈
(b) Write a CFG for EVEN and ODD palindromes. [2×8]

5. (a) Explain Chomsky hierarchy.


(b) Construct PDA for set of all strings of balanced parenthesis. [8+8]

6. (a) Let G be the grammar given by


S→aABB/aAA,
A→aBB/a,
B→bBB/A
Construct the PDA that accepts the language generated by this grammar G.
(b) Define Deterministic pushdown automata. Explain with an example. [8+8]

1 of 2
Code No: R05310501 Set No. 1
7. (a) Define a Turing machine mathematically. Define the term ‘move’ in a TM.
(b) Design a TM that recognizes the set
{02n 1n ≥ |n = 0 }. [16]

8. Discuss:

(a) The Hierarchy theorem.


(b) LR(0) grammar.
(c) Universal Turing Machine. [6+5+5]

⋆⋆⋆⋆⋆

2 of 2
Code No: R05310501 Set No. 2
III B.Tech I Semester Regular Examinations, November 2008
FORMAL LANGUAGES AND AUTOMATA THEORY
(Computer Science & Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. (a) Consider below transition (diagram 1a) and verify whether the following Strings
will be accepted or not? Explain.

Figure 1a
i. 0011
ii. 010101
iii. 111100
iv. 1011101. [8+8]
(b) Design a DFA, M that accepts the language. L(M) = {w/w ∈ {a,b} * } and
w does not contain 3 consecutive b’s.
2. Construct DFA for given (figure 2) NFA with ∈-moves. [16]

Figure 2
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’s.
(b) The set of all strings where the 10th symbol from right end is a 1.

1 of 2
Code No: R05310501 Set No. 2
(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 is
divisible by 3. [4×4]
4. (a) Obtain a right linear grammar for the following FA as shown in figure 4a.

Figure 4a
(b) Obtain a left linear grammar for the above FA. [2×8]
5. (a) Prove that the following language is not context-free language
n n j
L1 = {a b c n ≤ j ≤ 2n}
(b) Simplify the following grammar:
S → AB
A→a
B→C
B→b
C→D
D →E. [8+8]
6. (a) Construct the PDA corresponding to the grammar:
S→aABB/aAA
A→aBB/a
B→bBB/A.
(b) Construct a PDA that accepts the language
L = {wcwR /w ∈ {a, b}∗ }. [8+8]
7. (a) Briefly explain the properties of recursive enumerable languages.
(b) Design Turing machine to recognize the palindromes of digits {0,1}. Give its
state transition diagram also. [8+8]
8. Give LR(0) items for the grammar S’→S , S→aSa/bSb/c. Find its equivalent DFA.
Check the parsing by taking a suitable string. [16]

⋆⋆⋆⋆⋆

2 of 2
Code No: R05310501 Set No. 3
III B.Tech I Semester Regular Examinations, November 2008
FORMAL LANGUAGES AND AUTOMATA THEORY
(Computer Science & Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. (a) Design DFA to accept strings with c and d such that number d’s are divisible
by 4
(b) Design DFA which accepts language L ={ 0,000,00000,........} over {0}. [8+8]

2. For the following NFA with ∈ -moves convert it in to an NFA with out ∈ -moves
and show that NFA with ∈-moves accepts the same language as shown in figure 2.
[16]

Figure 2
3. Consider the two regular expressions
r=0*+1*, s=01*10*+1*0+(0*1)*

(a) Find a string corresponding to r but not to s.


(b) Find a string corresponding to s but not to r. [8+8]

4. Construct DFA for the following Regular expression


( ( a U b)* ( b U a)*)*. [16]

5. (a) When is a grammar is said to be in reduced form.


(b) Convert the following grammar to GNF:
G = ({A1 , A2 , A3 }, {a, b}, P1, A1)
Where P consists of the following:
A1 → A 2 A3
A2 → A3 A1 /b
A3 → A1 A2 /a. [8+8]

6. (a) Define PDA. In what ways a PDA can show the acceptance of a string. Explain
with examples.
(b) Construct the PDA M for the language L={wwR /w ∈ {a, b}∗ } such that
L=L(M). [8+8]

1 of 2
Code No: R05310501 Set No. 3
7. (a) Let T be the Turing machine defined by the five tuples:
(q0 , 0, q1 , 1, R), (q0 , 1, q1 , 0, r), (q0 , B, q1 , 0, R),
(q1 , 0, q2 1, L), (q1 , 1, q1 , 0, r)(q1 , B, q2 , 0, L).
for each of the following initial tapes, determine the final tape when T halts,
assuming that T begins in initial position.
(b) Design a Turing machine to add two given integers. [8+8]

8. (a) Write a type 2 grammar with productions that generate the language.
L={0n 1n /n >= 0}
(b) Write short notes on linear bound automata. [8+8]

⋆⋆⋆⋆⋆

2 of 2
Code No: R05310501 Set No. 4
III B.Tech I Semester Regular Examinations, November 2008
FORMAL LANGUAGES AND AUTOMATA THEORY
(Computer Science & Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. Out of the following languages, which are/is accepted by given FA and explain as
shown in figure 1.

Figure 1
(a) (a+b)* (c+d)* (ef)*
(b) (ab)* (cd)* (ef)*
(c) (a+b)*+(c+d)*+(ef)*
(d) ( (ab)*+ (cd)*+ (ef)* ) *. [4×4]

2. (a) Show that the FA are equivalent as shown in figure 2a.

Figure 2a
(b) Construct DFA for given FA as shown in figure 2b. [8+8]

1 of 2
Code No: R05310501 Set No. 4

Figure 2b
3. Give a regular expression for the following language
L = {x ∈ {0, 1}∗ |x ends with 1 and does not contain the sub string 00}. [16]

4. (a) Construct DFA for the following regular expression ( ab U aba)*a


(b) Write recursive definition of regular expression? [12+4]

5. (a) Show that L = {ai bj /j = i2 } is not context free language.


(b) List the properties of CFLs.
(c) Find if the given grammar is finite or infinite.
S→AB, A→BC/a, B→CC/b, C→a. [8+5+3]

6. (a) Find the PDA with only one state that accepts the language {am bn : n > m }
(b) Construct the PDA that recognizes the languages L={x=×R : x∈{a,b}+ }.
[8+8]

7. (a) Design A Turing machine that accepts L = {an bn |n ≥ 0 }


(b) What does the Turing Machine described by the 5-tules
(q0 , 0, q0 R), (q0 , 1, q1 , 0, r), (q0 , B, q2 , B, R),
(q1 , 0, q1 , 0, R), (q1 , 1, q0 , 1, R) and (q1 , B, q2 , B, R)
do when given a bit string as input? [8+8]

8. Write short notes on:

(a) Church’s hypothesis.


(b) Ogden’s lemma.
(c) DPDA. [6+5+5]

⋆⋆⋆⋆⋆

2 of 2

You might also like