TAFL BCS402 Question Bank
TAFL BCS402 Question Bank
TAFL BCS402 Question Bank
GREATER NOIDA
QUESTION BANK
BCS-402.1 Analyse and design finite automata, pushdown automata, Turing machines, formal
languages, and grammars
BCS-402.2 Analyse and design, Turing machines, formal languages, and grammars
BCS-402.3 Demonstrate the understanding of key notions, such as algorithm, computability,
decidability, and complexity through problem solving
BCS-402.4 Prove the basic results of the Theory of Computation
BCS-402.5 State and explain the relevance of the Church-Turing thesis
CO1
Q19. Define a FA that accepts set of strings containing exactly four 1’s in every string
over ∑ = {0, 1}.
Q20. Construct DFA equivalent to NFA where transition is defined in the table as
Q21. Convert following NFA to DFA and describe the language it accepts:
Q23. For the below transition diagram of a NFA, Convert it to an equivalent DFA.
Q25. Construct the minimum state automata equivalent to DFA described by the below
figure.
Q26. Define Mealy machine. Convert the following Mealy machine into equivalent Moore
machine:
Q27. Construct DFA accepting each of the following language:-
(a) L = {w є {a, b}* / w has an odd number of a’s or even number of b’s.}
(b) L = {w є {a, b}* / w has neither aa nor bb as substring}
(c) L = {w є {a, b}* / w has both ab and ba as substring}
(d) L = {w : na (w) mod 3> nb (w) mod 3, where na (w) represent no. of a in w and nb (w)
represent no. of b in w}
CO2
Q.1 Write down regular expression corresponding to each of the following language over {0,
1}
a) The language of all strings ending with 1 and don’t contain 00.
b) The language of all strings containing both 11 and 010 as substring.
c) The set of all strings over Σ = {0, 1} without length two.
d) The set of all strings of 0’s and 1’s such that every pair of adjacent 0’s appears before
any pair of adjacent 1’s.
e) {an bm , n ≥ 1, m ≥ 1, nm ≥ 3}
f) {a bn w : n ≥3, w ɛ {a, b}+ }
g) {an : n ≥ 0, n≠ 3}
h) The language of all strings in which every 0 is followed immediately by11.
i) The language of all strings that do not contain substring 110.
j) The language of all strings containing at least two 0’s.
k) The language of all strings that begin or end with 00 or 11.
Q.2 Find the regular expression corresponding to the automaton given in following figure using
Arden’s theorem.
a) b)
Q15. Using Pumping Lemma for Regular language, prove that language L= {yy/ y }
is not regular.
Q16. Prove that L = {aibi | i ≥ 0} is not regular.
CO3
Q1. Define Context Free Grammar with example.
Q2. Define Backus Naur Form.
Q3. Define ambiguity and inherently ambiguous grammar with example.
Q4. Show that the grammar G with following production is ambiguous.
S → a | aAb | abSb, A → aAAb | Bs
Q5. Define Derivation tree or parse tree. Differentiate between Leftmost and Rightmost
Derivation Tree with an example.
Q6. Find the parse tree for the string aabbbbb considering the productions-S→AB| , A→aB,
B→Sb.
Q7. Give the steps of Simplification of Grammar with an example.
Q8. Explain the procedure of Removal of Null Productions in Grammar.
Q9. Describe the process of removal of Unit Production for a Grammar...
Q10. Remove the Unit productions from the following grammar:
a) S→ aSb| A, A→ cAd| cd
b) S→ A/bb, A→ B/b, B→ S/a
Q11. Convert the following CFG into CNF: S → ASA | aB, A → B | S, B → b | ε.
Q12. Define Chomsky Normal Form with example.
Q 13. Define Greibach Normal Form (GNF) with suitable example.
Q14. Explain the classification of Grammar using Chomsky Hierarchy.
Q15. Differentiate between Right Linear and Left Linear grammars.
Q15. What is Left Recursion. Give the steps for removal of Left Recursion.
Q16. Convert the following CFG into GNF: S → aSbA |A, A → Sa | a.
Q17. Why is left recursion not desirable in Grammar. Remove left recursion from the
following
E → E + T| T , T → T * F | F, F → (E) | id
Q18. The following grammar generates the language consisting of all strings of even length:
S →AS | ε, A → aa| ab | ba | bb.
CO4
Q4. Design a non deterministic PDA for accepting the language L = {anbncm | m, n>=1}.
Q5. Distinguish between DPDA & NPDA?
Q6.Design PDA for language: L = {0n1m2m3n | m, n >= 0}.
Q7. Construct a PDA M equivalent to grammar with following productions:
S -> aAA, A-> aS / bS / a
Also, check whether the string ‘abaaaa’ is in M or not.
Q8. Construct the PDA for the language where R stands for
reverse string.
Q9. Describe closure properties of Context Free Language with examples.
A→aS/bS/a
Q21. Construct PDA to accept L={0n1 n/ n>=0}
Q22. Construct PDA from the following CFG.
G= ({S, X}, {a, b}, P, S) where the productions are
S→XS/ ε
X→aXb/Ab/ab
Q27. Define a Pushdown Automata (PDA). Construct a PDA accepting the language of
Palindromes
Q28. . Show that if L is a language of Deterministic PDA and R is regular then LՈR is a
language of DPDA.
Q29. Describe the instantaneous description of a PDA
Q30. Consider the CFG whose productions are as follows:
S->aABB/aAA, A->aBB/a, B->bBB/A. Convert the given grammar to PDA that
accepts the same language by empty stack.
CO5