Univ.
Roll No:
KIET Group of Institutions
(Department of Computer Applications)
MCA, 2nd Semester
Online PUE, (2020-21) Even Semester
Theory of Automata & Formal Languages (KCA-201)
Duration: 90 Minutes Max. Marks: 100
NOTE:
1. Attempt All Questions.
2. Each question carries +2 marks.
Q. Mark
Question CO BL
No. s
An ……. is any finite set of symbols
A) Alphabet
B) String
1 2 1 1
C) Language
D) Grammar
ANSWER: A
2 2 1 3
A) ababbaaab
B) abababab
C) bbbbbaaab
D) aaabaaab
ANSWER: B
3 2 1 3
A) 1
B) 5
C) 7
D) 8
ANSWER: C
4 If the final states and non-final states in the DFA below are interchanged, 2 1 3
then which of the following languages over the alphabets ∑ ={a,b} will be
accepted by the new DFA?
A. Set of all strings that do not end with ab
B. Set of all strings that begin with either a, or ab
C. Set of all strings that do not contain the substring ab
D. None of these.
ANSWER: A
5 2 1 3
A) Accepts all the strings starting with b
B) Accepts all the strings ending with b
C) Accepts all the strings containing consecutive a.
D) Accepts all the strings containing consecutive b.
ANSWER: B
6 2 1 3
A) abababa
B) aaaaaaa
C) ababab
D) baaa
ANSWER: C
7 2 1 3
A. {w∈{a,b}∗ | every a in w is followed by exactly two b’s}
B. {w∈{a,b}∗ | every a in w is followed by at least two b’s}{w∈{a,b}∗ | every
a in w is followed by at least two b’s}
C. {w∈{a,b}∗ | w contains the substring ‘abb’}{w∈{a,b}∗ | w contains the
substring ‘abb’}
D. {w∈{a,b}∗ | w does not contain ‘aa’ as a substring}
ANSWER: B
The following DFA will accept the giving strings:
8 2 1 3
A) Binary strings divisible by 3
B) Binary strings divisible by 5
C) Binary strings divisible by 3 and 5
D) None of these.
ANSWER: A
The following DFA will accept:
9 2 1 3
A. All strings of length at most 5.
B. All strings of length at least 5.
C. All strings of length exactly 5.
D. All of these
ANSWER: A
10 2 1 3
A) Set of all strings must contains at least four zeros.
B) Set of all strings must contains exactly four zeros.
C) Set of all strings must contains at most four zeros.
D) All of these.
ANSWER: B
11 Given Language L= {xϵ {a, b}*|x contains aba as its substring}. Find the 2 1 3
difference of transitions made in constructing a DFA and an equivalent NFA?
A) 2
B) 3
C) 4
D) Cannot be determined
ANSWER: A
12 2 1 3
A) Begin either with 0 or 1
B) End with 0
C) End with 00
D) Contain the substring 00
ANSWER: C
Minimal deterministic finite automaton for the language L = {0^n | n ≥ 0, n ≠
4} will have:
A) 1 final state among 5 states
13 B) 4 final states among 5 states 2 1 3
C) 1 final state among 6 states
D) 5 final states among 6 states
ANSWER: D
The difference between number of states with expression (a + b) and (a + b) *
is:
A) 1
14 B) 2 2 1 3
C) 3
D) 0
ANSWER: A
The following DFA will accept:
15 2 1 3
A) Binary number divisible by 7
B) Binary number divisible by 6
C) Binary number divisible by 5
D) Binary number divisible by 8
ANSWER: C
Finite automata require minimum _______ number of stacks.
A) 1
B) 0
16 C) 2 2 1 1
D) None of the mentioned
ANSWER: B
17 The applications of finite automata include 2 1 2
A. Compiler
B. Text editors
C. Interpreter
D. All of these
ANSWER: D
How many minimum numbers of states are required in the DFA over the
input alphabet (a,b) accepting all the strings with the number of a’s divisible
by 4 and number of b’s divisible by 5
A) 20
18 2 1 1
B) 9
C) 7
D) 15
ANSWER: A
∑+ is known as
A) Kleene Star
B) Kleene closure
19 2 1 1
C) Positive Closure
D) None of the above
ANSWER: C
Let ∑ ={a,b,c,d} How many substring are there in ∑4
A) 256
B) 4
20 2 1 2
C) 16
D) 64
ANSWER: A
The regular expression for the complement of the language L = {a^nb^m|n ≥
4, m ≤ 3} is:
A) (λ + a + aa + aaa) b* + a* bbbb* + (a + b)* ba(a + b)*
21 B) (λ + a + aa + aaa) b* + a* bbbbb* + (a + b)* ab(a + b)* 2 2 3
C) (λ + a + aa + aaa) + a* bbbbb* + (a + b)* ab(a + b)*
D) (λ + a + aa + aaa)b* + a* bbbbb* + (a + b)* ba(a + b)*
ANSWER: D
The following DFA will accepts all strings:
22 2 2 2
A) Ending with abb
B) Containing abb
C) Starting with abb
D) All of these
ANSWER: A
Which regular expression best describes the language accepted by the non-
deterministic automaton below?
A) (a + b)* a(a + b)b
23 B) (abb)* 2 2 2
C) (a + b)* a(a + b)* b(a + b)*
D) (a + b)*
ANSWER: A
Which two of the following four regular expressions are equivalent? (ε is the empty
string). (i). (00)*(ε+0) (ii). (00)* (iii). 0* (iv). 0(00)*
A) (i) and (ii)
24 B) (ii) and (iii) 2 2 2
C) (i) and (iii)
D) (iii) and (iv)
ANSWER: C
25 Consider the Following regular expressions r1 = 1(0 + 1)*, r2 = 1(1 + 0)+, r3 = 11*0. 2 2 2
What is the relation between the languages generated by the regular expressions
above?
A) L (r1) ⊆ L (r2) and L(r1) ⊆ L(r3)
B) L (r1) ⊇ L (r2) and L(r2) ⊇ L(r3)
C) L (r1) ⊇ L (r2) and L(r2) ⊆ L(r3)
D) L (r1) ⊇ L (r3) and L(r2) ⊆ L(r1)
ANSWER: B
Consider the regular language L = (111 + 11111) *. The minimum number of states
in any DFA accepting these languages is:
A) 3
26 B) 5 2 2 2
C) 8
D) 9
ANSWER: D
Consider the two regular languages: L₁ = (a +b)* a and L₂ = b(a + b)*. The
intersection of L₁ and L₂ is given by
A) (a + b)*ab
27 B) ab(a + b)* 2 2 2
C) a(a + b)*b
D) b(a + b)*a
ANSWER: A
Find the pair of regular expressions that are equivalent
A) (0+1)* and (01)*
B) (0+10)* and (0+10)
28 2 2 2
C) (0+10) and (0+10)
D) (111) and (111+11)
ANSWER: C
Find the regular expression whose fifth symbol from right is 'a' over the input symbol
{a,b}
A) (a+b)*a(a+b)*(a+b)*(a+b)*(a+b)*
29 B) (a+b)a(a+b)(a+b)(a+b)(a+b) 2 2 3
C) Both (a+b)*a(a+b)*(a+b)*(a+b)*(a+b)* and (a+b)a(a+b)(a+b)(a+b)(a+b)
D) None of these
ANSWER: A
For Σ={a,b} the regular expression r = (aa)*(bb)*b denotes
A) Set of strings with 2 a’s and 2 b’s
B) Set of strings with 2 a’s 2 b’s followed by b
30 2 2 3
C) Set of strings with 2 a’s followed by b’s which is a multiple of 3
D) Set of strings with even number of a’s followed by odd number of b’s
ANSWER: D
Given the language L = {ab, aa, baa}, which of the following strings are in
L*?1) abaabaaabaa 2)aaaabaaaa 3)baaaaabaaaab 4)baaaaabaa
A) 1, 2 and 3
31 B) 2, 3 and 4 2 2 3
C) 1, 2 and 4
D) 1, 3 and 4
ANSWER: C
If L is a regular language, then (((L’)r)’)* is:
A) regular
B) non regular
32 C) may be regular 2 2 1
D) none of the mentioned
ANSWER: A
If L is a regular language, then (L’)’ U L will be:
A) L
B) L’
33 C) f 2 2 1
D) none of the mentioned
ANSWER: A
If L1, L2 are regular and op(L1, L2) is also regular, then L1 and L2 are said to be
under an operation op.
A) open
34 B) closed 2 2 1
C) decidable
D) none of the mentioned
ANSWER: B
If P, Q, R are three regular expressions and if P does not contain epsilon, then the
equation R = Q + RP has a unique solution given by
A) R=QP*
35 B) R=PQ 2 2 1
C) R=RP
D) R=QP
ANSWER: A
If we select a string w such that w∈L, and w=xyz. Which of the following portions
cannot be an empty string?
A) x
36 B) y 2 2 1
C) z
D) all of the mentioned
ANSWER: B
Let ∑ = {a, b}, r₁ = a(a + b)* and r₂ = b(a + b)*. Which of the following is true?
A) L(r₁) = L(r₂) = ∑*
B) L(r₁) ∩ L(r₂) = {∈}
37 2 2 2
C) L(r₁) ∪ L(r₂) = ∑*
D) L(r₁) ∪ L(r₂) ∪ {∈} = ∑*
ANSWER: D
Let a and b the regular expressions then (a* + b*)* is not equivalent to
A) (b* + a*)*
B) (a + b)*
38 2 2 2
C) (b + a)*
D) a + b
ANSWER: B
Let L₁ and L₂ are regular sets defined over alphabet ∑*. Mark the false statement
A) L₁ U L₂ is regular
B) L₁ ∩ L₂ is not regular
39 2 2 2
C) ∑* – L₁ is regular
D) L₁* is regular
ANSWER: B
Let r₁=ab* c* and r₂ =(a*b+c)* and r₃ = (a+b+c)*. Then which of the following is
true
A) = ‘ac’ belongs to L(r₂) and L(r₃) but not L(r₁)
40 B) w= ‘ac’ belongs to L(r₃) only 2 2 3
C) w=’ac’ belongs to L(r₁), L(r₂) and L(r₃)
D) w = ‘ac’ belongs to L(r₁) and L(r₃) but not L(r₂)
ANSWER: D
The fol lowing GFG: S → aS|bS|a|b and S → aS|bS|a | b l ∊ is equivalent to regular
expressions
A) (a + b) and ∊ + a + b respectively
41 B) (a + b)(a + b)* and (a + b)* respectively 2 3 3
C) (a + b)(a + b) and (∊ + a + b) (∊ + a + b) respectively
D) None of the above
ANSWER: A
The language {0^n 1^n 2^n | 1 ≤ n ≤ 10^6} is
A) regular
B) context-free but not regular.
42 2 3 3
C) context-free but its complement is not context-free.
D) not context-free
ANSWER: A
A CFG consist of the following elements:
A) a set of terminal symbols
B) a set of non-terminal symbols
43 2 3 1
C) a set of productions
D) all of the mentioned
ANSWER: D
44 A grammar with more than one parse tree is called: 2 3 1
A) Unambiguous
B) Ambiguous
C) Regular
D) None of the mentioned
ANSWER: B
A is context free grammar with at most one nonterminal in the right-hand side of the
production.
A) linear grammar
45 B) linear bounded grammar 2 3 1
C) regular grammar
D) none of the mentioned
ANSWER: A
Every grammar in Chomsky Normal Form is:
A) Regular
B) Context sensitive
46 2 3 1
C) Context free
D) All of the mentioned
ANSWER: C
Given grammar G: 1. S->A 2. S->AAS 3. A->SA 4. A->aa Which of the following
productions denies the format of Chomsky Normal Form?
A) 2,4
47 B) 1,3 2 3 2
C) 1, 2, 3, 4
D) 2, 3, 4
ANSWER: A
If the partial derivation tree contains the root as the starting variable, the form is
known as:
A) Chomsky hierarchy
48 B) Sentential form 2 3 1
C) Root form
D) None of the mentioned
ANSWER: B
The CFG S→ aS|bS|a|b is equivalent to the regular expression 1. (a*+b)* 2. (a+b)⁺ 3.
(a + b)(a + b)* 4. (a + b)*(a + b)
A) 2 and 3 only
49 B) 2,3 and 4 2 3 2
C) All of the above
D) 3 and 4 only
ANSWER: B
The context free languages are closed under:
A) Intersection
B) Complement
50 2 3 1
C) Kleene
D) None of the mentioned
ANSWER: C
The format: A->aB refers to which of the following?
A) Chomsky Normal Form
B) Greibach Normal Form
51 2 3 1
C) Backus Naur Form
D) None of the mentioned
ANSWER: B
The Grammar can be defined as: G=(V, ∑, p, S) In the given definition, what does S
represents?
A) Accepting State
52 B) Starting Variable 2 3 1
C) Sensitive Grammar
D) None of these
ANSWER: B
The production of the form A->B, where A and B are non-terminals is called
A) Null production
B) Unit production
53 C) Greibach Normal Form 2 3 1
D) Chomsky Normal Form
ANSWER: B
54 The pumping lemma is often used to prove that a language is: 2 3 1
A) Context free
B) Not context free
C) Regular
D) None of the mentioned
ANSWER: B
The set {aⁿbⁿ | n =1,2,3,…) can be generated by the CFG
A) S→ab | aSb | ε
B) S→aaSbb | ab
55 2 3 2
C) S→ ab |aSb
D) None of these
ANSWER: C
What the does the given CFG defines? S->aSbS|bSaS| ε and w denotes terminal
A) ww^r
B) wSw
56 2 3 2
C) Equal number of a’s and b’s
D) None of the mentioned
ANSWER: C
Which among the following is the correct option for the given grammar? G->X111|
G1,X->X0|00
A) {0^a 1^b|a=2,b=3}
57 B) {0^a 1^b|a=1,b=5} 2 3 2
C) {0^a 1^b|a=b}
D) More than one of the mentioned is correct
ANSWER: A
Which of the expressions correctly is a requirement of the pumping lemma for the
context free languages?
A) uv^nwx^ny
58 B) uv^nw^nx^ny 2 3 2
C) uv^2n wx^2n y
D) All of the mentioned
ANSWER: B
Which of the following does not have left recursions?
A) Chomsky Normal Form
B) Greibach Normal Form
59 2 3 1
C) Backus Naur Form
D) All of the mentioned
ANSWER: B
Which of the following statements are correct for a concept called inherent ambiguity
in CFL?
A) Every CFG for L is ambiguous
60 B) Every CFG for L is unambiguous 2 3 1
C) Every CFG is also regular
D) None of the mentioned
ANSWER: A
The transition a Push down automaton makes is additionally dependent upon the:
A) Stack
B) Input tape
61 2 4 1
C) Input Symbols
D) All of the mentioned
ANSWER: A
A language accepted by Deterministic Push down automata is closed under which of
the following?
A) Complement
62 B) Union 2 4 1
C) Both (A) and (B)
D) None of the mentioned
ANSWER: A
A DPDA is a PDA in which:
A) No state p has two outgoing transitions
B) More than one state can have two or more outgoing transitions
63 2 4 1
C) At least one state has more than one transitions
D) None of the mentioned
ANSWER: A
64 A PDA machine configuration (p, w, y) can be correctly represented as: 2 4 1
A) (current state, unprocessed input, stack content)
B) (unprocessed input, stack content, current state)
C) (current state, stack content, unprocessed input)
D) none of the mentioned
ANSWER: A
A->aA| a| b The number of steps to form aab:
A) 2
B) 3
65 2 4 2
C) 4
D) 5
ANSWER: B
According to Chomsky hierarchy, which of the following is adopted by Recursively
Enumerable language?
A) Type 0
66 B) Type 1 2 4 1
C) Type 2
D) Type 3
ANSWER: A
B->aB| a| b The number of steps to form ab:
A) 2
B) 3
67 2 4 2
C) 4
D) 5
ANSWER: A
Consider L₁ = {Oⁿ 1ⁿ | n≥ 1}, L₂ = {Oⁿ c1ⁿ|n≥1} (1) L₁ and L₂ are accepted by non-
deterministic PDA. (ii) L₁ and L₂ are accepted by deterministic PDA. (iii) Only L₂ is
accepted by deterministic PDA. Which of the following statements are correct?
A) Only (i)
68 2 4 2
B) (i) and (ii)
C) (i) and (iii)
D) All (i), (ii), (iii)
ANSWER: B
Consider the following grammar: A->ε B->aAbC B->bAbA A->bB The number of
productions added on the removal of the nullable in the given grammar:
A) 3
69 B) 4 2 4 2
C) 2
D) 0
ANSWER: B
Context free grammar is called Type 2 grammar because of hierarchy.
A) Greibach
B) Backus
70 2 4 1
C) Chomsky
D) None of the mentioned
ANSWER: C
Decidable can be taken as a synonym to:
A) recursive
B) non recursive
71 2 4 1
C) recognizable
D) none of the mentioned
ANSWER: A
If the PDA does not stop on an accepting state and the stack is not empty, the string
is:
A) Rejected
72 B) Goes into loop forever 2 4 1
C) Both (A) and (B)
D) None of the mentioned
ANSWER: A
73 If the start symbol is one of those symbols which produce no terminal through any 2 4 1
sequence, the CFL is said to be
A) Nullable
B) Empty
C) Eliminated
D) None of the mentioned
ANSWER: B
Let L = {a^p | p is a prime}. Then which of the following is true? i)It is not accepted
by a Turing Machine ii)It is Type 0 language iii)It is context free but not regular iv)It
is neither regular nor context free, but accepted by a Turing Machine Which of the
following are correct?
74 A) i, ii, iv 2 4 2
B) i, ii, iii
C) ii, iv
D) i, ii, iii, iv
ANSWER: C
The language accepted by Push down Automaton:
A) Recursive Language
B) Context free language
75 2 4 2
C) Linearly Bounded language
D) All of the mentioned
ANSWER: B
Which of the following can be accepted by a DPDA?
A) The set of even length palindrome over {a,b}
B) The set of odd length palindrome over {a,b}
76 2 4 2
C) {xxc| where c stands for the complement, {0,1}}
D) None of the mentioned
ANSWER: D
Which of the following is/are CFL not closed under?
A) Reverse
B) Homomorphism
77 2 4 1
C) Inverse Homomorphism
D) All of the mentioned
ANSWER: D
With reference of a DPDA, which among the following do we perform from the start
state with an empty stack?
A) Process the whole string
78 B) End in final state 2 4 2
C) End with an empty stack
D) All of the mentioned
ANSWER: D
Which of the following are decision properties?
A) Emptiness
B) Infiniteness
79 2 4 1
C) Membership
D) All of the mentioned
ANSWER: D
Production Rule: aAb->agb belongs to which of the following category?
A) Regular Language
B) Context free Language
80 2 4 2
C) Context Sensitive Language
D) Recursively Ennumerable Language
ANSWER: C
A language L is said to be if there is a turing machine M such that L(M)=L and M
halts at every point.
A) Turing acceptable
81 B) Decidable 2 5 1
C) Undecidable
D) None of the mentioned
ANSWER: B
82 A multi-track turing machine can described as a 6-tuple (Q, X, S, d, q0, F) where X 2 5 1
represents:
A) Input alphabet
B) Tape alphabet
C) Shift symbols
D) None of the mentioned
ANSWER: B
A multitap Turing machine is ________ powerful than a single tape Turing machine.
A) more
B) less
83 2 5 1
C) equal
D) none of the mentioned
ANSWER: A
A Turing machine has ____________ number of states in a CPU.
A) finite
B) infinite
84 2 5 1
C) May be finite
D) None of the mentioned
ANSWER: A
A Turing machine with several tapes in known as:
A) Multi-tape Turing machine
B) Universal Turing machine
85 2 5 1
C) Poly-tape Turing machine
D) All of the mentioned
ANSWER: A
An algorithm is called efficient if it runs in time on a serial computer.
A) Polynomial
B) Non polynomial
86 2 5 1
C) Logarithmic
D) None of the mentioned
ANSWER: A
Are Multitape and Multitrack turing machines same?
A) Yes
B) No
87 2 5 2
C) sometimes they are same
D) Cannot tell
ANSWER: A
Halting states are of two types. They are:
A) Accept and Reject
B) Reject and Allow
88 2 5 1
C) Start and Reject
D) None of the mentioned
ANSWER: A
If a problem has an algorithm to answer it, we call it
A) Decidable
B) Solved
89 2 5 1
C) Recognizable
D) None of the mentioned
ANSWER: A
If L is a recursive language, then complement of L is:
A) Recursive
B) Recursively Enumerable
90 2 5 1
C) Both (A) and (B)
D) None of the mentioned
ANSWER: A
In definition of TM T= (Q, Σ, Γ, q0, δ) what Γ represents?
A) Tape alphabets
B) Input symbols
91 2 5 1
C) Transition function
D) Initial state
ANSWER: A
Instantaneous description of a Turing machine can be described using:
A) the input tape contents
B) position of the input head
92 C) direction of storage heads from symbol Z 2 5 1
D) all of the mentioned
ANSWER: D
93 PCP is 2 5 1
A) decidable decision problem
B) undecidable decision problem
C) not a decision problem
D) none of the mentioned
ANSWER: B
PCP stands for?
A) Post Correspondence Problem
B) Post Corresponding Problem
94 2 5 1
C) Pre-Correspondence problem
D) None of the mentioned
ANSWER: A
Statement 1: Multitrack Turing machine. Statement 2: Gamma is Cartesian product
of a finite number of finite sets. Which among the following is the correct option?
A) Statement 1 is the assertion and Statement 2 is the reason
95 B) Statement 1 is the reason and Statement 2 is the assertion 2 5 2
C) Statement 1 and Statement 2 are independent from each other
D) None of the mentioned
ANSWER: A
The ability for a system of instructions to simulate a Turing Machine is called
A) Turing Completeness
B) Simulation
96 2 5 1
C) Turing Halting
D) None of the mentioned
ANSWER: A
Which of the following is true for The Halting problem?
A) It is recursively enumerable
B) It is undecidable
97 2 5 1
C) Both (A) and (B)
D) None of the mentioned
ANSWER: C
The language accepted by a Turing machine is called
A) Recursive Enumerable
B) Recursive
98 2 5 1
C) Both (A) and (B)
D) None of the mentioned
ANSWER: C
Turing machine can be represented using the following tools:
A) Transition graph
B) Transition table
99 2 5 1
C) Queue and Input tape
D) All of the mentioned
ANSWER: D
Universal Turing machine (UTM) influenced the concepts of
A) Computability
B) Interpretive implementation of programming language
100 2 5 1
C) Program and data are in same memory
D) All are correct
ANSWER: D