Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

4/18/23, 12:14 AM about:blank

G.T.N. ARTS COLLEGE (AUTONOMOUS)


(Affiliated to Madurai Kamaraj University || Accredited with 'B' Grade by NAAC)
Old Karur Road , Dindigul - 624 005,Tamil Nadu,India

Department : Information Technology Prepared By : CHANDRAKALA P

Course Code : 20UITE63 Course Title : Theory of Computation

QUESTION BANK

Summary of Questions

Question Type Mark No Of Questions ( Unit Wise ) Total Mark


Unit - 1 : 20

Unit - 2 : 20

Unit - 3 : 20
Multiple Choice 1 100
Unit - 4 : 20

Unit - 5 : 20

Unit - 1 : 10

Unit - 2 : 10

Unit - 3 : 10
Desc with Master Code 4 200
Unit - 4 : 10

Unit - 5 : 10

Unit - 1 : 6

Unit - 2 : 6

Unit - 3 : 6
Desc with Master Code 10 300
Unit - 4 : 6

Unit - 5 : 6

Q. No. MULTIPLE CHOICE ( 1 Mark Questions ) CO(s) K-


Level

about:blank 1/20
4/18/23, 12:14 AM about:blank

1. 1. Assume the R is a relation on a set A, aRb is partially ordered such that a CO1 K1
and b are _____________
1.reflexive 2.transitive
3.symmetric 4.reflexive and transitive
2. The minimum number of states required to recognize an octal number CO1 K1
divisible by 3 are/is
1.1 2.3
3.5 4.7
3. _______________is not a part of 5-tuple finite automata CO1 K1
1. Input alphabet 2.Transition function
3.Initial State 4.Output Alphabet
4. If an Infinite language is passed to Machine M, the subsidiary which gives a CO1 K1
finite solution to the infinite input tape is ______________
1.Compiler 2.Interpreter
3.Loader and Linkers 4.Loader
5. The number of elements in the set for the Language L={xϵ(∑r) *|length if x CO1 K1
is at most 2} and ∑={0,1} is ________
1.7 2.6
3.8 4.5
6. A regular language over an alphabet ∑ is one that cannot be obtained from CO1 K1
the basic languages using the operation-__
1.Union 2.Concatenation
3.Kleene 4.Closure
7. Which of the following not an example Bounded Information? CO1 K1
1.fan switch outputs {on, off} 2.electricity meter reading
3. colour of the traffic light at the 4.Fan switch inputs
moment
8. A Language for which no DFA exist is a________ CO1 K1
1.Regular Language 2.Cannot be said
3.May be Regular 4.Non-Regular Language

9. A DFA cannot be represented in the following format CO1 K1
1.Transition graph 2.Transition Table
3.C code 4.Transition Tree
about:blank 2/20
4/18/23, 12:14 AM about:blank

10. . When are 2 finite states equivalent? CO1 K1


1.Same number of transitions 2.Same number of states
3. Same number of states as well 4.Both are final states
as transitions
11. Can a DFA recognize a palindrome number? CO1 K1
1.Yes 2.No
3. ) Yes, with input alphabet as 4.Can’t be determined
∑*

12. Which of the following is not an example of finite state machine system? CO1 K1
1. Control Mechanism of an 2.
elevator ‎Combinational Locks
3. 4.
‎Traffic Lights ‎Digital Watches
13. The password to the admins account=”administrator”. The total number of CO1 K1
states required to make a password-pass system using DFA would be
__________
1.14 states 2.13 states
3.12 states 4.A password pass system cannot
be created using DFA
14. For a machine to surpass all the letters of alphabet excluding vowels, how CO1 K2
many number of states in DFA would be required?
1.3 2.2
3.22 4.27
15. Given L= {Xϵ∑*= {a, b} |x has equal number of a, s and b’s}. CO1 K2
‎Which of the following property satisfy the regularity of the given
language?
1. Regularity is dependent upon 2. Regularity is not dependent
the length of the string upon the length of the string
3. Can’t be said for a particular 4. It may depend on the length of
string of a language the string
16. L is a regular Language if and only If the set of __________ classes of IL is CO1 K2
finite.
1.Equivalence 2.Reflexive
3.Myhill 4.Nerode

