260-A - St.Joseph's College

advertisement
CLASS: B.Sc. MATHEMATICS
15N/260
St. JOSEPH’S COLLEGE (AUTONOMOUS) TIRUCHIRAPPALLI – 620 002
SEMESTER EXAMINATIONS – NOVEMBER 2015
TIME: 3 Hrs.
SEM
V
SET
MAXIMUM MARKS: 100
PAPER CODE
TITLE OF THE PAPER
2013 11UMA530302A
AUTOMATA THEORY
SECTION – A
Answer all the questions:
20 x 1 = 20
Choose the correct answer:
1. Consider the following NFA
a,b
q0
a
  q0 , baa  is equal to
a) q0 , q1
c) q1, q2 
q1
a,b
a
q2
b) q0 , q2 
d) None of these
2. The grammar S  0SA2 | 012, 2 A  A2, 1A  11 is a
a) Type 0 grammar
b) Context-sensitive grammar
c) Context-free grammar
d) Regular grammar
3. If R is a regular expression, then   RR is equal to
a) RR 
b) R R
c) R
d) 
4. In the construction of a finite state automaton for a given regular
grammar G, each rule Ai  aA j induces a transition with label a
a) from qi to qi
b) from q j to qi
c) from q j to q j
d) from qi to q j
1
5. a  , A, B V . A is called nullable, if

a)
b)
A a
c)

d)
A 

A B

A  aA
Fill in the blanks:
6.
Consider the NFA with the following transition diagram
1
q1
q
a,b2
0
q0
1
0
q3
q4
The language accepted by the NFA is________ .
7.
If G is a grammar with P  S  aS | bS | a | b |  then
L(G) =________.
8.
The regular expression for the language ,11,1111,111111,....
is_________.
9.
If for every A  V  ,  a derivation S   A  w, w  L  G  ,

*
then G is called_______.
10. A terminal string w  L  G  is said to be _____ if there exists two
or more derivation trees for w.
State True or False:
11. In an NFA M  Q, ,  , q0 , F  for any state p  Q,   p,     p .
12. If the grammar G is S  aS | a then L  G   a* .
13. If R is a regular expression, then R* *  R .
 
2
14. If L is a regular set, then LT is also a regular set.
15. The derivation in CFG can be represented as a tree.
Answer in one or two sentences:
16. Define the language accepted by an NFA.
17. Define a derivation tree.
18. Define regular expression.
19. If a regular grammar G is given by S  aS | a, find M accepting
L(G).
20. Define left most derivation & right most derivation.
SECTION – B
Answer all the questions:
5 x 4 = 20
21. a. Find an equivalent DFA for the following NFA
State \ input
 q0
q1
q2 (final state)
a
b
q0 , q1
q2 
q0 
q1
-
q0 , q1
OR
b. Prove that for any transition function  and for any two input
strings x and y, (q,xy) = ((q,x),y).
22. a. Construct a context-free grammar to generate (i) a nbc n | n  1
(ii) a nbc n | n  0 .
OR
3
b. Consider the following grammar
E  E  T | E  T | T , T  T * F | T / F | F , F   E  | id
derive the following strings from the start symbol
(i) id  id / id (ii)  id  id  *id
23. a. Construct the regular expression that denotes the language
accepted by the following NFA.
1
0
1
q0
1q
1
0
0
1
q2
OR
b. Construct a DFA equivalent to the r.e R   0  1*  00  11
*
 0  1 .
24. a. Prove that if L is regular set over  , then *  L is also regular.
OR
b. Construct a regular grammar generating the regular set
*
represented by a*b  a  b 
25. a. Find equivalent grammar by eliminating unit productions to
the following S  AB, A  a, B  C | b, C  D, D  E , E  a
OR
b. Construct the reduced grammar equivalent to the following
grammar S  AB | CA, A  a, B  BC | AB, C  aB | b
4
SECTION – C
Answer any THREE questions:
4 x 15 = 60
26. Prove that for every NFA there exists an equivalent DFA.
27. Prove that each of the classes L0 , Lcsl , Lcfl , Lrl is closed under
union.
28. Prove that for every regular expression there exists an NFA with
λ- moves that accepts the language denoted by the regular
expression.
29. (i) State and prove pumping lemma for regular sets.
(ii) Prove that a p | p is a prime is not regular.
30.
(10)
(5)
*
Let G  VN , , P, S  be a context-free grammar. Prove that S 
if and only if there is a derivation tree with yield α.
**************
5
Download