Sie sind auf Seite 1von 5

1

COMPUTER SCIENCE & APPLICATIONS (NET)


Unit Test : Theory of Computation
Time: 0:50 Hour M.M. : 50

______________________________________________________________________________
INSTRUCTIONS: Attempt all the 25 questions. Each question carry two marks.

1. How many strings the following grammar generate?


A  BB, B  CC , C  1/2
(a) 16 (b) 7 (c) 8 (d) 15

2. How many strings the following grammar generate?


A  BB , B  CC , C  1/2 | 
(a) 64 (b) 32 (c) 16 (d) 31

3. Which of the following Regular expression generates the same language as the one recognized by this NFA

S0 0 S1  S3 1 S4
0
0
0
S2

(a) (000)*(10)+ (b) 0(000)*(10)* (c) (000)*(10)* (d) 0(000)*1(01)*

4. How many distinct string are there in the language of the regular expression?

 0  1    0  1    0  1    0  1   
(a) 31 (b) 64 (c) 81 (d) 32

5. What is the number of states the minium NFA has for a(bc)*d
(a) 3 (b) 4 (c) 5 (d) 2

6. The language of the regular expression (abab)* is equivalent to which of the following regular expression.


(I) aba  baba  b +λ
*
 (II)  ab  abab  *ab  +λ

(III)  a  ba  *b  +λ (IV)  ab  *
(a) I, II, III (b) I, II (c) II, III, IV (d) All of these

7. Minimum number of state of the DFA for the lanaguage

L= 011, 001111  0 n 12 n | n  1, 2 is
(a) 9 (b) 10 (c) 7 (d) 8

H.O.: 28-A/11, Jia Sarai, Near-IIT, New Delhi-16 , Ph : 011-26851008, 26861009 www.careerendeavour.com
B.O.: 16, 3rd Floor, Mall road, G.T.B. Nagar (Metro Gate No. 3), Delhi-110 009, Ph: 011-65462244, 9540292991
2

8. Number of two state DFA possible for accepting a* over = a, b


(a) 1 (b) 20 (c) 16 (d) 64

9. An NFA has 10 states out of which 3 are final states maximum number of final states in its equivalent DFA is:
(a) 895 (b) 894 (c) 896 (d) 897

10. Consider the finite automata


a
b
A a b
B C

b a
Dead
a,b

The language accepted by above FA is

(a) a mb n | m  0, n  0 (b) a mb n | m  0, n  1

(c) a mb n | m  1, n  0 (d) a mb n | m  1, n  1
11. Infinite languages are
(a) All regular languages (b) All non-regular languages
(c) Some are regular olanguages (d) None of these

12. Consider the two DFA’s


b a a a a
M1: q1 q2 b M2: q3 b q4 b q5

a
b

Consider the follwoing machine M3.


b

A b B b C

a a a a a a

D b E b F

b
Which of the following is TRUE for above FA
(a) M3 = M1 – M2 (b) M3 = M2– M1 (c) M3 = M1  M2 (d) M3 = M1  M2

13. The regular exp for the set strings that consists of alternating 0’s and 1’s
* * * * * * * *
(a)  01  10   0 10   1 01 (b)  01 10  1  01 0 10 
*
(c)  1 01  0  (d) both (a) and (c)

H.O.: 28-A/11, Jia Sarai, Near-IIT, New Delhi-16 , Ph : 011-26851008, 26861009 www.careerendeavour.com
B.O.: 16, 3rd Floor, Mall road, G.T.B. Nagar (Metro Gate No. 3), Delhi-110 009, Ph: 011-65462244, 9540292991
3
14. The grammar with the productions
S  aA / bB , B  b, A
belongs to
(a) Regular grammar (b) Context free grammar
(c) Regular and context free grammar (d) Context sensitive grammar

15. Consider the following statements


(I) Every subset of a regular language is regular.
(II) For a DFA with more than one final state we have an equivalent DFA having a single final state.
Which of the above is correct.
(a) I only (b) II only (c) Both I and II (d) Both are incorrect.

16. Match the following


