0% found this document useful (0 votes)
45 views

TOC - Adavnced Sheet - 2023

Uploaded by

as5626531
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)
45 views

TOC - Adavnced Sheet - 2023

Uploaded by

as5626531
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/ 38

GATE Computer Science & IT

ADVANCED
THEORY OF COMPUTATION

Practice Questions Booklet

ANALYSIS OF THEORY OF COMPUTATION GATE PAPER


Years Marks
2015 5
2016 9
2017 10
2018 8
2019 5
2020 9
2021 Set-1 8
2021 Set-2 10
2022 7

THEORY OF COMPUTATION FOR GATE SYLLABUS


 Chomsky classification of grammar.
 Regular languages
 Regular expression
 Regular grammar
 Finite Automata (DFA/NFA)
 Conversion from NFA to DFA
 Minimization of DFA
 Closure Properties
 Mealy /Moore machine
 Pumping Lemma for regular language
 Context free language
 Properties
 Context –free grammar
 PDA (Push down-automata)
 Chomsky Normal Form
 Greibach Normal Form
 CYK algorithm
 Pumping Lemma for Context Free Language
 Turing Machine
 TM Construction
 Turing decidable Language (Recursive language)
 Turing Machine recognizable(Recursively enumerable language)
 Undecidable / decidable problem.
 Countable / uncountable sets.
 Book Reference:
 An Introduction to formal languages and automata by “PETER LINZ”
 An introduction to Automata Theory, Language & computation by
“Ullmann, Hopcraft&Motwani”
THEORY OF COMPUTATION
Q1. [MSQ]
Which of the following language is/are regular language?
(a) L = 𝑎𝑛 𝑏𝑚 | 𝑛 < 𝑚 𝑜𝑟 (𝑛 > 𝑚) 𝑜𝑟 𝑛 + 𝑚 𝑖𝑠 𝑒𝑣𝑒𝑛; 𝑤𝑕𝑒𝑟𝑒 𝑛, 𝑚 𝜖𝑁
(b) L= 𝑎𝑛 𝑏𝑛 𝑐 𝑛 | n is either prime number or n is product of two prime number
(c) L = 𝑎𝑛 𝑏𝑚 | [ 𝑛 < 𝑚 𝑜𝑟 𝑛 > 𝑚 ] 𝑎𝑛𝑑 𝑛 + 𝑚 𝑖𝑠 𝑒𝑣𝑒𝑛; 𝑤𝑕𝑒𝑟𝑒 𝑛, 𝑚 𝜖𝑁
(d) L= 𝑎𝑛 𝑏𝑛 𝑐 𝑛 | 𝑛 𝑖𝑠 𝑝𝑟𝑖𝑚𝑒 𝑛𝑢𝑚𝑏𝑒𝑟𝑠 ∪ 𝑎𝑛 𝑏𝑛 𝑐 𝑛 | n is product of two or more prime
number

Q2. [MSQ]
Which of the following language(s) is/are Context-Free language?
(a) L = 𝑎𝑚 𝑏𝑛 𝑥𝑑𝑘 𝑒 𝑝 |𝑚 = 𝑝, 𝑛 = 𝑘 𝑎𝑛𝑑 𝑥 = 𝑏 𝑜𝑟 𝑑 ; 𝑤𝑕𝑒𝑟𝑒 𝑚, 𝑛, 𝑝, 𝑘 ≥ 0
(b) L = 𝑤𝑤𝑐𝑤 𝑟 𝑤 𝑟 | 𝑤𝜖 𝑎, 𝑏 ∗ 𝑎𝑛𝑑 𝑤 𝑟 𝑟𝑒𝑝𝑟𝑒𝑠𝑒𝑛𝑡𝑠 𝑡𝑕𝑒 𝑟𝑒𝑣𝑒𝑟𝑠𝑒 𝑜𝑓 𝑤
(c) L = 0𝑛 00 𝑛
000 2𝑛
|𝑛 ≥0
(d) L = 𝑎𝑛 𝑏𝑏 𝑛
𝑎𝑎𝑎 2𝑛
|𝑛 ≥0

Q3. [MSQ]
Which of the following statement is/are true about pumping lemma for regular
language?
(a) If L is regular then Pumping lemma must be satisfied.
(b) If the Pumping lemma is not satisfied for the language L (for every possible
division of w = xyz; where w 𝜖 L) then L is definitely non-regular.
2
(c) If L = 𝑎𝑖 | 𝑖 ≥ 0 then pumping lemma is always satisfied for L*.
(d) If L = 𝑎2𝑛 𝑏3𝑚 | 𝑛, 𝑚 > 0 then pumping length can be 5.

Q4. [MSQ]
Which of the following statement is/are true?
(a) If L = 𝑎𝑏 𝑛 𝑎𝑘 : 𝑛 > 𝑘 𝑎𝑛𝑑 𝑘 ≥ 0 then L is non-regular.
(b) If L = 𝑎𝑛 𝑏𝑘 𝑐 𝑛+𝑘 : 𝑛 ≥ 0 𝑎𝑛𝑑 𝑘 ≥ 0 then complement of L is DCFL.
(c) If L = 𝑤𝜖 𝑎, 𝑏 ∗ : 𝑛𝑎 𝑤 = 𝑛𝑏 𝑤 then L* is regular.
(d) If L = {𝑎𝑛 | 𝑛 ≥ 0; 𝑛 𝑖𝑠 𝑛𝑒𝑖𝑡𝑕𝑒𝑟 𝑝𝑒𝑟𝑓𝑒𝑐𝑡 𝑠𝑞𝑢𝑎𝑟𝑒 𝑛𝑜𝑟 𝑐𝑢𝑏𝑒} and 𝐿 is the complement
of L then L* is regular. Assume L is defined over {a}.

ADVANCED THEORY OF COMPUTATION - 2023 1


Q5. [MSQ]
Which of the following language is accepted by Deterministic finite automaton?
(a) 𝐿1 = 𝑎𝑚 𝑏𝑛 𝑐 𝑝 | 𝑚 = 𝑛 ˅ 𝑛 = 𝑝 ˄ 𝑚 + 𝑛 + 𝑝 ≥ 12
(b) 𝐿2 = 𝑎𝑚 𝑏𝑛 𝑐 𝑝 | 𝑚 = 𝑛 ˅ 𝑛 = 𝑝 ˄ 𝑚 + 𝑛 + 𝑝 ≤ 12
(c) 𝐿3 = 𝑎𝑚 𝑏𝑛 𝑐 𝑝 | 𝑚 < 𝑛 ˄ 𝑛 < 𝑝 ˄ 𝑚 + 𝑛 + 𝑝 = 12
(d) 𝐿4 = 𝑎𝑚 𝑏𝑛 𝑐 𝑝 | 𝑚 < 𝑛 ˅ 𝑛 < 𝑝 ˅ 𝑚 + 𝑛 + 𝑝 = 12

Q6. [MSQ]
Which of the following statements is/are True?
(a) The intersection of a context free language with a regular language is
context free.
(b) The intersection of non-regular language and context free language is
always non-regular language.
(c) The concatenation of a context free language and the complement of a
regular language is context free.
(d) The concatenation of two non-regular languages may be a regular
language.

Q7. [MSQ]
Let L = 𝐴 | A is a DFA and L A is an infinite language ; where (A) denotes the
description of the deterministic finite automata (DFA). Then which of the
following statement is/are true about L?
(a) It is context-free but not regular.
(b) It is Turing decidable (recursive).
(c) It is Turing recognizable.
(d) Its complement is Turing recognizable.

ADVANCED THEORY OF COMPUTATION - 2023 2


Q8. [MSQ]
Consider the following non-deterministic automaton, where q0 is the start
state and q1 is the final (accepting) state. The input alphabet is {a, b}. A
transition with label ϵ can be taken without consuming any symbol from the
input.

Which of the following regular expressions correspond to the language


accepted by given automaton?
(a)(a + b)*b(𝜖 + 𝑎𝑎 + 𝑎𝑏)*
(b)(a + b)*b(𝜖 + 𝑎𝑎 + 𝑎 𝑎 + 𝑏 ∗ 𝑏)*
(c)(a + b)*b( 𝑎𝑎 ∗
+ 𝑎 𝑎 + 𝑏 ∗ 𝑏)*
(d)(a + b)*b(𝜖 + 𝑎𝑎 ∗
+ 𝑎 𝑎 + 𝑏 ∗ 𝑏)*
Q9. [MSQ]
Consider the following NFA M:

Which of the following statement is/are true?

ADVANCED THEORY OF COMPUTATION - 2023 3