about:blank 3/20
4/18/23, 12:14 AM about:blank

17. A language can be generated from simple primitive language in a simple CO1 K2
way if and only if
1. It is recognized by a device of 2.It takes no auxiliary memory
infinite states
3.Dot 4.Kleene
18. Which of the following does not represents the given language? CO1 K2
‎Language: {0,01}
1.0+01
2. http://117.240.157.45/CMSAPP/api/master/soft-copies/view-
image U {01}
3. http://117.240.157.45/CMSAPP/api/master/soft-copies/view-
image U http://117.240.157.45/CMSAPP/api/master/soft-
copies/view-image{1}
4. http://117.240.157.45/CMSAPP/api/master/soft-copies/view-
image U {01}
19. Which among the following looks similar to the given expression? CO1 K2
‎((0+1). (0+1)) *
1. {xϵ {0,1} *|x is all binary 2. {xϵ {0,1} |x is all binary
number with even length} number with even length}
3. {xϵ {0,1} *|x is all binary 4. {xϵ {0,1} |x is all binary
number with odd length} number with odd length}
20. Concatenation Operation refers to which of the following set operations: CO1 K2
1.Union 2.Dot
3.Kleene 4.Two of the options are correct
21. Concatenation of R with Ф outputs: CO2 K1
1.R 2.Ф
3.R.Ф 4.Ф,R
22. RR* can be expressed in which of the forms: CO2 K1
1.R+ 2.c) R+ U R-
3.R- 4.R

about:blank 4/20
4/18/23, 12:14 AM about:blank

23. Which of the following statements is not true? CO2 K1


1. Every language defined by any 2. Every language defined by a
of the automata is also defined regular expression can be
by a regular expression represented using a DFA
3. Every language defined by a 4. Regular expression is just
regular expression can be another representation for any
represented using NFA with e automata definition
moves
24. The total number of states required to automate the given regular expression CO2 K1
‎(00)*(11)*
1.3 2.4
3.5 4.6
25. Generate a regular expression for the following problem statement: CO2 K1
‎P(x): String of length 6 or less for å={0,1}*
1. (1+0+e)6 2.(10)6
3. (1+0)(1+0)(1+0)(1+0)(1+0) 4. (1+0+e)
(1+0)
26. The minimum number of states required in a DFA (along with a dumping CO2 K1
state) to check whether the 3rd bit is 1 or not for |n|>=3
1.3 2.4
3.5 4.1
27. Which of the regular expressions corresponds to the given problem CO2 K1
statement:
‎P(x): Express the identifiers in C Programming language
‎l=letters
‎d=digits
1.(l+_)(d+_)* 2.(l+d+_)*
3. (l+_)(l+d+_)* 4. (_+d)(l+d+_)*
28. The minimum number of transitions to pass to reach the final state as per CO2 K1
the following regular expression is:
‎{a,b}*{baaa}
1.4 2.5
3.6 4.3
29. How many languages are over the alphabet R? CO2 K1
1.countably infinite 2.countably finite
3.uncountable finite 4.uncountable infinite

about:blank 5/20
4/18/23, 12:14 AM about:blank

30. According to the 5-tuple representation i.e. FA= {Q, ∑, δ, q, F} CO2 K1


