Toc Test
Toc Test
Test
A 0 D
0 1, 0
(D)
1 1
A B C Î, 1 1
0 C
Test | 5.51
b a
a (A) Divisible by 3 and 2
− + (B) Odd and even
(C) Even and odd
b (D) Divisible by 2 and 5
5.52 | Unit 5 • Theory of Computation
23. In the automaton below, s is the start state and t is only The above diagram represents NFA of regular
final state. expression.
b (A) (ab)* (a/b/∈). (B) (ab)* (a/b).
a (C) (ab)* (a/∈). (D) (ab)* (b/∈).
s t
27. If ‘a’ is a terminal and S, A, B are three (3) non-termi-
a a b nals, then which of the following is regular grammar.
(A) A → a B/a A (B) A → B a/B a a
r
(C) A → a B (D) S → ∈
b B → bA A → a S/b
Consider the strings 28. Consider the grammar
U=abbaba S → ABc/Abc
V = b a b and BA → AB
W=aabb
Ab → ab
Which of the following statement is true?
Aa → aa
(A) The automaton accepts U and V but not W.
(B) The automaton accepts each of U, V and W. Which of he following sentences can be derived by this
(C) The automaton rejects U, V and W. grammar?
(D) The automaton accepts U but rejects V and W. (A) aab (B) abcc
(C) abab (D) abc
24. Which regular expression best describe the language
accepted by the non-deterministic automaton below? 29. C a D
a
a, b a, b
a a, b b b
S1 S2 S3 t Start A
B a
Accept E
(A) (a + b)*a(a + b)b b
b
(B) (a + b)*a(a + b)b(a + b)*
(C) (abb)* The language recognized by the following finite auto-
(D) (a + b)* mation is
25. Which of the following strings are accepted by the reg- (A) aabb* + bab*
ular expression:(0/1)* 0(0/1) (0/1) (B) (aab (bab*))*
(A) 000 or 001 (B) 001 or 010
(C) (aab + ba) (bab)*
(C) 010 or 011 (D) All the above
(D) (aab* + bab*)*.
26. 4
a 5
∈
∈ ∈ 30. From the following regular expressions over an alpha-
a b bet {a, b} given below, which can yield all the possible
0 1 2 ∈ 8
∈
∈ b strings over ∑ (a, b)?
6 7
(i) (a*b*)
(ii) (a + b)*
(A) Only (i) (B) Only (ii)
∈
(C) Both (A) and (B) (D) None of these
Answers Keys
1. B 2. A 3. A 4. B 5. B 6. B 7. A 8. B 9. B 10. D
11. B 12. A 13. B 14. B 15. D 16. A 17. B 18. D 19. A 20. B
21. C 22. A 23. D 24. B 25. D 26. A 27. D 28. D 29. C 30. B