0% found this document useful (0 votes)
23 views4 pages

13 - Quiz(s) With Solution

The document contains a quiz for a Theory of Computation course at Thapar Institute, with questions covering topics such as regular expressions, finite automata, context-free grammars, and Turing machines. It includes multiple-choice questions and requires students to justify their answers. The quiz is structured to assess understanding of theoretical concepts in computer science.

Uploaded by

mighty.wizard.op
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)
23 views4 pages

13 - Quiz(s) With Solution

The document contains a quiz for a Theory of Computation course at Thapar Institute, with questions covering topics such as regular expressions, finite automata, context-free grammars, and Turing machines. It includes multiple-choice questions and requires students to justify their answers. The quiz is structured to assess understanding of theoretical concepts in computer science.

Uploaded by

mighty.wizard.op
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/ 4

Roll Number: Name: Group :.

Thapar Institute of Engineering and Technology


Department of Computer Scicnce and Engincering
BE-COE, (SE (VISemester ) Quizl Course Codc: UCS701
Course Name: Theory of Computation
February 24, 2023, 5:15 P.M. Time: 13 Mins Max Marks: 13
Note: AHemp all questions with proper justification. Assume missing data, if any, suitably.

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

7. In Mealy Machine, if the input string is of length n, then the


output string will be of
.h.......length?
construction, the number of
utegular expressionr= a(ba)*, Onapplying Thompson's
states and transitions obtained in NFA is
La 6,7 b) 7,8 c) 5,6 d) none of these
9. IfR1 =(atb)*, and R=b*,then R1-R2 is
a) (atab+ba)* b)a* c) b* vh(atab+ba)(a+ab+ba)*
10. Consider the two finite automata for languages Land Mgiven beloW:

0, 1
1

Automata for L Automata for M

The final state for the language (L-M) is:


a) [A, C] b) [A, D] c) (B, C] YB, DÊ
11.The regular expression for the given DFA is

\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:

(A)Finite Automata (P) Type 0Language


(8) Turing Machine (Q) Type 1 Language
(C) Pushdown Automata (R) Type 3 Language
(D) Linear Bounded Automata (S) Type 2 Language

a) (AS).(B, P),(C,R), (D,Q)


ib (A,R), (B, P).(C,S),(D,Q)
c) (A,R),(B,P),(C,Q),(D,S)
d) (A,R),(B,S),(C,P),(D,Q)
11. Which one of the following language is deterministic context free?
a) L={ww |we(a| b)' }
LbYL={wcw' |we(alb)'}
c) L=x|x isa palindrome over{a,b}}
d) L={a'bc" |n>0}
12. Choose the odd pair.
. a ifinite Automata, Push down automata)
b) (2- Push down automata, n-Push down automata)
c) (Computer, Universal Turing Machine)
d) (Turing Machine,2-Push down automata)

You might also like