A. PDA (I) Regular language
B. TM (II) Context free language
C. LBA (III) Recursive language
D. NFA (IV) Recursive enumerable language
(a) I-A, II-B, III-C, IV-D (b) I-D, II-C, III-B, IV-A
(c) I-B, II-C, III-D, IV-A (d) I-D, II-A, III-B, IV-B

17. Consider a DFA having n states out of which it has f final states. The above DFA accepts the language L
then the DFA accepting L has how many final states.
(a) f (b) n (c) n–f (d) f–n

18. If the mealy Machine has p states and its is defined over  with   q then the maximum number of states
in its equivalent moore machine is:
(a) p–q (b) pq (c) p+q (d) p/q

19. Let L1 = set of all strings whose nth symbol from begining is 1.
L2 = set of all string whose nth symbol from the last.
The number of states in DFA accepting the language L1 and L2 is:
n n 1 n
(a) n2  2 (b) n 2  2 n (c) 2n 2 (d) 2  n  2

20. Which of the following is TRUE


* * *
(I)  r  s    r *  s    r * s* 

*
(II) a  b  b   a  ab *
(III) All linear grammers are regular grammar.
(IV) The DFA accepting the language

 *

L    a, b |  mod 50  15 has 35 final states.

(a) I, II, III (b) I, II, IV (c) I, II, III, IV (d) None of these

H.O.: 28-A/11, Jia Sarai, Near-IIT, New Delhi-16 , Ph : 011-26851008, 26861009 www.careerendeavour.com
B.O.: 16, 3rd Floor, Mall road, G.T.B. Nagar (Metro Gate No. 3), Delhi-110 009, Ph: 011-65462244, 9540292991
4

21. Consider the following DFA

q1 b q2
a a
a b
q0 b q6 q3
b
b a
a a
q5 q4
b

The number of states in the minimum DFA of above DFA is:


(a) 3 (b) 4 (b) 5 (d) 6

22. Consider the 2-way FA

 a b
 q0 q1 , R  q1 , L 
q1 q0 , L  q3 , R 
q2 q1 , L  q2 , R 
The languages accepted by above 2-way DFA is

(a) a n b | n  1 (b) ab n | n  1 (c) ab n | n  2 (d) ab n | n  0

23. The number of state of a minimum state DFA which accept the set of all strings over   a, b, c having
substring abc that occurs an even number of times
(a) 3 (b) 4 (c) 5 (d) 6

24. Consider the following


(I) R    R (II) R1 R2  R2 R1 (III) R1 R1  R1
*
(IV)  R1 R2    R1 * R2 * * (V) R1  R2 R3   R1  R2  R1  R3 
where R, R1, R2 are regular expression.
Which of the above are correct.
(a) I, II, V (b) III, IV, V (c) IV, V (d) None of these

25. Consider the grammar


S  aS / aA, A  bA | bB B  cB | c
The language generated by above grammar is

(a)  abc  n
| n 1 (b) a n b n c n | n  1

(c) a n b n c m | m, n  1 (d) a mb n c p | m  1, p  1, n  1

H.O.: 28-A/11, Jia Sarai, Near-IIT, New Delhi-16 , Ph : 011-26851008, 26861009 www.careerendeavour.com
B.O.: 16, 3rd Floor, Mall road, G.T.B. Nagar (Metro Gate No. 3), Delhi-110 009, Ph: 011-65462244, 9540292991
5

COMPUTER SCIENCE & APPLICATIONS (NET)


Unit Test : Theory of Computation
__________________________________________________________________________________________

[ANSWER KEY]

1. (a) 2. (d) 3. (d) 4. (a) 5. (b) 6. (b) 7. (c)


8. (a) 9. (c) 10. (c) 11. (c) 12. (b) 13. (d) 14. (c)
15. (d) 16. (d) 17. (c) 18. (b) 19. (a) 20. (d) 21. (b)
22. (c) 23. (d) 24. (d) 25. (d)

H.O.: 28-A/11, Jia Sarai, Near-IIT, New Delhi-16 , Ph : 011-26851008, 26861009 www.careerendeavour.com
B.O.: 16, 3rd Floor, Mall road, G.T.B. Nagar (Metro Gate No. 3), Delhi-110 009, Ph: 011-65462244, 9540292991

Das könnte Ihnen auch gefallen