‎Statement 1: q ϵ Q’; Statement 2: FϵQ
1. Statement 1 is true, Statement 2. Statement 1 is false, Statement
2 is false 2 is true
3. Statement 1 is false, Statement 4. Statement 1 may be true,
2 may be true Statement 2 is false
31. δˆ tells us the best: CO2 K2
1. how the DFA S behaves on a 2.the state is the dumping state
word
3.the final state has been reached 4. Kleene operation is performed
on the set
32. A finite automaton accepts which type of language: CO2 K2
1. Type 0 2.Type 1
3.Type 2 4.Type 3
33. Which among the following are incorrect regular identities? CO2 K2
1.εR=R 2.ε*=ε
3.Ф*=ε 4.RФ=R
34. Simplify the following regular expression:ε+1*(011) *(1*(011) *) * CO2 K2
1. (1+011) * 2. (1*(011) *)
3.(1+(011) *) * 4. (1011) *
35. P, O, R be regular expression over ∑, P is not ε, then R=Q + RP has a CO2 K2
unique solution:
1.Q*P 2.QP*
3.Q*P* 4.(P*O*) *
36. Arden’s theorem is true for: CO2 K2
1.More than one initial states 2.Null transitions
3.Non-null transitions 4.More than two initial states
37. The difference between number of states with regular expression (a + b) and CO2 K2
(a + b) * is:
1.1 2.2
3.3 4.0

about:blank 6/20
4/18/23, 12:14 AM about:blank

38. In order to represent a regular expression, the first step to create the CO2 K2
transition diagram is:
1. Create the NFA using Null 2. Null moves are not acceptable,
moves thus should not be used
3. Predict the number of states to 4.Unable to predict the states
be used in order to construct
the Regular expression
39. (0+ε) (1+ε) represents CO2 K2
1. {0, 1, 01, ε} 2.{0, 1, ε}
3.{0, 1, 01 ,11, 00, 10, ε} 4.{0, 1}
40. Regular Expression denote precisely the ________ of Regular Language. CO2 K2
1.Class 2.Power Set
3.Super Set 4.Null Set
41. Given Language: {x | it is divisible by 3} CO3 K1
‎The total number of final states to be assumed in order to pass the number
constituting {0, 1} is
1.0 2.1
3.2 4.3
42. A binary string is divisible by 4 if and only if it ends with: CO3 K1
1. 100 2.1000
3.1100 4.0011
43. Let L be a language whose FA consist of 5 acceptance states and 11 non CO3 K1
final states. It further consists of a dumping state. Predict the number of
acceptance states in Lc.
1.16 2.11
3.5 4.6
44. If L1 and L2 are regular languages, which among the following is an CO3 K1
exception?
1.L1 U L2 2.L1 – L2
3.L1 ∩ L2 4.L1c

45. Predict the analogous operation for the given language: CO3 K1
‎A: {[p, q] | p ϵ A1, q does not belong to A2}
1.A1-A2 2.A2-A1
3.A1.A2 4.A1+A2

about:blank 7/20
4/18/23, 12:14 AM about:blank

46. Let N (Q, ∑, δ, q0, A) be the NFA recognizing a language L. Then for a CO3 K1
DFA (Q’, ∑, δ’, q0’, A’), which among the following is true?
1.Q’ = P(Q) 2.Δ’ = δ’ (R, a) = {q ϵ Q | q ϵ
3.δ (r, a), for some r ϵ R} 4.Q’ = {q0}
47. While applying Pumping lemma over a language, we consider a string w CO3 K1
that belong to L and fragment it into _________ parts.
1.2 2.5
3.3 4.6
48. If we select a string w such that w∈L, and w=xyz. Which of the following CO3 K1
portions cannot be an empty string?
1.X 2.Y
3.Z 4.A
49. Let w= xyz and y refers to the middle portion and |y|>0.What do we call the CO3 K1
process of repeating y 0 or more times before checking that they still belong
to the language L or not?
1.Generating 2.Pumping
3.Producing 4.String
50. There exists a language L. We define a string w such that w∈L and w=xyz CO3 K1
and |w| >=n for some constant integer n.What can be the maximum length
of the substring xy i.e. |xy|<=?
1.n 2.|y|
3.|x| 4.y
51. Answer in accordance to the third and last statement in pumping lemma: CO3 K2
‎For all _______ xyiz ∈L
1.i>0 2.i<0
3.i<=0 4.i>=0
52. Let w be a string and fragmented by three variable x, y, and z as per CO3 K2
pumping lemma. What does these variables represent?
1.string count 2.string
3.string count and string 4.count