(a) The language recognized by given NFA is 𝑤𝜖 𝑎, 𝑏, 𝑐 ∗ | w is start from the
symbol b or c
(b) The language recognized by given NFA is 𝐿1 = 𝑤𝜖 𝑎, 𝑏, 𝑐 ∗ | the second last
symbol of w is not a
(c) The regular expression R = (a + b + c)* b + c (a + b + c) is equivalent to given
NFA.
(d) The grammar G: {S → ABC, A → 𝑎𝐴 𝑏𝐴 𝑐𝐴|𝜖 , B→ 𝑏|𝑐, C→ 𝑎| B}

Q10. [MSQ]
Which of the following languages are not Recursive?
(a) L = < 𝐺 > |𝐺 𝑖𝑠 𝑎 𝐶𝐹𝐺 𝑎𝑛𝑑 𝑅 𝑖𝑠 𝑎 𝑟𝑒𝑔𝑢𝑙𝑎𝑟 𝑠𝑒𝑡 𝑠𝑢𝑐𝑕 𝑡𝑕𝑎𝑡 𝐿 𝐺 = 𝑅
(b) L = < 𝐺 > |𝐺 𝑖𝑠 𝑎 𝐶𝐹𝐺 𝑠𝑢𝑐𝑕 𝑡𝑕𝑎𝑡 𝐿 𝐺 = ∅
(c) L = < 𝐺1 , 𝐺2 > |𝐺𝑖 𝑖𝑠 𝑎 𝐶𝐹𝐺 𝑠𝑢𝑐𝑕 𝑡𝑕𝑎𝑡 𝐿 𝐺1 ∩ 𝐿 𝐺2 = ∅
(d) L = < 𝐺1 , 𝐺2 > |𝐺𝑖 𝑖𝑠 𝑎 𝐶𝐹𝐺 𝑠𝑢𝑐𝑕 𝑡𝑕𝑎𝑡 𝐿 𝐺1 = 𝐿 𝐺2

Q11. [MSQ]
Which of the following statements is/are False?
(a) If L is context-free language and M is DCFL then L – M is CFL.
(b) If L is DCFL and M is CFL then L – M is CFL.
(c) If L and M are DCFL then 𝐿 ∩ 𝑀 is CFL.
(d) The subset of a decidable language is always decidable.

Q12. [MSQ]
If L is consist of all binary strings beginning with a ‘1’ such that its value when
converted to decimal is divisible by 5, then which of the following statement
is/are true?
(a) L can be recognized by a deterministic finite state automaton.
(b) L can be recognized by a non-deterministic finite state automaton.
(c) L can be recognized by a deterministic push-down automaton
(d) L can be recognized by a non-deterministic push-down automaton but not
by a deterministic push-down automaton.

ADVANCED THEORY OF COMPUTATION - 2023 4


Q13. [MSQ]
If 𝑥 𝑅 is the reverse of string x, then which of the following language is/are
CFL?
(a) L = 𝑥𝑥 𝑅 | 𝑥 ∈ 𝑎∗ 𝑏 ∗
(b) L = 𝑥𝑥| 𝑥 ∈ 𝑎∗ ∪ 𝑏∗
(c) L = 𝑥𝑥 𝑅 | 𝑥 ∈ 𝑎∗ ∪ 𝑏∗
(d) L = 𝑥𝑥| 𝑥 ∈ 𝑎∗ 𝑏∗

Q14. [MSQ]
Let 𝑎𝑖 denote a sequence a.a.a…a with 𝒊letters and let N be the set of natural
numbers {1, 2, 3 …}.
Consider the following four languages:
2
𝐿1 = 𝑎𝑖 𝑏𝑖 | 𝑖 ∈ 𝑁 ,
2
𝐿2 = 𝑎𝑖 | 𝑖 ≥ 0 ,
𝐿3 = 𝑎𝑝 | 𝑒𝑖𝑡𝑕𝑒𝑟 𝑝 𝑖𝑠 𝑎 𝑝𝑟𝑖𝑚𝑒 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑟 𝑝 = 0
𝐿4 = 𝑎𝑝 | 𝑝 𝑖𝑠 𝑛𝑜𝑡 𝑎 𝑝𝑟𝑖𝑚𝑒 𝑛𝑢𝑚𝑏𝑒𝑟
Which of the following statement is/are true?
(a) Both 𝐿1 and 𝐿2 are recursive languages but not context-free.
(b) 𝐿3 ∪ 𝐿4 is Context-free language.
(c) 𝐿3 and 𝐿4 are non-regular language but 𝐿3 . 𝐿4 is regular.
(d) 𝐿2 ∗
is regular but 𝐿1 ∗
is CFL.

Q15. Let L be a given context-free language over the alphabet {0, 1}.
Let 𝐿1 = 𝐿 − 𝑥𝑦𝑥 | 𝑥, 𝑦 ∈ 0, 1 ∗
and 𝐿2 = 𝐿. 𝐿. 𝐿1 , then which of the following
statement is/are true?
(a) 𝐿1 − 𝐿2 is regular.
(b) 𝐿1 ∗
and 𝐿2 ∗
are regular.
(c) Every subsets of 𝐿1 ∪ 𝐿2 are regular.
(d) 𝐿2 − 𝐿1 is CFL but not regular.

ADVANCED THEORY OF COMPUTATION - 2023 5


Q16. [MSQ]
Consider the following grammar G with starting symbol S:
𝑆 → 𝐴𝐵𝐶, 𝐴 → 𝑎𝐴𝑏 𝐵𝐶, 𝐵 → 𝑏𝑏𝐵𝑐 𝑐, 𝐶 → 𝐶𝐶|𝑐
If the language generated by G is represented by L(G), then which of the
following statement is/are true?
(a) L (G) = 𝑎𝑛 𝑏𝑛+2𝑚 𝑐 𝑚 +1+𝑘 | 𝑛 ≥ 0, 𝑚 ≥ 0, 𝑘 ≥ 2
(b) L (G) = 𝑎𝑛 𝑏2𝑚 𝑐 𝑚 +1+𝑘 𝑏𝑛 | 𝑛 ≥ 0, 𝑚 ≥ 0, 𝑘 ≥ 2
(c) L (G) = 𝑎𝑛 𝑏2𝑚 𝑐 𝑚 +1+𝑘 𝑏𝑛 | 𝑛 ≥ 0, 𝑚 ≥ 0, 𝑘 ≥ 2 . 𝑏2𝑚 𝑐 𝑚 +1+𝑘 | 𝑚 ≥ 0, 𝑘 ≥ 2
(d) L (G) = 𝑎𝑛 𝑏2𝑚 𝑐 𝑚 +1+𝑘 𝑏𝑛 +2𝑚 𝑐 𝑚 +1+𝑘 | 𝑛 ≥ 0, 𝑚 ≥ 0, 𝑘 ≥ 2
Q17. Let 1 = 𝑎 be a one letter alphabet and 2 = 𝑎, 𝑏 be two letter alphabet. A
language over an alphabet is a set of finite length words comprising letters of
the alphabet. Let 𝐿1 and 𝐿2 be the set of languages over 1 𝑎𝑛𝑑 2 𝑟𝑒𝑠𝑝𝑒𝑐𝑡𝑖𝑣𝑒𝑙𝑦.
Which of the following language is/are countable?
(a) Both are countably infinite.
(b) 𝐿1 is countable but 𝐿2 is not.
(c) 𝐿2 is countable but 𝐿1 is not.
(d) Neither of them is countable
Q18. Consider the following grammar G with terminals {0, 1}, start symbol S, and
non-terminal {A, B, C}:
S → 𝐴𝐶 𝑆𝑆 𝐴𝐵 𝐶 → 𝑆𝐵, 𝐴 →0 𝐵 → 1
A language L is called prefix-closed if for 𝑥 ∈ 𝐿, every prefix of 𝑥 is also in L. If
the language generated by G is L(G) then which of the following statement
is/are True?
(a) L(G) can be recognized by deterministic pushdown automata.
(b) L(G) is infinite.
(c) L(G) is prefixed-closed.
(d) L(G) is recursive.
Q19. [MSQ]
A language L is called prefix-closed if for 𝑥 ∈ 𝐿, every prefix of 𝑥 is also in L.
Which of the following language is/are prefix-closed?
(a)(b*aa* + a*ba*)* (b) a*b*
(c) a*b* ∩ b*a* (d) {𝜖, 0, 1, 00, 01, 10, 11, 010, 100}

ADVANCED THEORY OF COMPUTATION - 2023 6


