0% found this document useful (0 votes)
221 views9 pages

TCS Question Bank Without Answer

1. The document contains a multiple choice quiz on concepts related to theory of computation including formal languages, automata theory and grammars. It asks questions about sets, relations, strings, regular expressions, finite automata models like DFA, NFA; pushdown automata and Turing machines. 2. It also asks questions about closure properties and applications of various formal language models. There are 35 questions in total along with additional problems to solve related to concepts like regular expressions, finite automata, context-free grammars and pushdown automata. 3. The document serves as a practice test to evaluate student understanding of key concepts and topics covered in the theory of computation course.

Uploaded by

Ganesh Magar
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)
221 views9 pages

TCS Question Bank Without Answer

1. The document contains a multiple choice quiz on concepts related to theory of computation including formal languages, automata theory and grammars. It asks questions about sets, relations, strings, regular expressions, finite automata models like DFA, NFA; pushdown automata and Turing machines. 2. It also asks questions about closure properties and applications of various formal language models. There are 35 questions in total along with additional problems to solve related to concepts like regular expressions, finite automata, context-free grammars and pushdown automata. 3. The document serves as a practice test to evaluate student understanding of key concepts and topics covered in the theory of computation course.

Uploaded by

Ganesh Magar
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/ 9

Class: B.

Sc [ECS]-III Sub:Theory of computer science(Paper ECS504)

Q.No.1 Choose correct alternatives.

1. The ordered pair of elements is known as -------------.


a) set b) alphabet c) relation d) string

2. All possible subset of set is known as__________.


a) sub set b) power set c) super set d) none of these

3. An ______ is finite, non empty set of symbols.


a) Language b) string c) alphabet d) none of these

4. Proper prefix of the string abc are..........


a) {ε,c,bc,abc} b) {ε,c,bc} c) {ε,a,ab,abc} d) {ε,a,ab}

5. Proper suffixes of the string abc are..........


b) {ε,c,bc,abc} b) {ε,c,bc} c) {ε,a,ab,abc} d) {ε,a,ab}

6. The empty string is denoted by______.

a) ε b) ᶲ c) both and a and b d) none of these


7. ______is collection of object without repetition.
a) set b) alphabet c) relation d) string

8. Function which mapping one to one from input to state such function is known as----
---function.
a)Machine b) State c) both a and b d) none of these

9. Function which mapping one to one from input to output such function is known as--
-----function.
a)Machine b) State c) both a and b d) none of these

10. DFA is more powerful than PDA.


a) True b) False

11. DFA has________tuples.


a) 4 b) 5 c) 6 d) 7

12. Mealy machine has________tuples.


a) 4 b) 5 c) 6 d) 7

13. Context free grammar has________tuples.


a) 4 b) 5 c) 6 d) 7

GFCCT 1
14. Push Down Automata has________tuples.
a) 4 b) 5 c) 6 d) 7

15. Number of states requires accepting string ends with 10.


a) 3 b) 2 c) 1 d) can‟t be represented.

16. In __________ machine the transition is associated with state.


a) Moore b) Mealy c) both a and b d) none of these

17. NFA is more powerful than DFA.


a) True b) False

18. The Moore machine has final states.


a) True b) False
19. Every NFA with ε-moves has an equivalent............................
a) NFA without ε-moves b) DFA c) Both a and b d) none of these
20. A finite automata with output has final states.

a) True b) False

21. The regular expression for Arden‟s algorithm is ________.


a) Rij(K) b) R=R+QP c) R=Q+RP d) None of these

22.
The (a/b) is rule used for conversion of RE to NFA with ϵ-moves is used for--------.

a) alternative b) closure c) positive closure d) series


23. Regular expression (a+b).(a+b) denotes the set .....................

a) a b) {aa,ba,ab,bb} c) {abab} d) { aabb}


24. If L(r)={a,b,aa,bb,………} then r=___________.
a) (a+b) b) (a+b)* c) (a+b)+ d) none of these

25. Regular expression are____________.

a) Type 0 language b) Type 1 language


c) Type 2 language d) Type 3 language

26. Pumping lemma is a...................................

a) powerful tool for providing certain languages non-regular.


b) powerful tool for providing certain languages context sensitive.
c) Both a and b
d) None of these
27. If L(r)={a,aa,aaa,aaaa,aaaaa} then r=……………

a) a * b) a + c) a 5 d) a 4

GFCCT 2
28. If L(r)={ ε, X, XX, XXX, XXXX, XXXXX} then r =______________
a)( ε+X) b) ( ε+X)5 c) ( ε+X)n d)None

29. The language accepted by finite automates are described or represented by simple
expression called__________________.

a) Grammer b) Reguler Set c) Language d) Regular expression.

30. If r=(a/b) then L(r)={____________}.

a) {a,b} b) {a.b} c) { ϵ,a,b } d) None of these


31. Pumping lemma is used to proving given language is--------------------.
a) irregular b) context sensitive c) restricted d) none of these

32. If rightmost and leftmost production is single non-terminal then it is known as--------
---- production.
a) unit b) self c) cross d) none of these

33. The context free language is not closed under----------.


a) union b) intersection c) series d) none of these

34. Type 1 grammar is also called as…………… grammar.


a) Context free b) Context sensitive c) Recursive d) Regular

35. Type 2 grammar is also called as…………… grammar.


a) Context free b) Context sensitive c) Recursive d) Regular

36. The grammar in which right hand side production contains at most one non-terminal
is called ____________ grammar.
a) Context free b) Context sensitive c) Recursive d) Regular
37. In CNF grammar is required in the form of _____.

a) A - > BC | a b) A - > aα c) Both a and b d) none of these


38. In GNF grammar is required in the form of _____.

a) A - > BC | a b) A - > aα c) Both a and b d) none of these


39. If the grammar {S→aB|bA, A→a|aS|bAA, B→b|bS|aBB} then generated string
is____________.

a) aaabbb b) bbbaaa c) baba d)All of the above.

40. The___________ is accepted unrestricted grammar.


a) TM b) PDA c) DFA d) None of these

GFCCT 3
41. A grammar that produce more than one parse tree for some sentence is
called______.

a) Context free b) regular c) ambiguous d) none of these.

42. A finite automaton with stack is known as----------------.


a) FA b) TM c) DFA d) PDA
43. In PDA one situation has more than one transition then it is known as--------------
a) PDA b) DPDA c) NPDA d) Stack
44. The string anbncn can be accepted by PDA.
a) True b) False
45. The language of PDA is _________.
a) Context free language b) Regular language
c) Both a and b d) none of these
46. The transition function δ:Q×(∑U{ε})×┌ →Q×┌* is of ..............................

a) PDA b) FSM c) Turing Machine d) Mealy machine


47. NPDA is more powerful than DPDA.
a) True b) False
48. In PDA one situation has only one transition then it is known as_________.

a) TM b) DPDA c) NPDA d) Stack

49. The _______machine has infinite tape two both side.


a) TM b) PDA c) DFA d) None of these
50. TM is more powerful than PDA.

a) True b) False

Q.No.2 Solve any five.

1) Let R={(1,2),(2,3),(2,4)} be a relation in {1,2,3,4}. Find R+

2) Let R={(a,b),(b,c),(c,a)}.Find R+,R*.

3) Define: a) Regular Expression b) Language

4) Define alphabet and language.

5) Give operations on set.

6) Define closure properties of relation.

7) Define Moore and Mealy Machine.

GFCCT 4
8)
Why we require NFA with ϵ-moves?
9) Construct DFA for accepting string over {a,b,c} which string start with „a‟ and not
having substring „abc‟ in it.

10) Design Moore machine for accepting 2‟s complement of binary number.

11) Define a) Alphabet b) language

12) What are the applications of DFA?

13) State difference between Moore and Mealy machine.

14) Design a FA that reads strings made up of letters in the word „renyolds‟ & recognize
those strings that contain the word „old‟ as a substring.
15) State difference between DFA and NFA.

16) Find language for the following regular expression


a) ab* + ab*
b) (0+1)* 00 (0+1)*

17) Show that (a+b)* = (a+b)* + (a+b)*.

18) Find a CFG for each of the language defined by the following regular expression.

i)a.b* ii)a*.b*
19) Give application of R.E. and F.A.

20) What is the context free grammar for (a+b)*.abc.(a+b)* .

21) Construct a CFG for generating L={WcWR | W ϵ ( a + b)* }.

22) What are the applications of pumping lemma?

23) Define Closure properties of CFL.

24) What are the applications of CFG?

25) Define PDA? Give pictorial representation of PDA.

26) Define CFG and CFL.

27) Explain notations used in CFG.

28) What are the difference between DPDA and NPDA?

29)
How many ways PDA accept language? Give names.
30) Give pictorial representation of PDA.

31) How many ways PDA accept language? Give the names.

32) What are the applications of PDA?

GFCCT 5
33)
Define Turing Machine.
34)
Explain Turing Machine model.
35) Give the instantaneous description of Turing Machine?

Q.No. Solve following questions.

1. Convert the following NFA to it‟s equivalent DFA


0 1
p {p,q} {p}
q {r} {r}
r {s} ф
*s {s} {s}
2. Design a DFA which accept number is even or odd.

3. Construct Mealy machine for decrement of binary number by 1.

4. Design a Mealy machine for 1‟s complement of binary number and convert it into
Moore machine.
5. Construct Mealy machine for increment binary number.