about:blank 8/20
4/18/23, 12:14 AM about:blank

53. Which of the following one can relate to the given statement: CO3 K2
‎Statement: If n items are put into m containers, with n>m, then atleast one
container must contain more than one item.
1.Pumping lemma 2.Pigeon Hole principle

3.Count principle 4.Regular
54. The entity which generate Language is termed as: CO3 K2
1.Automata 2.Tokens
3.Grammar 4.Data
55. Production Rule: aAb->agb belongs to which of the following category? CO3 K2
1. Regular Language 2.Context free Language
3.Context Sensitive Language 4. Recursively Ennumerable
Language
56. Which of the following statement is false? CO3 K2
1. Context free language is the 2. Regular language is the subset
subset of context sensitive of context sensitive language
language
3. Recursively ennumerable 4. Context sensitive language is a
language is the super set of subset of context free language
regular language
57. The Grammar can be defined as: G=(V, ∑, p, S) In the given definition, CO3 K2
what does S represents?
1. Accepting State 2.Starting Variable
3.Sensitive Grammar 4.CFL
58. Which among the following cannot be accepted by a regular grammar? CO3 K2
1. L is a set of numbers divisible 2.L is a set of binary complement
by 2
3. L is a set of string with odd 4.L is a set of 0n1n
number of 0
59. Which of the expression is appropriate? For production p: a->b where a∈V CO3 K2
and b∈_______
1.V 2.S
3.(V+∑)* 4.V+ ∑

about:blank 9/20
4/18/23, 12:14 AM about:blank

60. The minimum number of productions required to produce a language CO3 K2


consisting of palindrome strings over ∑={a,b} is
1.3 2.7
3.5 4.6
61. A push down automaton employs ________ data structure. CO4 K1
1.Queue 2.Linked List
3.Hash Table 4.Stack
62. Which of the following allows stacked values to be sub-stacks rather than CO4 K1
just finite symbols?
1.Push Down Automaton 2.Turing Machine
3.Nested Stack Automaton 4.NDFA
63. A non deterministic two way, nested stack automaton has n-tuple definition. CO4 K1
State the value of n.
1.5 2.8
3.4 4.10
64. Push down automata accepts _________ languages. CO4 K1
1.Type 3 2.Type 2
3.Type 1 4.Type 0
65. The class of languages not accepted by non deterministic, nonerasing stack CO4 K1
automata is _______
1. NSPACE(n2) 2.NL
3.CSL 4.CFL
66. A push down automaton with only symbol allowed on the stack along with CO4 K1
fixed symbol.
1.Embedded PDA 2.Nested Stack automata
3.DPDA 4.Counter Automaton
67. Which of the operations are eligible in PDA? CO4 K1
1. Push 2.Delete
3.Insert 4.Add
68. The following move of a PDA is on the basis of: CO4 K1
1.Present state 2.Input Symbol
3.Present state and Input Symbol 4.Output Symbol

about:blank 10/20
4/18/23, 12:14 AM about:blank

69. Which among the following is not a UNIX command for regular CO4 K1
expressions
1.ed 2.sed
3.vi 4.grep
70. What is the significance of $ used in regular expression in UNIX? CO4 K1
1. Matches the beginning of the 2.Matches the end of lines
line
3.Matches any single character 4.Matches double character

