13 - Quiz(s) With Solution
13 - Quiz(s) With Solution
w n ot the tollowing regular expression describes the given grammar {S,A}, {a,b},
{S’ aAa<s, A’ bS},S?
a) (ab)* b) (ab)*ta Lerab)*(E+a) d) ([ta)(ab)*
2. Let X be a Mealy machine with Nstates and Moutputs. Let P be the number of states of
the corresponding Moore machine Ywhich is equivalent to X. Which of the following
conditions always holds?
a) P<= M+N , bP <= M*Nt| c) P <= Max(M, N) d) P<= 2N
3. Giventhe language L- {ab, aa, baa), which of the following strings are in L*?
) abaatbaaabaa 2) aaaabaaaa 3)baaaaabaaaab 4) baaaaabaa
a) 1,2 and 3
b) 2, 3 and 4
Lo1,2 and 4
d) 1,3 and 4
4. Let N be an NFA with n states and let M be the minimized DFAwith m
states
recognizing the same language. Which of the following is NECESSARILY true?
a) m< 2n tnsm c) M has one accept state d) m=2n
5. Let w be any string of length n in {0, 1}*. Let L be the set of all substrings of w.
What is
the minimum number of states ina non-deterministic FA that accepts L?
a) n-1 b)n d) 2n+1
6. Consider the following Deterministic Finite Automata Mover the
=fa,b}, Which of the
following regular expression denotes the set of all words accepted by M.
a,b
a) (atbbtbaatbab)Xa+b)*
b) (atb)*ba(a+b)*
ý ba
d) (a+bb+baatbab)(a+b)*+ba
0, 1
1
\0, 1
0 1
(ao
a) (0+1)* ei-00*+1*
b)(10+01)* d) 1*0*1(0+1)*
12. Which of the following pairs of regular expression are not equivalent?
a) (01)*0 and 0(10)* c) (0+1)* and (0*+1)*
b) (0*+1)* and (0-+1)* u t None of these
13. Which of the following are not regular?
1) String of 0's whose length is a perfect square.
2) Set of allpalindromes made up of 0O'sand 1's.
3) Strings of 0's, whose length is a prime number.
4) String of odd number of 0's.
a) 1,2 b) 2,3 i2,3 d) 1,3,4
RollNumber Group.
Name
IhaPAR INSTITUTE OF ENGINEERINGAND TECHNOLOGY, PATIALA
Department of Computer Science and Engineering
BE- COE,CSE (VI
Semester) Quiz 2 Course Code: UCS 701
April 27, 2023 5:10 P.M. Course Name: Theory of Computation
Time: 12 Mins Max. Marks: 12
Note: Attempt all questions. Assume
missing data, if any suitably.
1. Consider the following CFG: A’ A+ dJA%d |A * d|wly
Write the production rules after removing Left
Recursion.....
Z. he number of auxiliary memory reguired for a finite-state machine to
behave like push-down machine.
3. Context-free grammar is not closed under
a Complementation b) Union c) Kleene Closure d) Product
4. Which of the following CFG's can't be simulated by FSM
a) A ’ abB B’ cC C’ dlaB oA ’ aAb\ab
b) A ’ Aa<a d) All given grammar can be simulated by FSM
5. Consider the following statement about the CFG:
G= {S ’ SS, S ’ ab, S’ ba, S’e}
G is ambiguous
ii) G produces all string with equal no. of a's and b's.
iii) Gcan accepted by a deterministic PDA
iv) Contain the substring aa
a)
i and ii only b) i only ,chi and ii
6. How many production or steps are required to d) i and iionly
generate a string w (wEL(G)) of length 'n' using CNF grammar?
a) n-1 b) n e 2n-1
7 Anushdown automata can behave like d) 2n
Turing machine IT It has
8. Consider thefollowing languages: L, = {0°"1"0" |n,m= 1,2,3..3
..2......umber of auxiliary memorv.
={0°1"o" | n, m=1,2,3...
L, ={0"0" |n=1,2,3...)
Which of the following is correct answer
i) L,=4nL,
ii) L and L,are not CFL but L3 is CFL
ii) L, is a subset of
iv) None of these
b) iand i c) iv
a) iand ii d) ii and ii ei
Consider the following Turing machine:
A, a) ’ (8, a, R)
oiB, b) ’ (C, b, R)
S(C, a) ’ (C, a, R)
S(C, b) ’ (D, b, R)
Dis the tinalstate. The language accepted by the TM is
(a) a*ba Lb) aba*b c) aba*ab d)aba*
10. Match the pairs given below: