Professional Documents
Culture Documents
G.T.N. Arts College (Autonomous)
G.T.N. Arts College (Autonomous)
QUESTION BANK
Summary of Questions
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
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
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
about:blank 5/20
4/18/23, 12:14 AM about:blank
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
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
about:blank 12/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 )
5) 7 6) Union
11) No 12)
Digital Watches
19) {xϵ {0,1} *|x is all binary number with 20) Dot
even length}
21) Ф 22) R+
47) 3 48) Y
about:blank 19/20
4/18/23, 12:14 AM about:blank
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
about:blank 20/20