71. Generate the regular expression to match blank lines CO4 K2
1./ */ 2./bl
3./^?/ 4./^$/
72. For the given syntax of sed, which among the following is not a correct CO4 K2
option?
‎General syntax of sed: /pattern/action
1./ are used as delimiters 2. pattern refers to a regular
expression
3.pattern refers to the string to be 4.action refers to the command
matched
73. What does grep do in UNIX? CO4 K2
1.It is an editor in UNIX 2.It searches for text patterns
3. It is an editor in UNIX and it 4.It is an editor in LINUX
searches for text patterns
74. Which of the following options support the given statement? CO4 K2
‎Statement: A regular expression could be a fixed word or describe
something like more general.
1. This flexibility makes Regular 2. This flexibility makes the
expression invaluable Regular expression unvaluable
3. This flexibility makes Regular 4. This flexibility makes Regular
expression invaluable and expression valuable
unvaluable
75. What does the following segment of code does? grep -i man heroes.txt CO4 K2
1. manually opens a file called 2.manages heroes.txt
heroes.txt
3. search for “man” in the file 4.deletes heroes.txt
“heroes.txt”

about:blank 11/20
4/18/23, 12:14 AM about:blank

76. What does “X?” do regular expression operator? CO4 K2


1. Matches zero or more capital 2. Matches no or one occurence
X’s of the capital letter X
3. Matches one or more capital 4.Matches zero only
X’s
77. Which of the following is an utility of state elimination phenomenon? CO4 K2
1.DFA to NFA 2.NFA to DFA
3.DFA to Regular Expression 4.DFA
78. If we have more than one accepting states or an accepting state with an out CO4 K2
degree, which of the following actions will be taken?
1.addition of new state 2.removal of a state
3. make the newly added state as 4.more than one option is correct
final
79. Which of the following is not a step in elimination of states procedure CO4 K2
1. Unifying all the final states 2. Unify single transitions to
into one using e-transitions multi transitions that contains
union of input
3. Remove states until there is 4. Get the resulting regular
only starting and accepting expression by direct
states calculation
80. Which of the following methods is suitable for conversion of DFA to RE? CO4 K2
1.Brzozowski method 2.Arden’s method
3.Walter’s method 4.Unique Approach
81. The behaviour of NFA can be simulated using DFA. CO5 K1
1.always 2.never
3.sometimes 4.Not Applicable
82. How many strings of length less than 4 contains the language described by CO5 K1
the regular expression (x+y)*y(a+ab)*?
1.7 2.10
3.12 4.11
83. A language is regular if and only if CO5 K1
1.accepted by DFA 2.accepted by PDA
3.accepted by LBA 4.accepted by Turing machine

about:blank 12/20
4/18/23, 12:14 AM about:blank

84. Regular grammar is CO5 K1


1.context free grammar 2.non context free grammar
3.english grammar 4.CFL grammar
85. Let the class of language accepted by finite state machine be L1 and the CO5 K1
class of languages represented by regular expressions be L2 then
1.L1<L2 2.L1>=L2
3.L1 U L2 = .* 4.L1=L2

86. L and ~L are recursive enumerable then L is CO5 K1
1.Regular 2.Context free
3.Context sensitive 4.Recursive
87. Lexemes can be referred to as: CO5 K1
1.elements of lexicography 2. sequence of alphanumeric
characters in a token
3.lexical errors 4.Syntax errors
88. If the lexical analyser finds a lexeme with the same name as that of a CO5 K1
reserved word,it _________
1. overwrites the word 2.overwrites the functionality
3.generates an error 4.something else
89. The methodology to show an error when the analyzer faces a keyword over CO5 K1
an user’s input is based on:

1.rule priority 2.longest match rule
3.keyword-out rule 4.Generates an error
90. The output of the lexical and syntax analyzer can stated as: CO5 K1
1.parse stream, parse tree 2.token tree, parse tree
3.token stream, parse tree 4.parse tree
91. Which among the following is not a tool to construct lexical analyzer from a CO5 K2
regular expression?
1. le 2.flex
3.jflex 4.Yaac
92. A program that performs lexical analysis is termed as: CO5 K2
1.scanner 2.lexer
3.tokenizer 4.Semantic
about:blank 13/20
4/18/23, 12:14 AM about:blank

