Automata Py q
Automata Py q
CS/B.Tech(IT)/SEM-5/CS-512/2009-10
2009
As far as practicable.
GROUP – A
a) R1 ∩ R2 is not regular.
b) R1 U R2 is not regular.
c) ∑ ∩ R2 is not regular.
ii) Which of the following strings can be obtained by the language L = { ai b2i/i≥ 1}?
a) aaabbbbbb b) aabbb
c) abbaabbbb d) aaaabb
iii) The regular expression with all strings of 0’s and 1’s with atleast
two consecutive 0’s is
c) (0 + 1) * 011 d) 0 * 0 * 1 *
a) aabccd b) adabcca
c) abcca d) abababd.
a) Union b) Concatenation
vii) A grammar that produces more than one parse tree for some sentence is called
a) ambiguous b) unambiguous
expression contains
a) n states b) n + 1 states
c) n + 2 states d) n - 1 states.
ix) The vernacular language English, if considered a formal language is a
a) regular language
d) none of these.
c) FSM cannot find whether the second half of the string matches the first half
d) all of these.
a) belongs to CFG
d) none of these.
a) μ ≤ n - 1 b) μ ≥ n - 1
c) μ = n - 1 d) none of these.
xv) Merger table is substitute of
a) L ( G ) = ø b) L ( G ) = an
c) L ( G ) = aø d) L ( G ) = an ban.
GROUP – B
2. Test the machine below is definiteness or not. If yes, find the order μ. 5
NS
PS
x=0 x=1
A A B
B E B
C E F
D E F
E A D
F E B
S → iCtS | iCtSeS | a
C→b 1+4
5. a) What are the differences between Moore machine and Mealy machines?
NS
PS
a=0 a=1
NS o/p NS o/p
q1 q1 1 q2 0
q2 q4 1 q4 1
q3 q2 1 q3 1
q4 q4 0 q1 1
2+3
Q/Σ 0 1
q0 q0, q1 q0
q1 q2 q1
q2 q3 q3
q3 ---- q2
2+3
GROUP – C
a a
q0 b q1 a q2 5+5+5
8. a) What is PDA?
L = { an bn |n ≥ 1 } U {am b2m |m ≥ 1 } and also construct PDA for the above derived
CFG. 1+6+8
9. a)
NS, z
PS
I1 I2 I3
A C, 0 E, 1 ---
B C, 0 E,-- ---
C B,-- C, 0 A,--
D B,0 C,-- E,--
E --- E A,--
For the incompletely specified machine shown above, find a minimum state reduced
NS, z
PS
x=0 x=1
A B,1 H, 1
B F, 1 D, 1
C D, 0 E, 1
D C, 0 F, 1
E D, 1 C, 1
F C, 1 C, 1
G C, 1 D, 1
H C, 0 A, 1
What the minimum length sequence that distinguishes state A from state B.
8 + (3 + 3 +1 )
S → aB| bA
A → a | aS | bAA
B → b | bS |aBB
Give the left most and right most derivation for the string “aaabbabbba”.
L (G ) = { 0n 1m | n ≠ m }
5+5+5
11. a) Remove left recursion from guven grammar :
A → Ba |b
B → Bc | Ad |e
S → a ABb | a
A → aaA |B
B → bAb
the output sequence 1110000010. Find the input sequence to the machine if it is
NS, z
PS
x=0 x=1
A B, 1 C, 0
B D, 1 B, 1
C E, 1 B, 0
D A, 0 E, 0
E F, 0 D, 1
F D, 0 A, 1
-------------------
http://www.makaut.com
Name : ……………………………………………………………
Roll No. : ………………………………………………………..
Invigilator's Signature : ……………………………………….
CS/B.Tech(IT)/SEM-5/CS-512/2009-10
2009
FORMAL LANGUAGE & AUTOMATA THEORY
Time Allotted : 3 Hours Full Marks : 70
GROUP – A
( Multiple Choice Type Questions )
∑
then
a) R 1 I R 2 is not regular
b) R 1 U R 2 is regular
c) ∑ I R 2 is not regular
d) R 2 * is not regular.
a) aaabbbbbb b) aabbb
c) abbaabbbb d) aaaabb.
iii) The regular expression with all strings of 0's and 1's
with at least two consecutive 0's is
a) 1 + ( 10 ) * b) ( 0 + 1 ) * 00 ( 0 + 1 ) *
c) ( 0 + 1 ) * 011 d) 0* 0* 1* .
a) aabccd b) adabcca
c) abcca d) abababd.
a) Union b) Concatenation
vii) A grammar that produces more than one parse tree for
some sentence is called
a) ambiguous b) unambiguous
a) n states b) n + 1 states
c) n + 2 states d) n – 1 states.
55902 2
CS/B.Tech(IT)/SEM-5/CS-512/2009-10
a) regular language
b) context-free language
c) context-sensitive language
d) none of these.
d) all of these.
a) belongs to CFG
d) none of these.
GROUP – B
( Short Answer Type Questions )
Answer any three of the following. 3 ∞ 5 = 15
2. Test the machine below is definiteness or not ? If yes, find
the order µ . 5
PS NS
x=0 x=1
A A B
B E B
C E F
D E F
E A D
F E B
55902 4
CS/B.Tech(IT)/SEM-5/CS-512/2009-10
GROUP – C
( Long Answer Type Questions )
Answer any three of the following. 3 ∞ 15 = 45
7. a) State and prove Arden's Theorem.
b) Prove that
( 1 + 00* 1 ) + ( 1 + 00*1 ) ( 0 + 10*1 )*( 0 + 10*1 )
= 0*1 ( 0 + 10*1 )*
c) Find the regular expression for the given transition
diagram :
dia.
5+5+5
8. a) What is PDA ?
b) Design a PDA to accept the following language
L = ( ww R |w ε( 0, 1 )* ).
c) Construct a context free grammar generating following
language :
L = { a n b n|n ≥ 1 } U { a m b 2m|m ≥ 1 } and also
construct PDA for the above derived CFG. 1+6+8
9. a)
Dia.
55902 6
CS/B.Tech(IT)/SEM-5/CS-512/2009-10
b)
Dia
S ∅ aB|bA
A ∅ a|aS|bAA
B ∅ b|bS|aBB
Give the left most and right most derivation for the
string "aaabbabbba".
L ( G ) = { 0 n 1 m |n ≠ m }
Dia.
3+5+7
55902 8
http://www.makaut.com
Name : …………………………………………….………………
Roll No. : …………………………………………...……………..
Invigilator’s Signature : ………………………………………..
2010-11
FORMAL LANGUAGE AND AUTOMATA THEORY
Time Allotted : 3 Hours Full Marks : 70
GROUP – A
production rules?
S → ASb |c
A →a
a) { a n cb n |n ∈ IN } b) { xcb | x ∈ {a } * }
5402 2
CS / B. TECH (IT) / SEM-5 / CS-512 / 2010-11
a) S → AB b) S → ab | A | B
A → aA | A → Aa |
B → bB | B → Bb |
c) S → A |B d) S → ab | A | B
A → aA |b A → aA |
B → Bb |a B → bB |
d) initial state.
c) recursion
d) iteration.
a) S states b) S –1 states
c) 2S states d) 2S –1 states.
5402 4
CS / B. TECH (IT) / SEM-5 / CS-512 / 2010-11
GROUP – B
GROUP – C
below :
NS, z
PS
x=0 x=1
A B, 1 H, 1
B F, 1 D, 1
C D, 0 E, 1
D C, 0 F, 1
E D, 1 C, 1
F C, 1 C, 1
G C, 1 D, 1
H C, 0 A, 1
machine.
5402 6
CS / B. TECH (IT) / SEM-5 / CS-512 / 2010-11
NS, z
PS
x=0 x=1
A A, 0 B, 0
B C, 0 D, 1
C E, 0 D, 0
D F, 0 E, 1
E G, 0 A, 0
F G, 0 B, 1
G C, 0 F, 1
c) Draw merger graph for the following incompletely
specified machine.
NS, z
PS
I1 I2 I3 I4
A – – E, 1 –
B C, 0 A, 1 B, 0 –
C C, 0 D, 1 – A, 0
D – E, 1 B, – –
E B, 0 – C, – B, 0
5+5+5
b) Find if the string aaa bbb ccc can be derived from the
productions.
the productions
S → AB , A → Aa , A → bB , B → a , B → Sb 5+5+5
{ 1n 2n 3n |n ≥ 1 }
=============
5402 8
http://www.makaut.com
Name : …………………………………………….………………
Roll No. : …………………………………………...……………..
Invigilator’s Signature : ………………………………………..
CS/B.TECH(IT)/SEM-5/CS-512/2011-12
2011
FORMAL LANGUAGE AND AUTOMATA THEORY
Time Allotted : 3 Hours Full Marks : 70
GROUP – A
( Multiple Choice Type Questions )
S1 : { O 2n |n ≥ 1 } is a regular language.
{ }
S2 : O mO nO m +n |m ≥ 1, n ≥ 1 is a regular language.
b) Only S2 is correct
a) N2 b) 2N
c) 2N d) N!.
vi) Properties of equivalence relations are
a) Reflexive b) Symmetric
c) Transitive d) all of these.
5402 2
CS/B.TECH(IT)/SEM-5/CS-512/2011-12
a) 3 b) 2
c) 1 d) 0.
d) none of these.
GROUP – B
( Short Answer Type Questions )
Answer any three of the following 3 × 5 = 15
5402 4
CS/B.TECH(IT)/SEM-5/CS-512/2011-12
2+6+7
5402 6
CS/B.TECH(IT)/SEM-5/CS-512/2011-12
Name : …………………………………………….………………
Roll No. : …………………………………………...……………..
Invigilator’s Signature : ………………………………………..
CS/B.TECH(CSE/IT)NEW/SEM-4/CS-402/2012
2012
FORMAL LANGUAGE & AUTOMATA THEORY
Time Allotted : 3 Hours Full Marks : 70
GROUP – A
10 × 1 = 10
information
d) all of these.
d) None of these.
a) no b) yes
4358 2
CS/B.TECH(CSE/IT)NEW/SEM-4/CS-402/2012
vi) ( P + Q )* = ?
a) ( P* + Q* ) b) P* + Q*
vii) What is the RE for the language set strings with atleast
a) { ai : i = n2, n > = 1 }
b) { ap : p is prime }
c) { ww : w is in (a, b) + }
d) { a2n : n > = 1 }.
a) XX ( X + Y ) * Y b) YY ( X + Y ) * X
c) Y ( X + Y ) * XX d) Y ( XY ) * XX.
a) { a, b, ab, aa } b) { a, b, ba, bb }
GROUP – B
( Short Answer Type Questions )
Answer any three of the following. 3 × 5 = 15
State / 0 1
q0 q 0 q 1
q1 q1 q0, q1 2
GROUP – C
( Long Answer Type Questions )
Answer any three of the following. 3 × 15 = 45
4358 4
CS/B.TECH(CSE/IT)NEW/SEM-4/CS-402/2012
Theorem. 5
grammar ?
S → ABb/a
A → aaA/B
B → bAb 1+4
not regular. 5
b) What is PDA ? 5
4358 6
CS/B.TECH(CSE/IT)NEW/SEM-4/CS-402/2012
11.
PS NS, Z
I1 I2 I3
A C,O E,1 ….......
B C,O E,… ………
C B,… C,O A,…
D B,O C,… E,…
E …… E A,…
Name : ……………………………………………………………
Roll No. : ………………………………………………………..
Invigilator’s Signature : ………………………………………..
CS/B.TECH (CSE/OLD)/SEM-4/CS-401/2013
2013
FORMAL LANGUAGE & AUTOMATA THEORY
Time Allotted : 3 Hours Full Marks : 70
GROUP – A
( Multiple Choice Type Questions )
1. Choose the correct alternatives for any ten of the following :
10 1 = 10
CS/B.TECH (CSE/OLD)/SEM-4/CS-401/2013
L= { anbncndn | n 1 }
L is
a) CFL but not regular
b) CSL but not CFL
c) regular
d) type 0 language but not type 1.
4001 (O) 2
www.makaut.com
CS/B.TECH (CSE/OLD)/SEM-4/CS-401/2013
G = ( N, T, P, S )
N = { S, A, B, C }
T = { a, b, c }
P :S aS
A bB
B cC
C a
a) is type 3
L= { a n b n |n 1 }
L is
c) regular
CS/B.TECH (CSE/OLD)/SEM-4/CS-401/2013
S AB
B CD
B AD
B b
D AD
D d
A a
C a
a) { a n b n c m d m |n‚ m 1 }
b) { a n b m c p d q |n = p or m = q‚ n‚ m‚ p‚ q 1 }
c) { a n b m c p d q |n m p q }
d) { a n b m c p d q |n mVp q }.
4001 (O) 4
www.makaut.com
CS/B.TECH (CSE/OLD)/SEM-4/CS-401/2013
a) Lexical analysis
b) Parser
c) Code generation
d) code optimization.
= { a, b } ( including ) is denoted by
a) (a+b) b) (a+b)+
c) a+b + d) a b
CS/B.TECH (CSE/OLD)/SEM-4/CS-401/2013
GROUP – B
( Short Answer Type Questions )
Answer any three of the following. 3 5 = 15
L(( a+b) b ( a + bb ) ). 2
S AB |
A aB
B Sb. 3
NS
PS
x=0 x=1
A A B
B E B
C E F
D E F
E A D
F E B
4001 (O) 6
www.makaut.com
CS/B.TECH (CSE/OLD)/SEM-4/CS-401/2013
GROUP – C
( Long Answer Type Questions )
Answer any three of the following. 3 15 = 45
NS
PS Output
i=0 i=1
q1 q1 q2 0
q2 q1 q3 0
q3 q1 q3 1
L= { a3 bncn : n 0 }. 8
L= { an bncn : n 1 }. 12
regular. 3
CS/B.TECH (CSE/OLD)/SEM-4/CS-401/2013
4001 (O) 8
http://www.makaut.com
Name : …………………………………………….………………
Roll No. : …………………………………………...……………..
Invigilator’s Signature : ………………………………………..
CS/B.TECH (CSE-NEW/IT-NEW)/SEM-4/CS-402/2013
2013
FORMAL LANGUAGE AND AUTOMATA THEORY
Time Allotted : 3 Hours Full Marks : 70
GROUP – A
( Multiple Choice Type Questions )
d) None of these.
c) Recursion
d) Iteration.
a) a* + b* b) a*b*
a) Concatenation
b) Union
c) Intersection
d) Repeated Concatenation.
c) abbabbba d) aaaabbbabb.
a) 00111 b) 00110
c) 01010 d) 11010.
4302 2
CS/B.TECH (CSE-NEW/IT-NEW)/SEM-4/CS-402/2013
a) S → aA b) SA → AS
c) S → AB d) All of these.
a) R = QP* b) R = Q*P
c) P = RQ* d) R = P.
a) Mealy M/C
b) Turing M/C
c) Moore M/C
d) all of these.
L = {an bn cn dn | n ≥ 1}
L is
c) Regular
GROUP – B
not regular.
4302 4
CS/B.TECH (CSE-NEW/IT-NEW)/SEM-4/CS-402/2013
GROUP – C
State/Σ I/P
0 1
→ Q0 Q0 , Q3 Q 0, Q 4
Q3 Qf ........
Q4 ....... Qf
Qr (Final State) Qf Qf
PS NS
X=a X=b
→ A B E
B C D
C H I
D I H
E F G
F H I
G H I
H H H
I I I
iii) L = { anbm | n ≠ m }
S → aA/B/C/a
A → aB/E
B → aA
C → cCD
D → abd
4302 6
CS/B.TECH (CSE-NEW/IT-NEW)/SEM-4/CS-402/2013
S → aAB/bBA
A → bS/a
B → aS/b