Q20. [MSQ]
Let L be the language over the alphabet {1, 2, 3, (, )} generated by the following
grammar G (with start symbol S, and non-terminals {A, B, C}):
𝑆 → 𝐴𝐵𝐶 𝐴 →( B→ 1𝐵 2𝐵 3𝐵|1|2|3 C →)
Which of the following statement is/are True?
(a) L is accepted by Deterministic pushdown automata.
(b) L is regular and its regular expression is (1 + 2 + 3)+.
(c) The grammar G is not regular.
(d) The equivalent regular expression for L = ((1 + 2 + 3)+).

Q21. [MSQ]
Consider the language L ⊆ {a, b, c}* defined as
L = 𝑎𝑝 𝑏𝑞 𝑐 𝑟 | 𝑝 = 𝑞 𝑜𝑟 𝑞 = 𝑟 𝑜𝑟 𝑟 = 𝑝
Which of the following statement is/are False?
(a) L is DCFL.
(b) The complement of L is CFL.
(c) L is recognised by some PDA.
(d) There exists a non context-free language M such L ∩ 𝑀 = ∅ but L∪ 𝑀 is
regular.

Q22. [MSQ]
Consider the following language
L = {<D>|D is a DFA and L(D) is infinite language}, where <D> denotes the
descrption of the deterministic finite automata (DFA). Then which of the
following statement is/are true about L?
(a) It is regular.
(b) It is Turing decidable.
(c) It is Turing recognizable.
(d) Its complement is Turing recognizable but L is not Turing recognizable.

ADVANCED THEORY OF COMPUTATION - 2023 7


Q23. [MSQ]
Consider the following three languages:
𝐿1 = 𝑤 ∈ 0,1 ∗ | 𝑠𝑢𝑏𝑠𝑡𝑟𝑖𝑛𝑔𝑠 01 𝑎𝑛𝑑 10 𝑜𝑐𝑐𝑢𝑟 𝑎𝑛 𝑒𝑞𝑢𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑡𝑖𝑚𝑒𝑠 𝑖𝑛 𝑤
For example: 1001 ∈ 𝐿1 but 1010 ∉ 𝐿1 .
𝐿2 = 𝑤 ∈ 0,1,2 ∗ | 𝑛0 𝑤 = 𝑛1 𝑤
𝐿3 = 𝑤 ∈ 0,1,2 ∗ | 𝑛1 𝑤 = 𝑛2 𝑤
Which of the following statement is/are true?
(a) 𝐿1 ∩ 𝐿2 ∪ 𝐿3 is CFL.
(b) (𝐿2 ∩ 𝐿3 ) is not DCFL.
(c) 𝐿∗1 is DCFL.
(d) The exists a context-free language such that 𝐿 ∪ (𝐿2 ∩ 𝐿3 ) is infinite regular
language.

Q24. How many of the following statement is/are True? ___________


(1) All recursive sets are recursively enumerable.
(2) The complement of every recursively enumerable sets is recursively
enumerable.
(3) If L = {<M> | M is a TM and L(M) is not RE} then L is RE.
(4) The complement of every recursive set is recursive.
(5) Every turning machine recognizable language is recursive.
(6) The complement of every recursively enumerable language is recursively
enumerable.
(7) The complement of a recursive language is recursively enumerable. (8) The
complement of a context-free language is context-free.
(9) The set of turning machines which do not halt on empty input forms a
recursively enumerable set.

Q25. [MSQ]
Which of the following regular expressions correctly accepts the set of all 0/1-
strings with an even (possibly zero number of 1’s)?
(a)(10*10*)* (b) (0*10*10*)*
(c) 0*(0*10*10*)*0* (d) (0 + 0*10*1*)*

ADVANCED THEORY OF COMPUTATION - 2023 8