93. Which phase of compiler includes Lexical Analysis? CO5 K2


1.1 2.2
3.3 4.Its primary function, not in any
phase
94. Which of the following characters are ignored while lexical analysis? CO5 K2
1.. 2.=
3.# 4.WhiteSpace
95. ____________ is used for grouping up of characters into token. CO5 K2
1.Lexical Analyzer 2.oolex
3.jflex 4.lex
96. The action of parsing the source code into proper syntactic classes is known CO5 K2
as:
1.Parsing 2.Interpretation analysis
3.Lexicography 4.Lexical Analysis
97. Which of the following is the task of lexical analysis? CO5 K2
1. To build the uniform symbol 2.To initialize the variables
table
3. To organize the variables in a 4. Building a literal and identifier
lexical order table
98. The scanner outputs: CO5 K2
1. Stream of tokens 2.Image file
3.Intermediate code 4.Machine code
99. The phase of compilation which involves type checking is: CO5 K2
1.Parsing 2.Scanning
3.Syntax directed translation 4.Semantic Analyzer
100. Diagonalization can be useful in: CO5 K2
1. To find a non recursively 2. To prove undecidability of
enumerable language halting problem
3. To find a non recursively 4. To find a recursively
enumerable language & also enumerable language
proves undecidability of
halting

Q. No. DESC WITH MASTER CODE ( 4 Mark Questions ) CO(s)K-


Level
1. Define Deterministic Finite Automaton. CO1 K1
about:blank 14/20
4/18/23, 12:14 AM about:blank

2. Define Non-Deterministic Finite Automation. CO1 K1


3. State the transition function. CO1 K1
4. Give short notes on Minimization of DFA CO1 K1
5. State regular expression. CO1 K1
6. Define regular expression for the language accepting the strings which are = CO1 K1
{0,1}.starting with 1 and ending with 0, over the set
7. r* + s*. Show that (r+s)* CO1 K1
8. Show the application of the pumping lemma. CO1 K1
9. Note on closure properties of regular language. CO1 K1
10. What do you mean by homomorphism. CO1 K1
11. aabbaaSbA / SS / ba, show that aAS/ a ,AConsider G whose CO2 K2
productions are S and construct a derivation tree
12. ε },S)0S1, s. Find L(G) where G = ({S},{0,1}, {S CO2 K2
13. Define a derivation tree for CFG. CO2 K2
14. Find a LM derivation for aaabbabbba with the productions. b / bS / CO2 K2
aBBa /S / bAA, B aB / bA, A P : S
15. Show that id* id can be generated by two distinct leftmost derivation in the CO2 K2
grammar E+E / E*E / (E) / idE
16. What are the different ways of language acceptances by a PDA and define CO2 K2
them.
17. Construct a PDA accepting {a n b m a n /m,n>=1} by empty stack. Also CO2 K2
construct the corresponding context-free grammar accepting the same set.
18. Give a detailed description of ambiguity in Context free grammar CO2 K2
19. Let G be a CFG and let a=>w in G. Then show that there is a leftmost CO2 K2
derivation of w.
20. Let G=(V,T,P,S) be a Context free Grammar then prove that if S=> α then CO2 K2
there is a derivation tree in G with yield α.
21. Define Pushdown Automata. CO3 K2
22. Compare NFA and PDA CO3 K2
23. Specify the two types of moves in PDA CO3 K2
24. What are the different types of language acceptances by a PDA and define CO3 K2
them.
25. Define Deterministic PDA. CO3 K2
about:blank 15/20
4/18/23, 12:14 AM about:blank

26. Give examples of languages handled by PDA CO3 K2


27. State the equivalence of acceptance by final state and empty stack. CO3 K2
28. State the equivalence of PDA and CFL CO3 K2
29. What are the closure properties of CFL? CO3 K2
30. State the pumping lemma for CFLs. CO3 K2
31. What are the special features of TM? CO4 K3
32. Explain Instantaneous description of TM CO4 K3
33. What are the applications of TM? CO4 K3
34. What is the basic difference between 2-way FA and TM? CO4 K3
35. Write about a move in TM. CO4 K3
36. What is the language accepted by TM? CO4 K3
37. What are the various representation of TM CO4 K3
38. What are the techniques for Turing machine construction? CO4 K3
39. What is the storage in FC? CO4 K3
40. What is a multihead TM? CO4 K3
41. What is a 2-way infinite tape TM? CO5 K3
42. Differentiate PDA and TM. CO5 K3
43. . What is a multi-tape Turing machine? CO5 K3
44. What is a multidimensional TM? CO5 K3
45. Give examples of decidable problems. CO5 K3
46. Give examples of recursive languages CO5 K3
47. Differentiate recursive and recursively enumerable languages. CO5 K3
48. What are UTMs or Universal Turing machines? CO5 K3
49. What is the crucial assumptions for encoding a TM? CO5 K3
50. What properties of recursive enumerable seta are not decidable? CO5 K3

Q. No. DESC WITH MASTER CODE ( 10 Mark Questions ) CO(s)K-


Level
1. Attempt the following : CO1 K1
1)Draw FA for (a + b)* baaa.
2)Write a Regular Expression for the String of 0’s and 1’s in which number
of 0’s and 1’s
are even.
about:blank 16/20
4/18/23, 12:14 AM about:blank

