TCS PYQs
TCS PYQs
TCS PYQs
Paper set 1
Certainly, here are the questions extracted from the image you provided:
1. Automata and Formal Languages
a. Differentiate Finite Automata, Push Down Automata, and Turing Machine.
b. Discuss different applications of Finite Automata.
c. Design DFA that accepts Strings with at least 3 a's. over Σ={a,b}.
d. Simplify the given grammar:
S → ASB | ε
A → aAS | a
B → SbS | A | bb
2. Finite State Machines
a. Compare and Contrast Moore and Mealy Machines. Design Moore machine for Σ={0,1}, print the residue
modulo 3 for binary numbers.
b. Design Push Down Machine that accepts L = {a^m b^n c^n d^m | m,n > 0}
3. Grammars and Parsing
a. i) Construct CFG for given language. L = {0^i 1^j 0^k | j > i+k} ii) The grammar G is S → aAb | bS | ε, A → aA | bB, B
→ b | bS | aBB
b. Explain Pumping Lemma with the help of a diagram to prove that the given language is not a regular language.
L = {0^m 1^(m+1) | m > 0}
4. Finite Automata Design
a.
i) Design DFA that accepts Strings that ends in either "110" or "101" over Σ={0,1}.
ii) Design NFA that accepts strings starting with "abb" or "bba".
b. Given NFA with epsilon, Find equivalent DFA. q1 is the initial state, q3 is the final state.
5. Grammars and Normal Forms
a. Find Equivalent Greibach Normal Form (GNF) for given CFG. b. Define and design Turing Machine to accept
{0^n 1^n 2^n} over Σ={0,1,2}.
6. Theory of Computation
a. Write short notes (Any Two):
Chomsky Hierarchy
Post Correspondence Problem
Recursive and Recursive enumerable languages
TM-Halting Problem
Paper Set 2
Here are the questions extracted from the image:
Q1.
a) Show that grammar represented by production rules given below is ambiguous.
S → S+S | S-S | S*S | S/S | (S) | a
b) Construct a Moore machine to output remainder modulo 4 for any binary number.
c) Differentiate between NPDA and PDA.
d) Explain Chomsky Hierarchy.
Q2.
a) Write steps for converting CFG to CNF form. Convert the following CFG to CNF:
S → ASB | ε
A → aAS | a
B → SbS | A | bb
b) Convert the following RE to NFA and convert it to minimized DFA corresponding to it:
(0+11)*(10)(11+0)*
Q3.
a) Construct a PDA for accepting L = {a^m b^n c^n | m,n >= 1}.
b) Give formal definition of Pumping Lemma for Regular Language. Prove that the following language is not
regular:
L = {ww^R | w ∈ {a,b}*, |w| >= 1}
Q4.
a) Construct CFG for following:
i. Alternate sequence of 0 and 1 starting with 0. ii. Do not contain 3 consecutive a over {a,b}. iii. L = {x ∈ {0,1}* | x
has equal number of 0's and 1's}
b) Explain applications for FA, PDA, and TM.
Q5.
a) Construct a Moore machine to convert all occurrences of 100 to 101 in a string over {0,1}.
b) Design a TM accepting all palindromes over {0,1}.
Q6.
Write short notes (Solve Any 4):
a) Decision Properties of Regular Languages
b) Post Correspondence Problem
c) Variants of Turing Machine
d) Acceptance by PDA
e) Conversion of Moore to Mealey Machine
Paper Set 3
Here are the questions extracted from the image:
1. Automata and Formal Languages
a) Explain the ways of acceptance by a PDA.
b) Discuss the difference in transition functions of PDA, TM, and FA.
c) Design DFA that accepts Strings that contain "ba" or "ab" as a suffix over Σ = {a,b}.
d) Construct CFG to generate the language: L = {ab^k c^l | k = i + j, i, j >= 1}
2. Finite Automata and Regular Languages
a) Represent RE epsilon for L = {w: w has prefix bab and suffix abb and w is a string over {a,b}}. Design NFA with
epsilon moves for accepting L. Convert it to minimized DFA.
b) Explain Pumping Lemma for regular languages. Prove that given language L = {a^n b^(n+1) | n >= 1} is not a
regular language.
3. Grammars and Pushdown Automata
a) The grammar G is S → aAb | bS | ε, A → aA | bB, B → b | bS | aBB. Derive using Left Most Derivation (LMD) and
Rightmost Derivation (RMD) for the following string "aaabbb". Draw Parse Tree.
b) Give formal definition of Push Down Automata. Design PDA that accepts odd palindromes over {a,b,c}, where
c exists only at the center of every string.
4. Finite Automata and Mealy Machines
a)
i) Design DFA that accepts Strings that are multiples of 4 over Σ = {0,1}.
ii) Design NFA that accepts strings starting with a and ending with a or starting with b and ending in b.
b) Design a Mealy machine to change every occurrence of a with x, b with y and c is kept unchanged. Convert
the same to equivalent Moore machine.
Here are the questions extracted from the image:
5. Grammars and Normal Forms
a) Consider the following CFG. Is it already simplified? Explain your answer. Convert it to CNF form.
S -> ASB | a | bb
A -> aSA | a
B -> SbS | bb
b) Design a TM for converting a binary number to its one's complement.
6. Theory of Computation
Write short notes (Any Four)
a) Chomsky Hierarchy
b) Post Correspondence Problem
c) Arden's Theorem
d) TM-Halting Problem
e) Variants of Turning Machines
Paper Set 4
Here are the questions extracted from the image:
1. Automata and Formal Languages
a) Differentiate between NFA and DFA.
b) Compare and contrast Moore and Mealy machines.
c) Explain variants of Turing Machine.
d) Show that the following grammar is ambiguous:
S -> aSbS | bSaS
2. Finite Automata and Regular Languages
a) Convert the following RE into NFA with ε-moves and hence obtain the DFA:
RE = (0+ ε)* (10) (ε +1)*
b) Consider the following grammar G:
V = {S, X, T}
T = {a, b}
Productions P are: S -> Xa | Xb
X -> Xa | Xb | a
Convert the grammar in Greibach Normal Form.
3. Pushdown Automata
a) Construct PDA accepting the language L = {a^n b^(n+1) | n >= 0} b) Construct TM to check well-formedness
of parenthesis.
4. Finite State Machines
a) Design Mealy machine to recognize r = (0+1)* 00 (0+1)* and then convert it to Moore machine. b) Consider
the following grammar:
S -> iCtS | iCtS | ε
C -> b
For the string "ibtaibta", find the following:
i) Left most derivation
ii) Right most derivation
iii) Parse tree
iv) Check if the above grammar is ambiguous or not.
5. Turing Machines and Regular Languages
a) Design a Turing machine that computes a function f(m,n) = m + n, the addition of two integers.
b) Give the formal definition of pumping lemma for regular language and then prove that the following language
is not regular:
L = {a^n b^(n+1) | n >= 0}
6. Theory of Computation
Write short notes on the following (Any two):
a) Chomsky Hierarchy
b) Decision properties of regular languages
c) Rice's theorem
d) Definition and working of PDA.