TAFL Quiz
TAFL Quiz
TAFL Quiz
Demonstrate the understanding of key notions, such as algorithm, computability, decidability, and
CO 3
complexity through problem solving
CO 4 Prove the basic results of the Theory of Computation.
DETAILED SYLLABUS
Unit Topic
Push Down Automata and Properties of Context Free Languages: Nondeterministic Pushdown
Automata (NPDA)- Definition, Moves, A Language Accepted by NPDA, Deterministic Pushdown
IV Automata(DPDA) and Deterministic Context free Languages(DCFL), Pushdown Automata for Context
Free Languages, Context Free grammars for Pushdown Automata, Two stack Pushdown Automata,
Pumping Lemma for CFL, Closure properties of CFL, Decision Problems of CFL,
Programming problems based on the properties of CFLs.
Turing Machines and Recursive Function Theory : Basic Turing Machine Model, Representation
V of Turing Machines, Language Acceptability of Turing Machines, Techniques for Turing Machine
Construction, Modifications of Turing Machine, Turing Machine as Computer of Integer Functions,
Universal Turing machine, Linear Bounded Automata, Church’s Thesis, Recursive and Recursively
Enumerable language, Halting Problem, Post’s Correspondance
Problem, Introduction to Recursive Function Theory.
0 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
2. Unit-2 …………………………………………………………………………...…….8
3. Unit-3…………………………………………………………………………...…... 17
4. Unit-4…………………………………………………………………………..…….24
5. Unit-5………………………………………………………………………......…….30
1 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
Unit-1
a) ϕ
b) Σ*− {x|x ∈ Σ∗ and |x| > 0}
c) Σ* − {0, 1}
d) {0, 1} A. All binary strings of even length.
B. All binary strings with odd difference
2 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
4 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
5 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
6 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
Answer Key
Unit-1
Question No. Answer Question No. Answer Question No. Answer
1 a 16 c 31 d
2 b 17 a 32 d
3 b 18 d 33 b
4 c 19 a 34 d
5 b 20 c 35 d
6 c 21 c 36 d
7 c 22 a 37 a
8 c 23 d 38 b
9 d 24 c 39 a
10 a 25 b 40 b
11 e 26 a 41 a
12 d 27 b 42 c
13 a 28 c 42 d
14 d 29 b 44 b
15 a, c 30 b 45 c
7 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
Unit-II
1. L = {ε, a,,aa,aaa,…..} is represented by__ 6. The minimum number of states required
a) a* in a DFA (along with a dumping state) to
b) a+ check whether the 3rd bit is 1 or not for
c) Both a & b |n|>=3 over (0,1)
d) ∑* a) 3
2. ε-closure of a state is combination of self- b) 4
state and ___ c) 5
e) initial state d) 1
f) ε-reachable state 7. While applying Pumping lemma over a
g) final state regular language, we consider a string w
h) All that belong to L and fragment it into
_________ parts.
3. RR* can be expressed in which of the a) 2
forms: b) 5
a) R+ c) 3
b) R- d) 6
c) R+ U R- 8. While applying the concept of Pumping
d) R lemma, If we select a string w such that
4. The regular expression denote a language w∈L, and w=xyz. Which of the following
comprising all possible strings of even portions cannot be an empty string?
length over the alphabet (0, 1) a) x
a) 1+ 0(1+0)* b) y
b) (0+1) (1+0)* c) z
c) (00+01+11+10)* d) all of the mentioned
d) (1+0) 9. P, O, R be regular expression over ∑, P is
5. Given the language L = {ab, aa, baa}, not ε, then R=Q + RP has a unique
which of the following strings are in L*? solution:
{1: abaabaaabaa, 2: aaaabaaaa, 3: a) Q*P
baaaaabaaaab, 4: baaaaabaa} b) QP*
a) 1, 2 and 3 c) Q*P*
b) 2, 3 and 4 d) (P*O*) *
c) 1, 2 and 4 10. Arden’s theorem is true for:
d) 1, 3 and 4 a) More than one initial states
b) Null transitions
8 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
9 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
10 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
a) 4
b) 5
c) 6
d) Can not construct a DFA for L
11 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
12 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
13 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
A = { an bm I n, m > 0}.
B = { an bm I n ≥m ≥0}
C = {an bm I n= m ≥ 0}
D = { an bm I n ≥ m ≤ 100}.
a) 1
Which of the above are not regular?
b) 2
c) 3
d) 4
a) Only Band D.
b) Only C.
c) Only B and C. 53. Which of the following languages are
d) All of them. regular?
51. Which of the following statements are true?
A = { x I x has two O's separated by the
1. Union of two non-regular languages is non- number of positions that is a multiple of 4. }
regular. B = { x I x is binary representation of multiple
of 3}
14 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
C = ( x I x is a binary string and decimal of any 56. Consider the following language,
prefix of x is not of form 3m + 2, where m ≥
L = {w ∈ {0, 1}* ∣ w is palindrome }
0}
Which of the following grammar generates the
a) Only B and C. above language.
b) Only B. a) S → 0S0 ∣ 1S1 ∣ ϵ
c) A, B and C. b) S → 0S0S ∣ 1S1S ∣ ϵ
d) Only A c) S → 0S0 ∣ 1S1 ∣ 0 ∣ 1
d) S → 0S0 ∣ 1S1 ∣ 0 ∣ 1 ∣ ϵ
S → aSaS ∣ ϵ
Which of the following is true?
a) G is ambiguous and L(G) is regular.
b) G is unambiguous L(G) is regular.
c) L(G) is CFL but not regular.
d) None of Above
15 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
Answer Key
Unit-2
Question Answer Question Answer Question Answer Question Answer
No. No. No. No.
1 a 16 c 31 c 46 a, b
2 b 17 a 32 b 47 c
3 a 18 d 33 b 48 a, b
4 c 19 b 34 b 49 a,d
5 c 20 c 35 c 50 c
6 c 21 c 36 c 51 d
7 c 22 a 37 a 52 d
8 b 23 b 38 a 53 c
9 b 24 b 39 a 54 d
10 c 25 b 40 a 55 c
11 a 26 d 41 c 56 d
12 a 27 d 42 a 57 a
13 a 28 d 43 a 58 c
14 c 29 a 44 b 59 b
15 a 30 b 45 d 60 b
16 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
Unit-III
17 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
18 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
19 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
S -> AB | BA | A | B
A -> aAa | aAb | bAa | bAb | a 34. Consider the following language,
B -> aBa | aBb | bBa | bBb | b
L = (an bn | n≥ 0).
a) {w I w ∈ {a,b}+}
If Lk represents the language L · L · · · L (k
b) { w | w is of form xxr or w is an odd
times L), where · is the concatenation
length string, where x ∈ { a, b}+ and xr
operation. Then which of the following
represents reverse of string x }
statements are true?
c) {w | w is not of form xx, where x ∈ {a,
b}+ } a) L2 is a CFL.
d) { w | w is a palindrome} b) Lk is a CFL.
c) L* is a CFL.
32. Which of the following statements are d) All of above
true? 35. Which of the following are CFLs?
a) Union of a regular language and a
CFL, is CFL.
b) Intersection of a regular language and a) Only A
20 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
37. Which of the following statements are b) A context free language is also a
true? regular language
a) CFLs are closed under union. c) A context free language is also
b) CFLs are closed under concatenation. recursive enumerable language
c) CFLs are closed under * (Kleene d) Both (a) and (b)
operation). 42. A context free language is called
d) All of above ambiguous if
21 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
22 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
Answer Key
Unit-3
Question Answer Question No. Answer Question Answer Question Answer
No. No. No.
1 c 16 c 31 c 46 a
2 c 17 b 32 d 47 a
3 d 18 c 33 c 48 d
4 d 19 b 34 d 49 b
5 a 20 b 35 d 50 c
6 a 21 d 36 d
7 b 22 a 37 d
8 d 23 c 38 c
9 b 24 d 39 b
10 b 25 a 40 a
11 d 26 d 41 b
12 b 27 a 42 c
13 b 28 c 43 d
14 a 29 b 44 d
15 a 30 b 45 d
23 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
Unit-IV
1. PDA is more powerful than 6. The push down automata indicate the
a) Turing machine acceptance of input string in terms of
b) Finite automata a) Finial state
c) CFG b) Empty store
d) None of these c) Both (a) and (b)
2. Which operation can be applied on stack d) None of these
in PDA? 7. Which type of symbols contain in the
a) PUSH stack of PDA
b) POP a) Variable
c) No operation b) Terminal
d) All of these c) Both (a) and (b)
3. PDA can be represented with the help of d) None of these
a) Instantaneous description 8. The instantaneous description is PDA
b) Transition diagram shows
c) Transition table a) Present state
d) All of these b) Stack symbol
4. Which of the following statement is false? c) String to be processed
a) Let L is a language accepted by a PDA d) All of these
P then there exist a CFG G L such that 9. The symbol Z0 in formal definition of
L(G) =N(P) PDA is used for
b) If L is a CFL then there exists a push a) Stack symbol
down automata P accepting CFL L b) Input symbol
by empty stack i.e. L = N(P) c) Both (a) and (b)
c) If L is a language accepted by PDA A d) None of these
by final state there exist a PDA B that 10. A PDA chooses the next move based on
accepts L by empty stack such that L a) Current state
=L(A) = N(B) b) Next input symbol
d) All of these c) Both (a) and (b)
5. A push down automata is different than d) None of these
finite automata by 11. Pumping lemma for context free grammar
a) Its memory (stack) is used for
b) Number of states a) Proving certain languages are
c) Both (a) and (b) not context free
d) None of these b) Proving language is infinite
24 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
14. Context free grammar is closed under 19. The CYK algorithm constructs table from
16. The CYK algorithm start with a) (current state, unprocessed input, stack
content)
25 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
26 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
d) None
32. What is the language accepted by the c) (A* U B*)* is a CFL but not a regular
following PDA? language.
d) A · B is a CFL but not regular.
34. Consider the following languages A and B, a) An NFA has an equivalent DFA.
which of the following statement are true d) NPDAs are more powerful that
b) A* U B* is a regular language.
27 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
41. Consider the following grammar, 44. Match the following grammars to the
28 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
a) (1,d)(2,a)(3,d)(4,c)
b) (1,b)(2,d)(3,c)(4,a)
c) (1,b)(2,c)(3,a)(4,d)
d) (1,d)(2,c)(3,a)(4,b)
Answer Key
Unit-4
Question No. Answer Question No. Answer Question Answer
No.
1 b 16 a 31 c
2 d 17 c 32 d
3 d 18 a 33 d
4 d 19 a 34 d
5 a 20 a 35 c
6 c 21 a 36 c
7 c 22 a 37 a, d
8 d 23 a 38 a
9 a 24 a 39 c
10 c 25 b 40 a,b
11 a 26 a 41 a,d
12 c 27 c 42 a,b
13 d 28 c 43 c,d
14 c 29 c 44 b
15 a 30 c
29 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
Unit-V
1. Turing machine was invented by: c) Offline turing machine
a) Alan Turing d) Both (a) and (b)
b) Turing man 7. Which of the following statement is
c) Turing taring worng?
d) None of these a) Turing machine is a simple
2. Turing machine is more powerful than: mathematical model of
30 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
11. A turing machine that is able to 17. Which of the following are the models
simulate other turing machines: equivalent to Turing machine?
a) Nested Turing machines a) Multi tape turing machine
b) Universal Turing machine b) Multi track turing machine
c) Counter machine c) Register machine
d) None of the mentioned d) All of the mentioned
12. Which of the problems are unsolvable? 18. Which among the following is incorrect
a) Halting problem for o-machines?
b) Boolean Satisfiability problem a) Oracle Turing machines
c) Both (a) and (b) b) Can be used to study decision
d) None of the mentioned problems
13. Which of the following a turing c) Visualizes Turing machine with a
machine does not consist of? black box which is able to decide
a) input tape cerain decion problems in one
b) head operation
c) state register d) None of the mentioned
d) none of the mentioned 19. RASP stands for:
14. The value of n if turing machine is a) Random access storage program
defined using n-tuples: b) Random access stored program
a) 6 c) Randomly accessed stored program
b) 7 d) Random access storage
c) 8 programming
d) 5 20. State true or false:
15. If d is not defined on the current state Statement: RASP is to RAM like UTM
and the current tape symbol, then the is to turing machine.
machine ______ a) true
a) does not halts b) false
b) halts 21. State true or false:
c) goes into loop forever Statement: We can use the finite
d) none of the mentionedTBD control of turing machine to hold a
16. Statement: Instantaneous descriptions finite amount of data
can be designed for a Turing machine. a) False
State true or false: b) True
a) true c) May True
b) false d) May False
31 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
32 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
31. Halting non-deterministic Turing machine 33. Let L be a language over ∑ Define the
(TM) is one which halts on all following operations:
computation paths. Let GM,X denote the Permute(L) = (w I w is a permutation of a
configuration graph of a nondeterministic string x ∈ L}
Turing machine M with respect to a string Halfswap(L) = {w I w = xy where |x|= |Y |
x. Which of the following statements are and yx ∈ L)
true? Which one of the following statements is
a) Every node has in-degree at most one true?
in GM,X if Mis a halting TM.
a) Decidable languages are not closed
b) M is a non-halting TM if there exists a
under Permute and Half swap
pair of two nodes in GM,X which are
b) Decidable languages are closed under
reachable from the starting
Permute but not under Half swap
configuration and are also reachable
c) Decidable languages are closed under
from each other.
Hal/swap but not under Permute
c) There exists at least one node with in-
d) Decidable languages are closed under
degree more than one in GM,X if M is a
both Permute and Hal/swap
non-halting TM.
d) Every node has in-degree exactly one
in GM,X if M is a non-hatting TM. 34. Let L1 be a decidable language and L2 be a
Turing recognizable but not decidable
language. Which of the following
32. Which of the following statements are
statements are true?
true?
a) L2 \ L1 is a Turing recognizable
a) Regular languages are a subset of the
language.
set of languages accepted by TMs
b) L1 ∩ L2 is a decidable language.
which do not write anything on the
c) L1 ∩ L2 is a Turing recognizable
tape.
language.
b) Every decidable language can be
d) L1 \ L2 is a decidable language.
accepted by a DFA with a priority
queue.
c) For every TM M there exists another 35. Consider the following statements:
M' which doesn't write the blank S1 = For every decidable language L over ∑
symbol such that L(M) = L(M'). there exists a single tape deterministic halting
d) All of above TM M with T = ( Ц) U ∑ and at most 10 states,
where T is the tape alphabet of M, such that L =
L(M).
33 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
36. Let M be a deterministic halting TM and x 38. Let MI and Mi be two context-free but
be an input. Which of the following non-regular languages. Which of the
statements are true? following statements are correct?
a) Every configuration of M with respect a) M1 ∩ M2 is decidable.
to x goes to another configuration. b) M1 ∩ M2 is not necessarily decidable.
b) No configuration of M with respect to x c) M1 \ M2 is recognizable.
can go to the starting configuration. d) M1 \ M2 is not necessarily
c) There can be more than two recognizable.
configurations of M with respect to x
which do not go to another
39. An alternate TM is a deterministic Turing
configuration.
machine which cannot make two
d) There are exactly two configurations of
successive left moves or two successive
M with respect to x which do not go to
right moves of the head. Which of the
another configuration.
following is correct? An alternate TM is a
deterministic Turing machine which
37. A Turing machine's description can be cannot make two successive left moves or
encoded as a binary string. Let ( M) denote two successive right moves of the head.
the description of a TM M in the binary Which of the following is correct?
form. Consider the following languages: a) Atternate TM accepts all and only
L1 = ( (M) I M's head doesn't move beyond the regular languages.
100th cell on the tape on any input.) b) Atternate TM accepts all and only
L2 = ( (M) I L(M) is non-empty.} DCFLs.
34 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
35 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
36 University Academy
THEORY OF AUTOMATA AND FORMAL LANGUAGES (KCS-402) 2020-21
Answer Key
Unit-5
Question Answer Question Answer Question Answer Question Answer
No. No. No. No.
1 a 16 a 31 b 46 c
2 b 17 d 32 d 47 c
3 d 18 d 33 d 48 a
4 d 19 b 34 a 49 d
5 d 20 a 35 c 50 d
6 d 21 b 36 d
7 d 22 a 37 a
8 a 23 b 38 a, c
9 c 24 b 39 d
10 b 25 a 40 a
11 b 26 a 41 a
12 c 27 a 42 a
13 d 28 b 43 d
14 b 29 a 44 b
15 b 30 a 45 c
37 University Academy