2. Statement P(n) follows from (a) P(0) and (b) P(n-1) implies P(n) for n>=1 CO1 K1
Condition (a) is an inductive proof is the basis and Condition (b) is called
the inductive step.
3. Draw a Non-deterministic finite automata to accept strings containing the CO1 K1
substring 0101.
4. Give a regular expression for the set of all strings having odd number of 1’s CO1 K1
RE= 1(0+11)*
5. Show that a connected graph G with n vertices and n-1 edges (n>2) has at CO1 K1
least one leaf.
6. Prove that there exists a DFA for every ε-NFA. CO1 K1
7. Give regular expressions for the following L1=set of all strings of 0 and 1 CO2 K2
ending in 00 L2=set of all strings of 0 and 1 beginning with 0 and ending
with 1. N
8. Construct a CFG for set of strings that contain equal number of a’s and b’s CO2 K2
over ∑ = {a,b}.
9. (i) What is the purpose of normalization? Construct the CNF and GNF for CO2 K2
the following grammar and explain the steps S→aAa | bBb |€ A→C|a
B→C|b C→CDE | € D→A|B|ab
10. Find the PDA equivalent to the given CFG with the following productions CO2 K2
1. S→A, A→BC, B→ba, C→ac 2. S→aSb|A, A→bSa|S| ε (10)
11. Is the following grammar is ambiguous? Justify your answer. 1. E→ E+E CO2 K2
|E*E | id 2. E→ E+E|E*E|(E)|a
12. Prove that if there exists a PDA that accepts by final state then there exists CO2 K2
an equivalent PDA that accepts by Null state.
13. Convert the following grammar into CNF S→cBA, S→A, A→cB, CO3 K2
A→AbbS, B→aaa
14. Find Greibach normal form for the following grammar (i) S→AA | 1, CO3 K2
A→SS |0
15. Describe the Chomsky hierarchy of languages. CO3 K2
16. How to prove that the Post Correspondence problem is Undecidable. CO3 K2
17. Show that the collection of all Turing machines is countable CO3 K2
18. State when a problem is said to be decidable and give an example of an CO3 K2
undecidable problem
19. Give two properties of recursively enumerable sets which are undecidable. CO4 K3
20. State and prove Post Correspondence Problem and Give example. CO4 K3

about:blank 17/20
4/18/23, 12:14 AM about:blank

21. Prove that for two recursive languages L1 and L2 their union and CO4 K3
intersection is recursive.
22. When a language is said to be recursively enumerable? C CO4 K3
23. Show that the union of two recursive language is recursive & union of two CO4 K3
recursively enumerable languages is recursive.
24. Consider the language of all TMs that given no input eventually write a CO4 K3
non-blank symbol on their tapes. Explain why this set is decidable. Why
does this not conflict with the halting problem?
25. Prove that the Punchcard Puzzle is NP-compete. CO5 K3
26. Let ∑={a,b}*. Let A and B the lists of three strings as given below: A= CO5 K3
{b,bab3,ba} B={b3,ba,a} Does this instance of PCP have a solution? Justify
your answer
27. State the halting problem of TMs. Prove that the halting problem of Turing CO5 K3
Machine over {0,1}* as unsolvable.
28. State and prove the Post’s correspondence problem. CO5 K3
29. Write about the properties of recursive languages CO5 K3
30. Discuss the difference between NP-complete and NP-hard problems CO5 K3
MULTIPLE CHOICE ANSWERS ( 1 MARK )

1) reflexive and transitive 2) 3

3) Output Alphabet 4) Compiler

5) 7 6) Union

7) electricity meter reading 8) Non-Regular Language


9) Transition Tree 10) Same number of states as well as


transitions

11) No 12)
‎Digital Watches

13) 14 states 14) 3

15) Regularity is not dependent upon the 16) Equivalence


length of the string

17) It takes no auxiliary memory 18) http://117.240.157.45/CMSAPP/api/master/soft-


copies/view-image U {01}
about:blank 18/20
4/18/23, 12:14 AM about:blank

19) {xϵ {0,1} *|x is all binary number with 20) Dot
even length}

21) Ф 22) R+

23) Every language defined by a regular 24) 5


expression can be represented using a DFA

25) (1+0+e)6 26) 5

27) (l+d+_)* 28) 4

29) uncountable infinite 30) Statement 1 is false, Statement 2 is true

31) how the DFA S behaves on a word 32) Type 3

33) RФ=R 34) (1*(011) *)

35) QP* 36) Non-null transitions

37) 1 38) Create the NFA using Null moves

39) {0, 1, 01, ε} 40) Class

41) 2 42) 100

43) 16 44) L1c

45) A1-A2 46) Δ’ = δ’ (R, a) = {q ϵ Q | q ϵ

47) 3 48) Y

49) Pumping 50) n

51) i>=0 52) string count

53) Pigeon Hole principle 54) Grammar

55) Context Sensitive Language 56) Context sensitive language is a subset of


context free language

57) Accepting State 58) L is a set of 0n1n

59) (V+∑)* 60) 5

61) Stack 62) Nested Stack Automaton

about:blank 19/20
4/18/23, 12:14 AM about:blank

63) 10 64) Type 2

65) NSPACE(n2) 66) Counter Automaton

67) Push 68) Present state and Input Symbol

69) grep 70) Matches the end of lines

71) /^$/ 72) pattern refers to the string to be matched

73) It is an editor in UNIX and it searches for 74) This flexibility makes Regular expression
text patterns invaluable

75) search for “man” in the file “heroes.txt” 76) Matches no or one occurence of the capital
letter X

77) DFA to Regular Expression 78) more than one option is correct

79) Unify single transitions to multi transitions 80) Brzozowski method


that contains union of input

81) always 82) 12

83) accepted by DFA 84) CFL grammar

85) L1=L2 86) Recursive

87) sequence of alphanumeric characters in a 88) generates an error


token

89) rule priority 90) token stream, parse tree

91) Yaac 92) tokenizer

93) 1 94) WhiteSpace

95) oolex 96) Lexical Analysis

97) To build the uniform symbol table 98) Stream of tokens

99) Syntax directed translation 100)To find a non recursively enumerable


language & also proves undecidability of
halting

about:blank 20/20

You might also like