6. Find a deterministic acceptor equivalent to M=({q0, q1, q2},{a,b}, q0,{ q2})

Δ A B
q0 q0, q1 q2
q1 q0 q1
q2 - q0, q1
7. Construct Mealy machine for 2‟s complement and convert it into Moore machine.

8. Construct DFA for find out given number is divisible by 3.

9. Explain how to convert Moore into Mealy with example.

10. Construct DFA for find out given binary number is divisible by 3.

11. Design a DFA which accept string either ending with ab or bc over ∑={a,b,c}.

12. Design a DFA which accept string does not having abc as substring over ∑={a,b,c}.

13. Construct RE for following DFA by using Rij(K).

14. Construct F.A. equivalent to R.E.


(a/b)* (aa+bb)* (a/b)*

GFCCT 6
15. Construct F.A. equivalent to R.E.
(a/b)* (aaa+bbb)* (a/b)*

16. Obtain an FA for the regular expression (a+b)*aab*(a+b)*.

17. What is regular expression? How to convert RE into FA?

18. Construct RE for following DFA by using Arden‟s theorem.

19. Find Regular expression for the following DFA by using Arden‟s theorem.

20. Construct FA for following RE


(0+1)* (0.1)* (0+1)*

21. Show that (a.b)*≠a*.b*.

22. What is pumping lemma? Using pumping lemma check {ap|p is prime} is regular or
not.

23. What is pumping lemma? Using pumping lemma check {anbn+1| n>=1} is regular or
not.

24. Explain simplification of grammar.

25. Check whether the following grammar is ambiguous or not; if ambiguity found
remove the ambiguity and rewrite an equivalent grammar.
S->iCtS |iCtSeS|a, C->b

26. Find out RE for following DFA by using Rij(K)

27. Explain simplification of grammar.

GFCCT 7
28. Convert the following right linear grammar to equivalent left linear grammar

S⟶ bB
B⟶ bC
B⟶ aB
C⟶ a
B⟶b

29. Convert the following right linear grammar to equivalent left linear grammar

S⟶ 0A | 1B
A⟶ 0C | 1A | 0
B⟶ 1B | 1A | 0 | 1A |1
C⟶ a
30. Write a grammar for language over {a,b} which accept palindrome strings.

31. Find a grammar in GNF equivalent to grammar E -> E+T|T ,T-> T*F|F,
F ->(E) |a

32. Find a grammar in CNF equivalent to grammar E -> E+T|T ,T-> T*F|F,
F ->(E) |a

33. Construct GNF for following grammar:


S - > S+S| S*S| id
34. Explain left linear and right linear grammar with example.

35. What is context free grammar? Explain derivations and parse tree with example.

36. Check whether the following grammar is ambiguous or not; if ambiguity found
remove the ambiguity and rewrite an equivalent grammar.
E - > E+E |E*E|id.

37. Find CNF for the following grammar:

A->A+A | A*A |(A) |a


38. Find CFG for following DFA:

39. For the grammar: S→ aABB|aAA


A→ aBB|a
B→ bBB|A
C→ a
Obtain the corresponding PDA.
40. What is the procedure to convert a CFG to PDA? Give example.

GFCCT 8
41. Construct PDA that accepts the language generated by CFG.

S->S+S|S*S|4

Give the acceptance of string “2+2*4” by PDA.


42. Design a PDA for accepting palindrome string over ∑={0,1}.

43. Design a PDA for language L={ai bj ck | i,j,k>=1 ;k=i+j} use final state as well as
empty stack.
44. Design a PDA to check whether a given string over {a,b} ends in abb.

45.
Construct CFG for PDA M=({q0,q1},{0,1},{0,1,z0},ɗ,q0, z0,ᶲ)
ɗ(q0, ϵ, z0) => (q1, ϵ)
ɗ(q0, 0, z0) => (q0, 0z0)
ɗ(q0, 0, 0) => (q0, 00)
ɗ(q0, 1, 0) => (q0, 10)
ɗ(q0, 1, 1) => (q0, 11)
ɗ(q0, 0, 1) => (q1, ϵ)
ɗ(q1, 0, 1) => (q1, ϵ)
ɗ(q1, 0, 0) => (q1, ϵ)
ɗ(q1, ϵ, z0) => (q1, ϵ)
A construct CFG, simplify CFG and describe the language it accept.
46. Construct Turing Machine for checking well formdness of parenthesis.

47. Design TM for L= {anbn| n>1}.

48. Construct TM for L={anbncn|n>=1}.

49. Construct Turing machine for copy string over ∑={a,b}.

50. Construct Turing Machine that recognize the language:


L={x ϵ {0,1}*| x ends in 00}.

GFCCT 9

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