Q26. [MSQ]
Which of the following identities is/are correct?
(a) (01*0 + 1*0*1)*+ 0*((1*0)*(0*1)*)* = (01* + 0*1)*
(b) 0(10)* + (1*0* + 1*1)+ = (01)*0 + (0 +1)*
(c) (0 + 1)(0 + 1)*(0 + 1) = (01* + 10*)+ (0 + 1)
(d) None of these
Q27. [MSQ]
Let L and L’ be language over the alphabets ∑. The left-quotient of L by L’ is
L/L’ = 𝑤 ∈ ∗: 𝑤𝑥 ∈ 𝐿 𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑥 ∈ 𝐿′ .
Which of the following statement is/are False?
(a) If L’ = a* and L = {ap | p is perfect square} then L/L’ = a*.
(b) If L = 𝑎𝑛 𝑏𝑛 𝑐 𝑛 | 𝑛 ≥ 0 and L’ = c* then L/L’ is DCFL.
(c) If L = 𝑥𝑦𝑥 𝑅 |𝑥 ∈ 𝑎, 𝑏 +, 𝑦 ∈ 𝑎, 𝑏 ∗ ; 𝑤𝑕𝑒𝑟𝑒 𝑥 𝑅 𝑖𝑠 𝑡𝑕𝑒 𝑟𝑒𝑣𝑒𝑟𝑠𝑒 𝑜𝑓 𝑥 and
L’ = {a, b} then L/L’ is regular.
(d) If L = 𝑥𝑦𝑥|𝑥, 𝑦 ∈ 𝑎, 𝑏 ∗
and L’ = {𝑎𝑛 𝑏𝑛 𝑛 ≥ 0 then L/L’ is recognised by a
minimized DFA with one state.
Q28. [MSQ]
Let L and L’ be language over the alphabets ∑. The left-quotient of L by L’ is
L/L’ = 𝑤 ∈ ∗: 𝑤𝑥 ∈ 𝐿 𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑥 ∈ 𝐿′ .
Which of the following statement is/are False?
(a) If L/L’ is regular then L’ is regular.
(b) If L is regular then L/L’ is regular.
(c) If L/L’ is regular then L is regular.
(d) If L/L’ and L’ is regular then L is regular.
Q29. [MSQ]
Consider the following languages:
𝐿1 = 𝑠𝑒𝑡 𝑜𝑓 𝑎𝑙𝑙 𝑏𝑖𝑛𝑎𝑟𝑦 𝑠𝑡𝑟𝑖𝑛𝑔𝑠 𝑏𝑒𝑔𝑖𝑛𝑖𝑛𝑔 𝑤𝑖𝑡𝑕 1.
𝐿2 = 𝑠𝑒𝑡 𝑜𝑓 𝑎𝑙𝑙 𝑏𝑖𝑛𝑎𝑟𝑦 𝑠𝑡𝑟𝑖𝑛𝑔𝑠 𝑤𝑕𝑜𝑠𝑒 𝑑𝑒𝑐𝑖𝑚𝑎𝑙 𝑒𝑞𝑢𝑖𝑣𝑎𝑙𝑒𝑛𝑡 𝑖𝑠 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 7.
𝐿 = 𝐿1 ∩ 𝐿2 and M = 𝐿2 ∩ 𝐿3
Which of the following statement is/are true?
(a) L is recognized by a minimized DFA with 9 states.
(b) M is recognized by a DFA with 2 states.
(c) 𝐿2 is recognised by a DFA with 7 states.
(d) 𝐿2 .M is recognised by a DFA with one state.

ADVANCED THEORY OF COMPUTATION - 2023 9


Q30. Let S be the set of all strings in L ((ab + b)*b(a + ab)*) of length less than or
equal to four. If one string is selected at random from S then what is the
probability that their length is three?
(a)5/18
(b)1/9
(c)5/8
(d) 1/2

Q31. Let S be the set of all strings in L ((ab + b)* b(a + ab)*) of length less than or
equal to four. If one string is selected at random from S then what is the
expected length of string? ________

Q32. Let A = {xx | x  {a, b}, and h: {a, b}*  {a, b}* be a homomorphism with h (a) =
h (b) = a, what is h(A)?
(a) {aa + bb}*
(b) ((a + b)(a + b))*
(c)(aa)*
(d) a*

Q33. Consider four regular expressions over the alphabet {a, b}:
E1 = (ab + a* b* b*)*,
E2 = ((ab)* (a* b*b*)*)*,
E3 = (a + b)*
E4 = a(a + b)*
Which of the following statement is/are False?
(a) L (E2) = L (E3)
(b) L (E3) = L (E4) and L (E1) = L (E4)
(c) The minimal DFA for L (E4) has two states.
(d) The minimal DFA for L (E1) has five states.

ADVANCED THEORY OF COMPUTATION - 2023 10


Q34. [MSQ]
Consider the language L = L1 L2, where
L1 = {an bn cm: n, m > 0}
L2 = {an bm cm: n, m > 0}
Which of the following grammar(s) generates L?
(a) (b)
𝑆 → 𝐴𝐶 | DB
A → 𝑎𝐴b | ab
C → cC| c
D → aA| a |∈
B → bBc | bc | ∈
(c) (d)
𝑆 → 𝐴𝐶 | DB 𝑆 → 𝐴𝐶 | DB | E
A → 𝑎𝐴b | ab A → 𝑎𝐴b | ab | aabb
C → cC| c C → cC| c| cc
D → aA| 𝑎 D → aA| a| aa
B → bBc | 𝑏𝑐 B → bBc | bc
E → abc | DB | AC

Q35. Consider the following statements:


(1) The set of non-palindromes (i.e., * — {w | w = wR, w *}) is non-regular;
(2) The set of odd-length strings with middle symbol 0 is regular;
(3) The set of strings that contain a substring of the form wuw where u*,
w+ is non-regular.
(4) The set of strings with the property that in every prefix, the number of 0’s
and the number of 1’s differ by at most 2 is regular;
(5) If L is non-regular and both of L' and L  L' are regular, then L  L' is non-
regular.
Which of the following statement is/are true?
(a) 1, 3, 4 only
(b) 2, 4, 5 only
(c) 1, 2, 5 only
(d) 1, 4, 5 only

ADVANCED THEORY OF COMPUTATION - 2023 11


Q36. [MSQ]
Consider the following language:
L= 𝑤∈ 𝑎 ∗
∶ 𝑤 𝑚𝑜𝑑 3 > 0
Which of the following statement is/are true about L?
(a) L is regular and its minimzed DFA contains three states in which two are
final states.
(b) The grammar G generates L; where G is:
S → A | B, A → a | aaaA, B → aa | aaaB
(c) The grammar G generates L; where G is:
S → a | aa | aaaS
(d) Its equivalent regular expression is (aaa)*(a + aa + aaaa).

Q37. Consider the following language:


L= 𝑤∈ 𝑎 ∗
∶ 𝑤 𝑚𝑜𝑑 3 ≥ 𝑤 𝑚𝑜𝑑 2
Given that
 Minimum X states are required to construct a DFA for L
 G generates L and minimum number of production rules is Y.
 N = X2 Y3.
How many different divisors of N are possible? _________

Q38. [MSQ]
Consider the following language:
L= 𝑤∈ 𝑎 ∗
∶ 𝑤 𝑚𝑜𝑑 3 ≠ 𝑤 𝑚𝑜𝑑 2
Minimum how many states are required to construct the DFA for L? _________

Q39. The following context-free grammar G generates all strings of the form
ax by for some x and y:
S  aT
T  aTbb|
What is the relation between x and y?
(a) x = 2(y – 1) (b) x = 2y + 1
(c) y = 2x – 1 (d) y = 2(x – 1)

ADVANCED THEORY OF COMPUTATION - 2023 12


Q40. [MSQ]
Which of the following statement is/are true about language L accepted by the
following automata?

(a) Every string of L contains at least two 01’s


(b) If a string starts with zero, changes symbols at least 3 times and if it starts
with 1, changes symbols at least 4 times.
(c) Length of smallest string of L is 4.
(d) Its equivalent regular expression is (0 + 1+ 0)0*1+0+1(0 + 1)*.

Q41. [MSQ]
Which of the following statement is/are True?
(a) The set of all base 7 positive integers n such that n % 3 = 2 is regular.
(b) There is a PDA that accepts all valid C programs.
(c) There is a DPDA that accepts the language of all palindromes over the
binary alphabet {0, 1}.
(d) The language consisting of all base 2 numerals for integer powers of 2 is
regular

ADVANCED THEORY OF COMPUTATION - 2023 13


Q42. Consider the following two languages:
𝐿1 = 𝑤 ∈ 𝑎, 𝑏 ∗ | 𝑤 𝑐𝑜𝑛𝑡𝑎𝑖𝑛𝑠 𝑒𝑣𝑒𝑛 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑎′𝑠
𝐿2 = 𝑤 ∈ 𝑎, 𝑏 ∗ | 𝑤 𝑖𝑠 𝑒𝑛𝑑𝑖𝑛𝑔 𝑤𝑖𝑡𝑕 ′𝑏′
Which of the following DFA accepts L1 L2?
(a) (b)

(c) (d)

Q43. [MSQ]
Consider the following two DFAs:

If the language accepted by DFAs D1 and D2 are L1 and L2, respectively, then
(a) The minimized DFA for (L1∪ L2) has exactly three final states.
(b) The minimized DFA for (L1L2) has exactly two final states.
(c) The minimized DFA for (L1*) has exactly two final states.
(d) None of these

ADVANCED THEORY OF COMPUTATION - 2023 14


Q44. The language accepted by the following PDA is

(a) L = 𝑎𝑛 𝑏2 𝑎𝑛+2 | 𝑛 > 0 (b) L = a*bbaaa*


(c) L = 𝑎 𝑏𝑎 𝑎 | 𝑛 ≥ 0
𝑛 2 𝑛
(d) L = 𝑎𝑛 𝑏2 𝑎𝑛+2 | 𝑛 ≥ 0
Q45. The following are two pairs of finite automata, in which pair automata are
equivalent to each other?

(a)I only (b) II only (c) Both (d)Neither I nor II

ADVANCED THEORY OF COMPUTATION - 2023 15


Q46. [MSQ]
Consider the following DFA:

Then which of the following statement is/are true?


(a) The regular expression for the given DFA is (00)*[𝜆 + [1 + 01(00)*0][ 𝜆 + 1 +
(00)*1(00)*0].
(b) The regular expression for the given DFA is (1*01*0)*1* + 0*10*10*.
(c) If only state number 2 is final state in above DFA then regular expression
will be [(00)* + (00)*01(00)*0].
(d) If only state number 2 and state number 0 are final states in above DFA
then regular expression will be (00)* + [(00)*1 + (00)*01(00)*0].

Q47. [MSQ]
Consider an arbitrary language L ⊆ {0, 1}*. Which of the following statements
may not be true?
(a) If L is decidable, then L is infinite.
(b) If L is not decidable, then L is infinite.
(c) If L is the union of two regular languages, then its complement L is
context-free.
(d) If L is context-free, then its complement L is context-free.

ADVANCED THEORY OF COMPUTATION - 2023 16


Q48. Suppose some language A ∈ {0, 1}* reduces to another language
B ∈ {0, 1}*. Which of the following statements must be true?
(a) A Turing machine that recognizes A can be used to construct a Turing
machine that recognizes B.
(b) A is decidable.
(c) If B is decidable then A is decidable.
(d) If A is decidable then B is decidable.

For next three questions: Consider non-empty languages (sets) A, B, and C, where
A is Regular, B is Context-Free but not regular, and C is Context Sensitive but not
context-free.
Q49. [MSQ]
Let D = A – B, that is all elements in A but not in B, then D can be
(a) Regular
(b) Context-Sensitive
(c) Context-Free
(d) Non-regular

Q50. [MSQ]
Let E = A  B, that is all elements in both A and B, then E can be
(a) Regular
(b) Context-Sensitive
(c) Context-Free
(d) Non-regular

Q51. [MSQ]
Let F = * − C, that is all elements not in C, can be
(a) Regular
(b) Context-Sensitive
(c) Context-Free
(d) Non-regular

ADVANCED THEORY OF COMPUTATION - 2023 17


Q52. The NFA on the left hand side of the diagram given below is converted into
equivalent DFA on the right hand side.

In this DFA, which states in the NFA make up the state X, Y and Z
respectively?
(a) X = 2, Y = 4, Z = 3 (b) X = 3, Y = 2, Z = 4
(c) X = 4, Y = 3, Z = 2 (d) X = 2, Y = 3, Z = 4
Q53. [MSQ]
What is the language accepted by the following finite state automata?

(a) a(bb + bba)*ba (b) ab(bb + bab)*a


(c) ab(bb + bab)*a + a(bb + bba)*ba (d) ab[(bb)*(bab)*]*a
Q54. [MSQ]
Consider the following languages over  = {a, b}
L1 = {bn|n  1}
L2 = {ban | n  0}
L3 = {bnan|n  0}
L4 = {(ba) n | n  1}
Which of the following statement is/are true?
(a) L4 ∩ 𝐿2 = L3 ∩ 𝐿2 (b)L4 ∩ 𝐿3 = L3 ∩ 𝐿2
(b) (c)𝐿21 = 𝑏𝑚 | 𝑚 ≥ 2 (d)𝐿4 𝐿𝑅4 = 𝑏𝑎 𝑛
𝑎𝑏 𝑛 | 𝑛 ≥ 1

ADVANCED THEORY OF COMPUTATION - 2023 18


Q55. [MSQ]
Let Σ = {a, b}. Let double be the function from Σ* to Σ* that doubles each
character in a string. For example, double (baaba) = bbaaaabbaa.
For L a language over Σ, define double(L) as follows:
Double (L) = {double(x) | x ∈ L}.
Which of the following statements is/are true?.
(a) If L is a regular language over Σ, then double (L) is regular.
(b) If L is a finite language over Σ, then double (L) is finite.
(c) If L ⊆ Σ* is not regular, then double (L) is not regular.
(d)There are the languages over Σ that have the property that double (L) = L.

Q56. [MSQ]
Which of the following statement is/are False?
(a) {ai|j is prime} is not context free.
(b) {(anb) n |n  1} is context free.
(c) {(anb) m|m, n  1} is context free.
(d) if L1 is context free and L2 is regular, then L1/L2 is context free.
(Note that L1/L2 = {x|y  L2, xy  L1})

Q57. [MSQ]
Which of the following statement is/are true?
(a) If L is a regular language over the alphabet {0, 1}, then {w1w|w  L} is also
regular.
(b) If L is a regular language over the alphabet {0, 1}, then {x1y | x, y  L} is
also regular.
(c) If L is a co-finite language over the alphabet {0, 1}, then {w1w|w ∉ L and w
𝐿} is regular language.
(d) The language L = 0* over the alphabet  = {0, 1} then {w1w|w  L} is also
regular.

ADVANCED THEORY OF COMPUTATION - 2023 19


Q58. [MSQ]
Which of the following statement is/are true?
(a) Let L1 be a finite language and L2 be an arbitrary language.
Then L1 L2 is regular.
(b) Let L1 be a finite language and L2 be an arbitrary language.
Then L1 L2 is regular.
(c) There exists a regular language L1 and an arbitrary language L2 such that
both L1 . L2 and L1 L2 are always regular language.
(d) The regular expression (00 + 01 + 10 + 11)* represents the language of all
strings over {0, 1} of even length.

Q59. [MSQ]
Which of the following statement is/are true?
(a) The -reach of any state in an NFA contains the state itself.
(b) Every regular expression that does not contain a Kleene star
(or Kleene plus) represents a finite language.
(c) Suppose we define an -DFA to be a DFA that can additionally make -
transitions. Any language that can be recognized by an -DFA can also be
recognized by a DFA that does not make any -transitions.
(d) The context-free grammar S  0S1 | 1S0 | SS | 01 | 10 | 0 | 1 generates
the language (0 +1) +.

Q60. [MSQ]
Consider the following regular language:
L = w | w is a non − empty binary string and w contains even number of 0′s
Which of the following regular expressions can define the language L?
(a) (01*0|1)+
(b) (1*01*01*)+
(c) (1*01*01*)+|1+
(d) ((0|1)* 0(0|1)* 0(0|1)*)+|1+

ADVANCED THEORY OF COMPUTATION - 2023 20


Q61. [MSQ]
Which of the following statement is/are true?
(a) If A is not recursive and B is a regular language, then
{x#y | x A, y B, # is a symbol not used in A and B} is not recursive.
(b) {M | M is a TM and L(M) contains at least 3800000 elements} is recursive.
(c) {M | M is a TM and L(M) contains at most 3800000 elements} is recursive.
(d) A countably infinite union of recursive sets (i.e., Ui=1…Li, each Li is recursive)
is always RE.

Q62. A grammar G = (V, T, P, S) is called reduced if for every proper subset


P’  P, which results in a grammar G'= (V, T, P’, S), the language L (G') is a
proper sublanguage of L (G). Which of the following statements are correct?
(a) Every grammar in Chomsky normal form is reduced.
(b) For every infinite context-free language L which does not contain , and every
nN there exists a grammar for L in Chomsky normal form which has at least n
variables.
(c) For every infinite context-free language L which does not contain , and every
n N there exists a reduce grammar for L in Chomsky normal form which has at
least n variables.
(d) If a grammar is reduced, it does not contain unit productions.

Q63. [MSQ]
Consider the four regular expressions over the alphabet (a, b}:
E1 = (ab + a*b*b*)*
E2 = ((ab)* (a*b*b*)*)*
E3 = (a + b)*
E4 = a (a + b)*
Which of the following statements are true?
(a) L (E1) = L(E2) = L (E3)
(b) L (E3) = L (E4) and L (E2) = L (E4)
(c) The minimal DFA for L (E2) has five states.
(d) The minimal DFA for L (E3) has one state.

ADVANCED THEORY OF COMPUTATION - 2023 21


Q64. Consider the following PDA P({{p, q, r}, {0,1}, {0, Z0},, q, Z0) with following
transitions
1. (q, 0, Z0) = {(q, 0Z0)}
2. (q, 0, 0) = {(q, 00)}
3. (q, 1, 0) = {(p, )}
4. (p, 1, 0) = {(p, )}
5. (p, 1, Z0) = {(r, Z0)}
6. (r, 1, Z0) = {(r, Z0)}
The language accepted by P is:
(a) 𝐿 = 0𝑛 1𝑛 | 𝑛 ≥ 0
(b) 𝐿 = 0𝑛 1𝑚 | 𝑛, 𝑚 ≥ 0
(c) 𝐿 = 0𝑛 1𝑚 | 𝑛 ≥ 𝑚 ≥ 1
(d) 𝐿 = 0𝑛 1𝑚 | 𝑚 ≥ 𝑛 ≥ 1

Q65. [MSQ]
Which of the following statement is/are true?
(a) Let A be a set and X = x0, x1, x2 ... be an infinite sequence such that every
element of A appears in X at least once. (Thus, X is an enumeration of A with
possible repetition.) Then, A is countable.
(b) If A is a countable set and B  A then B is countable.
(c) If Ai is a countable set for every i  N, then UiN Ai is countable. This fact is
sometimes phrased as: The countable union of countable sets is countable.
[Note that the set of finite sequences of natural numbers is countable.]
(d) The set of all languages over the alphabet {0, 1} is uncountable.

Q66. [MSQ]
Which of the following language(s) over {a, b, c} is/are regular?
(a) 𝐿 = 𝑎𝑘 | 𝑘 ≥ 0 and k is product of two 𝑜𝑟 𝑚𝑜𝑟𝑒 𝑝𝑟𝑖𝑚𝑒 𝑛𝑢𝑚𝑏𝑒𝑟 ∪ 𝑎𝑘 | 𝑘
is a prime number
(b) 𝐿 = 𝑎𝑖 𝑏 𝑗 𝑐 𝑘 | 𝑖 + 𝑗 + 𝑘 > 100 & 𝑘 > 50
(c) 𝐿 = 𝑎𝑖 𝑏 𝑗 𝑐 𝑘 | 𝑖 + 𝑗 + 𝑘 > 100 & 𝑗 + 𝑘 > 50
(d) 𝐿 = 𝑎𝑖 𝑏 𝑗 𝑐 𝑘 𝑎𝑚 | 𝑖 + 𝑗 + 𝑘 + 𝑚 ≤ 100 & 𝑗 + 𝑘 ≥ 50

ADVANCED THEORY OF COMPUTATION - 2023 22


Q67. [MSQ]
Which of the following statement is/are False?
(a) Membership in Phrase-Structured Languages is semi-decidable.
(b) Membership in Context-Free Languages can be solved in polynomial time.
(c) An algorithm exists to determine if a Context-Sensitive Language is finite.
(d) If S is a decidable set and R is a subset of S, then R is also decidable.

Q68. Which of the following statements is not always true for a recursive set A?
(a) A and 𝐴 are both recursively enumerable.
(b)A is infinite.
(c) A can be printed in increasing order.
(d) All of the above are always true

Q69. [MSQ]
Which of the following statement is/are False?
(a)For a decidable language L, LR may or may not be decidable. (LR denotes the
reverse of language L.
(b) If L  {0}* then L is decidable.
(c) If L m {0n 1n I n  0} then L is decidable.
(d) If L is not recursively enumerable then L must be recursively enumerable.

Q70. [MSQ]
The symmetric difference of languages L and M, which we shall denote SD(L,M),
is the set of strings that are in exactly one of L and M. For example, if L = {00,
101} and M = {11, 00}, then SD(L,M) = {11, 101Suppose L = L(0*1*) and M =
L(1*0*). Which of the following regular expression(s) is/are correct regular
expression for SD(L,M)?
(a) (00)*(11)* + (11)*(00)*
(b) 00+11+ + 11+ 00+
(c) 00*11* + 11*00*
(d) 0+1+ + 1+0+

ADVANCED THEORY OF COMPUTATION - 2023 23


Q71. [MSQ]
Which of the following problems are decidable?
(a) Given a Turing machine M with tape alphabet (0, 1, } and input word
w  {0, 1}*, does M ever change a 1 on its tape to a 0?
(b) Given a Turing machine M with tape alphabet {0, 1, } and input word
w  {0, 1}*, does M ever change a on its tape to either 0 or 1?
(c) Given two Turing machines M and M', is there a string w that is accepted by
both M and M'?
(d) Given a Turing machine M and string w, does M accept w after at most |w|2
steps?
Data for next four questions:
 R1 is regular language,
 R2 is finite,
 L1 and L2 are non-regular CFLs.
 L1/L2 = {x: yL2, xyL1}
Q72. [MSQ]
Then L1/L2 may be
(a) Regular (b) CFL but non-regular
(c) CFL but non- regular (d) Recursive

Q73. [MSQ]
Then L1 – R1 may be
(a) Regular (b) CFL but non-regular
(c) Not CFL (d) Recursive

Q74. [MSQ]
Then complement of L1 may be
(a) Regular (b) CFL but non-regular
(c) Not CFL (d) Recursive

Q75. [MSQ]
Then the subset of R2 can be
(a) Regular (b) CFL but non-regular
(c) Not CFL (d) Recursive

ADVANCED THEORY OF COMPUTATION - 2023 24


Q76. [MSQ]
Which of the following language is/are not a regular?
(a) The set of all strings in {0, 1}* in which the substrings 01 and 10 appear the
same number of times. (For example, the substrings 01 and 01 each appear
three times in the string 1100001101101.)
(b) The set of all strings in {0, 1}* in which the substrings 00 and 11 appear the
same number of times. (For example, the substrings 00 and 11 each appear
three times in the string 1100001101101.)
(c) The set of all strings in {0, 1, (, ), *, +, ∅, }* that are regular expressions
over the alphabet {0, 1}.
(d) The set of all strings in {0, 1}* such that in every prefix, the number of 0s is
greater than the number of l’s.

Q77. [MSQ]
Which of the following statement is/are true?
(a) The language generated by the following context-free grammar[S  0A1|, A
 1S0 | ] is regular.
(b) The language generated by the following context-free grammar:
[S  0A1, A  1S0| ] is CFL but not regular.
(c) The language generated by the following context-free grammar:
[S  0 S 1 |1S0| ] is CFL but not regular.
(d) The language generated by the following context-free grammar:
[S  0S0 |1S1| 0 | 1 | ] is regular.

Q78. [MSQ]
Which of the following language is/are non-regular?
(a) The set of all strings in {0, 1}* such that in every non-empty prefix, the
number of 0s is greater than the number of l s.
(b) {w # x | w, x  {0, 1}* and no substring of w is also a substring of x}
(c) {w # x | w, x  {0, 1)* & no non-empty substring of w is also a substring of x}
(d) {w # x | w, x  {0, 1}* and every non-empty substring of w is also a substring
of x}

ADVANCED THEORY OF COMPUTATION - 2023 25


Data for next two questions:
Consider the following regular expressions over the alphabet  = {a, b}
e1 = (aa) + 𝜆 e2 = (bb)* e3 = aa + bb
Recall that if X and Y are languages, then the intersection X Y is the language
consisting of all words that are in X as well as in Y, that is,
X  Y = {w*|wX and wY}.
Q79. [MSQ]
Which of the following statement is/are true?
(a) L (𝑒1∗ ) = {(aa)n| n  0}
(b) L (𝑒2∗ ) = L (e2)
(c) L (e1 e3) is finite and its cardinality is 3.
(d) L (e1 e2 e3) = L (e1)  L (e2 e3) = L (e1 e2 e3)) .L (e3)

Q80. How many of the following identities are true? _________


i. (e1 e2). 𝑒3∗ 𝑒3∗
ii. (e2 e3)*  e2
iii. (e1 + e2)* 𝑒3∗
iv. (𝑒1∗ +𝑒2∗ } 𝑒3∗
v. (𝑒1∗ . 𝑒2∗ ) 𝑒3∗

Q81. [MSQ]
Consider the following sets of languages over the alphabet {0, 1}:
(i) LDTM is the set of all languages L  {0, 1}* such that L is accepted by at least
one deterministic Turing machine.
(ii) LNTM is the set of all languages L  {0, 1}* such that L is accepted by at least
one non-deterministic Turing machine.
Which of the following statements is/are true?
(Recall that A ⊆ B means "A is a proper subset of B")
(a) LDTM⊆ LNTM
(b) LDTM⊇ LNTM
(c) LDTM = LNTM
(d) Neither a nor b

ADVANCED THEORY OF COMPUTATION - 2023 26


Q82. [MSQ]
Which of the following statement is/are not always true?
(a) Given a regular language L, the minimal DFA accepting L has always exactly
as many states as any minimal-size NFA accepting L.
(b) If A is a DFA for a language L, and A has two states q  p such that for some
nonempty word w it holds that  (q, w) =  (p, w) and  (p, w) is an accepting
state, then A is not minimal.
(c) An NFA for a language L can be transformed into a minimal DFA for L by first
carrying out the subset construction and then deleting all inaccessible states.
(d) Let A = (Q, , , q0, F) be a DFA. Define for every q  Q the language L (q) = {w
*|  (q, w)  F}. If for all p, q  Q, q  p, it holds that
L (p)  L (q) =∅, then A is minimal.

Q83. [MSQ]
Which of the following statement is/are true?
(a) a*b*c* - (an bn cn, n  0) is context-free but not regular.
(b) { w  {a, b}*: the first, middle, and last characters of w are identical) is
context-free.
(c) {anbn| n  0}  {ancn| n  0} is deterministic context-free.
(d) {anbn | n  5}  {ambm| m  0} is deterministic context-free.

Q84. [MSQ]
Which of the following statement is/are true?
(a) If middle (L) = {x: y, z * (yxz  L)}, then middle ({anbncn, n  0}) = a*b*c*.
(b) Context-free languages are closed under pref (L); where pref (L) = {w: x *
(wx  L)}.
(c) Context-free languages are closed under middle (L); whereMiddle (L) = {x: y,
z * (yxz  L)}.
(d) If middle (L) = {x: y, z * (yxz  L)}, then middle ( 𝑎𝑝 | 𝑝 𝑖𝑠 𝑝𝑟𝑖𝑚𝑒 ) is a*.

ADVANCED THEORY OF COMPUTATION - 2023 27


Q85. The language L1 = {0n 1n 2i | i  n} is not a CFL, although the proof is rather
tricky. However, suppose we are given that L1 is not context-free. Now consider
the language L2 = {0i 1n 2n I i  n}. We can prove L2 is not context-free either, by
applying two operations, both known to turn CFL's into CFL's, and thereby
convert L2 into L1.
What is the first operation you use? Give specifics of the operation, if necessary
(e.g., if you use "intersection with a regular language," tell what regular
language you choose).
(a) We will apply homomorphism such that h (2) = 0, h (1) = 2, h(0) = 1.
(b) We will apply homomorphism such that h (2) = 2, h (1) = 1, h(0) = 1.
And then reverse the language.
(c) We will apply the homomorphism h (2) = 0, h (1) = 1, and h(0) = 2.
And then reverse the language.
(d) Not possible
Q86. [MSQ]
Let set A be recursive, B be RE but non-recursive and C be non-RE, then which
of the following statement is/are true?
(a) If D = ~ C then D is RE but not Recursive.
(b) If D  A  C then D can be Recursive but cannot be RE.
(c) If D = ~ B, then D cannot be recursive.
(d) If D = B – A then D may be Recursive.
Q87. Define the following classes of languages:
 D is the class of languages decided by Turing machines
 F is the class of finite languages
 G is the class of languages having context-free grammars
 N is the class of languages recognized by NFAs
 P is the class of languages recognized by PDAs
 R is the class of languages having regular expressions
 T is the class of languages recognized by Turing machines.
How many of the above statement is/are true? _________
(i) R is a subset of F (v) D is closed under intersection
(ii) T is closed under union (vi) N is closed under
(iii) R is a subset of N complementation
(iv) R=P (vii) N is a subset of R

ADVANCED THEORY OF COMPUTATION - 2023 28


Q88. [MSQ]
Which of the following statement is/are False?
(a) If language A is finite, then A must have a context-free grammar in Chomsky
normal form.
(b) If language A is recognized by an NFA, then A* must be infinite.
(c) Every language recognized by a Turing has its equivalent CFG.
(d) If languages A & B have context-free grammars, then A  B must be
recognized by a PDA.
Q89. Consider a PDA M = (Q,, Γ, , q1, F);where Q = {q1, q2, q3, q4},
 = {a, b}, Γ = {a, b, c, $}, F = {q4}, and . As specified in the following graph:

How many of the following CFGs (if any) generates the language L (M)?
______________ [Below, only the rules of each CFG are specified.]
i. S  aSb|
ii. S  aSa|bSb |b
iii. S  bSa|
iv. S  bSa|ba
v. S bSc|X |Y, X  aXb|S, Y  cYa|b
vi. S bSa| X, X  bXa|ba
vii. S  aSb|ab
Q90. [MSQ]
Which of the following statement is/are False?
(a) A context-free grammar for A = {ln 0n | n  0} is G = (V,, R, S), with V = {S} , 
= {0, l} start variable S, and rules R = {S  1SOS | }.
(b) A language that is decided by a nondeterministic Turing machine must also
be recognized by a Deterministic Turing machine
(c) If a language A is recognized by a M = (Q, , , q1, F),
Then A* is recognized by the DFA = M’ (Q,, , q1,Q - F).
(d) If a language A is recognized by a 5-tape Turing machine, then
A U A must be regular.

ADVANCED THEORY OF COMPUTATION - 2023 29


Q91. [MSQ]
Which of the following language is/are decidable?
(a) L = < 𝐺 > | 𝐺 𝑖𝑠 𝐶𝐹𝐺 𝑎𝑛𝑑 𝐿 𝐺 𝑖𝑠 ∅
(b) L = < 𝐺 > | 𝐺 𝑖𝑠 𝐶𝐹𝐺 𝑎𝑛𝑑 𝐿 G is a, b ∗

(c) L = < 𝐷 > | 𝐺 𝑖𝑠 𝐷𝐹𝐴 𝑎𝑛𝑑 𝐿 D is a, b ∗

(d) L = < 𝐷 > | 𝐺 𝑖𝑠 𝐷𝐹𝐴 𝑎𝑛𝑑 𝐿 D is ∅


Q92. [MSQ]
Which the following language(s) is /are regular?
(a) 𝐿1 = 𝑤𝑤 |𝑤 ∈ 0,1 ∗ 𝑎𝑛𝑑 𝑤 𝑖𝑠 𝑜𝑑𝑑 𝑏𝑢𝑡 𝑛𝑜𝑡 𝑝𝑟𝑖𝑚𝑒 𝑛𝑢𝑚𝑏𝑒𝑟
(b) 𝐿2 = 𝑤𝑤 |𝑤 ∈ 0,1 ∗ 𝑎𝑛𝑑 𝑤 𝑖𝑠 𝑝𝑟𝑖𝑚𝑒 𝑏𝑢𝑡 𝑛𝑜𝑡 𝑜𝑑𝑑 𝑛𝑢𝑚𝑏𝑒𝑟
(c) 𝐿3 = 0𝑥 𝑦
|𝑥, 𝑦 ≥ 0 𝑎𝑛𝑑 𝑥𝑦 𝑖𝑠 𝑎 𝑐𝑜𝑚𝑝𝑜𝑠𝑖𝑡𝑒 𝑛𝑎𝑡𝑢𝑟𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟
(d) 𝐿4 = 0𝑥 𝑦
|𝑥, 𝑦 ≥ 0 𝑎𝑛𝑑 𝑥 + 𝑦 𝑖𝑠 𝑒𝑣𝑒𝑛 𝑛𝑢𝑚𝑏𝑒𝑟
Data for next two questions: In a certain programming languages, comment appear
between delimiters such as /# and #/. Let C be the language o all valid delimited
comment strings. Such a string in C must begin with /# and end with #/ but have no
intervening #/. For simplicity, assume the alphabet ∑ = {a, b, /, #}.
Q93. Minimum how many states are required to construct non-deterministic finite
automata (NFA) that recognize the language C? _________
Q94. [MSQ]
Which of the following regular expression(s) generates C?
(a) /#(a + b + /)*(#*(a + b)*)#/ (b)/# ((a + b + /)*(##*(a + b))*)*#/
(c) /# (a + b + / + (##*(a + b)))*#/ (d)/# (a + b + / + (#*(a + b))*#/
Q95. Consider the following finite automata:

ADVANCED THEORY OF COMPUTATION - 2023 30


The language recognize by above automata is
(a) L = 𝑤 ∈ 𝑎, 𝑏 ∗ | 𝑤 𝑐𝑜𝑛𝑡𝑎𝑖𝑛𝑠 𝑎𝑡 𝑙𝑒𝑎𝑠𝑡 𝑡𝑤𝑜 𝑎′ 𝑠
(b) L = 𝑤 ∈ 𝑎, 𝑏 ∗ | 𝑤 𝑐𝑜𝑛𝑡𝑎𝑖𝑛𝑠 𝑒𝑥𝑎𝑐𝑡𝑙𝑦 𝑡𝑤𝑜 𝑎′ 𝑠 𝑎𝑛𝑑 𝑜𝑑𝑑 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑏′𝑠
(c) L = 𝑤 ∈ 𝑎, 𝑏 ∗ | 𝑤 𝑐𝑜𝑛𝑡𝑎𝑖𝑛 𝑜𝑑𝑑 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑏′ 𝑠 𝑓𝑜𝑙𝑙𝑜𝑤𝑒𝑑 𝑏𝑦 𝑎𝑡 𝑙𝑒𝑎𝑠𝑡 𝑡𝑤𝑜 𝑎′ 𝑠
(d) L = 𝑤 ∈ 𝑎, 𝑏 ∗ | 𝑤 𝑐𝑜𝑛𝑡𝑎𝑖𝑛 𝑎𝑡 𝑙𝑒𝑎𝑠𝑡 𝑡𝑤𝑜 𝑎′ 𝑠 𝑎𝑛𝑑 𝑜𝑑𝑑 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑏′𝑠

Q96. Consider the following finite automata:

If the language recognize by above automata is L over {a, b} then L is Equivalent


to
(a) the language of all strings that begin with aa and end with bb.
(b) the language of all strings that begin with aa or bb.
(c) the language of all strings that end with aa or bb,
(d) the language of all strings that begin or end with aa or bb,

Q97. [MSQ]
Which of the following statement/s is/are False?
(a) If L1 is regular and L1UL2 is also regular then L2 is always regular.
(b) If L1 is non-regular and L1UL2 is regular then L2 must be non-regular.
(c) If L is regular then tail (L) is also regular, where
tail (L) = {v :uvL for some uΣ*}.
(d) If L is regular then head (L) is also regular, where head (L) = {u :uv L for
some vΣ*}

ADVANCED THEORY OF COMPUTATION - 2023 31


Q98. [MSQ]
Which of the following statement/s is/are not true?
(a) If L1L2 is regular and L1.L2 is also regular then L1 and L2 are always
regular.
(b) Define an operation third on strings and languages as third
(a1a2a3…… an) = (a3a6….). If L is regular, so is third (L).
(c) For a string a1a2a3…… an , define the operation SHIFT as
SHIFT (a1a2a3…… an) = a2a3a4……ana1. If L is regular, so is SHIFT (L), where
SHIFT (L) = {x : x = SHIFT(w) for some wL}.
(d)If (L1.L2 U L3) is regular, L3 is regular and complement of L2 is regular then
L1 must be regular.

Q99. The right quotient of a language L1 with respect to L2 is defined as L1/L2 = {x:
yL2, xyL1}
Let L1 = L(a*ba+) and L2 = {aba*} then what will be the L1/L2?
(a)a*
(b)a+
(c)a*b
(d)a+b

Q100. [MSQ]
Which of the following statement/s is/are true?
(a) If L1L2 is not regular and complement of L1 is not regular then L2 is
always non-regular.
(b) Define exchange (a1a2a3…… an) = ana2a3…… an-1a1. If L is regular, so is
exchange (L), where
exchange (L) = {y : y = exchange (w) for some wL }.
(c) Let L1 and L2 are two regular language, then shuffle (L1, L2) is also regular,
where
shuffle (L1, L2) = {w1v1w2v2 ……. wmvm : w1 w2 w3…. wmL1, v1v2v3….. vmL2, for
all wi, vi Σ*}.
(d)None of the above

ADVANCED THEORY OF COMPUTATION - 2023 32


Q101. Consider the following grammar G with starting symbol S:

S → TC | AR,
T → 𝑎𝑇𝑏 | 𝜆,
C→ 𝐶𝐶|𝜆
R → bRc | X | Y
X→Xb | b,
Y→ Yc | c
A → Aa | 𝜆
Which of the language is generated by G?(Assume i, j, k>=0)
(a) L = {aibjck | i = j and j=k} (b) L = {aibjck | i = j or k=j}
(c) L = {aibjck | i = j or j!=k } (d) L = {aibjck | i = j and k!=j}

Q102. [MSQ]
Consider the following grammar G with starting symbol S:

If the language generated by G is L, then L is the


(a) The set of strings over the alphabet {a, b} with equal number of a's and b's.
(b) The set of strings over the alphabet {a, b} with one more a's than b's.
(c) The set of strings over the alphabet {a, b} with more a's than b's.
(d) If T is starting symbol then L is the set of strings over the alphabet {a, b} with
equal number of a's and b's.

Q103. Consider the following grammar G with starting symbol S:

If the language generated by G is L, then L is the


(a) 𝑥#𝑦 | 𝑥, 𝑦 ∈ 0, 1 ∗
𝑎𝑛𝑑 𝑥 = 𝑦
(b) 𝑥#𝑦 | 𝑥, 𝑦 ∈ 0, 1 ∗
𝑎𝑛𝑑 𝑥 = 𝑦 𝑅
(c) 𝑥#𝑦 | 𝑥, 𝑦 ∈ 0, 1 ∗ 𝑎𝑛𝑑 𝑥 𝑅 𝑖𝑠 𝑎 𝑠𝑢𝑏𝑠𝑡𝑟𝑖𝑛𝑔 𝑜𝑓 𝑦
(d) 𝑥#𝑦 | 𝑥, 𝑦 ∈ 0, 1 ∗ 𝑎𝑛𝑑 𝑦 𝑅 𝑖𝑠 𝑎 𝑠𝑢𝑏𝑠𝑡𝑟𝑖𝑛𝑔 𝑜𝑓 𝑥
Q104. Consider the following three grammars with starting symbol S:

ADVANCED THEORY OF COMPUTATION - 2023 33


Grammar G1 Grammar G2 Grammar G3
S → ASA | A | 𝜆 S → BA DD 𝜆 S → 00S | 𝜆
A → 00 | 𝜆 A → BA | DD
B → DD
D →0
Which of the following statement is/are true?
(a) All the grammars (G1, G2 & G3) generate the same language.
(b) Only G2 is in Chomsky normal form.
(c) All the grammars(G1, G2 & G3) are not regular but all generates regular
language (may or may not be same)
(d) The language generated by G2 is inherently ambiguous.

Q105. [MSQ]
Consider the following grammar G with starting symbol S:
𝑺→𝑬 𝑪 𝒂|𝒃
E → AB | BA
A → ZAZ | a
B → ZBZ | b
C → ZCZ | Z
Z→a|b
If the language generated by G is L, then L is the
(a) Complement of 𝑥𝑦 | 𝑥, 𝑦 ∈ 𝑎, 𝑏 ∗
𝑎𝑛𝑑 |𝑥| = |𝑦|
(b) Complement of 𝑥𝑦 | 𝑥, 𝑦 ∈ 𝑎, 𝑏 ∗
𝑎𝑛𝑑 𝑥 = 𝑦 𝑎𝑛𝑑 𝑥 = 𝑦
(c) 𝑥𝑦 | 𝑥, 𝑦 ∈ 𝑎, 𝑏 ∗
𝑠𝑢𝑐𝑕 𝑡𝑕𝑎𝑡 𝑥 = 𝑦 𝑎𝑛𝑑 𝑥 ≠ 𝑦 ∪ { 𝑥 | 𝑥 ∈ 𝑎, 𝑏 ∗ & 𝑥 𝑖𝑠 𝑜𝑑𝑑}
(d) 𝑥𝑦 | 𝑥, 𝑦 ∈ 0, 1 ∗ 𝑎𝑛𝑑 𝑥 ≠ 𝑦
Q106. [MSQ]
Which of the following language is/are regular?
(a) 𝐿 = an m
| nm is product of two or more prime number
(b) L = 𝑎𝑛 𝑏𝑚 𝑐 𝑘 | 𝑛 + 𝑚 + 𝑘 = 2100 𝑎𝑛𝑑 𝑛, 𝑚, 𝑘 ≥ 0
(c) L = 𝑎𝑛 | 𝑛 ≥ 1 𝑎𝑛𝑑 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑑𝑖𝑣𝑖𝑠𝑜𝑟𝑠 𝑜𝑓 𝑛 𝑖𝑠 𝑜𝑑𝑑 ∗

(d) L = 𝑎𝑛+𝑘 | 𝑛, 𝑘 ≥ 1 𝑎𝑛𝑑 𝑛 & 𝑘 𝑎𝑟𝑒 𝑟𝑒𝑙𝑎𝑡𝑖𝑣𝑒 𝑝𝑟𝑖𝑚𝑒


Q107. Consider the following grammar G

ADVANCED THEORY OF COMPUTATION - 2023 34


S ⟶ 𝑆1 | 𝑆2
𝑆1 ⟶ 𝑎𝑆1 𝑐 | 𝑇
T ⟶ aTb | 𝜆
𝑆2 ⟶ 𝑋𝑌
X ⟶ aXb | 𝜆
Y ⟶ bYc | 𝜆
Which of the language is generated by G?(Assume i, j, k>=0)
(a) L = {aibjck | k = i +j}
(b) L = {aibjck | k = i – j }
(c) L = {aibjck | k= j – i}
(d) L = {aibjck | k = |i – j |}

Q108. Consider the following grammar G:

𝑆 ⟶ 𝑎𝑆𝑐 𝑐𝑆𝑎 𝑏𝑆𝑐 𝑐𝑆𝑏 𝑇 𝐴 𝐵 | 𝐶


A ⟶ Aa | a
B ⟶ Bb | b
C ⟶ Cc | c
T ⟶ ATB | BTA | A | B
Which of the language is generated by G?
(a) L = {w{a, b, c}* : na(w)+nb(w)=nc(w)}
(b) L = {w{a, b, c}* : na(w)+nb(w)>nc(w)}
(c) L = {w{a, b, c}* : na(w)+nb(w)<nc(w)}
(d) L = {w{a, b, c}* : na(w)+nb(w)nc(w)}

Q109. Consider three language L1, L2, L3 and three grammar G1, G2, G3:

Grammar Language

G1:𝑆 → 𝑎𝑆𝑐 | 𝑇, T → bTc | 𝜆 L1 = {aibjck | k = i +2*j},

G2:𝑆 → 𝑎𝑆𝑐 | 𝑇, T → bTcc | 𝜆 L2 ={aibick | k>=3},

G3: S → TC, T → aTb| 𝜆, C → 𝐶𝑐 |ccc L3 = {aibjck | k = i +j}

Which of the following language, grammar pair are equivalent?

ADVANCED THEORY OF COMPUTATION - 2023 35


(a)(L1, G1), (L2, G2), (L3, G3)
(b)(L1, G3), (L2, G2), (L3, G1)
(c)(L1, G2), (L2, G2), (L3, G3)
(d) (L1, G2), (L2, G3), (L3, G1)
Q110. [MSQ]
Consider the following grammar G, in which {c, l, x, v, i} are terminals. (Given
that x, i, c, l, v are roman letters).
S ⟶ xTU | lX | X
T⟶c|l
X ⟶ xX | U
U ⟶ iY | vI | I
Y⟶x|v
I ⟶ iI | 𝜆
Then which of the following is/are true?
(a) G can parse roman numerals for 1 to 150(i, ii, iii…..x…c…cl).
(b) G can parse roman numerals for 1 to 99( i, ii, iii…..x…l…xcix).
(c) G is unambiguous.
(d) L(G) is regular but G is not regular.
Q111. [MSQ]
Consider the following grammar with starting symbol S:
S ⟶ AC
A ⟶ aa | ab | ba | bb
C ⟶ aCa | bCb | B
B ⟶ aa | ab | ba | bb
If the language generated by G is L then which of the following statement is/are
true?
(a) G is neither ambiguous nor L is inherently ambiguous.
(b) L = 𝑢𝑥𝑤𝑤 𝑅 | 𝑢, 𝑥, 𝑤 ∈ 𝑎, 𝑏 +
𝑎𝑛𝑑 𝑢 = 𝑤 = 2
(c) L = 𝑢𝑥𝑤𝑥 𝑅 | 𝑢, 𝑥, 𝑤 ∈ 𝑎, 𝑏 +
𝑎𝑛𝑑 𝑢 = 𝑤 = 2
(d) L = 𝑢𝑥𝑤𝑥 𝑅 | 𝑢, 𝑥, 𝑤 ∈ 𝑎, 𝑏 +
𝑠𝑢𝑐𝑕 𝑡𝑕𝑎𝑡 𝑢 = 𝑤 𝑎𝑛𝑑 𝑢 = 𝑤 = 2

ADVANCED THEORY OF COMPUTATION - 2023 36

You might also like