Department of Computer Application It and Science Question Bank Mca Iv Semester Theory of Computation Unit-I I. Objective Type
Department of Computer Application It and Science Question Bank Mca Iv Semester Theory of Computation Unit-I I. Objective Type
QUESTION BANK
MCA IV SEMESTER
THEORY OF COMPUTATION
UNIT-I
I. OBJECTIVE TYPE:
1. Which of the following statements are correct?
a) An alphabet is a finite sequence of distinct symbols. b) A word is a finite sequence of symbols over a
given alphabet.
c) A regular language is always infinite. d) None of the above
2. Match the column
i. Regular grammar a. Type 1
ii. Recursive grammar b. type 0
iii. Context sensitive grammar c. type 2
iv. Context free grammar d. type 3
v. Turing machine e. recursive language
3. The following grammar
G = (N, T, P, S)
N = {S, A, B}
T = {a, b, c}
P : S aSa
S aAa
A bB
B bB
B c is
a. is type 3
b. is type 2 but not type 3
c. is type 1 but not type 2
d. is type 0 but not type 1
4. The following grammar
G = (N, T, P, S)
N = {S, A, B, C}
T = {a, b, c}
P : S aS
A bB
B cC
C a is
a. is type 3
b. is type 2 but not type 3
c. is type 1 but not type 2
d. is type 0 but not type 1
(10) 1+2+3+-------n=
(11) 12+22+32+--------n2=
(12) 13+23+33+------n3=n2(n+1)2/4
(13) 2+4+6+------2n=n(n+1)
(14) 1+3+5+7+---------(2n-1)=n2
(15) 1+2+4+8+16+-------=2n-1
(17) 1+4+7+-----(3n-2)=
(18) How many terms of A.p. -10,-7,-4,-1-------must be added to get the sum -104?
(19) Find the sum of the series 51+50+49+-----21?
(20) Write down the 8th terms in the G.p.1,3,9------?
(21) Find the sum of the following A.P.1,3,5,7-------199?
(22) Find the A.P. whose 10th terms is 5 and 18th terms is 77?
(23) An A.P. consists of 60 terms if the first and last terms be 7 and 125 respecitively find 32 nd
terms?
8. Prove that the sum of the first n natural num. is given by this formula 1+2+3+------n=
.
9. If n N
12. = .
UNIT-II
I. OBJECTIVE TYPE:
1. How many tuples are there in FSA?
a) 4 b) 5 c) 3 d) 6
2. Look at the following non-deterministic finite-state automaton (NFA), with A as the start state, and D as
the only accepting state.
Which deterministic finite-state automaton (DFA) with as its state transition function accepts the same
language?
a) Start state A , accepting states C and D. (A,b)=B (B,a)=C (C,a)=D
b) Start state A , accepting state C. (A,b)=B (B,a)=C (C,a)=C
c) Start state A , accepting state D. (A,b)=B (B,a)=D (B,b)=C (C,a)=D
d) All the answers above are correct
3. How many parameters are there in transition function for FSA?
a. 1 b. 2 c. 3 d. 4
4. A language L is accepted by a FSA iff it is
a. CFL b. CSL c. regular d. recursive
4. In a finite state machine, m = (Q, , d, q0 , F) transition function d is a function which maps
A) Q ->xQ B) Qx->Q C) Q->F D) Qxq0 ->
5. The regular sets are closed under
a) Union b) Kleene Closure c) concatenation d) all of the above
6. Which of the following statements is the most correct answer?
a) Every finite language is regular.
b) For some regular grammar G, it holds that L(G) = L(G)*.
c) Syntactically different regular expressions can describe the same language.
d) All statements above are valid.
7. What kind of strings is rejected by the following automaton?
A) All strings with two consecutive zeros B) All strings with two consecutive ones
C) All strings with alternate 1 and 0 D) None of these
8. Which string is not accepted by the following FSA?
a. 00110 b. 01010 c. 11010 d. 00111
9. Consider the following NFSA
27. Consider the following NFA. Compute the closure of each state and find its equivalent DFA.
A b C
p {p}
q {q}
* {r}
r
28. Convert the following NFA to its equivalent DFA
0 1
p {p,q} {p}
q {r} {r}
r {s}
* {s} {s}
s
29. For pumping lemma for regular language, what is w, x, y, z and write lemma.
10. Construct transition diagram of a finite automaton corresponding to the regular expression (ab+c
**
) b.
11. Find the regular expression corresponding to the finite automaton given below.
12. Find the regular expression for the set of all strings from the deterministic finite automata given
below.
14. Write about Mealy machine and Moore machine with example.
15. Transform given NFA to DFA.
16. Determine string acceptability of 01100 using transition function for below automata. Draw
Transition table.
a a b b 33 a,b
2 b 4
11
21. Conversion of NFA to DFA :-
a a b
1 2
a b b
3
22. Conversion of NFA to DFA :-
b
A B
b a a
C D
23. Conversion of NFA to DFA :-
0,1 0 0
0,1 0 Y
S R
0,1 0
1
X 0
A 1
0 1B 1 C
0
1
1 0
0
E D
UNIT-III
I. OBJECTIVE TYPE
1. A grammar has the following productions: S->aSSb | a | bSa
Which of the following sentences are in the language that is generated by this grammar?
a) aaaaabb b) aabbaabb c) bbbaabbaa d) All of the above
2. Let G1 and G2 be context-free grammars. Which of the following is the most precise statement that
holds?
a) L(G1) U L(G2) is always context-free b) Sometimes, G1 U G2 is context-free
c) L(G1) L(G2) is never context-free d) All statements above are valid
3. Which of the following statements is the most correct answer?
a) A language is ambiguous if every sentence has two or more parse trees
b) A language is unambiguous if every sentence has a unique left-most derivation
c) A context-free grammar is ambiguous if the right-hand side of one of its production rules starts with
the non-terminal that appears on the left-hand side.
d) All three statements above are valid.
4. Push down machine represents which grammar:
A) Type 0 B) Type 1 C) Type-2 D) Type-3
5. L = {a | p is prime}
P
13. Grammar that produce more than one Parse tree for same sentence is_______.
a) Ambiguous
b) Unambiguous
c) Complementation
d) Concatenation Intersection
14) The logic of pumping lemma is a good example of _________.
a) The pigeon hole principle
b) Divide and conquer method
c) Iteration
d) Recursion
15) Pumping lemma is generally used for proving that _________.
a) Given grammar is regular
b) Given grammar is not regular
c) Whether two given regular expression are equivalent or not
d) None of these
16 CNF is stands for__________.
a) Context normal form
b) Complete normal form
c) Chomsky normal form
d) Compared normal form
17 Type three grammar is________.
a) Context sensitive grammar
b) Context free grammar
c) Regular grammar
d) None of these
18 Normal form is__________.
a) One
b) Two
c) Three
d) Four
19 Production S AB|^, Aa, Bb is _________.
a) CYK Form
b) CNF Form
c) GNF Form
d) None of these
20. For one or more than one derivation tree the string is called_________.
a) Ambiguity
b) Derivation tree
c) Parse tree
d) Left most tree
21 A CFG SaB/bA
Ab/aS/bAA
Bb/bs/aBB
Generates string of terminates that have
a) Equal no. of as and bs
b) Odd no. of as and odd no. of bs
c) Even no. of as and even no. of bs
d) Odd no of as and even no. of as
2. Correct hierarchical relationship among context- free, right-linear, and context-sensitive language is
A. context-free right-linear context-sensitive
B. context-free context-sensitive right-linear
C. context-sensitive right-inear context-free
D. right-linear context-free context-sensitive
3. In a context-sensitive grammar, number of grammar symbols on the left hand side of a production can't
be greater than the number of
A. grammar symbols on the right hand side
B. terminals on the right hand side
C. non-terminals on the right hand side
D. all of these
UNIT-V
I. OBJECTIVE TYPE
1. How many tuples are there in TM?
a) 5 b) 6 c) 7 d) 8
2. Which of the following statements is/are FALSE?
a. For every non-deterministic Turing machine, there exists an equivalent deterministic Turing machine.
b. Turing recognizable languages are closed under union and complementation.
c. Turing decidable languages are closed under intersection and complementation
d. Turing recognizable languages are closed under union and intersection.
3. Recursively enumerable languages are not closed under
a. union b. homomorphism c. complementation d. concatenation
4. TM is more powerful the FSM because
a. the tape movement is confined to one direction b. it has no finite state control
c. it has the capability to remember arbitrary long sequences of input symbols d. none
5. PDA behaves like a TM when the number of auxiliary memory it has is
a. 0 b. 1 or more c. 2 or more d. none
6. UTM influenced the concept of
a. stored-program computers b. implementation of programming languages
c. computability d. all of these
7. The number of internal states of a UTM should be at least
a. 1 b. 2 c. 3 d. 4
8. Any TM with m symbols and n states can be simulated by another TM with just 2 symbols and less than
a. 8mn b. 8mn+4m c. 8mn+4states d. mn states
9. A TM cant solve halting problem
a. true b. false c. still a question d. none
10. If there exists a TM which when applied to any problem in the class, terminates if thhe correct answer
is yes, and , may or may not terminate otherwise is said to be
a. stable b. unsolvable c. partially solvable d. unstable