0% found this document useful (0 votes)
31 views3 pages

Toc Test

The document is a test on the Theory of Computation, consisting of 30 multiple-choice questions covering topics such as Chomsky's Hierarchy, finite automata, regular expressions, and grammars. Each question presents a scenario or concept related to computational theory, requiring the selection of the correct answer from given options. An answer key is provided at the end of the document.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views3 pages

Toc Test

The document is a test on the Theory of Computation, consisting of 30 multiple-choice questions covering topics such as Chomsky's Hierarchy, finite automata, regular expressions, and grammars. Each question presents a scenario or concept related to computational theory, requiring the selection of the correct answer from given options. An answer key is provided at the end of the document.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

5.

50 | Unit 5 • Theory of Computation

Test

Theory of Computation Time: 60 min.


Directions for questions 1 to 30: Select the correct alterna- 5. Which one of the following regular expressions over
tive from the given choices. {0, 1} denotes the set of strings not containing 100 as a
1. Phrase structure languages, context-sensitive lan- substring?
guages, context-free languages and regular languages (A) 0*(1*0)* (B) 0*1*01*
are commonly referred to as languages of type-0, 1, 2, (C) (0*(10 + 1)*)* (D) 0*1010*
and 3 respectively. Then, Chomsky’s Hierarchy states 6. The following transition diagram of a finite automaton
that accepts
(A) type-0 ⊇ type-1 ⊇ type-2 ⊇ type-3
a, b
(B) type-0 ⊃ type-1 ⊃ type-2 ⊃ type-3
a, b
(C) type-0 ⊂ type-1 ⊂ type-2 ⊂ type-3 A B
(D) type-0 ⊆ type-1 ⊆ type-2 ⊆ type-3
2. Let L be a language recognizable by a finite automaton. (A) All word over sigma (a, b) such that symbol a and
The language Reverse (L) = {x such that x is the reverse b alternate.
of y where y ∈ L} is a (B) Only empty string.
(A) Regular language (C) Only the λ1 meaning this automaton accepts no
(B) Context-sensitive language string of length greater than zero.
(C) Context-free language (D) All words over sigma (a, b) except λ.
(D) Phrase-structure language 7. Sentence that can be generated from the following pro-
3. Which of the following statement is true? duction grammar is
(A) It is possible to construct an NFA with more num- S→aS/bA
ber of states than its equivalent minimum DFA. A→d/ccA
(B) There can be a DFA with more than one start state. (A) aabccccd (B) ababccccd
(C) Both (A) and (B) (C) bccddd (D) aaccdb
(D) None of these
8. Pumping lemma is generally used for proving
4. Which of the following is an equivalent DFA for the (A) A given grammar is regular
NFA shown below: (B) A given grammar is non-regular
0, 1 (C) Whether two given regular expression are equiva-
lent or not
1 0, 1
A B C (D) Both (A) and (C)
9. Finite state machine can recognize
(A) 1 (A) Only context-free grammar
0 1 0
(B) Only regular grammar
1 0 0, 1 (C) Any unambiguous grammar
A B C D
(D) Any grammar
1
10. Which of the following is false?
(B) 0 (A) Regular sets are closed under reversal.
0 1 1 (B) Regular sets are closed under substitution.
1 0 0 (C) Regular sets are closed under intersection.
A B C D
(D) None of these
1
11. For the DFA shown below δ ( A, 01) will be
1 1 0
(C) 0
1 1
A B C B 0, 1
0 Î 1
0

A 0 D
0 1, 0
(D)
1 1
A B C Î, 1 1
0 C
Test | 5.51

(A) {B, D} (B) {C, D} (A) (a + b)*b (B) (a + b)*a


(C) {A, B, C} (D) {A, B, C, D} (C) a*b (D) a*b*
12. ‘NFA can be simulated by a DFA’. The statement is 18. Which of the following statement is false?
(A) True (B) False (A) The family of regular language is closed under the
(C) Depends on NFA (D) Depends on DFA complementary operation.
(B) If L is a regular language, L1 = {UV: U ∈ L, | V | =
13. Given an arbitrary non-deterministic finite automaton
2} is also regular.
(NFA) with N states, the maximum number of states in
(C) If L is a regular language, L1 = {UV: U ∈ L, V ∈
an equivalent minimized DFA is at least
LR} is also regular.
(A) N2 (B) 2N
(D) None of these
(C) 2N (D) N!
19. Which of the following is false?
14. Let M = (K, ∑, δ, S, F) be a finite state automaton, (A) L = {0i 1m2m: i ≥ 1, m ≥ 1} over ∑ = {0, 1, 2} is
Where regular.
K = {A, B} (B) L = {an bI ak, k ≥ n + I} is not regular.
∑ = {a, b} (C) L = {UWW 2V: U, V, W ∈{a, b} +} is regular.
S =A (D) L = {anbk : n > k} ∪{anbk : n ≠ k - 1} is not regular.
F = {B},
20. Consider a DFA over ∑ = {a, b} accepting all strings
δ (A, a) = A
which have number of a’s divisible by 6 and number
δ (A, b) = B
of b’s divisible by 8. What is the minimum number of
δ (B, a) = B and
states that the DFA will have?
δ (B, b) = A.
(A) 16 (B) 15
A grammar to generate the language accepted by M can (C) 48 (D) 8
be specified as G = (V, ∑, R, S), where
21. For the NFA M given below. Let the language, accepted
V = K ∪ ∑, and S = A. Which one of the following set by M be L. Let L1 be the language accepted by the NFA
of rules will make L (G) = L (M)? Mi, obtained by changing the accepting state of M to a
(A) {A→aB, A→bA, B→bA, B →aA, B→∈} non-accepting state and by changing the non-accepting
(B) {A→aA, A→bB, B→aB, B →bA, B→∈} states of M to accepting states. Which of the following
(C) {A→bB, A→aB, B→aA, B →bA, B→∈} statement is true?
(D) {A→aA, A→bA, B→aB, B →bA, A→∈}
15 A deterministic finite automaton M shown below has
0
a start state A and accepting state D. Which of the fol- 1, 0 1
lowing regular expression denotes the set of all words 1, 0
accepted by M?
0
1
1 0 1
(A) L1 = A (B) L1 ⊆ L
A 0 1 (C) L1 = {0, 1}* (D) L1 = (0, 1}* - L
B C D
0 22. The following finite state machine accepts all those
Start
0 binary strings in which the number of 1’s and 0’s are
respectively.
(A) 0 0 1 (B) 1 0* 1* 10
(C) 1* 0* 0 0 1 (D) (0/1)* 0 1 1 1

16. Which of the following regular expression is/are true? 1 1


(A) (x*)* = x* (B) (x + y)* = x* + y* 0 0 0
(C) x*y* = x* + y* (D) All of these 0 0 0
17. Consider the FA shown in the figure given below, 1 1
where ‘-’ is the start sate and ‘+’ is the ending state.
The language accepted by the FA is 1

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy