Download as pdf or txt
Download as pdf or txt
You are on page 1of 1103

TOC Unit I MCQ

1.Number of states of FSM required to simulate behaviour of a computer with a memory capable of
storing “m” words, each of length ‘n’
a.m x 2^n
b.2^mn
c.2^(m+n)
d.All of the mentioned
Answer: (b). 2^mn

2.An FSM with


a.M can be transformed to Numeral relabeling its states
b.M can be transformed to N, merely relabeling its edges
c.Both of the mentioned
d.None of the mentioned
Answer: (c).Both of the mentioned

3.The transitional function of a DFA is


a.Q X Σ→Q
b.Q X Σ→2Q
c.Q X Σ→2n
d.Q X Σ→Qn
Answer: (a).Q X Σ→Q

4.The transitional function of a NFA is


a.Q X Σ→Q
b.Q X Σ→2Q
c.Q X Σ→2n
d.Q X Σ→Qn
Answer: (b).Q X Σ→2Q

5.Maximum number of states of a DFA converted from a NFA with n states is


a.n
b.n^2
c.2n
d.None of these
Answer: (c).2n

6.Basic limitations of finite state machine is


a.It cannot remember arbitrarily large amount of information
b.It cannot remember state transitions
c.It cannot remember grammar for a language
d.It cannot remember language generated from a grammar

Answer: (b). It cannot remember state transitions

7.A finite automata recognizes


a.Any Language
b.Context Sensitive Language
c.Context Free Language
d.Regular Language
Answer: (d). Regular Language

8.Which is true for Moore Machine?


a.Output depends on present state
b.Output depends on present input
c.Output depends on present state and present input
d.Output depends on present state and past input
Answer: (a). Output depends on present state

9.Which is true for Mealy Machine?


a.Output depends on present state
b.Output depends on present input
c.Output depends on present state and present input
d.Output depends on present state and past input
Answer: (c).Output depends on present state and present input

10.Which is true for in accessible state?


a.It cannot be reached anytime
b.There is no necessity of the state
c.If control enters no way to come out from the state
d.If control enters FA deads
Answer: (a).It cannot be reached anytime

11.In Moore Machine O/P is associated with


a.Present state
b.Next state
c.Input
d.None of the above
Answer: (a).Present state

12.The regular languages are not closed under


a.Concatenation
b.Union
c.Kleene star
d.Complement
Answer: (d).Complement

13.NFAs are ___ DFAs.


a.Larger than
b.More expressive than
c.Less expressive than
d.Equally expressive as
Answer: (a).Larger than

14.Conversion of a DFA to an NFA


a.Is impossible
b.Requires the subset construction
c.Is Chancy
d.Is nondeterministic
Answer: (b).Requires the subset construction

15.The subset construction shows that every NFA accepts a


a.String
b.Function
c.Regular language
d.Context-free language
Answer: (c).Regular language

16.Can a DFA simulate NDFA


a.No
b.Yes
c.Sometimes
d.Depends on NDFA
Answer: (b).Yes

17.Find the wrong statement?


a.The language accepted by finite automata are the languages denoted by regular expression
b.Every DFA has a regular expression denoting its language
c.For a regular expression r, there does not exist NFA with L(r) any transit that accept
d.None of these
Answer: (c).For a regular expression r, there does not exist NFA with L(r) any transit that accept

18.The relation between NFA-accepted languages and DFA accepted languages is


a.>
b.<
c.=
d.<=

Answer: (c).=

19.The lexical analysis for a modern language such as Java needs the power of which one of the
following machine models in a necessary and sufficient sense?
a.Finite state automata
b.Deterministic pushdown automata
c.Non-deterministic pushdown automata
d.Turing machine
Answer: (a).Finite state automata

20.The classes of languages P and NP are closed under certain operations, and not closed under
others. Decide whether P and NP are closed under each of the following operations.
1. Union
2. Intersection
3. Intersection with a regular language
4. Kleene closure (star)
5. Homomorphism
6. Inverse homomorphism
a.P is not closed under union
b.NP is not closed under intersection
c.None of the mentioned
d.Both of the mentioned
Answer: (d).Both of the mentioned

21.The reorganizing capability of NDFA and DFA


a.May be different
b.Must be different
c.Must be same
d.None of the above
Answer: (c).Must be same
TOC Unit II MCQ

1.Which of the following pairs of regular expressions are equivalent?


a.1(01)* and (10)*1
b.x (xx)* and (xx)*x
c.x^+ and x^+ x^(*+)
d.All of the mentioned
Answer: (d).All of the mentioned

2.Which of the following are not regular?


a.String of )’s which has length that is a perfect square
b.Palindromes Consisting of 0’s 1’s
c.String of 0’s whose length is a prime number
d.All of the mentioned
Answer: (d).All of the mentioned

3.Regular expression (x/y)(x/y) denotes the set


a.{xy,xy}
b.{xx,xy,yx,yy}
c.{x,y}
d.{x,y,xy}
Answer: (b).{xx,xy,yx,yy}

4.Regular expression x/y denotes the set


a.{x,y}
b.{xy}
c.{x}
d.{y}
Answer: (a). {x,y}

5.The regular expressions denote zero or more instances of an x or y is


a.(x+y)
b.(x+y)*
c.(x* + y)
d.(xy)*

Answer: (b).(x+y)*

6.The regular expression denote a language comprising all possible strings of even length over the
alphabet (0, 1)
a.1 + 0(1+0)*
b.(0+1) (1+0)*
c.(1+0)
d.(00+0111+10)*

Answer: (d).(00+0111+10)*

7.The RE gives none or many instances of an x or y is


a.(x+y)
b.(x+y)*
c.(x* + y)
d.(xy)*
Answer: (b).(x+y)*

8.The RE in which any number of 0′s is followed by any number of 1′s followed by any number of 2′s is
a.(0+1+2)*
b.0*1*2*
c.0* + 1 + 2
d.(0+1)*2*
Answer: (b). 0*1*2*

9.Which of the following pairs of regular expression are equivalent?


a.1(01)* and (10)*1
b.X(xx)* and (xx)*x
c.None of the mentioned
d.Both of the mentioned
Answer: (d).Both of the mentioned

10.Which of the following identity is true?


a.Ɛ +RR* = R* = ɛ + R*R
b.(R1R2)*R1 = R1 (R2R1)*
c.R*R* = R*
d.All of the mentioned
Answer: (d).All of the mentioned

11.The set of all strings over ∑ ={a,b} in which a single a is followed by any number of b’s a single b
followed by any number of a’s is
a.ab* + ba*
b.ab*ba*
c.a*b + b*a
d.None of the mentioned
Answer: (a). ab* + ba*

12.The set of all strings over ∑ = {a,b} in which strings consisting a’s and b’s and ending with in bb is
a.ab
b.a*bbb
c.(a+b)* bb
d.All of the mentioned
Answer: (c). (a+b)* bb

13. If P, Q, R are three regular expressions and if P does not contain a then the equation R = R + RP has
a unique solution given by
a.R = QP*
b.R = P*Q
c.R = RP
d.None of the mentioned
Answer: (a).R = QP*

14.Which of the following is true ?


a.(01)*0 = 0(10)*
b.(0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*
c.(0+1)*01(0+1)*+1*0* = (0+1)*
d.All of the mentioned
Answer: (d).All of the mentioned

15.Let the class of language accepted by finite state machine be L1 and the class of languages
represented by regular expressions be L2 then
a.L1=L2
b.L1 U L2 = .*
c.L1=L2
d.None of the above
Answer: (c). L1=L2

16.Which of the following is not a regular expression?


a.[(a+b)*-(aa+bb)]*
b.[(0+1)-(0b+a1)*(a+b)]*
c.(01+11+10)*
d.(1+2+0)*(1+2)*
Answer: (b).[(0+1)-(0b+a1)*(a+b)]*
17.According to the given language, which among the following expressions does it corresponds to?
Language L={xϵ{0,1}|x is of length 4 or less}
a.(0+1+0+1+0+1+0+1)^4
b.(0+1)^4
c.(01)^4
d.(0+1+ε)^4
Answer: (d). (0+1+ε)^4

18.Which among the following looks similar to the given expression?


((0+1). (0+1)) *
a.{xϵ {0,1} *|x is all binary number with even length}
b.{xϵ {0,1} |x is all binary number with even length}
c.{xϵ {0,1} *|x is all binary number with odd length}
d.{xϵ {0,1} |x is all binary number with odd length}
Answer: (a). {xϵ {0,1} *|x is all binary number with even length}

19.A finite automaton accepts which type of language:


a.Type 0
b.Type 1
c.Type 2
d.Type 3

Answer: (d). Type 3

20. Simplify the following regular expression:


ε+1*(011) *(1*(011) *) *
a.(1+011) *
b.(1*(011) *)
c.(1+(011) *) *
d.(1011) *
Answer: (a). (1+011) *
TOC unit III MCQ

1. Grammars that can be translated to DFAs:


a.Left linear grammar
b.Right linear grammar
c.Generic grammar
d.All of these
Answer: (b).Right linear grammar

2. The language accepted by a Push down Automata:


a.Type0
b.Type1
c.Type2
d.Type3
Answer: (c).Type2

3.Recursive Descent Parsers are a type of:


a.LL parsers
b.LR parsers
c.LALR parsers
d.SLR parsers
Answer: (a).LL parsers

4. If language L={0,1}*, then the reversed language L^R =


a.{0,1}*
b.{}
c. {0}*
d.{1}*
Answer: (a).{0,1}*

5. Consider the following two languages:

L1 = {x ∣ for some y with ∣y∣ = 2^∣x∣,xy ∈ L and L is regular language}


L2 = {x ∣ for some y such that ∣x∣ = ∣y∣, xy ∈ L and L is regular language}

Which one of the following is correct?


a.Only L1 is regular language
b.Only L2 is regular language
c.Both L1 and L2 are regular languages
d.Both L1 and L2 are not regular languages
Answer: (c).Both L1 and L2 are regular languages
6. Consider R to be any regular language and L1, L2 be any two context-free languages. Which of the
following is correct?
a.L1’ is context free
b.(L1 ∪ L2)’ – R is context free
c.L1 ∩ L2 is context free
d.L1 – R is context free
Answer: (d).L1 – R is context free

7. Consider the following problems:

(i) Whether a finite state automaton halts on all inputs?


(ii) Whether a given context free language is regular?
(iii) Whether a Turing machine computes the product of two numbers?

Which one of the following is correct?


a.Only (i) and (iii) are undecidable problems
b.Only (ii) and (iii) are undecidable problems
c.Only (i) and (ii) are undecidable problems
d.(i), (ii) and (iii) are undecidable problems
Answer: (b). Only (ii) and (iii) are undecidable problems

8. Which of the following problems is decidable for recursive languages (L)?


a.Is L = ϕ?
b.Is w ∈ L, where w is a string?
c.Is L = Σ*?
d.Is L = R, where R is a given regular set?
Answer: (b). Is w ∈ L, where w is a string?

9. Consider the following grammar G:

S→A∣B
A→a∣c
B→b∣c
where {S, A, B} is the set of non-terminals, {a, b, c,} is the set of terminals.

Which of the following statement(s) is/are correct?


S1: LR(1) can parse all strings that are generated using grammar G.
S2: LL(1) can parse all strings that are generated using grammar G.

a.Only S1
b.Only S2
c.Both S1 and S2
d.Neither S1 nor S2
Answer: (d). Neither S1 nor S2

10. The grammar S → (S) ∣ SS ∣ ϵ is not suitable for predictive parsing because the grammar is
a.Right recursive
b.Left recursive
c.Ambiguous
d.An operator grammar
Answer: (c). Ambiguous

11. To obtain a string of n Terminals from a given Chomsky normal form grammar, the number of
productions to be used is:
a.2n−1
b.2n
c.n+1
d.n^2

Answer: (a).2n−1

12. Consider the following two Grammars:

G1 : S → SbS | a
G2 : S → aB | ab, A→GAB | a, B→ABb | b

Which of the following option is correct?


a.Only G1 is ambiguous
b.Only G2 is ambiguous
c.Both G1 and G2 are ambiguous
d.Both G1 and G2 are not ambiguous
Answer: (c). Both G1 and G2 are ambiguous

13.The set A={ 0^n 1^n 2^n | n=1, 2, 3, ......... } is an example of a grammar that is:
a.Context sensitive
b.Context free
c.Regular
d.None of the above
Answer: (a). Context sensitive

14. A bottom-up parser generates:


a.Left-most derivation in reverse
b.Right-most derivation in reverse
c.Left-most derivation
d.Right-most derivation
Answer: (b). Right-most derivation in reverse

15.Consider the following statements:

S1 : There exists no algorithm for deciding if any two Turing machines M1 and M2 accept the same
language.
S2 : The problem of determining whether a Turing machine halts on any input is undecidable.

Which of the following options is correct?


a. Both S1 and S2 are correct
b. Both S1 and S2 are not correct
c. Only S1 is correct
d. Only S2 is correct
Answer: (a). Both S1 and S2 are correct

16.Which of the following statements is/ are TRUE?

(a) The grammar S → SS a is ambiguous. (Where S is the start symbol)


(b) The grammar S → 0S1 | 01S | ϵ is ambiguous. (The special symbol ϵ represents the empty string)
(Where S is the start symbol)
(c) The grammar (Where S is the start symbol)
S → T/U
T → x S y | xy | ϵ
U → yT
generates a language consisting of the string yxxyy.
a.Only (a) and (b) are TRUE.
b.Only (a) and (c) are TRUE.
c.Only (b) and (c) are TRUE.
d.All of (a), (b) and (c) are TRUE.
Answer: (d). All of (a), (b) and (c) are TRUE.

17. Pumping lemma for regular language is generally used for proving:
a.whether two given regular expressions are equivalent
b.a given grammar is ambiguous
c.a given grammar is regular
d.a given grammar is not regular
Answer: (a). whether two given regular expressions are equivalent
18.Which of the following problems is undecidable?
a.To determine if two finite automata are equivalent
b.Membership problem for context free grammar
c.Finiteness problem for finite automata
d.Ambiguity problem for context free grammar
Answer: (d). Ambiguity problem for context free grammar

19.The language L = {a^i b c^i | i ≥ 0} over the alphabet {a, b, c} is:


a.a regular language.
b.not a deterministic context free language but a context free language.
c.recursive and is a deterministic context free language.
d.not recursive.
Answer: (c). recursive and is a deterministic context free language.

20.Context free grammar is not closed under :


a.Concatenation
b.Complementation
c.Kleene Star
d.Union
Answer: (b).Complementation

21. Consider the following languages :

L1 = {a^m b^n | m ≠ n}
L2 = {a^m b^n | m = 2n+1}
L3 = {a^m b^n | m ≠ 2n}

Which one of the following statement is correct?


a.Only L1 and L2 are context free languages
b.Only L1 and L3 are context free languages
c.Only L2 and L3 are context free languages
d.L1, L2 and L3 are context free languages
Answer: (d). L1, L2 and L3 are context free languages
1:

Correct hierarchical relationship among context- free, right-linear, and context-sensitive language
is

A.context-free ⊂ right-linear ⊂ context-sensitive

B. context-free ⊂ context-sensitive ⊂ right-linear

C. context-sensitive ⊂ right-inear ⊂context-free

D.right-linear ⊂context-free ⊂context-sensitive

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

2:

In the following grammar :

x::=x ⊕y| 4
y::=z*yI2
z : : = id

which of the folowing is true ?

A.⊕ is left associative while * is right associative

B. Both ⊕ and * are left associative

C. ⊕ is right associative while * is left associative

D.None of these

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

3:

Which of the following CFG's can't be simulated by an FSM ?

A.S --> Sa | b

B. S --> aSb | ab

C. S --> abX, X --> cY, Y --> d | aX


D.None of these

Answer Report Discuss

Option: B

Explanation :

Option (b) generates the set {an bn ,n=1,2,3 ....}which is not regular ,Option (a) is left linear
where as option (C) is right linear .

Click on Discuss to view users comments.

4:

ADG is said to be in Chomsky Form (CNF), if all the productions are of the form A --> BC or
A --> a. Let G be a CFG in CNF. To derive a string of terminals of length x , the number of
productions to be used is

A.2x - 1

B. 2x

C. 2x + I

D.None of these

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

5:

Which of the following statements is correct?

A.A = { If an bn | n = 0,1, 2, 3 ..} is regular language

B. Set B of all strings of equal number of a's and b's deines a regular language

C. L (A* B*)∩ B gives the set A

D.None of these

Answer Report Discuss

Option: C

Explanation :

If we include A and B in a set and if we write A* it means except then A i.e. B same
as B* means except then B i.e.A so if we intersect (A*B*) and B then get A because in any
regular language

if we write A-B then A-B=A intersection B' so if we intersect A and B means A-B So
intersection of (A*B*) and B = (BA) intersection B means (BA)-B' and B'=A so (BA)
intersection(A)=A

So ans is (C)

Click on Discuss to view users comments.

6:

P, Q, R are three languages, if P and R are regular and if PQ = R, then

A.Q has to be regular

B. Q cannot be regular

C. Q need not be regular

D.Q cannot be a CFL

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

7:

A class of language that is closed under

A.union and complementation has to be closed under intersection

B. intersection and complement has to be closed under union

C. union and intersection has to be closed under complementation

D.both (A) and (B)

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

8:

The productions
E—>E+E
E—>E—E
E-->E*E
E —> E / E
E —> id

A.generate an inherently ambiguous language

B. generate an ambiguous language but not inherently so


C. are unambiguous

D.can generate all possible fixed length valid computation for carrying out addition, subtraction,
multipication and division, which can be expressed in one expression

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

9:

Which of the folowing definitions below generates the same language as L, where
L = {xn yn such that n > = 1} ?

I. E —> xEy | xy

II. xy | (x+ xyy+)

III .x+y+

A.I only

B. I and II

C. II and III

D.II only

Answer Report Discuss

Option: A

Explanation :
II generates strings like xxyyy, which are not supposed to be.

III generates strings like xyy, which are not supposed to be.
I can be verified to generate all the strings in L and only those.

Click on Discuss to view users comments.

10:

Following context free grammar


S —> aB | bA
A —>b | aS | bAA
B —> b | bS | aBB
generates strings of terminals that have

A.equal number of a's and b's

B. odd number of a's and odd number b's


C. even number of a's and even number of b's

D.odd number of a's and even number of a's

Answer Report Discuss

Option: A

Explanation :
S �> aB �> aaBB-->aabB �> aabb
So (b) is wrong. We have
S --> a B �> a b So (c) is wrong.
A careful observation of the productions will
reveal a similarity. Change A to B, B to A, a to b
and b to a. The new set of productions will be
the same as the original set. So (d) is false and
(a) is the correct answer.

Click on Discuss to view users comments.

11:

Define for the context free language


L< {0;1} init (L) = { u | u v ε L for some v in {0, 1}}

If L { w | w is nonempty and has an equal number of 0's and 1's}, then init (L) is set of all binary
strings

A.with unequal numbers of 0's and 1's.

B. including the null string.

C. Both (a) and (b)

D.None of these

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

12:

Which of the following CFG's can't be simulated by an FSM ?

A.s ---> sa | a

B. s ---> abX , X --> cY, Y --> a | axY

C. s ---> a sb | ab
D.none of these

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

13:

Basic limitation of FSM is that it

A.cannot remember arbitrary large amount of information

B. sometimes fails to recognize grammars that are regular

C. sometimes recognizes grammars are not regular

D.None of these

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

14:

Which of the following is not possible algorithmically ?

A.Regular grammar to context free grammar

B. Non-deterministic FSA to deterministic FSA

C. Non-deterministic PDA to deterministic PDA

D.None of these

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

15:

The set {anbn | n = 1, 2, 3 ...} can be generated by the CFG

A.S �>ab | aSb

B. S �>aaSbb + abS

C. S�> ab | aSb | E
D.S �>aaSbb | ab | aabb

Answer Report Discuss

Option: D

Explanation :
Option (b) is wrong because it can't generate aabb
(in fact any even power).
Option (c) is wrong since it generates E also.
Both options (a) and (d) are correct.

Click on Discuss to view users comments.

The CFG
s---> as | bs | a | b

is equivalent to regular expression

A.(a + b)

B. (a + b) (a + b)*

C. (a + b) (a + b)

D.None of these

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

17:

Consider the grammar :

S —> ABCc | Abc


BA —> AB
Bb —> bb
Ab —> ab
Aa —> aa

Which of the following sentences can be derived by this grammar

A.abc

B. aab

C. abcc

D.abbb

Answer Report Discuss

Option: A
Explanation :

Click on Discuss to view users comments.

18:

Pumping lemma is generally used for proving that

A.given grammar is regular

B. given grammar is not regular

C. whether two given regular expressions are equivalent or not

D.None of these

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

19:

The language of all words with at least 2 a's can be described by the regular expression

A.(ab)*a and a (ba)*

B. (a + b)* ab* a (a + b)*

C. b* ab* a (a + b)*

D.all of these

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

20:

Any string of terminals that can be generated by the following CFG is


S-> XY
X--> aX | bX | a
Y-> Ya | Yb | a

A.has atleast one 'b'

B. should end in a 'a'

C. has no consecutive a's or b's

D.has atleast two a's

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

L = (an bn an | n = 1,2,3) is an example of a language that is

A.context free

B. not context free

C. not context free but whose complement is CF

D.both (b) and (c)

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

22:

If Σ = (0, 1), L = Σ* and R = (0n 1nsuch that n > 0 )

then languages L ∪ R and R respectively are

A.Regular, Regular

B. Regular, Not regular

C. Not regular, Not regular

D.None of these

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

23:

FSM can recognize

A.any grammar

B. only CG

C. Both (a) and ( b )

D.only regular grammar

Answer Report Discuss

Option: D
Explanation :

Click on Discuss to view users comments.

24:

Set of regular languages over a given alphabet set is closed under

A.union

B. complementation

C. intersection

D.All of these

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

25:

Which of the following statement is correct?

A.All languages can not be generated by CFG

B. Any regular language has an equivalent CFG

C. Some non regular languages can't be generated by CFG

D.both (b) and (c)

Answer Report Discuss

Option: D

Explanation :

CFG is a higher than regular language. So we can draw a regular equivalent to CFG. And some
non regular like context sensitive can't be generated by cfg. So, option 3 and 2 are correct. So
answer is 'D'.

Click on Discuss to view users comments.

26:

Given A = (0,1) and L = A*. If R = (0n 1n, n > 0) , then language L ∪ R and R are respectively

A.regular, regular

B. not regular, regular

C. regular, not regular


D.context free, not regular

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

27:

Define for a context free language

L ≤ {0 ; 1} init (L) = {u/uv ε L for some v in {0,1}}

(in other words, init (L) is the set of prefixes of L)

Let L {w/w is noempty and has an equal number of 0’s and 1’s)

Then init (L) is

A.set of all binary strings with unequal number of 0’s and 1’s

B. set of all binary strings including the null string

C. set of all binary strings with exactly one more 0’s than the number of 1’s or 1 more than the
number of 0’s

D.none of these

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

28:

If L1 and L2 are context free language and R a regular set, then which one of the languages below
is not necessarily a context free language?

A.L1 L2

B. L1 ∩ L2

C. L1 ∩ R

D.L1 ∪ L2

Answer Report Discuss

Option: B

Explanation :
Click on Discuss to view users comments.

29:

Consider a grammar with the following productions

S--> aab | bac | aB


S --> α S | b
S --> α b b | ab
Sα --> bdb | b

The above grammar is

A.Context free

B. regular

C. context sensitive

D.LR ( k )

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

30:

What can be said about a regular language L over {a} whose minimal finite state automation has
two states?

A.L must be { an | n is odd}

B. L must be { an | n is even}

C. L must be {an | > 0}

D.Either L must be {an | n is odd}, or L must be {an | n is even}

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

31:

In a context-sensitive grammar, number of grammar symbols on the left hand side of a production
can't be greater than the number of
A.grammar symbols on the right hand side

B. terminals on the right hand side

C. non-terminals on the right hand side

D. all of these

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

32:

In a context-free grammar

A.ε can't be the right hand side of any production

B. terminal symbols can't be present in the left hand side of any production

C. number of grammar symbols in the left hand side is not greater than the number of grammar
symbols in the right hand side

D.all of these

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

33:

CFG can be recognized by a

A.push-down automata

B. 2-way linear bounded automata

C. both (a) and (b)

D.none of these

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

34:

Which of the following statements are true?


I. The set of all odd integers is a monoid under multiplication.
II. The set of all complex number is a group under multiplication
III. The set of all integers under the operation * given by a * b = a+b-ab is a monoid

IV. Zs under symmetric difference defined by

A B = (A-B) ∪ (B-A) is an abelian group

A.I and II

B. I, III and IV

C. I, II and III

D.I, II and IV

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

35:

A given grammar is called ambiguous if

A.two or more productions have the same non-terminal on the left hand side

B. a derivation tree has more than one associated sentence

C. there is a sentence with more than one derivation tree corresponding to it

D.brackets are not present in the grammar

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments

Let L be a language recognizable by a finite automaton. The language

REVERSE (L) = {w such that w is the reverse of v where v ∈ L } is a

A.regular language

B. context-free language

C. context-sensitive language

D.recursively enumerable language

Answer Report Discuss

Option: A
Explanation :

Click on Discuss to view users comments.

37:

The grammars G = ( { s }, { 0, 1 }, p , s)
where p = (s —> 0S1, S —> OS, S —> S1, S —>0} is a

A.recursively enumerable language

B. regular language

C. context-sensitive language

D.context-free language

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

38:

The logic of pumping lemma is a good example of

A.pigeon-hole principle

B. divide-and-conquer technique

C. recursion

D.iteration

Answer Report Discuss

Option: A

Explanation :

The pigeon hole principle is nothing more than the obvious remark: if you have fewer pigeon
holes than pigeons and you put every pigeon in a pigeon hole, then there must result at least
one pigeon hole with more than one pigeon. It is surprising how useful this can be as a proof
strategy.

In the theory of formal languages in computability theory, a pumping lemma or pumping


argument states that, for a particular language to be a member of a language class, any
sufficiently long string in the language contains a section, or sections, that can be removed, or
repeated any number of times, with the resulting string remaining in that language. The
proofs of these lemmas typically require counting arguments such as the pigeonhole principle.
So the answer is 'A'

Click on Discuss to view users comments.

39:
The intersection of CFL and regular language

A.is always regular

B. is always context free

C. both (a) and (b)

D.need not be regular

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

40:

For two regular languages

L1 = (a + b)* a and L2 = b (a + b ) *
,
the intersection of L1 and L2 is given by

A.(a + b ) * ab

B. ab (a + b ) *

C. a ( a + b ) * b

D.b (a + b ) * a

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view u

Context free grammar is not closed under

A.product

B. union

C. complementation

D.kleen star

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.


42:

If L be a language recognizable by a finite automaton, then language front

{L} = { w such that w is prefix of v where v ∈ L }, is a

A.regular language

B. context-free language

C. context-sensitive language

D.recursive enumeration language

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

43:

For which of the following application, regular expressions can not be used ?

A.Designing computers

B. Designing compilers

C. Both (a) and (b)

D.Developing computers

Answer Report Discuss

Option: C

Explanation :

For Reference Link Click Here

Click on Discuss to view users comments.

44:

Consider the following grammar

S --> Ax / By
A --> By/Cw
B --> x / Bw
C--> y

Which of the regular expressions describe the same set of strings as the grammar ?

A.xw * y + xw * yx + ywx

B. xwy + xw * xy + ywx
C. xw * y + xw x yx + ywx

D.xw xy + xww * y + ywx

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

45:

Which of the following statements is (are) correct ?

A.Recursive languages are closed under complementation.

B. If a language and its complement are both regular, the language is recursive

C. Set of recursively enumerable language is closed under union

D. All of these

Answer Report Discuss

Option: D

Explanation :

46:

Which of the following statement is wrong ?

A. Any regular language has an equivalent context-free grammar.

B. Some non-regular languages can’t be generated by any context-free grammar

C. Intersection of context free language and a regular language is always context-free

D.All languages can be generated by context- free grammar

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

47:

Consider a grammar :

G = ( { x , y ) , { s , x , y } , p , s)

where elements of parse :


S--> x y
S -->y x
x--> x z
x--> x
y--> y
z--> z

The language L generated by G most accurately is called

A.Chomsky type 0

B. Chomsky type 1

C. Chomsky type 2

D.Chomsky type 3

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

48:

Consider a grammar :

G={{S},{0,1},p,s}

where elements of p are:

S --> ss
S--> 0S1
S--> 1S0
S--> empty

The grammer will generate

A.regular language

B. context-free language

C. context-sensitive language

D. recursive enumerable language

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.


49:

A grammar that produces more than one parse tree for some sentence is called

A.ambiguos

B. unambigous

C. regular

D.none of these

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

50:

Given a grammar G a production of G with a dot at some position of the right side is called

A.LR (0) item of G

B. LR (1) item of G

C. both (a) and (b)

D.none of these

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

51:

If a language is denoted by a regular expression


L = ( x )* (x | y x ) ,
then which of the following is not a legal string within L ?

A.yx

B. xyx

C. x

D.x y x y x

Answer Report Discuss

Option: D
Explanation :

Click on Discuss to view users comments.

52:

If every string of a language can be determined, whether it is legal or illegal in finite time, the
language is called

A.decidable

B. undecidable

C. interpretive

D.non-deterministic

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

53:

The defining language for developing a formalism in which language definitions can be stated, is
called

A.syntactic meta language

B. decidable language

C. intermediate language

D.high level language

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

54:

If L be set of strings from alphabet, then kleen closure of L is given as

A.

B.

C.
D.

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

55:

If e1 and e2 are the regular expressions denoting the languages L1 and L2 respectively, then which
of the following is wrong ?

A.(e1) | (e2) is a regular expression denoting L1 ∪ L2

B. (e1) .(e2) is a regular expression denoting L1. L2

C. φ is not a regular expression

D. {ex} is a regular expression denoting L1*

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

56:

Context-free grammar can be recognized by

A.finite state automation

B. 2-way linear bounded automata

C. push down automata

D.both (b) and (c)

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

57:

The language L = (0n 1n 2n where n > 0) is a

A.context free language


B. context-sensitive language

C. regular language

D.recursive enumerable language

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

58:

Context free language are closed under

A.union, intersection

B. union, kleene closure

C. intersection, complement

D.complement, kleene closure

Answer Report Discuss

Option: B

Explanation :

For Reference Click Here

Click on Discuss to view users comments.

59:

If G = ({S}, {a}, {S -> SS), S),

then language generated by G is

A.L (G) = φ

B. L(G) = an

C. L (G) = a*

D.L (G) = anban

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

60:
Grammar
S —> a,
S —> A3A4 ,
A3 —> A1, A3, A2 ,
A3 —> A1 A2, A1
A2—> aA2A1 ,
A1a —> a A1,
A2a —> aA2,
A1A4 —> A4a,
A2A4 —> A5a,
A2A5 —> A5a,
A5 —> a
generates

A.an^2

B. n2a

C. 2an

D.none of these

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments

61:

If L1 = {x | x is a palindrome in (0 + 1)*}
L2 = {letter (letter + digit)* };
L3 = (0n 1n 2n | n > 1}
L4 = {ambnam+n | m, n > 1}

then which of the following statement is correct ?

A.L1 is context free language and L3 is context sensitive language

B. L2 is a regular set and L4 is not a context free language

C. Both L1 and L2 are regular sets

D.Both L3 and L4 are context-sensitive languages

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

62:
A grammar to generate
{ (ab)n I n ≥ 1 } ∪ { (ba)n I n ≥ 1 }
is constructed as

A.S ---> S1, S1 ---> abS1, S1 ---> ab, S ---> S2, S2 —> baS2, S2 —> ba

B. S ---> S1 , Sl ---> aS1, S1 ---> ab, S ---> S2, S2 ---> bS2, S2 —> bc

C. S —> S1, S1—>S2, S2 —> S1a, S1 —> ab, S2 —> ba

D.none of these

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

63:

Consider the grammar


S ---> PQ | SQ | PS
P ---> x
Q--> y
To get a string of n terminals, the number of productions to be used is

A.n2

B. n + 1

C. 2n

D.2n - 1

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

64:

What is the highest type number which can be applied to the following grammar ?
S —> Aa, A —> Ba, B —> abc

A.Type 0

B. Type 1

C. Type 2

D.Type 3

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

65:

Following syntax-directed translation scheme is used with a shift reduction (bottom up) parser
that perform the action in braces immediately after a reduction by the corresponding production

A —> aB {print “(1)” A —> c {print “1”),


B —> Ab {print *2”}.

When parser is aaacbbb, then string printed

A.0202021

B. 1202020

C. 1020202

D.none of these

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

1:

Which of the following is complement of a?

A.Recursive language is recursive

B. Recursively enumerable language is recursively enumerable

C. Recursive language is either recursive or recursively enumerable

D.None of these

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

2:

If nL can be recognized by a multitape TM with time complexity f, then L can be recognized by a


one-tape machine with time complexity DSD
A.O( f 2)

B. o( f 2)

C. o(h)

D.O(h2)

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

3:

If T is a TM recognizing L, and T reads every symbol in the input string, τT(n) ≥ 2n + 2, then any
language that can be accepted by a TM T with τT(n) = 2n + 2 is

A.regular

B. not regular

C. uncertain

D.none of these

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

4:

Consider an alternate Turing machine model, in which there is an input tape on which the tape
head can move in both directions but cannot write, and one or more work tapes, one of which
serves as an output tape. For a function f, denoted by DSpace ( f ) , the set of languages that can
be recognized by a Turning machine of this type which uses no more than f(n) squares on any work
tape for any input string of length n. The only restriction we need to make on f is that f(n) > 0 for
every n. The language of balanced strings of parentheses are in

A.DSpace (1+ ⌈log2 (n + 1 ⌉). (⌈ x ⌉) means the smallest integer greater than or equal to x.

B. DSpace (1+ ⌈log2 n⌉)

C. DSpace ( 1+ ⌈ log2 n2⌉)

D.none of these

Answer Report Discuss

Option: A

Explanation :
Click on Discuss to view users comments.

5:

Which of the following problems is solvable ?

A.Writing a universal Turing machine

B. Determining of an arbitrary turing machine is an universal turing machine

C. Determining of a universal turing machine can be written for fewer than k instructions for
some k

D.Determining of a universal turing machine and some input will halt

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

Which of the following is not primitive recursive but partially recursive ?

A.Carnot's function

B. Ricmann function

C. Bounded function

D.Ackermann's function

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

7:

Turing machine (TM) is more powerful than FMS (Finite State Machine) because

A.tape movement is confined to one direction

B. it has no finite state

C. it has the capability to remember arbitrarily long sequences of input symbols

D.none of these

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.


8:

If f : N--> N. If L can be recoognized by a TM T, so that τT(n) ≤ f (n) for all but finitely many n, then (
Time (f) means Time ( max ( f, 2n +2))).

A.L ∈Time (f)

B. L ∈ Time(cf)

C. L ∈ Time (h)

D.none of these

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

9:

Let s is a step-counting function satisfying s(n) ≥ n, and L be a language accepted by a (multitape)


TM T. If tape heads of T do not move past square s(n) on any of the tapes for an input string of
length n, then T ∈

A.Space(s)

B. F(n)

C. Time(f)

D.Time(h)

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

10:

Which of the following statements is false ?

A.Halting problem of Turing machines is undecidable

B. Determining whether a context-free grammar is ambiguous is undecidable

C. Given two arbitrary context-free grammars G1 G2 and it is undecidable whether L (G1) = L (G2).

D.Given two regular grammars G1 G2 and it is undecidable whether L (G1) = L (G2)

Answer Report Discuss

Option: D

Explanation :
Click on Discuss to view users comments.

11:

Bounded minimalization is a technique for

A.proving whether a promotive recursive function is turning computable or not

B. proving whether a primitive recursive function is a total function or not

C. generating primitive recursive functions

D.generating partial recursive functions

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

12:

If there exists a language L, for which there exists a TM, T, that accepts every word in L and either
rejects or loops for every word that is not in L, is called

A.recursive

B. recursively enumerable

C. NP-HARD

D.none of these

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

13:

Which of the following statement(s) is/are correct?

A.L = {an bn an | n = 1, 2, 3...} is recursively enumerable

B. Recursive languages are closed under union

C. Every recursive is closed under union

D.All of these

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

14:

Universal TM influenced the concept of

A.stored program computers

B. interpretative implementation of programming language

C. computability

D.all of these

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

15:

Number of external states of a UTM should be atleast

A.1

B. 2

C. 3

D.4

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

16:

The statement, “A TM can’t solve halting problem” is

A.true

B. false

C. still an open question

D.all of these
Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

17:

If there exists a TM which when applied to any problem in the class, terminates, if correct answer
is yes and may or may not terminate otherwise is called

A.stable

B. unsolvable

C. partially solvable

D.unstable

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

18:

Given a Turing machine T and a step-counting function f, is the language accepted by T in Time(f) ?
This decision problem is

A.solvable

B. unsolvable

C. uncertain

D.none of these

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

19:

A total recursive function is a

A.partial recursive function

B. premitive recursive function

C. both (a) and (b)


D.none of these

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

20:

The running time T (n), where 'n' is input size of a recursive algorithm, is given as
T (n) = c + T (n - 1), if n > 1
= d, if n ≤ 1
The order of the algorithm is

A.n2

B. n

C. n3

D.nn

Answer Report Discuss

Option: B

Explanation :

Recuesivelt applying the relation, we get


T( n + 1 ) = C ( n - 1 ) + T (1)
=C(n-1)+d
Hence order is n.

Click on Discuss to view users comments.

21:

Next move function δ of a Turing machine M = (Q, Σ , Γ, δ, q0, B, F) is a mapping

A.δ : Q x Σ --> Q x Γ

B. δ : Q x Γ ---> Q x Σ x {L, R}

C. δ : Q x Σ ---> Q x Γ x {L, R}

D.δ : Q x Γ ---> Q x Γ x {L, R}

Answer Report Discuss

Option: D
Explanation :

Click on Discuss to view users comments.

22:

If L can be recognized by a TM T with a doubly infinite tape, and τt = f, then L can be recognized by
an ordinary TM with time complexity

A.O(f)

B. o(f)

C. O(h)

D.o(h)

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments

1:

Number of states of the FSM required to simulate behaviour of a computer with a memory
capable of storing "m" words, each of length 'n'

A.m x 2n

B. 2mn

C. 2m+n

D.all of these

Answer Report Discuss

Option: B

Explanation :

For every data here length is ‘n’ and memory's states are defined in terms of power of 2,
Here the total memory capability for all the words = mn
Hence number of states are 2mn

Click on Discuss to view users comments.

2:

An FSM with

A.1 stack is more powerful than an FSM with no stack


B. 2 stacks is more powerful than a FSM with 1 stack

C. both (a) and (b)

D.None of these

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

3:

If two finite states machine M and N are isomorphic, then

A.M can be transformed to N, merely re-labelling its states

B. M can be transformed to N, merely re-labelling its edges

C. Both (a) and (b)

D.None of these

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

4:

Power of

A.DFSM and NDFSM are same

B. DFSM and NDFSM are different

C. DPDM and NDPDM are diferent

D.Both (A) and (C)

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

5:

Which of the folowing pairs of regular expressions are equivalent ?

A.1 (01)* and (10)* 1

B. x (xx) * and (xx) * x


C. x+ and x+x*+

D.All of these

Answer Report Discuss

Option: D

Explanation :

Option (a) and option (b) are similar deriving expressions using rule :- (pq)*p = p(qp)*

Option (c) will also be valid since:-

(x+x*+) will be

--->(xx*)(x*x**)

--->(xx*)(x*x*) (Using x** = x*)

--->(xx*)(x*) (Using x*x* = x*)

--->(xx*) (Using x*x* = x*)

--->x+

So, the answer will be all of these (Option d)

Click on Discuss to view users comments.

6:

A finite state machine with the following state table has a single input x and a single output z. If
initial state is unknown, then shortest input sequence to reach the inal state C is

Present state Next state, z

X=1 X =0

A D, 0 B, 0

B B, 1 C, 1

C B, 0 D, 1

D B, 1 C, 0

A.01
B. 10

C. 110

D.110

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

7:

An FSM can be used to add how many given integers ?

A.1

B. 3

C. 4

D.2

Answer Report Discuss

Option: D

Explanation :

Finite Automata (FA) or Finite State Machine to add two integers can be constructed using
two states:
q0: Start state to represent carry bit is 0
q1: State to represent carry bit is 1

Click on Discuss to view users comments.

8:

If two finite state machines are equivalent, they should have the same number of

A.states

B. edges

C. states and edges

D.none of these

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

9:
For which of the following applications regular expressions can be used ?

A.Designing compilers

B. Developing text editors

C. Simulating sequential circuits

D.All of these

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

10:

L = {aP | p ; } is prime is

A.regular

B. not regular

C. accepted by DFA

D.accepted by PDA

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

In an incompletely specified automata

A.no edge should be labelled epsilon

B. from any given state, there can't be any token leading to two different states

C. both (a) and (b)

D.start state may not be there

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

12:

If f : {a, b}* —> (a, b}* be given by f (n) = ax for every value of n ∈ (a, b}, then f is

A.one to one not onto


B. one to one and onto

C. not one to one and not onto

D.not one to one and onto

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

13:

The word 'formal' in formal languages means

A.the symbols used have well-defined meaning

B. they are unnecessary, in reality

C. only form of the string of symbols is significant

D.Both (a) and (b)

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

14:

Running time of NFA to DFA conversion including the case where NFA has e-transition is

A.0 (n3)

B. 0 (n332)

C. 0 (n32n)

D.0 (n22n)

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

15:

Which of the following statements is/are false ?

A.The task of lexical analyzer is to translate the input source language text into tokens and
determine the groups of tokens are inter-related.
B. Two basic approaches to translation are generation and interpretation.

C. A load-and-go compiler is capable o translating the source language text on a host machine A
that can be later run on any target machine B.

D.None of these

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

Which of the following are not regular ?

A.String of 0's whose length is a perfect square

B. Set of all palindromes made up of 0's and 1's

C. Strings of 0's, whose length is a prime number

D.All of these

Answer Report Discuss

Option: D

Explanation :
Strings of odd number of zeroes can be generated by the regular expression (00) *0.Pumping
lemma can be used to prove the non-regularity of the other options.

Click on Discuss to view users comments.

17:

The main difference between a DFSA and an NDFSA is

A.in DFSA, ε transition may be present

B. in NDFSA, ε transitions may be present

C. in DFSA, from any given state, there can't be any alphabet leading to two diferent states

D.in NDFSA, from any given state, there can't be any alphabet leading to two diferent states

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

18:

If w ∈ (a, b)* satisfy abw = wab, then (w) is

A.even
B. odd

C. null

D.none of these

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

19:

A PDM behaves like an FSM wnen the number of auxiliary memory it has, is

A.0

B. 1

C. 2

D.None of these

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

20:

Finite state machine can recognize

A.any grammar

B. only context-free grammar

C. Both (a) and (b)

D.only regular grammar

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

21:

The major difference between a moore and mealy machine is that


A. output of the former depends on the present state and present input

B. output of the former depends only on the present state

C. output of former depends only on the present input

D.all of these

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

22:

Any given transition graph has an equivalent

A. regular expression

B. DFSM

C. NDFSM

D.all of these

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

23:

For which of the following application, regular expressions cannot be used ?

A.Designing computers

B. Designing compilers

C. Both (a) and (b)

D.Developing computers

Answer Report Discuss

Option: D

Explanation :
Click on Discuss to view users comments.

24:

If S be an infinite set and be sets such that S1 ∪ S2 ∪ .....∪ SN = S, then

A.atleast one of the set Si is a finite set

B. not more than one of the sets Si can be finite

C. atleast one of the sets Si is an infinite set

D.not more than one of the sets Si can be infinite

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

25:

Vienna Definition Language is an example of language definition facility based on

A.Mathematical semantics

B. Interpretative semantics

C. Translational semantics

D.Axiomatic semantics

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

26:

Which of the following regular expressions denotes a language comprising all possible strings over
the alphabet {a, b } ?
A. a* b*

B. (a | b)*

C. (ab)+

D. (a | b*)

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

27:

An FSM (Finite State Machine) can be considered to be a TM (Turing Machine) of finite tape length

A.without rewinding capability and unidirectional tape movement.

B. rewinding capacity, and unidirectional tape movement

C. without rewinding capability and bidirectional tape movement

D.rewinding capability and bidirectional tape movement

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

28:

Palindromes can't be recognized by any FSM because

A.FSM can't remember arbitrarily large of information

B. FSM can't deterministically fix the mid-point

C. even if mid-point is known, FSM be can't be found whether, second half of the string matches
the first half

D.all of these

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

29:
If ∑ = {a, b, c, d, e, f } then number of strings in ∑ of length 4 such that no symbol is used more
than once in a string is

A.35

B. 360

C. 49

D.720

Answer Report Discuss

Option: B

Explanation :

Here string length is 4 so we can create string of length 4 by 6 values. Suppose at first place
we can arrange any value by 6 methods.so 6. then Remaining total numbers are 5 so we can
arrange them by 5 methods at second place. then remaining total numbers are 4 so we can
arrange them by 4 methods. now remaining total numbers are 3 and we can arrange them by
3 methods. so according to permutation technique. We multiply them i.e. 6*5*4*3=360. So,
'B'

Click on Discuss to view users comments.

30:

A language L is accepted by a finite automaton if and only if it is

A.context - free

B. context-sensitive

C. recursive

D.Right-linear

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

31:

Can a DFA simulate NFA?

A.NO

B. YES
C. SOMETIMES

D.Depends on NFA

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

32:

Which of the following statements is wrong ?

A.The language accepted by finite automata are the languages denoted by regular expressions

B. For every DFA there is a regular expression denoting its language

C. For a regular expression r, there does not exist NFA with L(r) any transit that accept

D.None of these

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

33:

Regular expression a / b denotes the set

A. {a}

B. { ∈ , a, b }

C. {a, b}

D.{ ab }

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

34:

Regular expression (a | b ) (a | b) denotes the set

A.{ a, b, ab, aa }

B. { a, b, ba, bb }
C. { a, b }

D.{ aa, ab, ba, bb }

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

35:

Which of the following regular expressions denotes zero or more instances of an a or b ?

A.a | b

B. (ab)*

C. (a | b)*

D.a* I b

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments

36:

Which of the following regular expressions denotes a language comprising all possible strings of
even length over the alphabet ( 0 , 1 ) ?

A.(0 | 1) *

B. (0 | 1) (0 | 1)*

C. (00 01 10 11 )*

D.(0 | 1 ) (0 | 1)(0 | 1 ) *

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

37:
The regular expression (a | b)* denotes the set of all strings

A.with zero or more instances of a or b

B. with one or more instances of a or b

C. equal to regular expression (a* b*)*

D.both (a) and (c)

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

38:

The string (a) | ((b) * (c)) is equivalent to

A.set of strings with either a or zero or more b's and one c

B. set of strings with either a or one or more b's and one c

C. b* c l a

D.both (a) and (c)

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

39:

An automation is a __________ device and a grammar is a __________ device.

A.generative, cognitive

B. generative, acceptor

C. acceptor, cognitive

D.cognitive, generative

Answer Report Discuss

Option: D
Explanation :

Click on Discuss to view users comments.

40:

In the figure given below, a deterministic finite automation M has start state A and
accepting state D. Which of the following regular expression denoted the set of all words accepted
by
M?

A. 001

B. 10 * 1 * 0

C. ( 0 | 1) * 011

D.1* 0 * 001

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

41:

The regular sets are closed under

A.union

B. concatenation

C. Kleene's closure

D. all of these

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

42:

Dynamic errors can be detected at

A.compile time

B. Run time

C. both (a) and (b)

D.none of these

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

43:

If a and b be the regular expressions, then ( a* ∪ b* ) * is equivalent to

A.(a ∪ b) *

B. (b* ∪ a*)*

C. (b ∪ a)*

D.All of above

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

44:

Finite state machines _________ recognize palindromes

A.can

B. can't

C. may

D.may not
Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

45:

If S and T be language over Σ = {a, b } represented by regular expression (a + b * ) * and (a + b) * ,


respectively, then

A.S ⊂ T

B. T⊂ S

C. S = T

D.S ∩ T= φ

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments

46:

Consider regular expression (0 + 1) (0 + 1) ....... n times. Minimum state finite automaton


that recognizes the language represented by this regular expression contains

A.n states

B. n + 1 states

C. n + 2 states

D. none of these

Answer Report Discuss

Option: B

Explanation :

Click on Discuss to view users comments.

47:

If regular set A is represented by A = (01 + 1)* and the regular set 'B' is represented by B =
((01)*1*)*, then
A.A ⊂ B

B. B ⊂ A

C. A and B are uncomparable

D. A=B

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

48:

Which of the following can be recognized by a Deterministic Finite-state Automaton ?

A. Numbers, 1,2,4, ....... zN ..... written in binary.

B.

Numbers 1, 2, 4, ........, zN ...... written in unbinary.

C. Set of binary string in which number of zeros is same as the number of ones.

D. Set (1,101,11011,1110111, ......}

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

49:

Which of the following are not regular ?

A.String of 0’s whose length is a perfect square

B. Set of all palindromes made up of 0’s and 1's

C. Strings of 0’s, whose length is a prime number

D.All of these

Answer Report Discuss

Option: D

Explanation :

Click on Discuss to view users comments.

50:

An FSM with
A.1 stack is more powerful than an FSM with no stack

B. 2 stacks is more powerful than a FSM with 1 stack

C. both (a) and (b)

D.none of these

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments

51:

If w ∈ (a, b)* satisfy abw = wab, then (w) is

A.even

B. odd

C. null

D.none of these

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

52:

A PDM behaves like an FSM wnen the number of auxiliary memory it has, is

A.0

B. 1

C. 2

D.none of these

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

53:
A finite state machine with the following state table has a single input x and a single output z

Present state Next state, z

If the initial state is unknown, then shortest


x=1 x=0 input sequence to reach the final state C is

A.01
A D, 0 B, 0
B. 10

C. 10
B B,1 C,1
D.110

C B, 0 D, 1 Answer Report Discuss

Option: B
D B, 1 C, 0
Explanation :

Click on Discuss to view users comments.

54:

FSM shown in the figure

A.all strings

B. no string

C. ε- alone

D.none of these

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments.

55:
If f : {a, b}* ---> {a , b } * be given by f(n) = ax for every value of n ∈ {a, b}, then f is

A.one to one not onto

B. one to one and onto

C. not one to one and not onto

D.not one to one and onto

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

56:

If two finite states machine M and N are isomorphic, then

A.M can be transformed to N, merely re-labelling its states

B. M can be transformed to N, merely re-labelling its edges

C. M can be transformed to N, merely re-labelling its edges

D.none of these

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

57:
Regular expression corresponding to the state diagram given in the figure is

A.(0+1(1 + 01)* 00)*

B. (1 + 0 (0 + 10) 00)*

C. (0 + 1 (1 + 10) 00)*

D.(1 + 0(1 + 00) 11)*

Answer Report Discuss

Option: A

Explanation :

Click on Discuss to view users comments.

58:

Two finite state machines are said to be equivalent if they

A.have same number of states

B. have same number of edges

C. have same number of states and edges

D.recognize same set of tokens

Answer Report Discuss

Option: C

Explanation :

Click on Discuss to view users comments

1. Assume the R is a relation on a set A, aRb is partially ordered such that a and b are
_____________
a) reflexive
b) transitive
c) symmetric
d) reflexive and transitive
View Answer

Answer: d
Explanation: A partially ordered relation refers to one which is Reflexive, Transitive and
Antisymmetric.

2. The non- Kleene Star operation accepts the following string of finite length over set A = {0,1} |
where string s contains even number of 0 and 1
a) 01,0011,010101
b) 0011,11001100
c) ε,0011,11001100
d) ε,0011,11001100
View Answer

Answer: b
Explanation: The Kleene star of A, denoted by A*, is the set of all strings obtained by concatenating
zero or more strings from A.

3. A regular language over an alphabet ∑ is one that cannot be obtained from the basic languages
using the operation
a) Union
b) Concatenation
c) Kleene*
d) All of the mentioned
View Answer

Answer: d
Explanation: Union, Intersection, Concatenation, Kleene*, Reverse are all the closure properties of
Regular Language.

4. Statement 1: A Finite automata can be represented graphically; Statement 2: The nodes can be its
states; Statement 3: The edges or arcs can be used for transitions
Hint: Nodes and Edges are for trees and forests too.
Which of the following make the correct combination?
a) Statement 1 is false but Statement 2 and 3 are correct
b) Statement 1 and 2 are correct while 3 is wrong
c) None of the mentioned statements are correct
d) All of the mentioned
View Answer

Answer: d
Explanation: It is possible to represent a finite automaton graphically, with nodes for states, and arcs
for transitions.

5. The minimum number of states required to recognize an octal number divisible by 3 are/is
a) 1
b) 3
c) 5
d) 7
View Answer

Answer: b
Explanation: According to the question, minimum of 3 states are required to recognize an octal
number divisible by 3.

6. Which of the following is a not a part of 5-tuple finite automata?


a) Input alphabet
b) Transition function
c) Initial State
d) Output Alphabet
View Answer

Answer: d
Explanation: A FA can be represented as FA= (Q, ∑, δ, q0, F) where Q=Finite Set of States, ∑=Finite
Input Alphabet, δ=Transition Function, q0=Initial State, F=Final/Acceptance State).

7. If an Infinite language is passed to Machine M, the subsidiary which gives a finite solution to the
infinite input tape is ______________
a) Compiler
b) Interpreter
c) Loader and Linkers
d) None of the mentioned
View Answer

Answer: a
Explanation: A Compiler is used to give a finite solution to an infinite phenomenon. Example of an
infinite phenomenon is Language C, etc.

8. The number of elements in the set for the Language L={xϵ(∑r) *|length if x is at most 2} and
∑={0,1} is_________
a) 7
b) 6
c) 8
d) 5
View Answer

Answer: a
Explanation: ∑r= {1,0} and a Kleene* operation would lead to the following
set=COUNT{ε,0,1,00,11,01,10} =7.

9. For the following change of state in FA, which of the following codes is an incorrect option?
a) δ (m, 1) =n
b) δ (0, n) =m
c) δ (m,0) =ε
d) s: accept = false; cin >> char;
if char = “0” goto n;
View Answer
Answer: b
Explanation: δ(QX∑) = Q1 is the correct representation of change of state. Here, δ is called the
Transition function.

10. Given: ∑= {a, b}


L= {xϵ∑*|x is a string combination}
∑4 represents which among the following?

a) {aa, ab, ba, bb}


b) {aaaa, abab, ε, abaa, aabb}
c) {aaa, aab, aba, bbb}
d) All of the mentioned
View Answer

Answer: b
Explanation: ∑* represents any combination of the given set while ∑x represents the set of
combinations with length x where x ϵ

1. Moore Machine is an application of:


a) Finite automata without input
b) Finite automata with output
c) Non- Finite automata with output
d) None of the mentioned
View Answer

Answer: b
Explanation: Finite automaton with an output is categorize din two parts: Moore M/C and Mealy
M/C.

2. In Moore machine, output is produced over the change of:


a) transitions
b) states
c) Both
d) None of the mentioned
View Answer

Answer: b
Explanation: Moore machine produces an output over the change of transition states while mealy
machine does it so for transitions itself.

3. For a give Moore Machine, Given Input=’101010’, thus the output would be of length:
a) |Input|+1
b) |Input|
c) |Input-1|
d) Cannot be predicted
View Answer

Answer: a
Explanation: Initial state, from which the operations begin is also initialized with a value.

4. Statement 1: Null string is accepted in Moore Machine.


Statement 2: There are more than 5-Tuples in the definition of Moore Machine.
Choose the correct option:
a) Statement 1 is true and Statement 2 is true
b) Statement 1 is true while Statement 2 is false
c) Statement 1 is false while Statement 2 is true
d) Statement 1 and Statement 2, both are false
View Answer

Answer: a
Explanation: Even ε, when passed as an input to Moore machine produces an output.

5. The total number of states and transitions required to form a moore machine that will produce
residue mod 3.
a) 3 and 6
b) 3 and 5
c) 2 and 4
d) 2 and 5
View Answer

Answer: a
Explanation:

6. Complete the given table according to the given Moore machine.

Present State
Next State
Output

0
1

Q0
Q1
Q2
1
Q1
Q2

1
Q2

Q0

a) Q0, Q2, 0
b) Q0, Q2, 1
c) Q1, Q2, 1
d) Q1, Q0, 0
View Answer

Answer: a
Explanation: The table can be filled accordingly seeing the graph.

7. What is the output for the given language?


Language: A set of strings over ∑= {a, b} is taken as input and it prints 1 as an output “for every
occurrence of a, b as its substring. (INPUT: abaaab)
a) 0010001
b) 0101010
c) 0111010
d) 0010000
View Answer

Answer: a
Explanation: The outputs are as per the input, produced.

8. The output alphabet can be represented as:


a) δ
b) ∆
c) ∑
d) None of the mentioned
View Answer

Answer: b
Explanation: Source-The tuple definition of Moore and mealy machine comprises one new member
i.e. output alphabet as these are finite machines with output.

9. The O/P of Moore machine can be represented in the following format:


a) Op(t)=δ(Op(t))
b) Op(t)=δ(Op(t)i(t))
c) Op(t): ∑
d) None of the mentioned
View Answer

Answer: a
Explanation: Op(t)=δ(Op(t)) is the defined definition of how the output is received on giving a
specific input to Moore machine.

10. Which of the following is a correct statement?


a) Moore machine has no accepting states
b) Mealy machine has accepting states
c) We can convert Mealy to Moore but not vice versa
d) All of the mentioned
View Answer

Answer: a
Explanation: Statement a and b is correct while c is false. Finite machines with output have no
accepting states and can be converted within each other.

1. In mealy machine, the O/P depends upon?


a) State
b) Previous State
c) State and Input
d) Only Input
View Answer

Answer: c
Explanation: Definition of Mealy Machine.

2. Which of the given are correct?


a) Moore machine has 6-tuples
b) Mealy machine has 6-tuples
c) Both Mealy and Moore has 6-tuples
d) None of the mentioned
View Answer

Answer: c
Explanation: Finite Automaton with Output has a common definition for both the categories.

3. The following mealy machine outputs which of the following?

a) 9’s Complement
b) 2’s Complement
c) 1’s Complement
d) 10’s Complement
View Answer

Answer: b
Explanation: The input can be taken in form of a binary string and can be verified.

4. The O/P of Mealy machine can be represented in the following format:


a) Op(t)= δ(Op(t))
b) Op(t)= δ(Op(t)i(t))
c) Op(t): ∑
d) None of the mentioned
View Answer

Answer: b
Explanation: The output of mealy machine depends on the present state as well as the input to that
state.

5.The ratio of number of input to the number of output in a mealy machine can be given as:
a) 1
b) n: n+1
c) n+1: n
d) None of the mentioned
View Answer

Answer: a
Explanation: The number of output here follows the transitions in place of states as in Moore
machine.

6. Mealy and Moore machine can be categorized as:


a) Inducers
b) Transducers
c) Turing Machines
d) Linearly Bounder Automata
View Answer

Answer: b
Explanation: They are collectively known as Transducers.

7. The major difference between Mealy and Moore machine is about:


a) Output Variations
b) Input Variations
c) Both
d) None of the mentioned
View Answer

Answer: a
Explanation: Mealy and Moore machine vary over how the outputs depends on prior one
(transitions) and on the latter one(states).

8. Statement 1: Mealy machine reacts faster to inputs.


Statement 2: Moore machine has more circuit delays.
Choose the correct option:
a) Statement 1 is true and Statement 2 is true
b) Statement 1 is true but Statement 2 is false
c) Statement 1 is false and Statement 2 is true
d) None of the mentioned is true
View Answer

Answer: a
Explanation: Being an input dependent and output capable FSM, Mealy machine reacts faster to
inputs.
9. Which of the following does the given Mealy machine represents?

a) 9’s Complement
b) 2’s Complement
c) 1’s Complement
d) 10’s Complement
View Answer

Answer: c
Explanation: Inputs can be taken and can be verified.

10. Which one among the following is true?


A mealy machine
a) produces a language
b) produces a grammar
c) can be converted to NFA
d) has less circuit delays
View Answer

Answer: d
Explanation: It does not produce a language or a grammar or can be converted to a NFA

1. Which of the following does not belong to input alphabet if S={a, b}* for any language?
a) a
b) b
c) e
d) none of the mentioned
View Answer

Answer: c
Explanation: The automaton may be allowed to change its state without reading the input symbol
using epsilon but this does not mean that epsilon has become an input symbol. On the contrary, one
assumes that the symbol epsilon does not belong to any alphabet.

2. The number of final states we need as per the given language?


Language L: {an| n is even or divisible by 3}
a) 1
b) 2
c) 3
d) 4
View Answer
Answer: b
Explanation:

3. An e-NFA is ___________ in representation.


a) Quadruple
b) Quintuple
c) Triple
d) None of the mentioned
View Answer

Answer: b
Explanation: An e-NFA consist of 5 tuples: A=(Q, S, d, q0. F)
Note: e is never a member of S.

4. State true or false:


Statement: Both NFA and e-NFA recognize exactly the same languages.
a) true
b) false
View Answer

Answer: a
Explanation: e-NFA do come up with a convenient feature but nothing new.They do not extend the
class of languages that can be represented.

5. Design a NFA for the language:


L: {an| n is even or divisible by 3}
Which of the following methods can be used to simulate the same.
a) e-NFA
b) Power Construction Method
c) Both (a) and (b)
d) None of the mentioned
View Answer
Answer: c
Explanation: It is more convenient to simulate a machine using e-NFA else the method of Power
Construction is used from the union-closure of DFA’s.

6. Which of the following belongs to the epsilon closure set of a?

a) {f1, f2, f3}


b) {a, f1, f2, f3}
c) {f1, f2}
d) none of the mentioned
View Answer

Answer: b
Explanation: The epsilon closure of the set q is the set that contains q, together with all the states
which can be reached starting at q by following only epsilon transitions.

7. The number of elements present in the e-closure(f2) in the given diagram:

a) 0
b) 1
c) 2
d) 3
View Answer
Answer: c
Explanation: The epsilon closure set of f2 consist of the elements:{f2, f3}. Thus the count of the
element in the closure set is 2.

8. Which of the steps are non useful while eliminating the e-transitions for the given diagram?

a) Make a as accepting state of N’ if ECLOSE(p) contains an accepting state of N


b) Add an arc a to f1 labelled a if there is an arc labelled a in N from some state in ECLOSE(a) to f1
c) Delete all arcs labelled as e
d) None of the mentioned
View Answer

Answer: d
Explanation: The given are the steps followed while eliminating epsilon transitions from a NFA or
converting an e-NFA to just NFA.

9. Is the language preserved in all the steps while eliminating epsilon transitions from a NFA?
a) yes
b) no
View Answer

Answer: a
Explanation: Yes, the language is preserved during the dteps of construction: L(N)=L(N1)=L(N2)=L(3).

10. Remove all the epsilon transitions in the given diagram and compute the number of a-transitions
in the result?
a) 5
b) 7
c) 9
d) 6
View Answer

Answer: b
Explanation:

Sanfoundry Global Education & Learning Series – Automata Theor

1. Which of the following not an example Bounded Information?


a) fan switch outputs {on, off}
b) electricity meter reading
c) colour of the traffic light at the moment
d) none of the mentioned
View Answer
Answer: b
Explanation: Bounded information refers to one whose output is limited and it cannot be said what
were the recorded outputs previously until memorized.

2. A Language for which no DFA exist is a________


a) Regular Language
b) Non-Regular Language
c) May be Regular
d) Cannot be said
View Answer

Answer: b
Explanation: A language for which there is no existence of a deterministic finite automata is always
Non Regular and methods like Pumping Lemma can be used to prove the same.

3. A DFA cannot be represented in the following format


a) Transition graph
b) Transition Table
c) C code
d) None of the mentioned
View Answer

Answer: d
Explanation: A DFA can be represented in the following formats: Transition Graph, Transition Table,
Transition tree/forest/Any programming Language.

4. What the following DFA accepts?

a) x is a string such that it ends with ‘101’


b) x is a string such that it ends with ‘01’
c) x is a string such that it has odd 1’s and even 0’s
d) x is a strings such that it has starting and ending character as 1
View Answer
Answer: a
Explanation: Strings such as {1101,101,10101} are being accepted while {1001,11001} are not. Thus,
this conclusion leads to option a.

5. When are 2 finite states equivalent?


a) Same number of transitions
b) Same number of states
c) Same number of states as well as transitions
d) Both are final states
View Answer

Answer: c
Explanation: Two states are said to be equivalent if and only if they have same number of states as
well as transitions.

6. What does the following figure most correctly represents?

a) Final state with loop x


b) Transitional state with loop x
c) Initial state as well as final state with loop x
d) Insufficient Data
View Answer

Answer: c
Explanation: The figure represents the initial as well as the final state with an iteration of x.

7. Which of the following will not be accepted by the following DFA?

a) ababaabaa
b) abbbaa
c) abbbaabb
d) abbaabbaa
View Answer

Answer: a
Explanation: All the Strings are getting accepted except ‘ababaabaa’ as it is directed to dumping
state. Dumping state also refers to the reject state of the automata.

8. Which of the following will the given DFA won’t accept?

a) ε
b) 11010
c) 10001010
d) String of letter count 11
View Answer

Answer: a
Explanation: As the initial state is not made an acceptance state, thus ε will not be accepted by the
given DFA. For the automata to accept ε as an entity, one should make the initial state as also the
final state.

9. Can a DFA recognize a palindrome number?


a) Yes
b) No
c) Yes, with input alphabet as ∑*
d) Can’t be determined
View Answer

Answer: b
Explanation: Language to accept a palindrome number or string will be non-regular and thus, its DFA
cannot be obtained. Though, PDA is possible.

10. Which of the following is not an example of finite state machine system?
a) Control Mechanism of an elevator
b) Combinational Locks
c) Traffic Lights
d) Digital Watches
View Answer

Answer: d
Explanation: Proper and sequential combination of events leads the machines to work in hand which
includes The elevator, Combinational Locks, Traffic Lights, vending machine, etc. Other applications
of Finite machine state system are Communication Protocol Design, Artificial Intelligence Research,
A Turnstile, etc.

1. The password to the admins account=”administrator”. The total number of states required to
make a password-pass system using DFA would be __________
a) 14 states
b) 13 states
c) 12 states
d) A password pass system cannot be created using DFA
View Answer

Answer: a
Explanation: For a string of n characters with no repetitive substrings, the number of states required
to pass the string is n+1.

2. Which of the following is the corresponding Language to the given DFA?

a) L= {x ϵ {0, 1} * | x ends in 1 and does not contain substring 01}


b) L= {x ϵ {0,1} * |x ends in 1 and does not contain substring 00}
c) L= {x ϵ {0,1} |x ends in 1 and does not contain substring 00}
d) L= {x ϵ {0,1} * |x ends in 1 and does not contain substring 11}
View Answer

Answer: b
Explanation: The Language can be anonymously checked and thus the answer can be predicted. The
language needs to be accepted by the automata (acceptance state) in order to prove its regularity.
3. Let ∑= {a, b, …. z} and A = {Hello, World}, B= {Input, Output}, then (A*∩B) U (B*∩A) can be
represented as:
a) {Hello, World, Input, Output, ε}
b) {Hello, World, ε}
c) {Input, Output, ε}
d) {}
View Answer

Answer: d
Explanation: Union operation creates the universal set by combining all the elements of first and
second set while intersection operation creates a set of common elements of the first and the
second state.

4. Let the given DFA consist of x states. Find x-y such that y is the number of states on minimization
of DFA?

a) 3
b) 2
c) 1
d) 4
View Answer

Answer: b
Explanation: Use the equivalence theorem or Myphill Nerode theorem to minimize the DFA.

5. For a machine to surpass all the letters of alphabet excluding vowels, how many number of states
in DFA would be required?
a) 3
b) 2
c) 22
d) 27
View Answer
Answer: a
Explanation:

6. For the DFA given below compute the following:


Union of all possible combinations at state 7,8 and 9.

a) {aba, ac, cc, ca, cb, bc, bab, ca}


b) {bab, bc, ac, aba, ca, aac, ccb}
c) {cc, ca, cb, aba, bab, ac}
d) {aba, ac, cc, ca, cb, bc, bab, caa}
View Answer

Answer: d
Explanation: The string a state receives is the combination of all input alphabets which lie across the
path covered.
7. Given L= {Xϵ∑*= {a, b} |x has equal number of a, s and b’s}.
Which of the following property satisfy the regularity of the given language?
a) Regularity is dependent upon the length of the string
b) Regularity is not dependent upon the length of the string
c) Can’t be said for a particular string of a language
d) It may depend on the length of the string
View Answer

Answer: b
Explanation: DFA can be made for infinite language with an infinite length. Thus, dependency over
length is unfruitful.

8. Given:
L= {xϵ∑= {0,1} |x=0n1n for n>=1}; Can there be a DFA possible for the language?
a) Yes
b) No
View Answer

Answer: b
Explanation: It is not possible to have a count of equal number of 0 and 1 at any instant in DFA. Thus,
It is not possible to build a DFA for the given Language.

9. δ(A,1) = B, δ(A,0) =A
Δ (B, (0,1)) =C
δ(C,0) = A (Initial state =A)
String=”011001” is transit at which of the states?
a) A
b) C
c) B
d) Invalid String
View Answer

Answer: a
Explanation: It is east and simple to create the table and then the corresponding transition graph in
order to get the result, at which state the given string would be accepted

1.Given Language: L= {xϵ∑= {a, b} |x has a substring ‘aa’ in the production}. Which of the
corresponding representation notate the same?
a)

b)
c)

d)

View Answer

Answer: a
Explanation: The states transited has been written corresponding to the transitions as per the row
and column. The row represents the transitions made and the ultimate.

2.Let u=’1101’, v=’0001’, then uv=11010001 and vu= 00011101.Using the given information what is
the identity element for the string?
a) u-1
b) v-1
c) u-1v-1
d) ε
View Answer

Answer: d
Explanation: Identity relation: εw = wε = w, thus the one satisfying the given relation will be the
identity element.

3.Which of the following substring will the following notation result?

a) 0101011
b) 0101010
c) 010100
d) 100001
View Answer

Answer: c
Explanation: The given DFA notation accepts the string of even length and prefix ‘01’.

4.Predict the following step in the given bunch of steps which accepts a strings which is of even
length and has a prefix=’01’
δ (q0, ε) =q0 < δ(q0,0) =δ (δ (q0, ε),0) =δ(q0,0) =q1 < _______________
a) δ (q0, 011) =δ (δ (q0,1), 1) =δ (q2, 1) =q3
b) δ (q0, 01) =δ (δ (q0, 0), 1) = δ (q1, 1) =q2
c) δ (q0, 011) =δ (δ (q01, 1), 1) =δ (q2, 0) =q3
d) δ (q0, 0111) =δ (δ (q0, 011), 0) = δ (q3, 1) =q2
View Answer

Answer: b
Explanation: Here, δ refers to transition function and results into new state or function when an
transition is performed over its state.

5. Fill the missing blank in the given Transition Table:


Language L= {xϵ∑= {0,1} |x accepts all the binary strings not divisible by 3}

a) Q0
b) Q1
c) Q2
d) No Transition
View Answer

Answer: Q1
Explanation: The tabular representation of DFA is quite readable and can be used to some ore
complex problems. Here, we need to form the transition graph and fill up the given blank.

6.Which among the following is the missing transition in the given DFA?
L= {xϵ∑= {a, b} | x starts with a and ends with b}

a) δ (q0, a) =q0
b) δ (F, a) =q1
c) δ (F, a) =D
d) δ (q1, a) =D
View Answer
Answer: b
Explanation: For the given Language, the transition missing is δ (F, a) =q1.

7.The complement of a language will only be defined when and only when the __________ over the
language is defined.
a) String
b) Word
c) Alphabet
d) Grammar
View Answer

Answer: c
Explanation: It is not possible to define the complement of a language without defining the input
alphabets. Example: A language which does not consist of substring ‘ab’ while the complement
would be the language which does contain a substring ‘ab’.

8.Which among the following is not notated as infinite language?


a) Palindrome
b) Reverse
c) Factorial
d) L={ab}*
View Answer

Answer: Factorial
Explanation: Factorial, here is the most appropriate non-infinite domain. Otherwise, palindrome and
reverse have infinite domains.

9.Which among the following states would be notated as the final state/acceptance state?
L= {xϵ∑= {a, b} | length of x is 2}

a) q1
b) q2
c) q1, q2
d) q3
View Answer

Answer: b
Explanation: According to the given language, q2 Is to become the final/acceptance state in order to
satisfy.

10.Which of the following are the final states in the given DFA according to the Language given.?
L= {xϵ∑= {a, b} |length of x is at most 2}

a) q0, q1
b) q0, q2
c) q1, q2
d) q0, q1, q2
View Answer

Answer: d
Explanation: According to the given language, the length is at most 2, thus the answer is found
accordingly.

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “The
Language of DFA”

1. How many languages are over the alphabet R?


a) countably infinite
b) countably finite
c) uncountable finite
d) uncountable infinite
View Answer

Answer: d
Explanation: A language over an alphabet R is a set of strings over A which is uncountable and
infinite.
2. According to the 5-tuple representation i.e. FA= {Q, ∑, δ, q, F}
Statement 1: q ϵ Q’; Statement 2: FϵQ
a) Statement 1 is true, Statement 2 is false
b) Statement 1 is false, Statement 2 is true
c) Statement 1 is false, Statement 2 may be true
d) Statement 1 may be true, Statement 2 is false
View Answer

Answer: b
Explanation: Q is the Finite set of states, whose elements i.e. the states constitute the finite
automata.

3. δˆ tells us the best:


a) how the DFA S behaves on a word u
b) the state is the dumping state
c) the final state has been reached
d) Kleene operation is performed on the set
View Answer

Answer: a
Explanation: δ or the Transition function describes the best, how a DFA behaves on a string where to
transit next, which direction to take.

4. Which of the following option is correct?


A= {{abc, aaba}. {ε, a, bb}}
a) abcbb ₵ A
b) ε₵A
c) ε may not belong to A
d) abca ₵ A
View Answer

Answer: b
Explanation: As the question has dot operation, ε will not be a part of the concatenated set. Had it
been a union operation, ε would be a part of the operated set.

5. For a DFA accepting binary numbers whose decimal equivalent is divisible by 4, what are all the
possible remainders?
a) 0
b) 0,2
c) 0,2,4
d) 0,1,2,3
View Answer

Answer: d
Explanation: All the decimal numbers on division would lead to only 4 remainders i.e. 0,1,2,3
(Property of Decimal division).
6. Which of the following x is accepted by the given DFA (x is a binary string ∑= {0,1})?

a) divisible by 3
b) divisible by 2
c) divisible by 2 and 3
d) divisible by 3 and 2
View Answer

Answer: d
Explanation: The given DFA accepts all the binary strings such that they are divisible by 3 and 2.Thus,
it can be said that it also accepts all the strings which is divisible by 6.

7. Given:
L1= {xϵ ∑*|x contains even no’s of 0’s}
L2= {xϵ ∑*|x contains odd no’s of 1’s}
No of final states in Language L1 U L2?
a) 1
b) 2
c) 3
d) 4
View Answer
Answer: c
Explanation:

8. The maximum number of transition which can be performed over a state in a DFA?
∑= {a, b, c}
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: c
Explanation: The maximum number of transitions which a DFA allows for a language is the number
of elements the transitions constitute.

9. The maximum sum of in degree and out degree over a state in a DFA can be determined as:
∑= {a, b, c, d}
a) 4+4
b) 4+16
c) 4+0
d) depends on the Language
View Answer

Answer: d
Explanation: The out degree for a DFA I fixed while the in degree depends on the number of states in
the DFA and that cannot be determined without the dependence over the Language.

10. The sum of minimum and maximum number of final states for a DFA n states is equal to:
a) n+1
b) n
c) n-1
d) n+2
View Answer
Answer: a
Explanation: The maximum number of final states for a DFA can be total number of states itself and
minimum would always be 1, as no DFA exits without a final state. Therefore, the solution is n+1

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “Regular
Language & Expression”.

1. There are ________ tuples in finite state machine.


a) 4
b) 5
c) 6
d) unlimited
View Answer

Answer:b
Explanation: States, input symbols,initial state,accepting state and transition function.

2. Transition function maps.


a) Σ * Q -> Σ
b) Q * Q -> Σ
c) Σ * Σ -> Q
d) Q * Σ -> Q
View Answer

Answer:d
Explanation: Inputs are state and input string output is states.

3. Number of states require to accept string ends with 10.


a) 3
b) 2
c) 1
d) can’t be represented.
View Answer

Answer:a
Explanation: This is minimal finite automata.

4. Extended transition function is .


a) Q * Σ* -> Q
b) Q * Σ -> Q
c) Q* * Σ* -> Σ
d) Q * Σ -> Σ
View Answer

Answer:a
Explanation: This takes single state and string of input to produce a state.

5. δ*(q,ya) is equivalent to .
a) δ((q,y),a)
b) δ(δ*(q,y),a)
c) δ(q,ya)
d) independent from δ notation
View Answer

Answer:b
Explanation: First it parse y string after that it parse a.

6. String X is accepted by finite automata if .


a) δ*(q,x) E A
b) δ(q,x) E A
c) δ*(Q0,x) E A
d) δ(Q0,x) E A
View Answer

Answer:c
Explanation: If automata starts with starting state and after finite moves if reaches to final step then
it called accepted.

7. Languages of a automata is
a) If it is accepted by automata
b) If it halts
c) If automata touch final state in its life time
d) All language are language of automata
View Answer

Answer:a
Explanation: If a string accepted by automata it is called language of automata.

8. Language of finite automata is.


a) Type 0
b) Type 1
c) Type 2
d) Type 3
View Answer

Answer:d
Explanation: According to Chomsky classification.

9. Finite automata requires minimum _______ number of stacks.


a) 1
b) 0
c) 2
d) None of the mentioned
View Answer

Answer:b
Explanation: Finite automata doesn’t require any stack operation .

10. Number of final state require to accept Φ in minimal finite automata.


a) 1
b) 2
c) 3
d) None of the mentioned
View Answer

Answer:d
Explanation: No final state requires.

11. Regular expression for all strings starts with ab and ends with bba is.
a) aba*b*bba
b) ab(ab)*bba
c) ab(a+b)*bba
d) All of the mentioned
View Answer

Answer:c
Explanation: Starts with ab then any number of a or b and ends with bba.

12. How many DFA’s exits with two states over input alphabet {0,1} ?
a) 16
b) 26
c) 32
d) 64
View Answer

Answer:d
Explanation: Number of DFA’s = 2n * n(2*n).

13. The basic limitation of finite automata is that


a) It can’t remember arbitrary large amount of information.
b) It sometimes recognize grammar that are not regular.
c) It sometimes fails to recognize regular grammar.
d) All of the mentioned
View Answer

Answer:a
Explanation:Because there is no memory associated with automata.

14. Number of states require to simulate a computer with memory capable of storing ‘3’ words each
of length ‘8’.
a) 3 * 28
b) 2(3*8)
c) 2(3+8)
d) None of the mentioned
View Answer

Answer:b
Explanation: 2(m*n) states requires .

15. FSM with output capability can be used to add two given integer in binary representation. This is
a) True
b) False
c) May be true
d) None of the mentioned
View Answer

Answer:a
Explanation: Use them as a flip flop output .

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “Non
Deterministic Finite Automata – Introduction”

1. Which of the following options is correct?


Statement 1: Initial State of NFA is Initial State of DFA.
Statement 2: The final state of DFA will be every combination of final state of NFA.
a) Statement 1 is true and Statement 2 is true
b) Statement 1 is true and Statement 2 is false
c) Statement 1 can be true and Statement 2 is true
d) Statement 1 is false and Statement 2 is also false
View Answer

Answer: a
Explanation: Statement 1 and 2 always true for a given Language.

2. Given Language: L= {ab U aba}*


If X is the minimum number of states for a DFA and Y is the number of states to construct the NFA,
|X-Y|=?
a) 2
b) 3
c) 4
d) 1
View Answer

Answer: a
Explanation: Construct the DFA and NFA individually, and the attain the difference of states.

3. An automaton that presents output based on previous state or current input:


a) Acceptor
b) Classifier
c) Transducer
d) None of the mentioned.
View Answer

Answer: c
Explanation: A transducer is an automaton that produces an output on the basis of what input has
been given currently or previous state.

4. If NFA of 6 states excluding the initial state is converted into DFA, maximum possible number of
states for the DFA is ?
a) 64
b) 32
c) 128
d) 127
View Answer
Answer: c
Explanation: The maximum number of sets for DFA converted from NFA would be not greater than
2n.

5. NFA, in its name has ’non-deterministic’ because of :


a) The result is undetermined
b) The choice of path is non-deterministic
c) The state to be transited next is non-deterministic
d) All of the mentioned
View Answer

Answer: b
Explanation: Non deterministic or deterministic depends upon the definite path defined for the
transition from one state to another or undefined(multiple paths).

6. Which of the following is correct proposition?


Statement 1: Non determinism is a generalization of Determinism.
Statement 2: Every DFA is automatically an NFA

a) Statement 1 is correct because Statement 2 is correct


b) Statement 2 is correct because Statement 2 is correct
c) Statement 2 is false and Statement 1 is false
d) Statement 1 is false because Statement 2 is false
View Answer

Answer: b
Explanation: DFA is a specific case of NFA.

7. Given Language L= {xϵ {a, b}*|x contains aba as its substring}


Find the difference of transitions made in constructing a DFA and an equivalent NFA?
a) 2
b) 3
c) 4
d) Cannot be determined.
View Answer

Answer: a
Explanation: The individual Transition graphs can be made and the difference of transitions can be
determined.

8. The construction time for DFA from an equivalent NFA (m number of node)is:
a) O(m2)
b) O(2m)
c) O(m)
d) O(log m)
View Answer

Answer: b
Explanation: From the coded NFA-DFA conversion.

9. If n is the length of Input string and m is the number of nodes, the running time of DFA is x that of
NFA.Find x?
a) 1/m2
b) 2m
c) 1/m
d) log m
View Answer

Answer: a
Explanation: Running time of DFA: O(n) and Running time of NFA =O(m2n).

10. Which of the following option is correct?


a) NFA is slower to process and its representation uses more memory than DFA
b) DFA is faster to process and its representation uses less memory than NFA
c) NFA is slower to process and its representation uses less memory than DFA
d) DFA is slower to process and its representation uses less memory than NFA
View Answer

Answer: c
Explanation: NFA, while computing strings, take parallel paths, make different copies of input and
goes along different paths in order to search for the result. This creates the difference in processing
speed of DFA and NFA

1. The number of tuples in an extended Non Deterministic Finite Automaton:


a) 5
b) 6
c) 7
d) 4
View Answer

Answer: a
Explanation: For NFA or extended transition function on NFA, the tuple elements remains same i.e.
5.

2. Choose the correct option for the given statement:


Statement: The DFA shown represents all strings which has 1 at second last position.

a) Correct
b) Incorrect, Incomplete DFA
c) Wrong proposition
d) May be correct
View Answer

Answer: c
Explanation: The given figure is an NFA. The statement contradicts itself.

3. What is wrong in the given definition?


Def: ({q0, q1, q2}, {0,1}, δ, q3, {q3})
a) The definition does not satisfy 5 Tuple definition of NFA
b) There are no transition definition
c) Initial and Final states do not belong to the Graph
d) Initial and final states can’t be same
View Answer

Answer: c
Explanation: q3 does not belong to Q where Q= set of finite states.

4. If δ is the transition function for a given NFA, then we define the δ’ for the DFA accepting the
same language would be:
Note: S is a subset of Q and a is a symbol.
a) δ’ (S, a) =Upϵs δ (p, a)
b) δ’ (S, a) =Up≠s δ (p, a)
c) δ’ (S, a) =Upϵs δ(p)
d) δ’ (S) =Up≠s δ(p)
View Answer

Answer: a
Explanation: According to subset construction, equation 1 holds true.

5. What is the relation between DFA and NFA on the basis of computational power?
a) DFA > NFA
b) NFA > DFA
c) Equal
d) Can’t be said
View Answer

Answer: c
Explanation: DFA is said to be a specific case of NFA and for every NFA that exists for a given
language, an equivalent DFA also exists.

6. If a string S is accepted by a finite state automaton, S=s1s2s3……sn where siϵ∑ and there exists a
sequence of states r0, r1, r2…… rn such that δ(r(i), si+1) =ri+1 for each 0, 1, …n-1, then r(n) is:
a) initial state
b) transition symbol
c) accepting state
d) intermediate state
View Answer

Answer: c
Explanation: r(n) is the final state and accepts the string S after the string being traversed through
r(i) other states where I ϵ 01,2…(n-2).

7. According to the given table, compute the number of transitions with 1 as its symbol but not 0:

a) 4
b) 3
c) 2
d) 1
View Answer

Answer: d
Explanation: The transition graph is made and thus the answer can be found.

8. From the given table, δ*(q0, 011) =?

a) {q0}
b) {q1} U {q0, q1, q2}
c) {q2, q1}
d) {q3, q1, q2, q0}
View Answer

Answer: b
Explanation: δ*(q0,011) = Urϵδ*(q0,01) δ (r, 1) = {q0, q1, q2}.

9. Number of times the state q3 or q2 is being a part of extended 6 transition state is

a) 6
b) 5
c) 4
d) 7
View Answer
Answer: a
Explanation: According to the question, presence of q2 or q1 would count so it does and the answer
according to the diagram is 6.

10. Predict the missing procedure:

1.Δ(Q0, ε) ={Q0},
2.Δ(Q0, 01) = {Q0, Q1}
3.δ(Q0, 010) =?

a) {Q0, Q1, Q2}


b) {Q0, Q1}
c) {Q0, Q2}
d) {Q1, Q2}
View Answer

Answer: c
Explanation: According to given table and extended transition state implementation, we can find the
state at which it rests.

1. Subset Construction method refers to:


a) Conversion of NFA to DFA
b) DFA minimization
c) Eliminating Null references
d) ε-NFA to NFA
View Answer

Answer: a
Explanation: The conversion of a non-deterministic automata into a deterministic one is a process
we call subset construction or power set construction.

2. Given Language:
Ln= {xϵ {0,1} * | |x|≥n, nth symbol from the right in x is 1}
How many state are required to execute L3 using NFA?
a) 16
b) 15
c) 8
d) 7
View Answer

Answer: b
Explanation: The finite automaton for the given language is made and thus, the answer can be
obtained.
3. Which of the following does the given NFA represent?

a) {11, 101} * {01}


b) {110, 01} * {11}
c) {11, 110} * {0}
d) {00, 110} * {1}
View Answer

Answer: c
Explanation: The given diagram can be analysed and thus the option can be seeked.

4. The number of transitions required to convert the following into equivalents DFA:

a) 2
b) 3
c) 1
d) 0
View Answer

Answer: a
Explanation:
5. If L is a regular language, Lc and Lr both will be:
a) Accepted by NFA
b) Rejected by NFA
c) One of them will be accepted
d) Cannot be said
View Answer

Answer: a
Explanation: If L is a regular Language, Lc and Lr both are regular even.

6. In NFA, this very state is like dead-end non final state:


a) ACCEPT
b) REJECT
c) DISTINCT
d) START
View Answer

Answer: b
Explanation: REJECT state will be like a halting state which rejects a particular invalid input.

7. We can represent one language in more one FSMs, true or false?


a) TRUE
b) FALSE
c) May be true
d) Cannot be said
View Answer

Answer: a
Explanation: We can represent one language in more one FSMs, example for a same language we
have a DFA and an equivalent NFA.

8. The production of form non-terminal -> ε is called:


a) Sigma Production
b) Null Production
c) Epsilon Production
d) All of the mentioned
View Answer

Answer: b
Explanation: The production of form non-terminal ->ε is call null production.

9. Which of the following is a regular language?


a) String whose length is a sequence of prime numbers
b) String with substring wwr in between
c) Palindrome string
d) String with even number of Zero’s
View Answer

Answer: d
Explanation: DFSM’s for the first three option is not possible; hence they aren’t regular.
10. Which of the following recognizes the same formal language as of DFA and NFA?
a) Power set Construction
b) Subset Construction
c) Robin-Scott Construction
d) All of the mentioned
View Answer

Answer: d
Explanation: All the three option refers to same technique if distinguishing similar constructions for
different type of automata.

1. Under which of the following operation, NFA is not closed?


a) Negation
b) Kleene
c) Concatenation
d) None of the mentioned
View Answer

Answer: d
Explanation: NFA is said to be closed under the following operations:
a) Union
b) Intersection
c) Concatenation
d) Kleene
e) Negation

2. It is less complex to prove the closure properties over regular languages using
a) NFA
b) DFA
c) PDA
d) Can’t be said
View Answer

Answer: a
Explanation: We use the construction method to prove the validity of closure properties of regular
languages. Thus, it can be observe, how tedious and complex is the construction of a DFA as
compared to an NFA with respect to space.

3. Which of the following is an application of Finite Automaton?


a) Compiler Design
b) Grammar Parsers
c) Text Search
d) All of the mentioned
View Answer

Answer: d
Explanation: There are many applications of finite automata, mainly in the field of Compiler Design
and Parsers and Search Engines.

4. John is asked to make an automaton which accepts a given string for all the occurrence of ‘1001’
in it. How many number of transitions would John use such that, the string processing application
works?
a) 9
b) 11
c) 12
d) 15
View Answer

Answer: a
Explanation:

5. Which of the following do we use to form an NFA from a regular expression?


a) Subset Construction Method
b) Power Set Construction Method
c) Thompson Construction Method
d) Scott Construction Method
View Answer

Answer: c
Explanation: Thompson Construction method is used to turn a regular expression in an NFA by
fragmenting the given regular expression through the operations performed on the input alphabets.

6. Which among the following can be an example of application of finite state machine(FSM)?
a) Communication Link
b) Adder
c) Stack
d) None of the mentioned
View Answer

Answer: a
Explanation: Idle is the state when data in form of packets is send and returns if NAK is received else
waits for the NAK to be received.

7. Which among the following is not an application of FSM?


a) Lexical Analyser
b) BOT
c) State charts
d) None of the mentioned
View Answer

Answer: d
Explanation: Finite state automation is used in Lexical Analyser, Computer BOT (used in games),
State charts, etc.
8. L1= {w | w does not contain the string tr }
L2= {w | w does contain the string tr}
Given ∑= {t, r}, The difference of the minimum number of states required to form L1 and L2?
a) 0
b) 1
c) 2
d) Cannot be said
View Answer

Answer: a
Explanation:

9. Predict the number of transitions required to automate the following language using only 3 states:
L= {w | w ends with 00}
a) 3
b) 2
c) 4
d) Cannot be said
View Answer

Answer: a
Explanation:
10. The total number of states to build the given language using DFA:
L= {w | w has exactly 2 a’s and at least 2 b’s}
a) 10
b) 11
c) 12
d) 13
View Answer

Answer: a
Explanation: We need to make the number of a as fixed i.e. 2 and b can be 2 or more. Thus, using
this condition a finite automata can be created using 1 states

1. Given Language: {x | it is divisible by 3}


The total number of final states to be assumed in order to pass the number constituting {0, 1} is
a) 0
b) 1
c) 2
d) 3
View Answer

Answer: c
Explanation: The DFA for the given language can be constructed as follows:

2. A binary string is divisible by 4 if and only if it ends with:


a) 100
b) 1000
c) 1100
d) 0011
View Answer

Answer: a
Explanation: If the string is divisible by four, it surely ends with the substring ‘100’ while a binary
string divisible by 2 would surely end with the substring ‘10’.

3. Let L be a language whose FA consist of 5 acceptance states and 11 non final states. It further
consists of a dumping state. Predict the number of acceptance states in Lc.
a) 16
b) 11
c) 5
d) 6
View Answer

Answer: a
Explanation: If L leads to FA1, then for Lc, the FA can be obtained by exchanging the final and non-
final states.
4. If L1 and L2 are regular languages, which among the following is an exception?
a) L1 U L2
b) L1 – L2
c) L1 ∩ L2
d) All of the mentioned
View Answer

Answer: d
Explanation: It the closure property of Regular language which lays down the following statement:
If L1, L2 are 2- regular languages, then L1 U L2, L1 ∩ L2, L1C, L1 – L2 are regular language.

5. Predict the analogous operation for the given language:


A: {[p, q] | p ϵ A1, q does not belong to A2}
a) A1-A2
b) A2-A1
c) A1.A2
d) A1+A2
View Answer

Answer: a
Explanation: When set operation ‘-‘ is performed between two sets, it points to those values of prior
set which belongs to it but not to the latter set analogous to basic subtraction operation.

6. Which among the following NFA’s is correct corresponding to the given Language?
L= {xϵ {0, 1} | 3rd bit from right is 0}

a)

b)
c)
d) None of the mentioned
View Answer

Answer: a
Explanation: The NFA accepts all binary strings such that the third bit from right end is 1 and if not, is
send to Dumping state. Note: It is assumed that the input is given from the right end bit by bit.

7. Statement 1: NFA computes the string along parallel paths.


Statement 2: An input can be accepted at more than one place in an NFA.
Which among the following options are most appropriate?
a) Statement 1 is true while 2 is not
b) Statement 1 is false while is not
c) Statement 1 and 2, both are true
d) Statement 1 and 2, both are false
View Answer

Answer: c
Explanation: While the machine runs on some input string, if it has the choice to split, it goes in all
possible way and each one is different copy of the machine. The machine takes subsequent choice to
split further giving rise to more copies of the machine getting each copy run parallel. If any one copy
of the machine accepts the strings, then NFA accepts, otherwise it rejects.

8. Which of the following options is correct for the given statement?


Statement: If K is the number of states in NFA, the DFA simulating the same language would have
states less than 2k.
a) True
b) False
View Answer

Answer: a
Explanation: If K is the number of states in NFA, the DFA simulating the same language would have
states equal to or less than 2k.

9. Let N (Q, ∑, δ, q0, A) be the NFA recognizing a language L. Then for a DFA (Q’, ∑, δ’, q0’, A’), which
among the following is true?
a) Q’ = P(Q)
b) Δ’ = δ’ (R, a) = {q ϵ Q | q ϵ δ (r, a), for some r ϵ R}
c) Q’={q0}
d) All of the mentioned
View Answer

Answer: d
Explanation: All the optioned mentioned are the instruction formats of how to convert a NFA to a
DFA.

10. There exists an initial state, 17 transition states, 7 final states and one dumping state, Predict the
maximum number of states in its equivalent DFA?
a) 226
b) 224
c) 225
d) 223
View Answer

Answer: a
Explanation: The maximum number of states an equivalent DFA can comprise for its respective NFA
with k states will be 2k.

1. According to the given transitions, which among the following are the epsilon closures of q1 for
the given NFA?
Δ (q1, ε) = {q2, q3, q4}
Δ (q4, 1) =q1
Δ (q1, ε) =q1
a) q4
b) q2
c) q1
d) q1, q2, q3, q4
View Answer

Answer: d
Explanation: The set of states which can be reached from q using ε-transitions, is called the ε-closure
over state q.

2. State true or false?


Statement: An NFA can be modified to allow transition without input alphabets, along with one or
more transitions on input symbols.
a) True
b) False
View Answer

Answer: a
Explanation: It is possible to construct an NFA with ε-transitions, presence of no input symbols, and
that is called NFA with ε-moves.

3. State true or false?


Statement: ε (Input) does not appears on Input tape.
a) True
b) False
Answer: a
View Answer
Explanation: ε does not appears on Input tape, ε transition means a transition without scanning a
symbol i.e. without moving the read head.

4. Statement 1: ε- transition can be called as hidden non-determinism.


Statement 2: δ (q, ε) = p means from q it can jump to p with a shift in read head.
Which among the following options is correct?
a) Statement 1 and 2, both are correct
b) Statement 1 and 2, both are wrong
c) Statement 1 is correct while Statement 2 is wrong
d) Statement 1 is wrong while Statement 2 is correct
View Answer

Answer: c
Explanation: The transition with ε leads to a jump but without any shift in read head. Further, the
method can be called one to introduce hidden non-determinism.

5. ε- closure of q1 in the given transition graph:


a) {q1}
b) {q0, q2}
c) {q1, q2}
d) {q0, q1, q2}
View Answer

Answer: c
Explanation: ε-closure is defined as the set of states being reached through ε-transitions from a
starting state.

6. Predict the total number of final states after removing the ε-moves from the given NFA?
a) 1
b) 2
c) 3
d) 0
View Answer

Answer: c
Explanation: The NFA which would result after eliminating ε-moves can be shown diagramatically.

7. For NFA with ε-moves, which among the following is correct?


a) Δ: Q X (∑ U {ε}) -> P(Q)
b) Δ: Q X (∑) -> P(Q)
c) Δ: Q X (∑*) -> P(Q)
d) All of the mentioned
View Answer

Answer: a
Explanation: Due to the presence of ε symbol, or rather an epsilon-move, the input alphabets unites
with it to form a set including ε.

8. Which among the following is false?


ε-closure of a subset S of Q is:
a) Every element of S ϵ Q
b) For any q ϵ ε(S), every element of δ (q, ε) is in ε(S)
c) No other element is in ε(S)
d) None of the mentioned
View Answer

Answer: d
Explanation: All the mentioned are the closure properties of ε and encircles all the elements if it
satisfies the following options:
a) Every element of S ϵ Q
b) For any q ϵ ε(S), every element of δ (q, ε) is in ε(S)
c) No other element is in ε(S)

9. The automaton which allows transformation to a new state without consuming any input symbols:
a) NFA
b) DFA
c) NFA-l
d) All of the mentioned
View Answer

Answer: c
Explanation: NFA-l or e-NFA is an extension of Non deterministic Finite Automata which are usually
called NFA with epsilon moves or lambda transitions.

10. e-transitions are


a) conditional
b) unconditional
c) input dependent
d) none of the mentioned
View Answer

Answer: b
Explanation: An epsilon move is a transition from one state to another that doesnt require any
specific condition.

11. The __________ of a set of states, P, of an NFA is defined as the set of states reachable from any
state in P following e-transitions.
a) e-closure
b) e-pack
c) Q in the tuple
d) None of the mentioned
View Answer

Answer: a
Explanation: The e-closure of a set of states, P, of an NFA is defined as the set of states reachable
from any state in P following e-transitions.

12. The e-NFA recognizable languages are not closed under :


a) Union
b) Negation
c) Kleene Closure
d) None of the mentioned
View Answer
Answer: d
Explanation: The languages which are recognized by an epsilon Non deterministic automata are
closed under the following operations:
a) Union
b) Intersection
c) Concatenation
d) Negation
e) Star
f) Kleene closure

1. The automaton which allows transformation to a new state without consuming any input symbols:
a) NFA
b) DFA
c) NFA-l
d) All of the mentioned
View Answer

Answer: c
Explanation: NFA-l or e-NFA is an extension of Non deterministic Finite Automata which are usually
called NFA with epsilon moves or lambda transitions.

2. e-transitions are
a) conditional
b) unconditional
c) input dependent
d) none of the mentioned
View Answer

Answer: b
Explanation: An epsilon move is a transition from one state to another that doesn’t require any
specific condition.

3. The __________ of a set of states, P, of an NFA is defined as the set of states reachable from any
state in P following e-transitions.
a) e-closure
b) e-pack
c) Q in the tuple
d) None of the mentioned
View Answer

Answer: a
Explanation: The e-closure of a set of states, P, of an NFAis defined as the set of states reachable
from any state in P following e-transitions.

4. The e-NFA recognizable languages are not closed under :


a) Union
b) Negation
c) Kleene Closure
d) None of the mentioned
View Answer
Answer: The languages which are recognized by an epsilon Non deterministic automata are closed
under the following operations:
a) Union
b) Intersection
c) Concatenation
d) Negation
e) Star
f) Kleene closure

5. Is the language preserved in all the steps while eliminating epsilon transitions from a NFA?
a) yes
b) no
View Answer

Answer: a
Explanation: Yes, the language is preserved during the dteps of construction: L(N)=L(N1)=L(N2)=L(3).

6. An e-NFA is ___________ in representation.


a) Quadruple
b) Quintuple
c) Triple
d) None of the mentioned
View Answer

Answer: b
Explanation: An e-NFA consist of 5 tuples: A=(Q, S, d, q0, F)
Note: e is never a member of S.

7. State true or false:


Statement: Both NFA and e-NFA recognize exactly the same languages.
a) true
b) false
View Answer

Answer: a
Explanation: e-NFA do come up with a convenient feature but nothing new.They do not extend the
class of languages that can be represented.

1. Which of the following does not belong to input alphabet if S={a, b}* for any language?
a) a
b) b
c) e
d) none of the mentioned
View Answer

Answer: c
Explanation: The automaton may be allowed to change its state without reading the input symbol
using epsilon but this does not mean that epsilon has become an input symbol. On the contrary, one
assumes that the symbol epsilon does not belong to any alphabet.

2. The number of final states we need as per the given language?


Language L: {an| n is even or divisible by 3}
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: b
Explanation:

3. State true or false:


Statement: Both NFA and e-NFA recognize exactly the same languages.
a) true
b) false
View Answer

Answer: a
Explanation: e-NFA do come up with a convenient feature but nothing new.They do not extend the
class of languages that can be represented.

4. Design a NFA for the language:


L: {an| n is even or divisible by 3}
Which of the following methods can be used to simulate the same.
a) e-NFA
b) Power Construction Method
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: It is more convenient to simulate a machine using e-NFA else the method of Power
Construction is used from the union-closure of DFA’s.
5. Which of the following belongs to the epsilon closure set of a?

a) {f1, f2, f3}


b) {a, f1, f2, f3}
c) {f1, f2}
d) none of the mentioned
View Answer

Answer: b
Explanation: The epsilon closure of the set q is the set that contains q, together with all the states
which can be reached starting at q by following only epsilon transitions.

6. The number of elements present in the e-closure(f2) in the given diagram:


a) 0
b) 1
c) 2
d) 3
View Answer

Answer: c
Explanation: The epsilon closure set of f2 consist of the elements:{f2, f3}. Thus the count of the
element in the closure set is 2.

7. Which of the steps are non useful while eliminating the e-transitions for the given diagram?

a) Make a as accepting state of N’ if ECLOSE(p) contains an accepting state of N


b) Add an arc a to f1 labelled a if there is an arc labelled a in N from some state in ECLOSE(a) to f1
c) Delete all arcs labelled as e
d) None of the mentioned
View Answer

Answer: d
Explanation: The given are the steps followed while eliminating epsilon transitions from a NFA or
converting an e-NFA to just NFA.

8. Remove all the epsilon transitions in the given diagram and compute the number of a-transitions
in the result?
a) 5
b) 7
c) 9
d) 6
View Answer

Answer: b
Explanation:

1. Regular sets are closed under union,concatenation and kleene closure.


a) True
b) False
c) Depends on regular set
d) Can’t say
View Answer

Answer:a
Explanation: Regular sets are closed under these three operation.

2. Complement of a DFA can be obtained by


a) making starting state as final state.
b) no trival method.
c) making final states non-final and non-final to final.
d) make final as a starting state.
View Answer

Answer:c
Explanation: String accepted in previous DFA will not be accepted and non accepting string will be
accepted .

3. Complement of regular sets are _________


a) Regular
b) CFG
c) CSG
d) RE
View Answer

Answer:a
Explanation: Regular sets are closed under complement operation.

4. If L1 and L2 are regular sets then intersection of these two will be


a) Regular
b) Non Regular
c) Recursive
d) Non Recursive
View Answer

Answer:a
Explanation: Regular expression are also colsed under intersection.

5. If L1 is regular L2 is unknown but L1-L2 is regular ,then L2 must be


a) Empty set
b) CFG
c) Decidable
d) Regular
View Answer

Answer:d
Explanation: Regular is closed under difference.

6. Reverse of a DFA can be formed by


a) using PDA
b) making final state as non-final
c) making final as starting state and starting state as final state
d) None of the mentioned
View Answer

Answer:c
Explanation: By making final state as starting state string starting from end will be accepted.

7. Reverse of (0+1)* will be


a) Phi
b) Null
c) (0+1)*
d) (0+1)
View Answer

Answer:c
Explanation: There is only one state which is start and final state of DFA so interchanging starting
start and final state doesn’t change DFA.

8. A ___________ is a substitution such that h(a) contains a string for each a.


a) Closure
b) Interchange
c) Homomorphism
d) Inverse Homomorphism
View Answer

Answer:c
Explanation: This operation replace using a function .

9. Homomorphism of a regular set is _______


a) Universal set
b) Null set
c) Regular set
d) Non regular set
View Answer

Answer:c
Explanation: Regular set are closed under homomorphism.

10. (a ^ 5b ^ 5)* is example of ________


a) Type 0 language
b) Type 1 language
c) Type 2 language
d) Type 3 language
View Answer

Answer:d
Explanation: It is a regular expression.

11. Which of the following is type 3 language ?


a) Strings of 0’s whose length is perfect square
b) Palindromes string
c) Strings of 0’s having length prime number
d) String of odd number of 0’s
View Answer

Answer:d
Explanation: Only d is regular language.

12. a ^ nb ^ n where (n+m) is even .


a) Type 0
b) Type 1
c) Type 2
d) Type 3
View Answer

Answer:d
Explanation: It is a regular expression.

13. Complement of a ^ nb ^ m where n >= 4 and m <= 3 is example of


a) Type 0
b) Type 1
c) Type 2
d) Type 3
View Answer

Answer:d
Explanation: It is a regular expression.

14. a ^ nb ^ m where n >= 1, m >= 1, nm >= 3 is example of


a) Type 0
b) Type 1
c) Type 2
d) Type 3
View Answer

Answer:d
Explanation: It is a regular expression.

15. Complement of (a + b)* will be


a) phi
b) null
c) a
d) b
View Answer

Answer:a
Explanation: Given expression accept all string so complement will accept nothing

1. L is a regular Language if and only If the set of __________ classes of IL is finite.


a) Equivalence
b) Reflexive
c) Myhill
d) Nerode
View Answer

Answer: a
Explanation: According to Myhill Nerode theorem, the corollary proves the given statement correct
for equivalence classes.

2. A language can be generated from simple primitive language in a simple way if and only if
a) It is recognized by a device of infinite states
b) It takes no auxiliary memory
c) Both are correct
d) Both are wrong
View Answer

Answer: b
Explanation: A language is regular if and only if it can be accepted by a finite automaton. Secondly, It
supports no concept of auxiliary memory as it loses the data as soon as the device is shut down.

3. Which of the following does not represents the given language?


Language: {0,01}
a) 0+01
b) {0} U {01}
c) {0} U {0}{1}
d) {0} ^ {01}
View Answer

Answer: d
Explanation: The given option represents {0, 01} in different forms using set operations and Regular
Expressions. The operator like ^, v, etc. are logical operation and they form invalid regular
expressions when used.

4. According to the given language, which among the following expressions does it corresponds to?
Language L={xϵ{0,1}|x is of length 4 or less}

a) (0+1+0+1+0+1+0+1)4
b) (0+1)4
c) (01)4
d) (0+1+ε)4
View Answer

Answer: d
Explanation: The extended notation would be (0+1)4 but however, we may allow some or all the
factors to be ε. Thus ε needs to be included in the given regular expression.

5. Which among the following looks similar to the given expression?


((0+1). (0+1)) *
a) {xϵ {0,1} *|x is all binary number with even length}
b) {xϵ {0,1} |x is all binary number with even length}
c) {xϵ {0,1} *|x is all binary number with odd length}
d) {xϵ {0,1} |x is all binary number with odd length}
View Answer

Answer: a
Explanation: The given regular expression corresponds to a language of binary strings which is of
even length including a length of 0.

6. If R represents a regular language, which of the following represents the Venn-diagram most
correctly?

a) An Irregular Set
b) R*
c) R complement
d) R reverse
View Answer
Answer: b
Explanation: The given diagram represents the Kleene operation over the Regular Language R in
which the final states become the initial and the initial state becomes final.

7. The given NFA corresponds to which of the following Regular expressions?

a) (0+1) *(00+11) (0+1) *


b) (0+1) *(00+11) *(0+1) *
c) (0+1) *(00+11) (0+1)
d) (0+1) (00+11) (0+1) *
View Answer

Answer: a
Explanation: The transition states shown are the result of breaking down the given regular
expression in fragments. For dot operation, we change a state, for union (plus) operation, we
diverge into two transitions and for Kleene Operation, we apply a loop.

8. Concatenation Operation refers to which of the following set operations:


a) Union
b) Dot
c) Kleene
d) Two of the options are correct
View Answer

Answer: b
Explanation: Two operands are said to be performing Concatenation operation AB = A•B = {xy: x ∈ A
& y ∈ B}.

9. Concatenation of R with Ф outputs:


a) R
b) Ф
c) R.Ф
d) None of the mentioned
View Answer

Answer: b
Explanation: By distributive property (Regular expression identities), we can prove the given identity
to be Ф.
10. RR* can be expressed in which of the forms:
a) R+
b) R-
c) R+ U R-
d) R
View Answer

Answer: a
Explanation: RR*=R+ as R+ means the occurrence to be at least once.

1. A finite automaton accepts which type of language:


a) Type 0
b) Type 1
c) Type 2
d) Type 3
View Answer

Answer: d
Explanation: Type 3 refers to Regular Languages which is accepted by a finite automaton.

2. Which among the following are incorrect regular identities?


a) εR=R
b) ε*=ε
c) Ф*=ε
d) RФ=R
View Answer

Answer: d
Explanation: There are few identities over Regular Expressions which include: RФ=ФR=Ф≠R

3. Simplify the following regular expression:


ε+1*(011) *(1*(011) *) *
a) (1+011) *
b) (1*(011) *)
c) (1+(011) *) *
d) (1011) *
View Answer

Answer: a
Explanation: ε+1*(011) *(1*(011) *) *
ε + RR*= ε + R*R= ε + R+= R*

4. P, O, R be regular expression over ∑, P is not ε, then


R=Q + RP has a unique solution:

a) Q*P
b) QP*
c) Q*P*
d) (P*O*) *
View Answer
Answer: b
Explanation: The given statement is the Arden’s Theorem and it tends to have a unique solution as
QP*.
Let P and Q be regular expressions,
R=Q+RP
R=Q+(Q+RP) P
R=Q+((Q+RP) +RP) +P=Q+QP+RPP+RPP=Q+QP+(Q+RP) PP+(Q+RP) PP=Q+QP+QPP+RPPP+QPP+RPPP,
If we do this recursively, we get:
R= QP*

5. Arden’s theorem is true for:


a) More than one initial states
b) Null transitions
c) Non-null transitions
d) None of the mentioned
View Answer

Answer: c
Explanation: Arden’s theorem strictly assumes the following;
a) No null transitions in the transition diagrams
b) True for only single initial state

6. The difference between number of states with regular expression (a + b) and (a + b) * is:
a) 1
b) 2
c) 3
d) 0
View Answer

Answer: a
Explanation:

7. In order to represent a regular expression, the first step to create the transition diagram is:
a) Create the NFA using Null moves
b) Null moves are not acceptable, thus should not be used
c) Predict the number of states to be used in order to construct the Regular expression
d) None of the mentioned
View Answer

Answer: a
Explanation: Two steps are to be followed while converting a regular expression into a transition
diagram:
a) Construct the NFA using null moves.
b) Remove the null transitions and convert it into its equivalent DFA.

8. (0+ε) (1+ε) represents


a) {0, 1, 01, ε}
b) {0, 1, ε}
c) {0, 1, 01 ,11, 00, 10, ε}
d) {0, 1}
View Answer
Answer: a
Explanation: The regular expression is fragmented and the set of the strings eligible is formed. ‘+’
represents union while ‘.’ Represents concatenation.

9. The minimum number of states required to automate the following Regular Expression:
(1) *(01+10) (1) *
a) 4
b) 3
c) 2
d) 5
View Answer

Answer: a

10. Regular Expression denote precisely the ________ of Regular Language.


a) Class
b) Power Set
c) Super Set
d) None of the mentioned
View Answer

Answer: a
Explanation: Regular Expression denote precisely the class of regular language. Given any regular
expression, L(R) is a regular language. Given any regular language L, there is a regular expression R,
such that L(R)=L.

1. Which of the following is correct?


Statement 1: ε represents a single string in the set.
Statement 2: Ф represents the language that consist of no string.
a) Statement 1 and 2 both are correct
b) Statement 1 is false but 2 is correct
c) Statement 1 and 2 both are false
d) There is no difference between both the statements, ε and Ф are different notation for same
reason
View Answer

Answer: a
Explanation: ε represents a single string in the set namely, the empty string while Statement 2 is also
correct.

2. The appropriate precedence order of operations over a Regular Language is


a) Kleene, Union, Concatenate
b) Kleene, Star, Union
c) Kleene, Dot, Union
d) Star, Union, Dot
View Answer

Answer: c
Explanation: If a regular language expression is given, the appropriate order of precedence if the
parenthesis is ignored is: Star or Kleene, Dot or Concatenation, Union or Plus.
3. Regular Expression R and the language it describes can be represented as:
a) R, R(L)
b) L(R), R(L)
c) R, L(R)
d) All of the mentioned
View Answer

Answer: c
Explanation: When we wish to distinguish between a regular expression R and the language it
represents; we write L(R) to be the language of R.

4. Let for ∑= {0,1} R= (∑∑∑) *, the language of R would be


a) {w | w is a string of odd length}
b) {w | w is a string of length multiple of 3}
c) {w | w is a string of length 3}
d) All of the mentioned
View Answer

Answer: b
Explanation: This regular expression can be used to eliminate the answers and get the result. The
length can be even and as well more than 3 when R= (∑∑∑) (∑∑∑) (particular case).

5. If ∑= {0,1}, then Ф* will result to:


a) ε
b) Ф
c) ∑
d) None of the mentioned
View Answer

Answer: a
Explanation: The star operation brings together any number of strings from the language to get a
string in the result. If the language is empty, the star operation can put together 0 strings, resulting
only the empty string.

6. The given NFA represents which of the following NFA


a) (ab U a) *
b) (a*b* U a*)
c) (ab U a*)
d) (ab)* U a*
View Answer

Answer: a
Explanation: The Regular expression (ab U a) * is converted to NFA in a sequence of stages as it can
be clearly seen in the diagram. This NFA consist of 8 stated while its minimized form only contains 2
states.

7. Which of the following represents a language which has no pair of consecutive 1’s if ∑= {0,1}?
a) (0+10)*(1+ε)
b) (0+10)*(1+ε)*
c) (0+101)*(0+ε)
d) (1+010)*(1+ε)
View Answer

Answer: a
Explanation: All the options except ‘a’ accept those strings which comprises minimum one pair of 1’s
together.

8. The finite automata accept the following languages:


a) Context Free Languages
b) Context Sensitive Languages
c) Regular Languages
d) All the mentioned
View Answer

Answer: c
Explanation: A finite automaton accepts the languages which are regular and for which a DFA can be
constructed.

9. (a + b*c) most correctly represents:


a) (a +b) *c
b) (a)+((b)*.c)
c) (a + (b*)).c
d) a+ ((b*).c)
View Answer

Answer: d
Explanation: Following the rules of precedence, Kleene or star operation would be done first, then
concatenation and finally union or plus operation.

10. Which of the following regular expressions represents the set of strings which do not contain a
substring ‘rt’ if ∑= {r, t}
a) (rt)*
b) (tr)*
c) (r*t*)
d) (t*r*)
View Answer

Answer: d
Explanation: As Kleene operation is not on the whole of the substring, it will not repeat and maintain
the order of t, r.

11. According to the precedence rules, x-y-z is equivalent to which of the following?
a) (x-y)-z
b) x-(y-z)
c) Both (x-y)-z and x-(y-z)
d) None of the mentioned
View Answer

Answer: a
Explanation: In arithmetic, we group two of the same operators from the left, hence x-y-z is
equivalent to (x-y)-z and not x-(y—z).
12. Dot operator in regular expression resembles which of the following?
a) Expressions are juxtaposed
b) Expressions are multiplied
c) Cross operation
d) None of the mentioned
View Answer

Answer: a
Explanation: Dot operation or concatenation operation means that the two expressions are
juxtaposed i.e. there are no intervening operators in between. In fact, UNIX regular expressions use
the dot for an entirely different purpose: representing any ASCII character.

13. Which among the following is not an associative operation?


a) Union
b) Concatenation
c) Dot
d) None of the mentioned
View Answer

Answer: d
Explanation: It does not matter in which order we group the expression with the operators as they
are associative. If one gets a chance to group the expression, one should group them from left for
convenience. For instance, 012 is grouped as (01)2.

14.Which among the following is equivalent to the given regular expression?


01*+1
a) (01)*+1
b) 0((1)*+1)
c) (0(1)*)+1
d) ((0*1)1*)*
View Answer

Answer: c
Explanation: Using the rules of precedence on the give expression, c is the appropriate choice with
the order of: Bracket>Kleene>Dot>Union

1. Which of the following is same as the given DFA?

a) (0+1)*001(0+1)*
b) 1*001(0+1)*
c) (01)*(0+0+1)(01)*
d) None of the mentioned
View Answer
Answer: a
Explanation: There needs to be 001 together in the string as an essential substring. Thus, the other
components can be anything, 0 or 1 or e.

2. Which of the following statements is not true?


a) Every language defined by any of the automata is also defined by a regular expression
b) Every language defined by a regular expression can be represented using a DFA
c) Every language defined by a regular expression can be represented using NFA with e moves
d) Regular expression is just another representation for any automata definition
View Answer

Answer: b
Explanation: Using NFA with e moves, we can represent all the regular expressions as an automata.
As regular expressions include e, we need to use e moves.

3. The total number of states required to automate the given regular expression
(00)*(11)*
a) 3
b) 4
c) 5
d) 6
View Answer

Answer: c

Explanation:
4. Which of the given regular expressions correspond to the automata shown?

a) (110+1)*0
b) (11+110)*1
c) (110+11)*0
d) (1+110)*1
View Answer

Answer: c
Explanation: There is no state change for union operation, but has two different paths while for
concatenation or dot operation, we have a state change for every element of the string.

5. Generate a regular expression for the following problem statement:


Password Validation: String should be 8-15 characters long. String must contain a number, an
Uppercase letter and a Lower case letter.
a) ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,15}$
b) ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{9,16}$
c) ^(?=.[a-z])(?=.[A-Z])(?=.\d).{8,15}$
d) None of the mentioned
View Answer

Answer: a
Explanation: Passwords like abc123, 123XYZ, should not be accepted . If one also wants to include
special characters as one of the constraint, one can use the following regular expression:
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-za-Z]).{8,15}$

6. Generate a regular expression for the following problem statement:


P(x): String of length 6 or less for å={0,1}*
a) (1+0+e)6
b) (10)6
c) (1+0)(1+0)(1+0)(1+0)(1+0)(1+0)
d) More than one of the mentioned is correct
View Answer

Answer: a
Explanation: As the input variables are under Kleene Operation, we need to include e,thus option c is
not correct,thereby option (a) is the right answer.

7. The minimum number of states required in a DFA (along with a dumping state) to check whether
the 3rd bit is 1 or not for |n|>=3
a) 3
b) 4
c) 5
d) 1
View Answer

Answer: c
Explanation:

8. Which of the regular expressions corresponds to the given problem statement:


P(x): Express the identifiers in C Programming language
l=letters
d=digits
a) (l+_)(d+_)*
b) (l+d+_)*
c) (l+_)(l+d+_)*
d) (_+d)(l+d+_)*
View Answer

Answer: c
Explanation: Identifiers in C Programming Language follows the following identifiers rule:
a) The name of the identifier should not begin with a digit.
b) It can only begin with a letter or a underscore.
c) It can be of length 1 or more.

9. Generate a regular expression for the given language:l


L(x): {xÎ{0,1}*| x ends with 1 nd does not contain a substring 01}
a) (0+01)*
b) (0+01)*1
c) (0+01)*(1+01)
d) All of the mentioned
View Answer

Answer: c
Explanation: (a) and (b) are the general cases where we restrict the acceptance of a string witrh
substring 00 but we ignore the case where the string needs to end with 1 which therby, does not
allows the acceptance of e.

10. The minimum number of transitions to pass to reach the final state as per the following regular
expression is:
{a,b}*{baaa}
a) 4
b) 5
c) 6
d) 3
View Answer

Answer: a

1. Which of the following is an utility of state elimination phenomenon?


a) DFA to NFA
b) NFA to DFA
c) DFA to Regular Expression
d) All of the mentioned
View Answer

Answer: c
Explanation: We use this algorithm to simplify a finite automaton to regular expression or vice versa.
We eliminate states while converting a given finite automata to its corresponding regular
expression.

2. If we have more than one accepting states or an accepting state with an outdegree, which of the
following actions will be taken?
a) addition of new state
b) removal of a state
c) make the newly added state as final
d) more than one option is correct
View Answer

Answer: d
Explanation: If there is more than one accepting state or if the single accepting state as an out
degree , add a new accepting state, make all other states non accepting, and hold an e-transitions
from each former accepting state to the new accepting state.

3. Which of the following is not a step in elimination of states procedure?


a) Unifying all the final states into one using e-transitions
b) Unify single transitions to multi transitions that contains union of input
c) Remove states until there is only starting and accepting states
d) Get the resulting regular expression by direct calculation
View Answer
Answer: b
Explanation: While eliminating the states, we unify multiple transitions to one transition that
contains union of input and not the vice versa.

4. Can the given state diagram be reduced?

a) Yes
b) No
View Answer

Answer: a
Explanation: The state q2 can be eliminated with ease and the reduced state diagram can be
represented as:

5. Which of the following methods is suitable for conversion of DFA to RE?


a) Brzozowski method
b) Arden’s method
c) Walter’s method
d) All of the mentioned
View Answer

Answer: a
Explanation: Brzozowski method takes a unique approach to generating regular expressions. We
create a system of regular expressions with one regular expression unknown for each state in M, and
then we solve the system for Rλ where Rλ is the regular expression associated with starting state qλ.

6. State true or false:


Statement: The state removal approach identifies patterns within the graph and removes state,
building up regular expressions along each transition.
a) true
b) false
View Answer
Answer: a
Explanation: This method has the advantage over the transitive closure technique as it can easily be
visualized.

7. The behaviour of NFA can be simulated using DFA.


a) always
b) never
c) sometimes
d) none of the mentioned
View Answer

Answer: a
Explanation: For every NFA, there exists an equivalent DFA and vice versa.

8. It is suitable to use ____________ method/methods to convert a DFA to regular expression.


a) Transitive Closure properties
b) Brzozowski method
c) State elimination method
d) All of the mentioned
View Answer

Answer: d
Explanation: For converting RE to DFA , first we convert RE to NFA (Thompson Construction), and
then NFA is converted into DFA(Subset Construction).

9. State true or false:


Statement: For every removed state, there is a regular expression produced.
a) true
b) false
View Answer

Answer: a
Explanation: For every state which is eliminated, a new regular expression is produced. The newly
generated regular expression act as an input for a state which is next to removed state.

10. Is it possible to obtain more than one regular expression from a given DFA using the state
elimination method?
a) Yes
b) No
View Answer

Answer: a
Explanation: Using different sequence of removal of state, we can have different possible solution of
regular expressions. For n-state deterministic finite automata excluding starting and final states, n!
Removal sequences are there. It is very tough to try all the possible removal sequences for smaller
expressions.

1. A regular language over an alphabet a is one that can be obtained from


a) union
b) concatenation
c) kleene
d) All of the mentioned
View Answer

Answer: d
Explanation: None.

2. Regular expression {0,1} is equivalent to


a) 0 U 1
b) 0 / 1
c) 0 + 1
d) All of the mentioned
View Answer

Answer: d
Explanation: All are equivalent to union operation.

3. Precedence of regular expression in decreasing order is


a) * , . , +
b) . , * , +
c) . , + , *
d) + , a , *
View Answer

Answer: a
Explanation: None.

4. Regular expression Φ* is equivalent to


a) ϵ
b) Φ
c) 0
d) 1
View Answer

Answer: a
Explanation: None.

5. a? is equivalent to
a) a
b) a+Φ
c) a+ϵ
d) wrong expression
View Answer

Answer: c
Explanation: Zero or one time repetition of previous character .

6. ϵL is equivalent to
a) ϵ
b) Φ
c) L
d) Lϵ
View Answer
Answer: c,d
Explanation: None.

7. (a+b)* is equivalent to
a) b*a*
b) (a*b*)*
c) a*b*
d) none of the mentioned
View Answer

Answer: b
Explanation: None.

8. ΦL is equivalent to
a) LΦ
b) Φ
c) L
d) ϵ
View Answer

Answer: a,b
Explanation: None.

9. Which of the following pair of regular expression are not equivalent?


a) 1(01)* and (10)*1
b) x(xx)* and (xx)*x
c) (ab)* and a*b*
d) x+ and x*x+
View Answer

Answer: c
Explanation: (ab)*=(a*b*)*.

10. Consider following regular expression


i) (a/b)* ii) (a*/b*)* iii) ((ϵ/a)b*)*
Which of the following statements is correct
a) i,ii are equal and ii,iii are not
b) i,ii are equal and i,iii are not
c) ii,iii are equal and i,ii are not
d) all are equal
View Answer

Answer: d
Explanation: All are equivalent to (a+b)*.

1. How many strings of length less than 4 contains the language described by the regular expression
(x+y)*y(a+ab)*?
a) 7
b) 10
c) 12
d) 11
View Answer
Answer: c
Explanation: string of length 0 = Not possible (because y is always present).
string of length 1 = 1 (y)
string of length 2 = 3 (xy,yy,ya)
string of length 3 = 8 (xxy,xyy,yxy,yyy,yaa,yab,xya,yya)

2. Which of the following is true?


a) (01)*0 = 0(10)*
b) (0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*
c) (0+1)*01(0+1)*+1*0* = (0+1)*
d) All of the mentioned
View Answer

Answer: d
Explanation: None.

3. A language is regular if and only if


a) accepted by DFA
b) accepted by PDA
c) accepted by LBA
d) accepted by Turing machine
View Answer

Answer: a
Explanation: All of above machine can accept regular language but all string accepted by machine is
regular only for DFA.

4. Regular grammar is
a) context free grammar
b) non context free grammar
c) english grammar
d) none of the mentioned
View Answer

Answer: a
Explanation: Regular grammar is subset of context free grammar.

5. Let the class of language accepted by finite state machine be L1 and the class of languages
represented by regular expressions be L2 then
a) L1<L2
b) L1>=L2
c) L1 U L2 = .*
d) L1=L2
View Answer

Answer: d
Explanation: Finite state machine and regular expression have same power to express a language.

6. Which of the following is not a regular expression?


a) [(a+b)*-(aa+bb)]*
b) [(0+1)-(0b+a1)*(a+b)]*
c) (01+11+10)*
d) (1+2+0)*(1+2)*
View Answer

Answer: b
Explanation: Except b all are regular expression*.

7. Regular expression are


a) Type 0 language
b) Type 1 language
c) Type 2 language
d) Type 3 language
View Answer

Answer: a
Explanation: According to Chomsky hierarchy .

8. Which of the following is true?


a) Every subset of a regular set is regular
b) Every finite subset of non-regular set is regular
c) The union of two non regular set is not regular
d) Infinite union of finite set is regular
View Answer

Answer: b
Explanation: None.

9. L and ~L are recursive enumerable then L is


a) Regular
b) Context free
c) Context sensitive
d) Recursive
View Answer

Answer: d
Explanation:If L is recursive enumerable and its complement too if and only if L is recursive.

10. Regular expressions are closed under


a) Union
b) Intersection
c) Kleen star
d) All of the mentioned
View Answer

Answer: d
Explanation: According to definition of regular expression

1. What kind of expressions do we used for pattern matching?


a) Regular Expression
b) Rational Expression
c) Regular & Rational Expression
d) None of the mentioned
View Answer
Answer: c
Explanation: In automata theory, Regular Expression(sometimes also called the Rational Expression )
is a sequence or set of characters that define a search pattern, mainly for the use in pattern
matching with strings or string matching.

2. Which of the following do Regexps do not find their use in?


a) search engines
b) word processors
c) sed
d) none of the mentioned
View Answer

Answer: d
Explanation: Regexp processors are found in several search engines, seach and replace mechanisms,
and text processing utilities.

3. Which of the following languages have built in regexps support?


a) Perl
b) Java
c) Python
d) C++
View Answer

Answer: a
Explanation: Many languages come with built in support of regexps like Perl, Javascript, Ruby etc.
While some provide support using standard libraries like .NET, Java, Python, C++, C and POSIX.

4. The following is/are an approach to process a regexp:


a) Contruction of NFA and subsequently, a DFA.
b) Thompson’s Contruction Algorithm
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: A regexp processor translates the syntax into internal representation which can be
executed and matched with a string and that internal representation can have several approaches
like the ones mentioned.

5. Are the given two patterns equivalent?


(1) gray|grey
(2) gr(a|e)y
a) yes
b) no
View Answer

Answer: a
Explanation: Paranthesis can be used to define the scope and precedence of operators. Thus, both
the expression represents the same pattern.

6. Which of the following are not quantifiers?


a) Kleene plus +
b) Kleene star *
c) Question mark ?
d) None of the mentioned
View Answer

Answer: d
Explanation: A quantifier after a token specifies how often the preceding element is allowed to
occur. ?, *, +, {n}, {min, }, {min, max} are few quantifiers we use in regexps implementations.

7. Which of the following cannot be used to decide whether and how a given regexp matches a
string:
a) NFA to DFA
b) Lazy DFA algorithm
c) Backtracking
d) None of the mentioned
View Answer

Answer: d
Explanation: There are at least three algorithms which decides for us, whether and how a regexp
matches a string which included the transformation of Non deterministic automaton to deterministic
finite automaton, The lazy DFA algorithm where one simulates the NFA directly, building each DFA
on demand and then discarding it at the next step and the process of backtracking whose running
time is exponential.

8. What does the following segment of code output?

$string1 = "Hello World\n";

if ($string1 =~ m/(H..).(l..)/) {

print "We matched '$1' and '$2'.\n";

a) We matched ‘Hel’ and ‘ld’


b) We matched ‘Hel’ and ‘lld’
c) We matched ‘Hel’ and ‘lo ‘
d) None of the mentioned
View Answer

Answer: c
Explanation: () groups a series of pattern element to a single element.
When we use pattern in parenthesis, we can use any of ‘$1’, ‘$2’ later to refer to the previously
matched pattern.

9. Given segment of code:

$string1 = "Hello\nWorld\n";

if ($string1 =~ m/d\n\z/) {

print "$string1 is a string ";

print "that ends with 'd\\n'.\n";


}

What does the symbol /z does?


a) changes line
b) matches the beginning of a string
c) matches the end of a string
d) none of the mentioned
View Answer

Answer: c
Explanation: It matches the end of a string and not an internal line.The given segment of code
outputs:
Hello
World
is a string that ends with ‘d\n’

10. Conversion of a regular expression into its corresponding NFA :


a) Thompson’s Construction Algorithm
b) Powerset Construction
c) Kleene’s algorithm
d) None of the mentioned
View Answer

Answer: a
Explanation: Thompson construction algorithm is an algorithm in automata theory used to convert a
given regular expression into NFA. Similarly, Kleene algorithm is used to convert a finite automaton
to a regular expression.

1. Which among the following is not a UNIX command for regular expressions?
a) ed
b) sed
c) vi
d) none of the mentioned
View Answer

Answer: d
Explanation: Regular expressions are used by different commands in Unix like ed, sed, grep, awk, vi,
etc. Sed stands for stream editor which is exclusively used for executing scripts.

2. What is the significance of $ used in regular expression in UNIX?


a) Matches the beginning of the line
b) Matches the end of lines
c) Matches any single character
d) None of the mentioned
View Answer

Answer: b
Explanation: Regular expression provides more flexibility while matching string patterns. Special
characters like ^, $, *, . are very useful.

3. Generate the regular expression to match blank lines


a) / */
b) /bl
c) /^?/
d) /^$/
View Answer

Answer: d
Explanation: There are few expressions which provide the utility of matching metacharacters
including /^$/ for blank lines, / */ for matching one or more spaces, /^.*$/ for matching an entire
line whatever it is.

4. For the given syntax of sed, which among the following is not a correct option?
General syntax of sed: /pattern/action
a) / are used as delimiters
b) pattern refers to a regular expression
c) pattern refers to the string to be matched
d) action refers to the command
View Answer

Answer: c
Explanation: In the general syntax of sed, pattern is the regular expression and action refers to the
command given (p: prints the line, d: deletes the line, etc).

5. What does grep do in UNIX?


a) It is an editor in UNIX
b) It searches for text patterns
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: b
Explanation: The grep is a standard UNIX utility program that searches through a set of files in search
of a text pattern,specified through a regular expression.

6. State true or false:


Statement: A regular expression is a sequence of characters that represent a pattern.
a) true
b) false
View Answer

Answer: a
Explanation: Such a generated pattern could be a fixed word or describe something like more
general.

7. Which of the following options support the given statement?


Statement: A regular expression could be a fixed word or describe something like more general.
a) This flexibility makes Regular expression invaluable.
b) This flexibility makes the Regular expression unvaluable.
c) Both (a) and (b)
d) None of the mentioned
View Answer
Answer: a
Explanation: Regular expressions are very much invaluable tools; they can be used to find a
particular segment of line in a file and instruct to take certain actions.

8. What does the following segment of code does?


grep -i man heroes.txt
a) manually opens a file called heroes.txt
b) manages heroes.txt
c) search for “man” in the file “heroes.txt”
d) none of the mentioned
View Answer

Answer: c
Explanation: grep is a command which finds the pattern in a particular text segment.Here, it scans
each line in heroes.txt and looks for an m followed by a and then followed by n.

9. What does “X?” do regular expression operator?


a) Matches zero or more capital X’s.
b) Matches no or one occurence of the capital letter X.
c) Matches one or more capital X’s.
d) All of the mentioned
View Answer

Answer: b
Explanation: There are many other common regular expression operators like $, ^, etc. Which have
their own respective purposes.

10. Which of the following does not support regular expressions?


a) sed
b) awk
c) emacs
d) none of the mentioned
View Answer

Answer: d
Explanation: There are many UNIX tools including vi, Emacs, sed, awk and modern programming
languages which support regular expressions.

1. Lexemes can be referred to as:


a) elements of lexicography
b) sequence of alphanumeric characters in a token
c) lexical errors
d) none of the mentioned
View Answer

Answer: b
Explanation: A lexeme is a string of characters that form a syntactic unit. It is reasonable to say that
is the sequence of alphanumeric characters in a token.

2. If the lexical analyser finds a lexeme with the same name as that of a reserved word,it _________
a) overwrites the word
b) overwrites the functionality
c) generates an error
d) something else
View Answer

Answer: c
Explanation: Reserved words are known as keywords and they are specific and reserved with its
functionality to a language. Thus, getting an input with the same name by the analyzer will generate
an error.

3. The methodology to show an error when the analyzer faces a keyword over an user’s input is
based on:
a) rule priority
b) longest match rule
c) keyword-out rule
d) none of mentioned
View Answer

Answer: a
Explanation: The lexical analyzer follows the rule priority where its prioritizes keywords over an input
it gets with the same name as that of the keyword and thus generates an error.

4. State true or false:


Statement: A lexical analyzer reads the source code line by line.
a) True
b) False
View Answer

Answer: b
Explanation: A lexical analyzer reads the source code letter by letter and when it encounters a space
or an operator or any special character, it decides that the word is completed.

5.Which among the following statement is correct?


Statement 1: When the analyzer scans ‘int’ and ‘intvalue’, it is not able to decide whether the int
leads to a keyword or an identifier.
Statement 2: Longest Match Rule

a) Statement 1 is assertion, Statement 2 is the reason


b) Statement 1 is assertion, Statement 2 is the solution
c) There is no such Statement 2
d) This is not a function of Lexical Analyzer
View Answer

Answer: b
Explanation: The Longest Match rule states that the lexeme scanned should be determined on the
basis of longest match among all the token available.

6. The output of the lexical and syntax analyzer can stated as:
a) parse stream, parse tree
b) token tree, parse tree
c) token stream, parse tree
d) all of the mentioned
View Answer
Answer: c
Explanation: The lexical analyzer outputs the stream of token which is taken up by syntax analyzer
one by one against the production rule and parse tree is generated.

7. Which among the following is not a tool to construct lexical analyzer from a regular expression?
a) lex
b) flex
c) jflex
d) none of the mentioned
View Answer

Answer: d
Explanation: Lexical analysis is done using few tools such as lex, flex and jflex. Jflex is a computer
program that generates lexical analyzers (also known as lexers or scanners) and works apparently
like lex and flex. Lex is commonly used with yacc parser generator.

8. A program that performs lexical analysis is termed as:


a) scanner
b) lexer
c) tokenizer
d) all of the mentioned
View Answer

Answer: d
Explanation: A program which performs lexical analysis is called lexer, scanner or lexer. Nowadays,
lexer is combined with a parser which allows syntactic analysis.

9. Lexers and parsers are not found in which of the following?


a) compiler front end processing
b) prettyprinters
c) linters
d) none of the mentioned
View Answer

Answer: d
Explanation: Lexers and parsers are most commonly used in compilers, but it has more application
elsewhere like in prettyprinters or linters(application of stylistic formatting conventions to textfiles,
source code, etc.).

10. Which phase of compiler includes Lexical Analysis?


a) 1
b) 2
c) 3
d) Its primary function, not in any phase
View Answer

Answer: a
Explanation: The first phase of compilation process is called lexical analysis. It fragments the source
code into token which is the smallest programming unit of a program.

11. Which of the following characters are ignored while lexical analysis?
a) .
b) =
c) #
d) WhiteSpace
View Answer

Answer: d
Explanation: The lexical analyzer ignores all the whitespaces and fragments the program into tokens.

12. ____________ is used for grouping up of characters into token.


a) Lexical Analyzer
b) oolex
c) jflex
d) All of the mentioned
View Answer

Answer: d
Explanation: oolex, flex, lex, jflex, all are lexical analyzer tools which perform the following function.

13. The action of parsing the source code into proper syntactic classes is known as:
a) Parsing
b) Interpretation analysis
c) Lexicography
d) Lexical Analysis
View Answer

Answer: d
Explanation: Lexical analysis or scanning is the process of parsing the source code into proper
syntactic classes. It gets things ready for the parser with lexemes to built the parse tree.

14. Which of the following is the task of lexical analysis?


a) To build the uniform symbol table
b) To initialize the variables
c) To organize the variables in a lexical order
d) None of the mentioned
View Answer

Answer: a
Explanation: Lexical analysis involves the following task:
a) Building a uniform symbol table
b) Parsing the source code into tokens
c) Building a literal and identifier table

15. The scanner outputs:


a) Stream of tokens
b) Image file
c) Intermediate code
d) Machine code
View Answer

Answer: a
Explanation: A scanner or a lexical analyzer takes a source code as input and outputs a stream of
token after fragmenting the code.
16. The phase of compilation which involves type checking is:
a) Parsing
b) Scanning
c) Syntax directed translation
d) Semantic Analyzer
View Answer

Answer: c

1. The minimum length of a string {0,1}* not in the language corresponding to the given regular
expression:
(0*+1*)(0*+1*)(0*+1*)
a) 3
b) 4
c) 5
d) 6
View Answer

Answer: b
Explanation: 0101 or 1010 the strings with minimum length on {0,1}* which does not belong to the
language of the given regular expression.Other strings like 111, 000, 1101, etc are accepted by the
language .

2. Which of the following regular expression is equivalent to R(1,0)?


R(1,0)={111*}*
a) (11+111)*
b) (111+1111)*
c) (111+11*)*
d) All of the mentioned
View Answer

Answer: a
Explanation: What we observe from the question is that, it includes e and 11 and any number of 1’s
then. Therefore, its simplifies when we write the same reg. Expression as (11+111)*.

3. The minimum number of 1’s to be used in a regular expression of the given language:
R(x): The language of all strings containing exactly 2 zeroes.
a) 2
b) 3
c) 0
d) 1
View Answer

Answer: b
Explanation: It is not required to automate the question if asked theoretically.The number of zeroes
fixed is 2. Therefore, we can represent the regular expression as 1*01*01*.

4. The given regular language corresponds to which of the given regular language
e+1+(1+0)*0+(0+1)*11
a) The language of all strings that end with 11 or 00
b) The language of all strings that end with 0 or 1
c) The language of all strings which does not end with 01
d) None of the mentioned
View Answer

Answer: c
Explanation: According to the given regular expression, e is accepted by its language and it does not
end with 00 or 11 or 0 or 1. Thus option a and b are eliminated. Further, the regular expression is
valid for the third option.

5. Statement: If we take the union of two identical expression, we can replace them by one copy of
the expression.
Which of the following is a correct option for the given statement?
a) Absorption Law
b) Idempotent Law
c) Closure Law
d) Commutative Law
View Answer

Answer: b
Explanation: Idempotent Law states that if we take the union of two like expression, we can use a
copy of the expression instead i.e. L+L=L. The common arithmetic operators are not idempotent.

6. Which among the following can be an annihilator for multiplication operation?


a) 0
b) 1
c) 100
d) 22/7
View Answer

Answer: a
Explanation: An annihilator for an operator is a value such that when the operator is applied to the
annihilator and some other value, the result is the annihilator.

7. Statement: A digit, when used in the CFG notation, will always be used as a terminal.
State true or false?
a) True
b) False
View Answer

Answer: a
Explanation: Lowercase letters near the beginning of an alphabet, a, b and so on are terminal
symbols. We shall also assume that digits and other characters such as + or parenthesis are
terminals.

8. Choose the incorrect process to check whether the string belongs to the language of certain
variable or not?
a) recursive inference
b) derivations
c) head to body method
d) All of the mentioned
View Answer
Answer: d
Explanation: There are two approaches to infer that certain string are in the language of a certain
variable. The most conventional way is to use the rules from body to head, recursive inference. The
second approach is expanding the starting variable using one of its productions whose head is tart
symbol and derive a string consisting entirely of terminals(head to body or derivations).

9. Statement: Left most derivations are lengthy as compared to Right most derivations.
Choose the correct option:
a) correct statement
b) incorrect statement
c) may or may not be correct
d) depends on the language of the grammar
View Answer

Answer: c
Explanation: It completely depends on the person who develops the grammar of any language, how
to make use of the tools i.e. leftmost and rightmost derivations.

10. A->aAa|bAb|a|b|e
Which among the following is the correct option for the given production?
a) Left most derivation
b) Right most derivation
c) Recursive Inference
d) None of the mentioned
View Answer

Answer: a
Explanation: The given form represents leftmost derivations in which at each step we replace the
leftmost variable by one of its production bodies.
1. All the regular languages can have one or more of the following descriptions:
i) DFA ii) NFA iii) e-NFA iv) Regular Expressions
Which of the following are correct?
a) i, ii, iv
b) i, ii, iii
c) i, iv
d) i, ii, iii, iv
View Answer

Answer: d
Explanation: The class of languages known as the regular language has atleast four different
descriptions: i) DFA ii) NFA iii) e-NFA iv) Regular Expressions

2. Which of the technique can be used to prove that a language is non regular?
a) Ardens theorem
b) Pumping Lemma
c) Ogden’s Lemma
d) None of the mentioned
View Answer
Answer: b
Explanation: We use the powerful technique called Pumping Lemma, for showing certain languages
not to be regular. We use Ardens theorem to find out a regular expression out of a finite automaton.

3. Which of the following language regular?


a) {aibi|i>=0}
b) {aibi|0<i<5}
c) {aibi|i>=1}
d) None of the mentioned
View Answer

Answer: b
Explanation: Here, i has limits i.e. the language is finite, contains few elements and can be graphed
using a deterministic finite automata. Thus, it is regular. Others can be proved non regular using
Pumping lemma.

4. Which of the following are non regular?


a) The set of strings in {a,b}* with an even number of b’s
b) The set of strings in {a, b, c}* where there is no c anywhere to the left of a
c) The set of strings in {0, 1}* that encode, in binary, an integer w that is a multiple of 3. Interpret the
empty strings e as the number 0.
d) None of the mentioned
View Answer

Answer: d
Explanation: All of the given languages are regular and finite and thus, can be represented using
respective deterministic finite automata. We can also use mealy or moore machine to represent
remainders for option c.

5. If L is DFA-regular, L’ is
a) Non regular
b) DFA-regular
c) Non-finite
d) None of the mentioned
View Answer

Answer: b
Explanation: This is a simple example of a closure property: a property saying that the set of DFA-
regular languages is closed under certain operations.

6. Which of the following options is incorrect?


a) A language L is regular if and only if ~L has finite number of equivalent classes.
b) Let L be a regular language. If ~L has k equivalent classes, then any DFA that recognizes L must
have atmost k states.
c) A language L is NFA-regular if and only if it is DFA-regular.
d) None of the mentioned
View Answer

Answer: b
Explanation: Let L be a regular language. If ~L has k equivalent classes, then any DFA that recognizes
L must have atleast k states.
7. Myphill Nerode does the following:
a) Minimization of DFA
b) Tells us exactly when a language is regular
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: In automata theory, the Myphill Nerode theorem provides a necessary and sufficient
condition for a language to be regular. The Myphill Nerode theorem can be used to show a language
L is regular by proving that the number of equivalence classes of RL(relation) is finite.

8. Which of the following are related to tree automaton?


a) Myphill Nerode Theorem
b) State machine
c) Courcelle’s Theorem
d) All of the mentioned
View Answer

Answer: d
Explanation: The myphill nerode theorem can be generalized to trees and an application of tree
automata prove an algorithmic meta theorem about graphs.

9. Given languages:
i) {anbn|n>=0}
ii) <div>n</div>n
iii) {w∈{a,b}∗| #a(w)=#b(w)}, # represents occurrences
Which of the following is/are non regular?
a) i, iii
b) i
c) iii
d) i, ii, iii
View Answer

Answer: d
Explanation: There is no regular expression that can parse HTML documents. Other options are also
non-regular as they cannot be drawn into finite automaton.

10. Finite state machine are not able to recognize Palindromes because:
a) Finite automata cannot deterministically find the midpoint
b) Finite automata cannot remember arbitarily large amount of data
c) Even if the mid point is known, it cannot find whether the second half matches the first
d) All of the mentioned
View Answer

Answer: d

1. Relate the following statement:


Statement: All sufficiently long words in a regular language can have a middle section of words
repeated a number of times to produce a new word which also lies within the same language.
a) Turing Machine
b) Pumping Lemma
c) Arden’s theorem
d) None of the mentioned
View Answer

Answer: b
Explanation: Pumping lemma defines an essential property for every regular language in automata
theory. It has certain rules which decide whether a language is regular or not.

2. While applying Pumping lemma over a language, we consider a string w that belong to L and
fragment it into _________ parts.
a) 2
b) 5
c) 3
d) 6
View Answer

Answer: c
Explanation: We select a string w such that w=xyz and |y|>0 and other conditions. However, there
exists an integer n such that |w|>=n for any wÎL.

3. 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
b) y
c) z
d) all of the mentioned
View Answer

Answer: b
Explanation: The lemma says, the portion y in xyz cannot be zero or empty i.e. |y|>0, this condition
needs to be fulfilled to check the conclusion condition.

4. Let w= xyz and y refers to the middle portion and |y|>0.What do we call the process of repeating
y 0 or more times before checking that they still belong to the language L or not?
a) Generating
b) Pumping
c) Producing
d) None of the mentioned
View Answer

Answer: b
Explanation: The process of repeatation is called pumping and so, pumping is the process we
perform before we check whether the pumped string belongs to L or not.

5. There exists a language L. We define a string w such that w∈L and w=xyz and |w| >=n for some
constant integer n.What can be the maximum length of the substring xy i.e. |xy|<=?
a) n
b) |y|
c) |x|
d) none of the mentioned
View Answer

Answer: a
Explanation: It is the first conditional statement of the lemma that states that |xy|<=n, i.e. the
maximum length of the substring xy in w can be n only.

6. Fill in the blank in terms of p, where p is the maximum string length in L.


Statement: Finite languages trivially satisfy the pumping lemma by having n = ______
a) p*1
b) p+1
c) p-1
d) None of the mentioned
View Answer

Answer: b
Explanation: Finite languages trivially satisfy the pumping lemma by having n equal to the maximum
string length in l plus 1.

7. Answer in accordance to the third and last statement in pumping lemma:


For all _______ xyiz ∈L
a) i>0
b) i<0
c) i<=0
d) i>=0
View Answer

Answer: d
Explanation: Suppose L is a regular language . Then there is an integer n so that for any x∈L and
|x|>=n, there are strings u,v,w so that
x= uvw
|uv|<=n
|v|>0
for any m>=0, uvmw ∈L.

8. If d is a final state, which of the following is correct according to the given diagram?

a) x=p, y=qr, z=s


b) x=p, z=qrs
c) x=pr, y=r, z=s
d) All of the mentioned
View Answer

Answer: a
Explanation: The FSA accepts the string pqrs. In terms of pumping lemma, the string pqrs is broken
into an x portion an a, a y portion qr and a z portion s.

9. Let w be a string and fragmented by three variable x, y, and z as per pumping lemma. What does
these variables represent?
a) string count
b) string
c) both (a) and (b)
d) none of the mentioned
View Answer

Answer: a
Explanation: Given: w =xyz. Here, xyz individually represents strings or rather substrings which we
compute over conditions to check the regularity of the language.

10. Which of the following one can relate to the given statement:
Statement: If n items are put into m containers, with n>m, then atleast one container must contain
more than one item.
a) Pumping lemma
b) Pigeon Hole principle
c) Count principle
d) None of the mentioned
View Answer

Answer: b
Explanation: Pigeon hole principle states the following example: If there exists n=10 pigeons in m=9
holes, then since 10>9, the pigeonhole principle says that at least one hole has more than one
pigeon

1. 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
b) closed
c) decidable
d) none of the mentioned
View Answer

Answer: b
Explanation: If two regular languages are closed under an operation op, then the resultant of the
languages over an operation op will also be regular.

2. Suppose a regular language L is closed under the operation halving, then the result would be:
a) 1/4 L will be regular
b) 1/2 L will be regular
c) 1/8 L will be regular
d) Al of the mentioned
View Answer
Answer: d
Explanation: At first stage 1/2 L will be regular and subsequently, all the options will be regular.

3. If L1′ and L2′ are regular languages, then L1.L2 will be


a) regular
b) non regular
c) may be regular
d) none of the mentioned
View Answer

Answer: a
Explanation: Regular language is closed under complement operation. Thus, if L1′ and L2′ are regular
so are L1 and L2. And if L1 and L2 are regular so is L1.L2.

4. If L1 and L2′ are regular languages, L1 ∩ (L2′ U L1′)’ will be


a) regular
b) non regular
c) may be regular
d) none of the mentioned
View Answer

Answer: a
Explanation: If L1 is regular, so is L1′ and if L1′ and L2′ are regular so is L1′ U L2′. Further, regular
languages are also closed under intersection operation.

5. If A and B are regular languages, !(A’ U B’) is:


a) regular
b) non regular
c) may be regular
d) none of the mentioned
View Answer

Answer: a
Explanation: If A and B are regular languages, then A Ç B is a regular language and A ∩ B is
equivalent to !(A’ U B’).

6. Which among the following are the boolean operations that under which regular languages are
closed?
a) Union
b) Intersection
c) Complement
d) All of the mentioned
View Answer

Answer: d
Explanation: Regular languages are closed under the following operations:
a) Regular expression operations
b) Boolean operations
c) Homomorphism
d) Inverse Homomorphism
7. Suppose a language L1 has 2 states and L2 has 2 states. After using the cross product construction
method, we have a machine M that accepts L1 ∩ L2. The total number of states in M:
a) 6
b) 4
c) 2
d) 8
View Answer

Answer: 4
Explanation: M is defined as: (Q, S, d, q0, F)
where Q=Q1*Q2 and F=F1*F2

8. If L is a regular language, then (L’)’ U L will be :


a) L
b) L’
c) f
d) none of the mentioned
View Answer

Answer: a
Explanation: (L’)’ is equivalent to L and L U L is subsequently equivalent to L.

9. If L is a regular language, then (((L’)r)’)* is:


a) regular
b) non regular
c) may be regular
d) none of the mentioned
View Answer

Answer: a
Explanation: If L is regular so is its complement, if L’ is regular so is its reverse, if (L’)r is regular so is
its Kleene.

10. Which among the following is the closure property of a regular language?
a) Emptiness
b) Universality
c) Membership
d) None of the mentioned
View Answer

Answer: d
Explanation: All the following mentioned are decidability properties of a regular language. The
closure properties of a regular language include union, concatenation, intersection, Kleene,
complement , reverse and many more operations.

1. If L is a language, the reversal of the language can be represented as:


a) L’
b) Lc
c) Lr
d) more than one option is correct
View Answer
Answer: c
Explanation: Lr is defined as the reversal of a language. Lr is a set of strings whose reversal is in L.
Example: L={0, 01, 100}
Lr={0, 10, 001}

2. If L is a regular language, ____ is also regular.


a) Lr
b) L’
c) L*
d) All of the mentioned
View Answer

Answer: d
Explanation: Lr, L’, L* i.e. reversal, complementation and kleene all are the closure properties of
regular language.

3. If E=F+G;
Er=?
a) Fr+Gr
b) (F+G)r
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: a
Explanation: If E is a symbol a, e, or f, then Er=E. Other inductive properties include union of
reversals, concatenation and Kleene.

4. If E= FG, Er=?
a) FrGr
b) GrFr
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: b
Explanation: If E= FG, Er=GrFr . Example: (01*)R=(1*)R(0)R

5. Simplify the following identity:


E=01*+10*
ER=?
a) (1*0+0*1)
b) (01*10*)R
c) (0*1+10*)
d) All of the mentioned
View Answer

Answer: a
Explanation: 01*+10*
ER=(01*)R+(10*)R=>(1*)R0R+(0*)R1R=>1*0+0*1
6. Which of the following obey the closure properties of Regular language?
a) Homomorphism
b) Inverse Homomorphism
c) Reversal
d) All of the mentioned
View Answer

Answer: d
Explanation: Homomorphism on an aphabet is a function that gives a string for each symbol in that
alphabet. Example: h(0)=ab, etc.

7. Let h(L) be a language of regular expression abe*+e(ab)*. Simplify the h(L)


a) (ab)*+eab*
b) abe*+ea*b*
c) (ab)*
d) None of the mentioned
View Answer

Answer:
abe*+e(ab)*(Using the identities e=e*, eE=Ee=E)
=ab+(ab)*=> ab will contain inside (ab)*, thus =>(ab)*.

8. Let h(0)=ab; h(1)=e


Let L={abab,baba}
h-1(L)=_______
a) the language of two one’s and any number of zeroes
b) the language of two zeroes and any number of one’s
c) the language of two zeroes and two one’s
d) none of the mentioned
View Answer

Answer: b
Explanation: h-1(L) is the language with two 0’s and any number of 1’s=>(1*01*01*).

9. While proving Inverse Homomorphism, which of the following steps are needed?
a) Start with a DFA Ain L
b) Construct a DFA B for h-1(L)
c) The set of states, initial and final states should be same.
d) All of the mentioned
View Answer

Answer: d
Explanation: While constructing DFA B, we need to take care of the following:
a) The same set of states
b) The same start state
c) The same final state
d) Input alphabet = the symbols to which homomorphism h applies.

10. 8. Let h(0)=ab; h(1)=e


Let L={abab,baba}
h-1(L)= the language of two zeroes and any number of one’s.
The given example belongs to which of the following?
a) Homomorphism
b) Inverse Homomorphism
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: b
Explanation: Let h be a homomorphism and L a language whose alphabet is the output language of
h.
h-1(L) = {w | h(w) is in L}.

1. Which of the following conversion is not feasible?


a) Regular expression to automaton conversion
b) Automaton to Regular Expression Conversion
c) NFA to DFA
d) None of the mentioned
View Answer

Answer: d
Explanation: Each of the four formats of representation of the regular language be it, DFA, NFA,
Regular Expression or e-NFA can be converted to the rest three forms.

2. The computation of e-closure of n-states takes ______ time.


a) O(n2)
b) O(n3)
c) O(2n)
d) None of the mentioned
View Answer

Answer: b
Explanation: We must search from each of the n states along all arcs labelled e. If there are n states,
there can be no more than n2 states.

3. For a _________ state DFA, the time taken for DFA-NFA conversion is O(n).
a) n
b) n1/2
c) n2
d) 2n
View Answer

Answer: a
Explanation: The conversion DFA to NFA is simple, and takes O(n) time on an n-state DFA.

4. With reference to Automaton to Regular Expression Conversion, for each of the n rounds, where n
is the number of states of DFA, we can _________ the size of the regular expression constructed.
a) double
b) triple
c) quadruple
d) none of the mentioned
View Answer
Answer: c
Explanation: We can quadruple the size of the regular expression per round. Thus, we can simply
write n3 expressions can take time O(n34n), where n =number of states of the DFA.

5. Conversion of regular expression to e-NFA takes ___________ time.


a) linear
b) exponential
c) logarithmic
d) none of the mentioned
View Answer

Answer: a
Explanation: It is possible to parse the expression efficiently, using a technique that takes only O(n)
time on a expression of length n3.

6. The conversion of NFA to DFA can be done in:


a) exponential time
b) linear time
c) logarithmic time
d) all of the mentioned
View Answer

Answer: a
Explanation: We can eliminate e-transitions from an n state epsilon-NFA to build an ordinary NFA in
O(n3) time, without changing the number of states.Next, producing to DFA can take exponential
time.

7. Which of the following cannot be converted in an ordinary NFA?


a) DFA
b) Regular Expression
c) e-NFA
d) None of the mentioned
View Answer

Answer: d
Explanation: Each of the following can expressed in terms of ordinary NFA with different time
complexities.

8. NFA to DFA conversion is done via


a) Subset Construction method
b) Warshalls Algorithm
c) Ardens theorem
d) None of the mentioned
View Answer

Answer: a
Explanation: Powerset or subset construction method is a standard method for converting a non
deterministic finite automata into DFA which recognizes the same formal language.

9. State true or false:


Statement: Regular expression can directly be converted to DFA without intermediate steps.
a) true
b) false
View Answer

Answer: b
Explanation: There exists subsequent steps like formation of epsilon-NFA and NFA before the
formation of corresponding DFA.

10. Is the following statement correct?


Statement: Thompson construction is used to convert Regular expression to finite automata.
a) Yes
b) No
View Answer

Answer: a
Explanation: Thompson’s Construction is used to find out a Finite Automaton from a Regular
Expression. We will reduce the regular expression into smallest regular expressions and convert
them to NFA and finally to DFA.

1. Language classes have the following property:


a) Closure property
b) Decision property
c) Closure & Decision property
d) None of the mentioned
View Answer

Answer: c
Explanation: A decision property of a language class is an algorithm that takes a formal description of
a language(e.g., a DFA) and tells whether or not some property holds.

2. Which of the following are decision properties?


a) Emptiness
b) Infiniteness
c) Membership
d) All of the mentioned
View Answer

Answer: d
Explanation: Emptiness, Infiniteness and Membership are the decision properties of any language
class. Example: Is the language L empty? Or Is w, a string belongs to the regular language L?

3. Pick the odd one out of the given properties of a regular language:
a) Kleene
b) Reversal
c) Homomorphism
d) Membership
View Answer

Answer: d
Explanation: Membership is a decision property of language class while others mentioned like
Kleene, Reversal and Homomorphism are Closure properties of language class.
4. For an automata, which of the following are equivalent variants?
DFA,NFA and NFA with epsilon transitions
a) DFA and NFA
b) NFA and epsilon NFA
c) DFA and epsilon NFA
d) All of the mentioned
View Answer

Answer: d
Explanation: For a given automata, all the formats of representation be it deterministic finite
automata or non deterministic finite automata or non deterministic finite automata with epsilon
transitions, all are equivalent variants.

5. Which of the following are not meant to specify a regular language?


a) Regular Expression
b) DFA
c) NDFA and epsilon-NFA
d) All of the mentioned
View Answer

Answer: d
Explanation: It is possible to convert from one specification to another. We can express a regular
language in all the given four variants.

6. Which of the following problems do not belong to decision properties?


a) Given two languages, are there strings that are in both
b) Is the language a subset of another regular language
c) Is the language same as another regular language
d) None of the mentioned
View Answer

Answer: d
Explanation: To give a solution to the mentioned problems, we require decision properties and for
some, we need additional tools like minimized automaton and Pumping lemma.

7. Which of the following is a function of Closure properties?


a) Helps construct representations
b) Helps show informally described languages not to be in class
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: Using closure properties we can give a=solution to many problems like :
Is the regular languages L1 and L2 closed on concatenation operation?, etc.

8. Suppose there is a string w=abbab, and there exists a DFA which accepts w. How many stepts will
be required to test its membership?
a) 2
b) 1
c) 4
d) None of the mentioned
View Answer

Answer: If a string belongs to a language, the number of steps required to test that member ship is
equal to the length of string i.e. 5.

9. If a DFA has n states and the language contains any string of length n or more, the language is
termed as:
a) Infinite
b) Empty
c) Non regular
d) None of the mentioned
View Answer

Answer: The language is surely finite if it is limited to string of length n or less. This is because there
are atleast n+1 states along the path while traversing w(string).

10. State true or false:


Statement: If an n-state DFA accepts a string w of length n or more, then there must be a state that
appears twice on the path labeled w from the start state to the final state.
a) true
b) false
View Answer

Answer: a

1. The entity which generate Language is termed as:


a) Automata
b) Tokens
c) Grammar
d) Data
View Answer

Answer: c
Explanation: The entity which accepts a language is termed as Automata while the one which
generates it is called Grammar. Tokens are the smallest individual unit of a program.

2. Production Rule: aAb->agb belongs to which of the following category?


a) Regular Language
b) Context free Language
c) Context Sensitive Language
d) Recursively Ennumerable Language
View Answer

Answer: c
Explanation: Context Sensitive Language or Type 1 or Linearly Bounded Non deterministic Language
has the production rule where the production is context dependent i.e. aAb->agb.

3. Which of the following statement is false?


a) Context free language is the subset of context sensitive language
b) Regular language is the subset of context sensitive language
c) Recursively ennumerable language is the super set of regular language
d) Context sensitive language is a subset of context free language
View Answer

Answer: d
Explanation: Every regular language can be produced by context free grammar and context free
language can be produced by context sensitive grammar and so on.

4. The Grammar can be defined as: G=(V, ∑, p, S)


In the given definition, what does S represents?
a) Accepting State
b) Starting Variable
c) Sensitive Grammar
d) None of these
View Answer

Answer: b
Explanation: G=(V, ∑, p, S), here V=Finite set of variables, ∑= set of terminals, p= finite productions,
S= Starting Variable.

5. Which among the following cannot be accepted by a regular grammar?


a) L is a set of numbers divisible by 2
b) L is a set of binary complement
c) L is a set of string with odd number of 0
d) L is a set of 0n1n
View Answer

Answer: d
Explanation: There exists no finite automata to accept the given language i.e. 0n1n. For other options,
it is possible to make a dfa or nfa representing the language set.

6. Which of the expression is appropriate?


For production p: a->b where a∈V and b∈_______
a) V
b) S
c) (V+∑)*
d) V+ ∑
View Answer

Answer: c
Explanation: According to the definition, the starting variable can produce another variable or any
terminal or a variable which leads to terminal.

7. For S->0S1|e for ∑={0,1}*, which of the following is wrong for the language produced?
a) Non regular language
b) 0n1n | n>=0
c) 0n1n | n>=1
d) None of the mentioned
View Answer

Answer: d
Explanation: L={e, 01, 0011, 000111, ……0n1n }. As epsilon is a part of the set, thus all the options are
correct implying none of them to be wrong.

8. The minimum number of productions required to produce a language consisting of palindrome


strings over ∑={a,b} is
a) 3
b) 7
c) 5
d) 6
View Answer

Answer: c
Explanation: The grammar which produces a palindrome set can be written as:
S-> aSa | bSb | e | a | b
L={e, a, b, aba, abbbaabbba…..}

9. Which of the following statement is correct?


a) All Regular grammar are context free but not vice versa
b) All context free grammar are regular grammar but not vice versa
c) Regular grammar and context free grammar are the same entity
d) None of the mentioned
View Answer

Answer: a
Explanation: Regular grammar is a subset of context free grammar and thus all regular grammars are
context free.

10. Are ambiguous grammar context free?


a) Yes
b) No
View Answer

Answer: a
Explanation: A context free grammar G is ambiguous if there is atleast one string in L(G) which has
two or more distinct leftmost derivations

1. Which of the following is not a notion of Context free grammars?


a) Recursive Inference
b) Derivations
c) Sentential forms
d) All of the mentioned
View Answer

Answer: d
Explanation: The following are the notions to express Context free grammars:
a) Recursive Inferences
b) Derivations
c) Sentential form
d) Parse trees

2. State true or false:


Statement: The recursive inference procedure determines that string w is in the language of the
variable A, A being the starting variable.
a) true
b) false
View Answer

Answer: a
Explanation: We apply the productions of CFG to infer that certain strings are in the language of a
certain variable.

3. Which of the following is/are the suitable approaches for inferencing?


a) Recursive Inference
b) Derivations
c) Both Recursive Inference and Derivations
d) None of the mentioned
View Answer

Answer: c
Explanation: Two inference approaches:
1. Recursive inference, using productions from body to head
2. Derivations, using productions from head to body

4. If w belongs to L(G), for some CFG, then w has a parse tree, which defines the syntactic structure
of w. w could be:
a) program
b) SQL-query
c) XML document
d) All of the mentioned
View Answer

Answer: d
Explanation: Parse trees are an alternative representation to derivations and recursive inferences.
There can be several parse trees for the same string.

5. Is the following statement correct?


Statement: Recursive inference and derivation are equivalent.
a) Yes
b) No
View Answer

Answer: a
Explanation: Yes, they are equivalent. Both the terminologies represent the two approaches of
recursive inferencing.

6. A->aA| a| b
The number of steps to form aab:
a) 2
b) 3
c) 4
d) 5
View Answer

Answer: b
Explanation: A->aA=>aaA=>aab

7. An expression is mentioned as follows. Figure out number of incorrect notations or symbols, such
that a change in those could make the expression correct.
L(G)={w in T*|S→*w}
a) 0 Errors
b) 1 Error
c) 2 Error
d) Invalid Expression
View Answer

Answer: a
Explanation: For the given expression, L(G)={w in T*|S→*w}, If G(V, T, P, S) is a CFG, the language of
G, denoted by L(G), is the set of terminal strings that have derivations from the start symbol.

8. The language accepted by Push down Automaton:


a) Recursive Language
b) Context free language
c) Linearly Bounded language
d) All of the mentioned
View Answer

Answer: b
Explanation: Push down automata accepts context free language.

9. Which among the following is the correct option for the given grammar?
G->X111|G1,X->X0|00
a) {0a1b|a=2,b=3}
b) {0a1b|a=1,b=5}
c) {0a1b|a=b}
d) More than one of the mentioned is correct
View Answer

Answer: a
Explanation: Using the recursive approach, we can conclude that option a is the correct answer, and
its not possible for a grammar to have more than one language.

10. Which of the following the given language belongs to?


L={ambmcm| m>=1}
a) Context free language
b) Regular language
c) Both (a) and (b)
d) None of the mentioned
View Answer
Answer: d
Explanation: The given language is neither accepted by a finite automata or a push down automata.
Thus, it is neither a context free language nor a regular language.

11. Choose the correct option:


Statement: There exists two inference approaches:
a) Recursive Inference
b) Derivation

a) true
b) partially true
c) false
d) none of the mentioned
View Answer

Answer: a
Explanation: We apply the productions of a CFG to infer that certain strings are in a language of
certain variable.

12. Choose the correct option:


Statement 1: Recursive Inference, using productions from head to body.
Statement 2: Derivations, using productions from body to head.
a) Statement 1 is true and Statement 2 is true
b) Statement 1 and Statement 2, both are false
c) Statement 1 is true and Statement 2 is false
d) Statement 2 is true and Statement 1 is true
View Answer

Answer: b
Explanation: Both the statements are false. Recursive Inference, using productions from body to
head. Derivations, using productions from head to body.

13. Which of the following statements are correct for a concept called inherent ambiguity in CFL?
a) Every CFG for L is ambiguous
b) Every CFG for L is unambiguous
c) Every CFG is also regular
d) None of the mentioned
View Answer

Answer: a
Explanation: A CFL L is said to be inherently ambiguous if every CFG for L is ambiguous.

14. Which of the theorem defines the existence of Parikhs theorem?


a) Parikh’s theorem
b) Jacobi theorem
c) AF+BG theorem
d) None of the mentioned
View Answer

Answer: a
1. State true or false:
Statement: Every right-linear grammar generates a regular language.
a) True
b) False
View Answer

Answer: a
Explanation: A CFG is said to right linear if each production body has at most one variable, and that
variable is at the right end. That is, all productions of a right linear grammar are of the form A->wB
or A->w, where A and B are variables while w is some terminal.

2. What the does the given CFG defines?


S->aSbS|bSaS|e and w denotes terminal
a) wwr
b) wSw
c) Equal number of a’s and b’s
d) None of the mentioned
View Answer

Answer: c
Explanation: Using the derivation approach, we can conclude that the given grammar produces a
language with a set of string which have equal number of a’s and b’s.

3. If L1 and L2 are context free languages, which of the following is context free?
a) L1*
b) L2UL1
c) L1.L2
d) All of the mentioned
View Answer

Answer: d
Explanation: The following is a theorem which states the closure property of context free languages
which includes Kleene operation, Union operation and Dot operation.

4. For the given Regular expression, the minimum number of variables including starting variable
required to derive its grammar is:
(011+1)*(01)*
a) 4
b) 3
c) 5
d) 6
View Answer

Answer: c
Explanation: The grammar can be written as:
S->BC
B->AB|ε
A->011|1
C->DC|ε
D->01
5. For the given Regular expression, the minimum number of terminals required to derive its
grammar is:
(011+1)*(01)*
a) 4
b) 3
c) 5
d) 6
View Answer

Answer: b
Explanation: The grammar can be written as:
S->BC
B->AB|ε
A->011|1
C->DC|ε
D->01

6. A grammar G=(V, T, P, S) is __________ if every production taken one of the two forms:
B->aC
B->a

a) Ambiguous
b) Regular
c) Non Regular
d) None of the mentioned
View Answer

Answer: b
Explanation: The following format of grammar is of Regular grammar and is a part of Context free
grammar i.e. like a specific form whose finite automata can be generated.

7. Which among the following is a CFG for the given Language:


L={x∈{0,1}*|number of zeroes in x=number of one’s in x}
a) S->e|0S1|1S0|SS
b) S->0B|1A|e A->0S B->1S
c) All of the mentioned
View Answer

Answer: c
Explanation: We can build context free grammar through different approaches, recursively defining
the variables and terminals inorder to fulfil the conditions.

8. Which of the following languages are most suitable for implement context free languages ?
a) C
b) Perl
c) Assembly Language
d) None of the mentioned
View Answer
Answer: a
Explanation: The advantage of using high level programming language like C and Pascal is that they
allow us to write statements that look more like English.

9. Which among the following is the correct grammar for the given language?
L={x∈{0,1}*|number of zeroes in x¹number of one’s in x}
a) S-> 0|SS|1SS|SS1|S1S
b) S-> 1|0S|0SS|SS0|S0S
c) S-> 0|0S|1SS|SS1|S1S
d) None of the mentioned
View Answer

Answer: c
Explanation: L={0, 1, 00, 11, 001, 010,…}
The grammar can be framed as: S-> 0|0S|1SS|SS1|S1S

10. L={0i1j2k | j>i+k}


Which of the following satisfies the language?
a) 0111100
b) 011100
c) 0001100
d) 0101010
View Answer

Answer: a

1. The most suitable data structure used to represent the derivations in compiler:
a) Queue
b) Linked List
c) Tree
d) Hash Tables
View Answer

Answer: c
Explanation: The tree, known as “Parse tree” when used in a compiler, is the data structure of choice
to represent the source program.

2. Which of the following statement is false in context of tree terminology?


a) Root with no children is called a leaf
b) A node can have three children
c) Root has no parent
d) Trees are collection of nodes, with a parent child relationship
View Answer

Answer: a
Explanation: A node has atmost one parent, drawn above the node, and zero or more children
drawn below. Lines connect parents to children. There is one node, one root, that has no parent; this
node appears to be at the top of the tree. Nodes with no children are called leaves. Nodes that are
not leaves are called interior nodes.

3. In which order are the children of any node ordered?


a) From the left
b) From the right
c) Arbitrarily
d) None of the mentioned
View Answer

Answer: a
Explanation: The children of a node are ordered from the left and drawn so. If N is to the left of node
M, then all the descendents of N are considered to be to the left of all the descendents of M.

4. Which among the following is the root of the parse tree?


a) Production P
b) Terminal T
c) Variable V
d) Starting Variable S
View Answer

Answer: d
Explanation: The root is labelled by the start symbol. All the leaves are either labelled by a a terminal
or with e.

5. For the expression E*(E) where * and brackets are the operation, number of nodes in the
respective parse tree are:
a) 6
b) 7
c) 5
d) 2
View Answer

Answer: b

Explanation:

6. The number of leaves in a parse tree with expression E*(E) where * and () are operators
a) 5
b) 2
c) 4
d) 3
View Answer
Answer: a

Explanation:

7. Which of the following does the given parse tree correspond to?

a) P->1100
b) P->0110
c) P->1100ε
d) P->0101
View Answer

Answer: b
Explanation: The following is a parse tree for the production 0110 over {0,1}*.

8. A grammar with more than one parse tree is called:


a) Unambiguous
b) Ambiguous
c) Regular
d) None of the mentioned
View Answer
Answer: b
Explanation: A context free grammar G is ambiguous if there is at least one string in L(G) having two
or more distinct derivation trees or equivalently, two or more distinct leftmost derivations.

9. __________ is the acyclic graphical representation of a grammar.


a) Binary tree
b) Oct tree
c) Parse tree
d) None of the mentioned
View Answer

Answer: c
Explanation: In order to graphically represent a derivation of a grammar we need to use parse trees.

10. Grammar is checked by which component of compiler


a) Scanner
b) Parser
c) Semantic Analyzer
d) None of the mentioned
View Answer

Answer: Parser or syntax analyzer is the one responsible for checking the grammar and reporting
errors. In this phase, parse tree is generated and syntax is analyzed.

1. A symbol X is ________ if there exists : S->* aXb


a) reachable
b) generating
c) context free
d) none of the mentioned
View Answer

Answer: a
Explanation: A symbol X is generating if there exists : X->*w for some w that belongs to T*.
Also, a symbol can never be context free.

2. A symbol X is called to be useful if and only if its is:


a) generating
b) reachable
c) both generating and reachable
d) none of the mentioned
View Answer

Answer: c
Explanation: For a symbol X to be useful, it has to be both reachable and generating i.e.
S->* aXb -> * w where w belongs to T*.

3. Which of the following is false for a grammar G in Chomsky Normal Form:


a) G has no useless symbols
b) G has no unit productions
c) G has no epsilon productions
d) None of the mentioned
View Answer
Answer: d
Explanation: G, a CFG is said to be in Chomsky normal form if all its productions are in one of the
following form:
A->BC or A->a

4. Given Checklist:
a) G has no useless symbols
b) G has no unit productions
c) G has no epsilon productions
d) Normal form for production is violated
Is it possible for the grammar G to be in CNF with the following checklisy ?
a) Yes
b) No
View Answer

Answer: b
Explanation: The grammar is not in CNF if it violates the normal form of the productions which is
strictly restricted.

5. State true or false:


Statement: A CNF parse tree’s string yield (w) can no longer be 2h-1.
a) true
b) false
View Answer

Answer: a
Explanation: It is the parse tree theorem which states:
Given: Suppose we have a parse tree for a string w, according to a CNF grammar, G=(V, T, P, S). Let h
be the height of the parse tree. Now, Implication: |w|<=2h-1.

6. If |w|>=2h, then its parse tree’s height is at least _____


a) h
b) h+1
c) h-1
d) 2h
View Answer

Answer: b
Explanation: It is the basic implication of Parse tree theorem (assuming CNF). If the height of the
parse tree is h, then |w| <=2h-1.

7. If w belongs to L(G), for some CFG, then w has a parse tree, which tell us the ________ structure
of w.
a) semantic
b) syntactic
c) lexical
d) all of the mentioned
View Answer
Answer: b
Explanation: A parse tree or concrete syntactic tree is an ordered, rooted tree that represents the
syntactic structure of a string according to some context free grammar.

8. Which of the following are distinct to parse trees?


a) abstract parse trees
b) sentence diagrams
c) both abstract parse trees and sentence diagrams
d) none of the mentioned
View Answer

Answer: c
Explanation: Both of the mentioned are different from parse trees. Sentence diagrams are pictorial
representations of grammatical structure of a sentence.

9. Choose the correct option:


Statement: Unambiguity is the ideal structure of a language.
a) true
b) partially true
c) false
d) cant be said
View Answer

Answer: a
Explanation: Ideally, there should be only one parse tree for each string, i.e. the language should be
unambiguous.

10. Is the given statement correct?


Statement: The mere existence of several derivations is not an issue, its is the existence of several
parse trees that ruins a grammar.
a) Yes
b) No
View Answer

Answer: a
Explanation: It is also true that multiple leftmost or rightmost derivations do cause ambiguity.
Unfortunately, it is not possible to remove the ambiguity always.

1. To derive a string using the production rules of a given grammar, we use:


a) Scanning
b) Parsing
c) Derivation
d) All of the mentioned
View Answer

Answer: b
Explanation: Parsing is required to check the acceptability of a string. Further, comes the syntactical
phase which is taken care by other phases of compiler.

2. Which of the following parser reaches the root symbol of the tree at last?
a) Top down parser
b) Bottom up parser
c) TOP down and Bottom up parser
d) None of the mentioned
View Answer

Answer: b
Explanation: Bottom up parser starts from the bottom with the string and comes up to the start
symbolusing a parse tree or a derivation tree.

3. Left corner parsing methof uses which of the following?


a) Top down parser
b) Bottom up parser
c) TOP down and Bottom up parser
d) None of the mentioned
View Answer

Answer: c
Explanation: It is a hybrid method which works bottom up along the left edges of each subtree, and
top down on the rest of the parse tree.

4. Which of the following parser performs top down parsing?


a) LALR parser
b) LL parser
c) Recursive Accent parser
d) None of the mentioned
View Answer

Answer: b
Explanation: Bottom up parsing is done by shift reduce parsers like LALR parsers, Operator
precedence parsers, simple precedence parsers, etc.

5. Which of the following is true for shift reduce parsers?


a) Scans and parses the input in one forward pass over the text, without any backup.
b) A shift command advances in the input stream by one symbol
c) LALR parser
d) All of the mentioned
View Answer

Answer: d
Explanation: The mentioned are the correct and proper functions of a shift reduce parsers. The
parsing methods are most commonly used for parsing programming languages, etc.

6. State true or false:


Statement: LALR parsers uses tables rather than mutually recursive functions.
a) true
b) false
View Answer

Answer: b
Explanation: It is exactly the opposite case where LALR parsers uses mutually recursive functions
instead of tables. It is a simplified version of canonical left to right parser.
7. LALR in LALR parser stands for:
a) Left aligned left right parser
b) Look ahead left to right parser
c) Language Argument left to right parser
d) None of the mentioned
View Answer

Answer:
Explanation: LALR stands for Look ahead left to right parsers. It has more language recognition
power than LR(0) parser.

8. Which of the following can be a LALR parser generator?


a) YACC
b) GNU Bison
c) YACC and GNU Bison
d) None of the mentioned
View Answer

Answer: c
Explanation: YACC is a computer code for UNIX operating system which generates a LALR parser. On
the other hand GNU Bison or Bison can generate LALR and GLR parsers.

9. Which of the following parsers do not relate to Bottom up parsing?


a) LL parser
b) Recursive descent parser
c) Earley parsers
d) All of the mentioned
View Answer

Answer: d
Explanation: All the following mentioned are top down parsers and begin their operation from the
starting symbol.

10. Which of the following is true for a predictive parser?


a) Recursive Descent parser
b) no backtracking
c) Recursive Descent parser and no backtracking
d) None of the mentioned
View Answer

Answer: c
Explanation: Predictive parsing is possible only for the class of LL-grammars, which are the CFG for
which there exists some positive integer k that allows a recursive descent parser to decide which
production to use by examining only the next k tokens of input.

1. YACC is a computer program for ______ operation system.


a) Windows
b) DOS
c) Unix
d) openSUSE
View Answer
Answer: c
Explanation: YACC technique is a computer code for the Unix operating system. It is a LALR parser
generator, generating a parser, the part of a compiler that tries to make syntactic sense of the
source code.

2. YACC is an acronym for:


a) Yes Another Compile Compiler
b) Yet Another Compile Compiler
c) Yet Another Compiler Compiler
d) Yes Another Compiler Compiler
View Answer

Answer: c
Explanation: YACC stands for ‘Yet another compiler compiler’ and it was developed by Stephen
Johnson in B programming language later translated to C.

3. The YACC takes C code as input and outputs_________


a) Top down parsers
b) Bottom up parsers
c) Machine code
d) None of the mentioned
View Answer

Answer: b
Explanation: The YACC takes C code as input and produces shift reduce parsers in C,also known as
Bottom up parsers which execute C snippets with the associated rule.

4. The _______ table is created by YACC.


a) LALR parsing
b) LL parsing
c) GLR parsing
d) None of the mentioned
View Answer

Answer: a
Explanation: LALR parser generator is software tool that reads a BNF grammar and creates a LALR
parser which is capable of parsing files written in programming language identified by BNF grammar.

5. The original YACC as written in __________ language


a) R programming language
b) C programming language
c) B programming language
d) None of the mentioned
View Answer

Answer: c
Explanation: Stephen Johnson wrote this parser generator in B programming language which was
further modified and written in C, JAVA, Python, etc.

6. Which of the following is false for B programming language?


a) Typeless
b) Influenced by PL/I
c) Designed by Dennis Ritchie
d) None of the mentioned
View Answer

Answer: d
Explanation: B was programming language designed by Dennis Ritchie and Ken Thompson for
recursive, non numeric, system and language softwares. It was a typeless language, everything is a
word.

7. Which of the following is false for BNF?


a) BNF means Backus Naur Form
b) It is a normal form used in Data base normalization
c) It is a notation technique for context free grammar
d) None of the mentioned
View Answer

Answer: b
Explanation: The normal form used in Data base normalization is BCNF i.e. Boyce Codd normal form
and NOT Backus Naur Form.

8. State true or false:


Statement: BNF is a metasyntax used to express CFG
a) True
b) False
View Answer

Answer: a
Explanation: BNF is a metasyntax used to express context free grammar, moreover a formal way to
express the language.

9. Which of the following are not used to express CFG?


a) BNF
b) EBNF, ABNF
c) Van Wijngaarden form
d) None of the mentioned
View Answer

Answer: d
Explanation: W grammar or van Wijngaarden form is used to define potentially infinite context free
grammars in a finite number of rules. It is an example of larger class of affix grammars. This
technique was used to define the P/L Algol 68.

10. Which of the following version of Unix came up with YACC first?
a) V3
b) V5
c) CB UNIX
d) Unix-RT
View Answer

Answer: a
Explanation: Yacc appeared in version 3 of unix, though full description was published by 1975
1. A CFG is ambiguous if
a) It has more than one rightmost derivations
b) It has more than one leftmost derivations
c) No parse tree can be generated for the CFG
d) None of the mentioned
View Answer

Answer: b
Explanation: A context free grammar is ambiguous if it has more than one parse tree generated or
more than one leftmost derivations. An unambiguous grammar is a context free grammar for which
every valid string has a unique leftmost derivation.

2. Which of the following are always unambiguous?


a) Deterministic Context free grammars
b) Non-Deterministic Regular grammars
c) Context sensitive grammar
d) None of the mentioned
View Answer

Answer: a
Explanation: Deterministic CFGs are always unambiguous , and are an important subclass of
unambiguous CFGs; there are non-deterministic unambiguous CFGs, however.

3. A CFG is not closed under


a) Dot operation
b) Union Operation
c) Concatenation
d) Iteration
View Answer

Answer: d
Explanation: The closure property of a context free grammar does not include iteration or kleene or
star operation.

4. Which of the following is an real-world programming language ambiguity?


a) dangling else problem
b) halting problem
c) maze problem
d) none of the mentioned
View Answer

Answer: a
Explanation: Dangling else problem: In many languages,the else in an if-then-else statement is
optional, which results into nested conditionals being ambiguous, at least in terms of the CFG.

5. Which of the following is a parser for an ambiguous grammar?


a) GLR parser
b) Chart parser
c) All of the mentioned
d) None of the mentioned
View Answer
Answer: c
Explanation: GLR parser: a type of parser for non deterministic and ambiguous grammar
Chart parser: aa type of parser for ambiguous grammar.

6. A language that admits only ambiguous grammar:


a) Inherent Ambiguous language
b) Inherent Unambiguous language
c) Context free language
d) Context Sensitive language
View Answer

Answer: a
Explanation: A context free language for which no unambiguous grammar exists, is called Inherent
ambiguous language.

7. Which of the following is an example of inherent ambiguous language?


a) {an|n>1}
b) {anbncmdm| n,m > 0}
c) {0n1n|n>0}
d) None of the mentioned
View Answer

Answer: b
Explanation: This set is context-free, since the union of two context-free languages is always context
free.

8. State true or false:


Statement: R->R|T T->ε is an ambiguous grammar
a) true
b) false
View Answer

Answer: a
Explanation: The production can be either itself or an empty string. Thus the empty string has more
than one leftmost derivations, depending on how many times R->R is being used.

9. In context to ambiguity, the number of times the following programming statement can be
interpreted as:
Statement: if R then if T then P else V
a) 2
b) 3
c) 4
d) 1
View Answer

Answer: a
Explanation: Dangling else problem
if R then (if T then P else V) and if R then (if T then P) else V are the two ways in which the given if
else statement can be parsed.

10. CFGs can be parsed in polynomial time using__________


a) LR parser
b) CYK algorithm
c) SLR parser
d) None of the mentioned
View Answer

Answer: CYK algorithm parses the CFG in polynomial time while LR parsers do the same in linear
time. DCFGs are accepted by DPDAs and parsed using LR parsers or CYK algorithm.

1. A push down automaton employs ________ data structure.


a) Queue
b) Linked List
c) Hash Table
d) Stack
View Answer

Answer: d
Explanation: A push down automata uses a stack to carry out its operations. They are more capable
than the finite automatons but less than the turing model.

2. State true or false:


Statement: The operations of PDA never work on elements, other than the top.
a) true
b) false
View Answer

Answer: a
Explanation: The term pushdown refers to the fact that the elements are pushed down in the stack
and as per the LIFO principle, the operation is always performed on the top element of the stack.

3. Which of the following allows stacked values to be sub-stacks rather than just finite symbols?
a) Push Down Automaton
b) Turing Machine
c) Nested Stack Automaton
d) None of the mentioned
View Answer

Answer: c
Explanation: In computational theory, a nested stack automaton is a finite automaton which makes
use of stack containing data which can be additional stacks.

4. A non deterministic two way, nested stack automaton has n-tuple definition. State the value of n.
a) 5
b) 8
c) 4
d) 10
View Answer

Answer: d
Explanation: The 10-tuple can be stated as: NSA= ‹Q,Σ,Γ,δ,q0,Z0,F,[,],]›.

5. Push down automata accepts _________ languages.


a) Type 3
b) Type 2
c) Type 1
d) Type 0
View Answer

Answer: b
Explanation: Push down automata is for Context free languages and they are termed as Type 2
languages according to Chomsky hierarchy.

6. The class of languages not accepted by non deterministic, nonerasing stack automata is _______
a) NSPACE(n2)
b) NL
c) CSL
d) All of the mentioned
View Answer

Answer: d
Explanation: NSPACE or non deterministic space is the computational resource describing the
memory space for a non deterministic turing machine.

7. A push down automaton with only symbol allowed on the stack along with fixed symbol.
a) Embedded PDA
b) Nested Stack automata
c) DPDA
d) Counter Automaton
View Answer

Answer: d
Explanation: This class of automata can recognize a set of context free languages like {anbn|n
belongs to N}

8. Which of the operations are eligible in PDA?


a) Push
b) Delete
c) Insert
d) Pop
View Answer

Answer: a, d
Explanation: Push and pop are the operations we perform to operate a stack. A stack follows the
LIFO principle, which states its rule as: Last In First Out.

9. A string is accepted by a PDA when


a) Stack is empty
b) Acceptance state
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: When we reach the acceptance state and find the stack to be empty, we say, the string
has been accepted by the push down automata.
10. The following move of a PDA is on the basis of:
a) Present state
b) Input Symbol
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: The next operation is performed by PDA considering three factors: present
state,symbol on the top of the stack and the input symbol.

Sanfoundry Global Education & Lear

1. If two sets, R and T has no elements in common i.e. RÇT=Æ, then the sets are called
a) Complement
b) Union
c) Disjoint
d) Connected
View Answer

Answer: c
Explanation: Two sets are called disjoint if they have no elements in common i.e. RÇT=Æ.

2. Which among the following is not a part of the Context free grammar tuple?
a) End symbol
b) Start symbol
c) Variable
d) Production
View Answer

Answer: a
Explanation: The tuple definition of context free grammar is: (V, T, P, S) where V=set of variables,
T=set of terminals, P=production, S= Starting Variable.

3. A context free grammar is a ___________


a) English grammar
b) Regular grammar
c) Context sensitive grammar
d) None of the mentioned
View Answer

Answer: c
Explanation: Context free grammar is the set which belongs to the set of context free grammar.
Similarly, Regular grammar is a set which belongs to the the set of Context free grammar.

4. The closure property of context free grammar includes :


a) Kleene
b) Concatenation
c) Union
d) All of the mentioned
View Answer
Answer: d
Explanation: Context free grammars are closed under kleene operation, union and concatenation
too.

5. Which of the following automata takes stack as auxiliary storage?


a) Finite automata
b) Push down automata
c) Turing machine
d) All of the mentioned
View Answer

Answer: b
Explanation: Pushdown Automaton uses stack as an auxiliary storage for its operations. Turing
machines use Queue for the same.

6. Which of the following automata takes queue as an auxiliary storage?


a) Finite automata
b) Push down automata
c) Turing machine
d) All of the mentioned
View Answer

Answer: c
Explanation: Pushdown Automaton uses stack as an auxiliary storage for its operations. Turing
machines use Queue for the same.

7. A context free grammar can be recognized by


a) Push down automata
b) 2 way linearly bounded automata
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: A linearly bounded automata is a restricted non deterministic turing machine which is
capable of accepting ant context free grammar.

8. A null production can be referred to as:


a) String
b) Symbol
c) Word
d) All of the mentioned
View Answer

Answer: a
Explanation: Null production is always taken as a string in computational theory.

9. The context free grammar which generates a Regular Language is termed as:
a) Context Regular Grammar
b) Regular Grammar
c) Context Sensitive Grammar
d) None of the mentioned
View Answer

Answer: b
Explanation: Regular grammar is a subset of Context free grammar. The CFGs which produces a
language for which a finite automaton can be created is called Regular grammar.

10. NPDA stands for


a) Non-Deterministic Push Down Automata
b) Null-Push Down Automata
c) Nested Push Down Automata
d) All of the mentioned
View Answer

Answer: a
Explanation: NPDA stands for non-deterministic push down automata whereas DPDA stands for
deterministic push down automata.

1. The production of the form A->B , where A and B are non terminals is called
a) Null production
b) Unit production
c) Greibach Normal Form
d) Chomsky Normal Form
View Answer

Answer: b
Explanation: A->ε is termed as Null production while A->B is termed as Unit production.

2. Halting states are of two types. They are:


a) Accept and Reject
b) Reject and Allow
c) Start and Reject
d) None of the mentioned
View Answer

Answer: a
Explanation: Halting states are the new tuple members introduced in turing machine and is of two
types: Accept Halting State and Reject Halting State.

3. A push down automata can be represented as:


PDA= ε-NFA +[stack] State true or false:
a) true
b) false
View Answer
Answer: a
Explanation:

4. A pushdown automata can be defined as: (Q, ∑, G, q0, z0, A, d)


What does the symbol z0 represents?
a) an element of G
b) initial stack symbol
c) top stack alphabet
d) all of the mentioned
View Answer

Answer: d
Explanation: z0 is the initial stack symbol, is an element of G. Other symbols like d represents the
transition function of the machine.

5. Which of the following correctly recognize the symbol ‘|-‘ in context to PDA?
a) Moves
b) transition function
c) or/not symbol
d) none of the mentioned
View Answer

Answer: a
Explanation: Using this notation, we can define moves and further acceptance of a string by the
machine.

6. Which among the following is true for the given statement?


Statement :If there are strings R and T in a language L so that R is prefix of T and R is not equivalent
to T.
a) No DPDA can accept L by empty stack
b) DPDA can accept L by an empty stack
c) L is regular
d) None of the mentioned
View Answer

Answer: a
Explanation: If M is a DPDA accepting L by an empty stsck, R and T are distinct strings in L, and R is a
prefix of T, then the sequence of moves M must make in order to accept R leaves the stack empty,
since R∈L. But then T cannot be accepted, since M cant move with an empty stack.

7. 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}
c) {xxc| where c stands for the complement,{0,1}}
d) None of the mentioned
View Answer

Answer: d
Explanation: Theorem: The language pal of palindromes over the alphabet {0,1} cannot be accepted
by any finite automaton , and it is therefore not regular.

8. For a counter automaton, with the symbols A and Z0, the string on the stack is always in the form
of __________
a) A
b) AnZ0, n>=0
c) Z0An, n>=0
d) None of the mentioned
View Answer

Answer: b
Explanation:The possible change in the stack contents is a change in the number of A’s on the stack.

9. State true or false:


Statement: Counter Automaton can exist for the language L={0i1i|i>=0}
a) true
b) false
View Answer

Answer: a
Explanation: The PDA works as follows. Instead of saving excess 0’s or 1’s on the stack, we save *’s
and use two different states to indicate which symbol there is currently a surplus of. The state q0 is
the initial state and the only accepting state.

10. Let ∑={0,1}* and the grammar G be:


S->ε
S->SS
S->0S1|1S0
State which of the following is true for the given
a) Language of all and only Balanced strings
b) It contains equal number of 0’s and 1’s
c) Ambiguous Grammar
d) All of the mentioned
View Answer

Answer: d
Explanation: A string is said to be balanced if it consist of equal number of 0’s and 1’s.

1. The instantaneous PDA is has the following elements


a) State
b) Unconsumed input
c) Stack content
d) All of the mentioned
View Answer

Answer: d
Explanation: The instantaneous description of a PDA is represented by 3 tuple:
(q,w,s)
where q is the state, w is the unconsumed input and s is the stack content.

2. The moves in the PDA is technically termed as:


a) Turnstile
b) Shifter
c) Router
d) None of the mentioned
View Answer

Answer: a
Explanation: A turnstile notation is used for connecting pairs od ID’s taht represents one or many
moves of a PDA.

3. Which of the following option resembles the given PDA?

a) {0n1n|n>=0}
b) {0n12n|n>=0}
c) {02n1n|n>=0}
d) None of the mentioned
View Answer

Answer: a

4. Which of the following correctly resembles the given state diagram?

a) {wwr|w=(a+b)*}
b) ε is called the initial stack symbol
c) Both (a) and (b)
d) None of the mentioned
View Answer
Answer: a
Explanation: Initially we put a special symbol ‘#’ into the empty stack. At state q1, the w is being
read. In state q2, each 0 or 1 is popped when it matches the input. If any other input is given, the
PDA will go to a dead state. When we reach that special symbol ‘#’, we go to the accepting state q3.

5. Which of the following assertion is false?


a) If L is a language accepted by PDA1 by final state, there exist a PDA2 that accepts L by empty stack
i.e. L=L(PDA1)=L(PDA2)
b) If L is a CFL then there exists a push down automata P accepting CF; ; by empty stack i.e. L=M(P)
c) Let L is a language accepted by PDA1 then there exist a CFG X such that L(X)=M(P)
d) All of the mentioned
View Answer

Answer: d
Explanation:
All the assertions mentioned are theorems or corollary.

6. A push down automata can represented using:


a) Transition graph
b) Transition table
c) ID
d) All of the mentioned
View Answer

Answer: d
Explanation: Yes, a PDA can be represented using a transition diagram, transition table and an
instantaneous description.

7. State true or false:


Statement: Every context free grammar can be transformed into an equvalent non deterministic
push down automata.
a) true
b) false
View Answer

Answer: a
Explanation: Push down automata is the automaton machine for all the context free grammar or
Type 2 languages.

8. Which of the following statement is false?


a) For non deterministic PDA, equivalence is undecidable
b) For deterministic PDA, equivalence is decidable
c) For deterministic PDA, equivalence is undecidable.
d) None of the mentioned
View Answer

Answer: c
Explanation: Geraud proved the equivalence problem decidable for Deterministic PDA .

9. Which of the following are the actions that operates on stack top?
a) Pushing
b) Popping
c) Replacing
d) All of the mentioned
View Answer

Answer: d
Explanation: Push, pop and replace are all the basic and only operations that takes place on stack
top.

10. A push down automata is said to be _________ if it has atmost one transition around all
configurations.
a) Finite
b) Non regular
c) Non-deterministic
d) Deterministic
View Answer

Answer: d
Explanation: DPDA or Deterministic Push down automata has atmost one transition applicable to
each configuration.

1. The transition a Push down automaton makes is additionally dependent upon the:
a) stack
b) input tape
c) terminals
d) none of the mentioned
View Answer

Answer: a
Explanation: A PDA is a finite machine which has an additional stack storage. Its transitions are based
not only on input and the correct state but also on the stack.

2. A PDA machine configuration (p, w, y) can be correctly represented as:


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
View Answer

Answer: a
Explanation: A machine configuration is an element of K×Σ*×Γ*.
(p,w,γ) = (current state, unprocessed input, stack content).

3. |-* is the __________ closure of |-


a) symmetric and reflexive
b) transitive and reflexive
c) symmetric and transitive
d) none of the mentioned
View Answer

Answer: b
Explanation: A string w is accepted by a PDA if and only if (s,w, e) |-* (f, e, e)
4. 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
b) end in final state
c) end with an empty stack
d) all of the mentioned
View Answer

Answer: d
Explanation: The empty stack in the end is our requirement relative to finite state automatons.

5. 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
c) Atleast one state has more than one transitions
d) None of the mentioned
View Answer

Answer: a
Explanation: A Deterministic Push Down Automata is a Push Down Automata in which no state p has
two or more transitions.

6. State true or false:


Statement: For every CFL, G, there exists a PDA M such that L(G) = L(M) and vice versa.
a) true
b) false
View Answer

Answer: a
Explanation: There exists two lemma’s such that:
a) Given a grammar G, construct the PDA and show the equivalence
b) Given a PDA, construct a grammar and show the equivalence

7. If the PDA does not stop on an accepting state and the stack is not empty, the string is:
a) rejected
b) goes into loop forever
c) both (a) and (b)
d) none of the mentioned
View Answer

Answer: a
Explanation: To accept a string, PDA needs to halt at an accepting state and with a stack empty, else
it is called rejected. Given a PDA M, we can construct a PDA M’ that accepts the same language as M,
by both acceptance criteria.

8. A language accepted by Deterministic Push down automata is closed under which of the
following?
a) Complement
b) Union
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: a
Explanation: Deterministic Context free languages(one accepted by PDA by final state), are
drastically different from the context free languages. For example they are closed under
complementation and not union.

9. Which of the following is a simulator for non deterministic automata?


a) JFLAP
b) Gedit
c) FAUTO
d) None of the mentioned
View Answer

Answer: a
Explanation: JFLAP is a software for experimenting with formal topics including NFA, NPDA, multi-
tape turing machines and L-systems.

10. Finite-state acceptors for the nested words can be:


a) nested word automata
b) push down automata
c) ndfa
d) none of the mentioned
View Answer

Answer: a
Explanation: The linear encodings of languages accepted by finite nested word automata gives the
class of ‘visibly pushdown automata’.
Theory of Computation -MCQs
1. Assume the R is a relation on a set A, aRb is partially ordered such that a and b are _____________
a) reflexive
b) transitive
c) symmetric
d) reflexive and transitive
Answer: d
Explanation: A partially ordered relation refers to one which is Reflexive, Transitive and
Antisymmetric.

2. The non- Kleene Star operation accepts the following string of finite length over set A = {0,1} |
where string s contains even number of 0 and 1
a) 01,0011,010101
b) 0011,11001100
c) ε,0011,11001100
d) ε,0011,11001100
Answer: b
Explanation: The Kleene star of A, denoted by A*, is the set of all strings obtained by
concatenating zero or more strings from A.

3. A regular language over an alphabet ∑ is one that cannot be obtained from the basic languages
using the operation
a) Union
b) Concatenation
c) Kleene*
d) All of the mentioned

Answer: d
Explanation: Union, Intersection, Concatenation, Kleene*, Reverse are all the closure
properties of Regular Language.

4. Statement 1: A Finite automata can be represented graphically; Statement 2: The nodes can be its
states; Statement 3: The edges or arcs can be used for transitions
Hint: Nodes and Edges are for trees and forests too.
Which of the following make the correct combination?
a) Statement 1 is false but Statement 2 and 3 are correct
b) Statement 1 and 2 are correct while 3 is wrong
c) None of the mentioned statements are correct
d) All of the mentioned

Answer: d
Explanation: It is possible to represent a finite automaton graphically, with nodes for states,
and arcs for transitions.

5. The minimum number of states required to recognize an octal number divisible by 3 are/is
a) 1
b) 3
c) 5
d) 7
Answer: b
Explanation: According to the question, minimum of 3 states are required to recognize an
octal number divisible by 3.

6. Which of the following is a not a part of 5-tuple finite automata?


a) Input alphabet
b) Transition function
c) Initial State
d) Output Alphabet
Answer: d
Explanation: A FA can be represented as FA= (Q, ∑, δ, q0, F) where Q=Finite Set of States,
∑=Finite Input Alphabet, δ=Transition Function, q0=Initial State, F=Final/Acceptance State).

7. If an Infinite language is passed to Machine M, the subsidiary which gives a finite solution to the
infinite input tape is ______________
a) Compiler
b) Interpreter
c) Loader and Linkers
d) None of the mentioned
Answer: a
Explanation: A Compiler is used to give a finite solution to an infinite phenomenon. Example
of an infinite phenomenon is Language C, etc.

8. The number of elements in the set for the Language L={xϵ(∑r) *|length if x is at most 2} and
∑={0,1} is_________
a) 7
b) 6
c) 8
d) 5
Answer: a
Explanation: ∑r= {1,0} and a Kleene* operation would lead to the following
set=COUNT{ε,0,1,00,11,01,10} =7.

9. For the following change of state in FA, which of the following codes is an incorrect option?
a) δ (m, 1) =n
b) δ (0, n) =m
c) δ (m,0) =ε
d) s: accept = false; cin >> char;
if char = “0” goto n;

Answer: b
Explanation: δ(QX∑) = Q1 is the correct representation of change of state. Here, δ is called
the Transition function.
10. Given: ∑= {a, b}
L= {xϵ∑*|x is a string combination}
∑4 represents which among the following?

a) {aa, ab, ba, bb}


b) {aaaa, abab, ε, abaa, aabb}
c) {aaa, aab, aba, bbb}
d) All of the mentioned

Answer: b
Explanation: ∑* represents any combination of the given set while ∑x represents the set of
combinations with length x where x ϵ I.

11. Assume the R is a relation on a set A, aRb is partially ordered such that a and b are _____________
a) reflexive
b) transitive
c) symmetric
d) reflexive and transitive
Answer: d
Explanation: A partially ordered relation refers to one which is Reflexive, Transitive and
Antisymmetric.

12. The non- Kleene Star operation accepts the following string of finite length over set A = {0,1} |
where string s contains even number of 0 and 1
a) 01,0011,010101
b) 0011,11001100
c) ε,0011,11001100
d) ε,0011,11001100
Answer: b
Explanation: The Kleene star of A, denoted by A*, is the set of all strings obtained by
concatenating zero or more strings from A.

13. A regular language over an alphabet ∑ is one that cannot be obtained from the basic languages
using the operation
a) Union
b) Concatenation
c) Kleene*
d) All of the mentioned
Answer: d
Explanation: Union, Intersection, Concatenation, Kleene*, Reverse are all the closure
properties of Regular Language.

14. Statement 1: A Finite automata can be represented graphically; Statement 2: The nodes can be
its states; Statement 3: The edges or arcs can be used for transitions
Hint: Nodes and Edges are for trees and forests too.
Which of the following make the correct combination?
a) Statement 1 is false but Statement 2 and 3 are correct
b) Statement 1 and 2 are correct while 3 is wrong
c) None of the mentioned statements are correct
d) All of the mentioned
Answer: d
Explanation: It is possible to represent a finite automaton graphically, with nodes for states,
and arcs for transitions.

15. The minimum number of states required to recognize an octal number divisible by 3 are/is
a) 1
b) 3
c) 5
d) 7
Answer: b
Explanation: According to the question, minimum of 3 states are required to recognize an
octal number divisible by 3.

16. Which of the following is a not a part of 5-tuple finite automata?


a) Input alphabet
b) Transition function
c) Initial State
d) Output Alphabet
Answer: d
Explanation: A FA can be represented as FA= (Q, ∑, δ, q0, F) where Q=Finite Set of States,
∑=Finite Input Alphabet, δ=Transition Function, q0=Initial State, F=Final/Acceptance State).

17. If an Infinite language is passed to Machine M, the subsidiary which gives a finite solution to the
infinite input tape is ______________
a) Compiler
b) Interpreter
c) Loader and Linkers
d) None of the mentioned
Answer: a
Explanation: A Compiler is used to give a finite solution to an infinite phenomenon. Example
of an infinite phenomenon is Language C, etc.

18. The number of elements in the set for the Language L={xϵ(∑r) *|length if x is at most 2} and
∑={0,1} is_________
a) 7
b) 6
c) 8
d) 5
Answer: a
Explanation: ∑r= {1,0} and a Kleene* operation would lead to the following
set=COUNT{ε,0,1,00,11,01,10} =7.

9. For the following change of state in FA, which of the following codes is an incorrect option?
a) δ (m, 1) =n
b) δ (0, n) =m
c) δ (m,0) =ε
d) s: accept = false; cin >> char; if char = “0” goto n;
Answer: b
Explanation: δ(QX∑) = Q1 is the correct representation of change of state. Here, δ is called
the Transition function.

20. Given: ∑= {a, b}


L= {xϵ∑*|x is a string combination}
∑4 represents which among the following?

a) {aa, ab, ba, bb}


b) {aaaa, abab, ε, abaa, aabb}
c) {aaa, aab, aba, bbb}
d) All of the mentioned
Answer: b
Explanation: ∑* represents any combination of the given set while ∑x represents the set of
combinations with length x where x ϵ I.

“Moore Machine”.
21. Moore Machine is an application of:
a) Finite automata without input
b) Finite automata with output
c) Non- Finite automata with output
d) None of the mentioned
Answer: b
Explanation: Finite automaton with an output is categorize din two parts: Moore M/C and
Mealy M/C.

22. In Moore machine, output is produced over the change of:


a) transitions
b) states
c) Both
d) None of the mentioned
Answer: b
Explanation: Moore machine produces an output over the change of transition states while
mealy machine does it so for transitions itself.

23. For a give Moore Machine, Given Input=’101010’, thus the output would be of length:
a) |Input|+1
b) |Input|
c) |Input-1|
d) Cannot be predicted
Answer: a
Explanation: Initial state, from which the operations begin is also initialized with a value.

24. Statement 1: Null string is accepted in Moore Machine.


Statement 2: There are more than 5-Tuples in the definition of Moore Machine.
Choose the correct option:
a) Statement 1 is true and Statement 2 is true
b) Statement 1 is true while Statement 2 is false
c) Statement 1 is false while Statement 2 is true
d) Statement 1 and Statement 2, both are false
Answer: a
Explanation: Even ε, when passed as an input to Moore machine produces an output.

25. The total number of states and transitions required to form a moore machine that will produce
residue mod 3.
a) 3 and 6
b) 3 and 5
c) 2 and 4
d) 2 and 5
Answer: a
Explanation:

26. Complete the given table according to the given Moore machine.

Present State
Next State
Output

0
1

Q0
Q1
Q2
1
Q1
Q2
1
Q2

Q0

a) Q0, Q2, 0
b) Q0, Q2, 1
c) Q1, Q2, 1
d) Q1, Q0, 0
Answer: a
Explanation: The table can be filled accordingly seeing the graph.

27. What is the output for the given language?


Language: A set of strings over ∑= {a, b} is taken as input and it prints 1 as an output “for every
occurrence of a, b as its substring. (INPUT: abaaab)
a) 0010001
b) 0101010
c) 0111010
d) 0010000
Answer: a
Explanation: The outputs are as per the input, produced.

28. The output alphabet can be represented as:


a) δ
b) ∆
c) ∑
d) None of the mentioned
Answer: b
Explanation: Source-The tuple definition of Moore and mealy machine comprises one new
member i.e. output alphabet as these are finite machines with output.

29. The O/P of Moore machine can be represented in the following format:
a) Op(t)=δ(Op(t))
b) Op(t)=δ(Op(t)i(t))
c) Op(t): ∑
d) None of the mentioned
Answer: a
Explanation: Op(t)=δ(Op(t)) is the defined definition of how the output is received on giving
a specific input to Moore machine.

30. Which of the following is a correct statement?


a) Moore machine has no accepting states
b) Mealy machine has accepting states
c) We can convert Mealy to Moore but not vice versa
d) All of the mentioned
Answer: a
Explanation: Statement a and b is correct while c is false. Finite machines with output have
no accepting states and can be converted within each other.
Deterministic Finite Automata-Introduction and
Definition

1. Which of the following not an example Bounded Information?


a) fan switch outputs {on, off}
b) electricity meter reading
c) colour of the traffic light at the moment
d) none of the mentioned

Answer: b
Explanation: Bounded information refers to one whose output is limited and it cannot be
said what were the recorded outputs previously until memorized.

2. A Language for which no DFA exist is a________


a) Regular Language
b) Non-Regular Language
c) May be Regular
d) Cannot be said

Answer: b
Explanation: A language for which there is no existence of a deterministic finite automata is
always Non Regular and methods like Pumping Lemma can be used to prove the same.

3. A DFA cannot be represented in the following format


a) Transition graph
b) Transition Table
c) C code
d) None of the mentioned

Answer: d
Explanation: A DFA can be represented in the following formats: Transition Graph,
Transition Table, Transition tree/forest/Any programming Language.
4. What the following DFA accepts?

a) x is a string such that it ends with ‘101’


b) x is a string such that it ends with ‘01’
c) x is a string such that it has odd 1’s and even 0’s
d) x is a strings such that it has starting and ending character as 1

Answer: a
Explanation: Strings such as {1101,101,10101} are being accepted while {1001,11001} are
not. Thus, this conclusion leads to option a.

5. When are 2 finite states equivalent?


a) Same number of transitions
b) Same number of states
c) Same number of states as well as transitions
d) Both are final states

Answer: c
Explanation: Two states are said to be equivalent if and only if they have same number of
states as well as transitions.

6. What does the following figure most correctly represents?


a) Final state with loop x
b) Transitional state with loop x
c) Initial state as well as final state with loop x
d) Insufficient Data

Answer: c
Explanation: The figure represents the initial as well as the final state with an iteration of x.

7. Which of the following will not be accepted by the following DFA?

a) ababaabaa
b) abbbaa
c) abbbaabb
d) abbaabbaa

Answer: a
Explanation: All the Strings are getting accepted except ‘ababaabaa’ as it is directed to
dumping state. Dumping state also refers to the reject state of the automata.
8. Which of the following will the given DFA won’t accept?

a) ε
b) 11010
c) 10001010
d) String of letter count 11

Answer: a
Explanation: As the initial state is not made an acceptance state, thus ε will not be accepted
by the given DFA. For the automata to accept ε as an entity, one should make the initial state
as also the final state.

9. Can a DFA recognize a palindrome number?


a) Yes
b) No
c) Yes, with input alphabet as ∑*
d) Can’t be determined

Answer: b
Explanation: Language to accept a palindrome number or string will be non-regular and
thus, its DFA cannot be obtained. Though, PDA is possible.

10. Which of the following is not an example of finite state machine system?
a) Control Mechanism of an elevator
b) Combinational Locks
c) Traffic Lights
d) Digital Watches

Answer: d
Explanation: Proper and sequential combination of events leads the machines to work in
hand which includes The elevator, Combinational Locks, Traffic Lights, vending machine, etc.
Other applications of Finite machine state system are Communication Protocol Design,
Artificial Intelligence Research, A Turnstile, etc.

DFA Processing Strings


1. The password to the admins account=”administrator”. The total number of states required to
make a password-pass system using DFA would be __________
a) 14 states
b) 13 states
c) 12 states
d) A password pass system cannot be created using DFA

Answer: a
Explanation: For a string of n characters with no repetitive substrings, the number of states
required to pass the string is n+1.

2. Which of the following is the corresponding Language to the given DFA?

a) L= {x ϵ {0, 1} * | x ends in 1 and does not contain substring 01}


b) L= {x ϵ {0,1} * |x ends in 1 and does not contain substring 00}
c) L= {x ϵ {0,1} |x ends in 1 and does not contain substring 00}
d) L= {x ϵ {0,1} * |x ends in 1 and does not contain substring 11}

Answer: b
Explanation: The Language can be anonymously checked and thus the answer can be
predicted. The language needs to be accepted by the automata (acceptance state) in order to
prove its regularity.
3. Let ∑= {a, b, …. z} and A = {Hello, World}, B= {Input, Output}, then (A*∩B) U (B*∩A) can be
represented as:
a) {Hello, World, Input, Output, ε}
b) {Hello, World, ε}
c) {Input, Output, ε}
d) {}

Answer: d
Explanation: Union operation creates the universal set by combining all the elements of first
and second set while intersection operation creates a set of common elements of the first
and the second state.

4. Let the given DFA consist of x states. Find x-y such that y is the number of states on minimization
of DFA?

a) 3
b) 2
c) 1
d) 4

Answer: b
Explanation: Use the equivalence theorem or Myphill Nerode theorem to minimize the DFA.

5. For a machine to surpass all the letters of alphabet excluding vowels, how many number of states
in DFA would be required?
a) 3
b) 2
c) 22
d) 27
Answer: a
Explanation:

6. For the DFA given below compute the following:


Union of all possible combinations at state 7,8 and 9.

a) {aba, ac, cc, ca, cb, bc, bab, ca}


b) {bab, bc, ac, aba, ca, aac, ccb}
c) {cc, ca, cb, aba, bab, ac}
d) {aba, ac, cc, ca, cb, bc, bab, caa}

Answer: d
Explanation: The string a state receives is the combination of all input alphabets which lie
across the path covered.
7. Given L= {Xϵ∑*= {a, b} |x has equal number of a, s and b’s}.
Which of the following property satisfy the regularity of the given language?
a) Regularity is dependent upon the length of the string
b) Regularity is not dependent upon the length of the string
c) Can’t be said for a particular string of a language
d) It may depend on the length of the string

Answer: b
Explanation: DFA can be made for infinite language with an infinite length. Thus,
dependency over length is unfruitful.

8. Given:
L= {xϵ∑= {0,1} |x=0n1n for n>=1}; Can there be a DFA possible for the language?
a) Yes
b) No

Answer: b
Explanation: It is not possible to have a count of equal number of 0 and 1 at any instant in
DFA. Thus, It is not possible to build a DFA for the given Language.

9. δ(A,1) = B, δ(A,0) =A
Δ (B, (0,1)) =C
δ(C,0) = A (Initial state =A)
String=”011001” is transit at which of the states?
a) A
b) C
c) B
d) Invalid String

Answer: a
Explanation: It is east and simple to create the table and then the corresponding transition
graph in order to get the result, at which state the given string would be accepted.

The Language of NFA


1. Subset Construction method refers to:
a) Conversion of NFA to DFA
b) DFA minimization
c) Eliminating Null references
d) ε-NFA to NFA

Answer: a
Explanation: The conversion of a non-deterministic automata into a deterministic one is a
process we call subset construction or power set construction.
2. Given Language:
Ln= {xϵ {0,1} * | |x|≥n, nth symbol from the right in x is 1}
How many state are required to execute L3 using NFA?
a) 16
b) 15
c) 8
d) 7

Answer: b
Explanation: The finite automaton for the given language is made and thus, the answer can
be obtained.

3. Which of the following does the given NFA represent?

a) {11, 101} * {01}


b) {110, 01} * {11}
c) {11, 110} * {0}
d) {00, 110} * {1}

Answer: c
Explanation: The given diagram can be analysed and thus the option can be seeked.

4. The number of transitions required to convert the following into equivalents DFA:

a) 2
b) 3
c) 1
d) 0

Answer: a
Explanation:

5. If L is a regular language, Lc and Lr both will be:


a) Accepted by NFA
b) Rejected by NFA
c) One of them will be accepted
d) Cannot be said

Answer: a
Explanation: If L is a regular Language, Lc and Lr both are regular even.

6. In NFA, this very state is like dead-end non final state:


a) ACCEPT
b) REJECT
c) DISTINCT
d) START

Answer: b
Explanation: REJECT state will be like a halting state which rejects a particular invalid input.

7. We can represent one language in more one FSMs, true or false?


a) TRUE
b) FALSE
c) May be true
d) Cannot be said

Answer: a
Explanation: We can represent one language in more one FSMs, example for a same language
we have a DFA and an equivalent NFA.

8. The production of form non-terminal -> ε is called:


a) Sigma Production
b) Null Production
c) Epsilon Production
d) All of the mentioned

Answer: b
Explanation: The production of form non-terminal ->ε is call null production.

9. Which of the following is a regular language?


a) String whose length is a sequence of prime numbers
b) String with substring wwr in between
c) Palindrome string
d) String with even number of Zero’s

Answer: d
Explanation: DFSM’s for the first three option is not possible; hence they aren’t regular.

10. Which of the following recognizes the same formal language as of DFA and NFA?
a) Power set Construction
b) Subset Construction
c) Robin-Scott Construction
d) All of the mentioned

Answer: d
Explanation: All the three option refers to same technique if distinguishing similar
constructions for different type of automata.

Finite Automata with Epsilon Transition


1. According to the given transitions, which among the following are the epsilon closures of q1 for
the given NFA?
Δ (q1, ε) = {q2, q3, q4}
Δ (q4, 1) =q1
Δ (q1, ε) =q1
a) q4
b) q2
c) q1
d) q1, q2, q3, q4

Answer: d
Explanation: The set of states which can be reached from q using ε-transitions, is called the
ε-closure over state q.

2. State true or false?


Statement: An NFA can be modified to allow transition without input alphabets, along with one or
more transitions on input symbols.
a) True
b) False

Answer: a
Explanation: It is possible to construct an NFA with ε-transitions, presence of no input
symbols, and that is called NFA with ε-moves.

3. State true or false?


Statement: ε (Input) does not appears on Input tape.
a) True
b) False
Answer: a

Explanation: ε does not appears on Input tape, ε transition means a transition without
scanning a symbol i.e. without moving the read head.

4. Statement 1: ε- transition can be called as hidden non-determinism.


Statement 2: δ (q, ε) = p means from q it can jump to p with a shift in read head.
Which among the following options is correct?
a) Statement 1 and 2, both are correct
b) Statement 1 and 2, both are wrong
c) Statement 1 is correct while Statement 2 is wrong
d) Statement 1 is wrong while Statement 2 is correct

Answer: c
Explanation: The transition with ε leads to a jump but without any shift in read head.
Further, the method can be called one to introduce hidden non-determinism.

5. ε- closure of q1 in the given transition graph:


a) {q1}
b) {q0, q2}
c) {q1, q2}
d) {q0, q1, q2}

Answer: c
Explanation: ε-closure is defined as the set of states being reached through ε-transitions
from a starting state.

6. Predict the total number of final states after removing the ε-moves from the given NFA?
a) 1
b) 2
c) 3
d) 0
Answer: c
Explanation: The NFA which would result after eliminating ε-moves can be shown
diagramatically.

7. For NFA with ε-moves, which among the following is correct?


a) Δ: Q X (∑ U {ε}) -> P(Q)
b) Δ: Q X (∑) -> P(Q)
c) Δ: Q X (∑*) -> P(Q)
d) All of the mentioned

Answer: a
Explanation: Due to the presence of ε symbol, or rather an epsilon-move, the input alphabets
unites with it to form a set including ε.

8. Which among the following is false?


ε-closure of a subset S of Q is:
a) Every element of S ϵ Q
b) For any q ϵ ε(S), every element of δ (q, ε) is in ε(S)
c) No other element is in ε(S)
d) None of the mentioned

Answer: d
Explanation: All the mentioned are the closure properties of ε and encircles all the elements
if it satisfies the following options:
a) Every element of S ϵ Q
b) For any q ϵ ε(S), every element of δ (q, ε) is in ε(S)
c) No other element is in ε(S)

9. The automaton which allows transformation to a new state without consuming any input
symbols:
a) NFA
b) DFA
c) NFA-l
d) All of the mentioned

Answer: c
Explanation: NFA-l or e-NFA is an extension of Non deterministic Finite Automata which are
usually called NFA with epsilon moves or lambda transitions.

10. e-transitions are


a) conditional
b) unconditional
c) input dependent
d) none of the mentioned
Answer: b
Explanation: An epsilon move is a transition from one state to another that doesnt require
any specific condition.

11. The __________ of a set of states, P, of an NFA is defined as the set of states reachable from any
state in P following e-transitions.
a) e-closure
b) e-pack
c) Q in the tuple
d) None of the mentioned

Answer: a
Explanation: The e-closure of a set of states, P, of an NFA is defined as the set of states
reachable from any state in P following e-transitions.

12. The e-NFA recognizable languages are not closed under :


a) Union
b) Negation
c) Kleene Closure
d) None of the mentioned

Answer: d
Explanation: The languages which are recognized by an epsilon Non deterministic automata
are closed under the following operations:
a) Union
b) Intersection
c) Concatenation
d) Negation
e) Star
f) Kleene closure

Regular Expression-Introduction
1. L is a regular Language if and only If the set of __________ classes of IL is finite.
a) Equivalence
b) Reflexive
c) Myhill
d) Nerode

Answer: a
Explanation: According to Myhill Nerode theorem, the corollary proves the given statement
correct for equivalence classes.

2. A language can be generated from simple primitive language in a simple way if and only if
a) It is recognized by a device of infinite states
b) It takes no auxiliary memory
c) Both are correct
d) Both are wrong

Answer: b
Explanation: A language is regular if and only if it can be accepted by a finite automaton.
Secondly, It supports no concept of auxiliary memory as it loses the data as soon as the
device is shut down.

3. Which of the following does not represents the given language?


Language: {0,01}
a) 0+01
b) {0} U {01}
c) {0} U {0}{1}
d) {0} ^ {01}

Answer: d
Explanation: The given option represents {0, 01} in different forms using set operations and
Regular Expressions. The operator like ^, v, etc. are logical operation and they form invalid
regular expressions when used.

4. According to the given language, which among the following expressions does it corresponds to?
Language L={xϵ{0,1}|x is of length 4 or less}

a) (0+1+0+1+0+1+0+1)4
b) (0+1)4
c) (01)4
d) (0+1+ε)4

Answer: d
Explanation: The extended notation would be (0+1)4 but however, we may allow some or all
the factors to be ε. Thus ε needs to be included in the given regular expression.

5. Which among the following looks similar to the given expression?


((0+1). (0+1)) *
a) {xϵ {0,1} *|x is all binary number with even length}
b) {xϵ {0,1} |x is all binary number with even length}
c) {xϵ {0,1} *|x is all binary number with odd length}
d) {xϵ {0,1} |x is all binary number with odd length}

Answer: a
Explanation: The given regular expression corresponds to a language of binary strings which
is of even length including a length of 0.

6. If R represents a regular language, which of the following represents the Venn-diagram most
correctly?
a) An Irregular Set
b) R*
c) R complement
d) R reverse

Answer: b
Explanation: The given diagram represents the Kleene operation over the Regular Language
R in which the final states become the initial and the initial state becomes final.

7. The given NFA corresponds to which of the following Regular expressions?

a) (0+1) *(00+11) (0+1) *


b) (0+1) *(00+11) *(0+1) *
c) (0+1) *(00+11) (0+1)
d) (0+1) (00+11) (0+1) *

Answer: a
Explanation: The transition states shown are the result of breaking down the given regular
expression in fragments. For dot operation, we change a state, for union (plus) operation, we
diverge into two transitions and for Kleene Operation, we apply a loop.

8. Concatenation Operation refers to which of the following set operations:


a) Union
b) Dot
c) Kleene
d) Two of the options are correct
Answer: b
Explanation: Two operands are said to be performing Concatenation operation AB = A•B =
{xy: x ∈ A & y ∈ B}.

9. Concatenation of R with Ф outputs:


a) R
b) Ф
c) R.Ф
d) None of the mentioned

Answer: b
Explanation: By distributive property (Regular expression identities), we can prove the
given identity to be Ф.

10. RR* can be expressed in which of the forms:


a) R+
b) R-
c) R+ U R-
d) R

Answer: a
Explanation: RR*=R+ as R+ means the occurrence to be at least once.

Building Regular Expressions


1. Which of the following is correct?
Statement 1: ε represents a single string in the set.
Statement 2: Ф represents the language that consist of no string.
a) Statement 1 and 2 both are correct
b) Statement 1 is false but 2 is correct
c) Statement 1 and 2 both are false
d) There is no difference between both the statements, ε and Ф are different notation for same
reason

Answer: a
Explanation: ε represents a single string in the set namely, the empty string while Statement
2 is also correct.

2. The appropriate precedence order of operations over a Regular Language is


a) Kleene, Union, Concatenate
b) Kleene, Star, Union
c) Kleene, Dot, Union
d) Star, Union, Dot
Answer: c
Explanation: If a regular language expression is given, the appropriate order of precedence if
the parenthesis is ignored is: Star or Kleene, Dot or Concatenation, Union or Plus.

3. Regular Expression R and the language it describes can be represented as:


a) R, R(L)
b) L(R), R(L)
c) R, L(R)
d) All of the mentioned

Answer: c
Explanation: When we wish to distinguish between a regular expression R and the language
it represents; we write L(R) to be the language of R.

4. Let for ∑= {0,1} R= (∑∑∑) *, the language of R would be


a) {w | w is a string of odd length}
b) {w | w is a string of length multiple of 3}
c) {w | w is a string of length 3}
d) All of the mentioned

Answer: b
Explanation: This regular expression can be used to eliminate the answers and get the
result. The length can be even and as well more than 3 when R= (∑∑∑) (∑∑∑) (particular
case).

5. If ∑= {0,1}, then Ф* will result to:


a) ε
b) Ф
c) ∑
d) None of the mentioned

Answer: a
Explanation: The star operation brings together any number of strings from the language to
get a string in the result. If the language is empty, the star operation can put together 0
strings, resulting only the empty string.

6. The given NFA represents which of the following NFA


a) (ab U a) *
b) (a*b* U a*)
c) (ab U a*)
d) (ab)* U a*

Answer: a
Explanation: The Regular expression (ab U a) * is converted to NFA in a sequence of stages as
it can be clearly seen in the diagram. This NFA consist of 8 stated while its minimized form
only contains 2 states.
7. Which of the following represents a language which has no pair of consecutive 1’s if ∑= {0,1}?
a) (0+10)*(1+ε)
b) (0+10)*(1+ε)*
c) (0+101)*(0+ε)
d) (1+010)*(1+ε)

Answer: a
Explanation: All the options except ‘a’ accept those strings which comprises minimum one
pair of 1’s together.

8. The finite automata accept the following languages:


a) Context Free Languages
b) Context Sensitive Languages
c) Regular Languages
d) All the mentioned

Answer: c
Explanation: A finite automaton accepts the languages which are regular and for which a
DFA can be constructed.

9. (a + b*c) most correctly represents:


a) (a +b) *c
b) (a)+((b)*.c)
c) (a + (b*)).c
d) a+ ((b*).c)

Answer: d
Explanation: Following the rules of precedence, Kleene or star operation would be done
first, then concatenation and finally union or plus operation.

10. Which of the following regular expressions represents the set of strings which do not contain a
substring ‘rt’ if ∑= {r, t}
a) (rt)*
b) (tr)*
c) (r*t*)
d) (t*r*)

Answer: d
Explanation: As Kleene operation is not on the whole of the substring, it will not repeat and
maintain the order of t, r.

11. According to the precedence rules, x-y-z is equivalent to which of the following?
a) (x-y)-z
b) x-(y-z)
c) Both (x-y)-z and x-(y-z)
d) None of the mentioned

Answer: a
Explanation: In arithmetic, we group two of the same operators from the left, hence x-y-z is
equivalent to (x-y)-z and not x-(y—z).

12. Dot operator in regular expression resembles which of the following?


a) Expressions are juxtaposed
b) Expressions are multiplied
c) Cross operation
d) None of the mentioned

Answer: a
Explanation: Dot operation or concatenation operation means that the two expressions are
juxtaposed i.e. there are no intervening operators in between. In fact, UNIX regular
expressions use the dot for an entirely different purpose: representing any ASCII character.

13. Which among the following is not an associative operation?


a) Union
b) Concatenation
c) Dot
d) None of the mentioned

Answer: d
Explanation: It does not matter in which order we group the expression with the operators
as they are associative. If one gets a chance to group the expression, one should group them
from left for convenience. For instance, 012 is grouped as (01)2.

14.Which among the following is equivalent to the given regular expression?


01*+1
a) (01)*+1
b) 0((1)*+1)
c) (0(1)*)+1
d) ((0*1)1*)*

Answer: c
Explanation: Using the rules of precedence on the give expression, c is the appropriate
choice with the order of: Bracket>Kleene>Dot>Union

Pumping Lemma for Regular Language


1. Relate the following statement:
Statement: All sufficiently long words in a regular language can have a middle section of words
repeated a number of times to produce a new word which also lies within the same language.
a) Turing Machine
b) Pumping Lemma
c) Arden’s theorem
d) None of the mentioned

Answer: b
Explanation: Pumping lemma defines an essential property for every regular language in
automata theory. It has certain rules which decide whether a language is regular or not.

2. While applying Pumping lemma over a language, we consider a string w that belong to L and
fragment it into _________ parts.
a) 2
b) 5
c) 3
d) 6

Answer: c
Explanation: We select a string w such that w=xyz and |y|>0 and other conditions. However,
there exists an integer n such that |w|>=n for any wÎL.

3. 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
b) y
c) z
d) all of the mentioned

Answer: b
Explanation: The lemma says, the portion y in xyz cannot be zero or empty i.e. |y|>0, this
condition needs to be fulfilled to check the conclusion condition.

4. Let w= xyz and y refers to the middle portion and |y|>0.What do we call the process of repeating
y 0 or more times before checking that they still belong to the language L or not?
a) Generating
b) Pumping
c) Producing
d) None of the mentioned

Answer: b
Explanation: The process of repeatation is called pumping and so, pumping is the process we
perform before we check whether the pumped string belongs to L or not.

5. There exists a language L. We define a string w such that w∈L and w=xyz and |w| >=n for some
constant integer n.What can be the maximum length of the substring xy i.e. |xy|<=?
a) n
b) |y|
c) |x|
d) none of the mentioned

Answer: a
Explanation: It is the first conditional statement of the lemma that states that |xy|<=n, i.e. the
maximum length of the substring xy in w can be n only.

6. Fill in the blank in terms of p, where p is the maximum string length in L.


Statement: Finite languages trivially satisfy the pumping lemma by having n = ______
a) p*1
b) p+1
c) p-1
d) None of the mentioned

Answer: b
Explanation: Finite languages trivially satisfy the pumping lemma by having n equal to the
maximum string length in l plus 1.

7. Answer in accordance to the third and last statement in pumping lemma:


For all _______ xyiz ∈L
a) i>0
b) i<0
c) i<=0
d) i>=0

Answer: d
Explanation: Suppose L is a regular language . Then there is an integer n so that for any x∈L
and |x|>=n, there are strings u,v,w so that
x= uvw
|uv|<=n
|v|>0
for any m>=0, uvmw ∈L.

8. If d is a final state, which of the following is correct according to the given diagram?

a) x=p, y=qr, z=s


b) x=p, z=qrs
c) x=pr, y=r, z=s
d) All of the mentioned

Answer: a
Explanation: The FSA accepts the string pqrs. In terms of pumping lemma, the string pqrs is
broken into an x portion an a, a y portion qr and a z portion s.

9. Let w be a string and fragmented by three variable x, y, and z as per pumping lemma. What does
these variables represent?
a) string count
b) string
c) both (a) and (b)
d) none of the mentioned

Answer: a
Explanation: Given: w =xyz. Here, xyz individually represents strings or rather substrings
which we compute over conditions to check the regularity of the language.

10. Which of the following one can relate to the given statement:
Statement: If n items are put into m containers, with n>m, then atleast one container must contain
more than one item.
a) Pumping lemma
b) Pigeon Hole principle
c) Count principle
d) None of the mentioned

Answer: b
Explanation: Pigeon hole principle states the following example: If there exists n=10 pigeons
in m=9 holes, then since 10>9, the pigeonhole principle says that at least one hole has more
than one pigeon.

Context Free Grammar-Derivations and Definitions


1. The entity which generate Language is termed as:
a) Automata
b) Tokens
c) Grammar
d) Data

Answer: c
Explanation: The entity which accepts a language is termed as Automata while the one which
generates it is called Grammar. Tokens are the smallest individual unit of a program.
2. Production Rule: aAb->agb belongs to which of the following category?
a) Regular Language
b) Context free Language
c) Context Sensitive Language
d) Recursively Ennumerable Language

Answer: c
Explanation: Context Sensitive Language or Type 1 or Linearly Bounded Non deterministic
Language has the production rule where the production is context dependent i.e. aAb->agb.

3. Which of the following statement is false?


a) Context free language is the subset of context sensitive language
b) Regular language is the subset of context sensitive language
c) Recursively ennumerable language is the super set of regular language
d) Context sensitive language is a subset of context free language

Answer: d
Explanation: Every regular language can be produced by context free grammar and context
free language can be produced by context sensitive grammar and so on.

4. The Grammar can be defined as: G=(V, ∑, p, S)


In the given definition, what does S represents?
a) Accepting State
b) Starting Variable
c) Sensitive Grammar
d) None of these

Answer: b
Explanation: G=(V, ∑, p, S), here V=Finite set of variables, ∑= set of terminals, p= finite
productions, S= Starting Variable.

5. Which among the following cannot be accepted by a regular grammar?


a) L is a set of numbers divisible by 2
b) L is a set of binary complement
c) L is a set of string with odd number of 0
d) L is a set of 0n1n
Answer: d
Explanation: There exists no finite automata to accept the given language i.e. 0n1n. For other
options, it is possible to make a dfa or nfa representing the language set.

6. Which of the expression is appropriate?


For production p: a->b where a∈V and b∈_______
a) V
b) S
c) (V+∑)*
d) V+ ∑

Answer: c
Explanation: According to the definition, the starting variable can produce another variable
or any terminal or a variable which leads to terminal.

7. For S->0S1|e for ∑={0,1}*, which of the following is wrong for the language produced?
a) Non regular language
b) 0n1n | n>=0
c) 0n1n | n>=1
d) None of the mentioned

Answer: d
Explanation: L={e, 01, 0011, 000111, ……0n1n }. As epsilon is a part of the set, thus all the
options are correct implying none of them to be wrong.

8. The minimum number of productions required to produce a language consisting of palindrome


strings over ∑={a,b} is
a) 3
b) 7
c) 5
d) 6

Answer: c
Explanation: The grammar which produces a palindrome set can be written as:
S-> aSa | bSb | e | a | b
L={e, a, b, aba, abbbaabbba…..}

9. Which of the following statement is correct?


a) All Regular grammar are context free but not vice versa
b) All context free grammar are regular grammar but not vice versa
c) Regular grammar and context free grammar are the same entity
d) None of the mentioned

Answer: a
Explanation: Regular grammar is a subset of context free grammar and thus all regular
grammars are context free.
10. Are ambiguous grammar context free?
a) Yes
b) No

Answer: a
Explanation: A context free grammar G is ambiguous if there is atleast one string in L(G)
which has two or more distinct leftmost derivations.

The Language of a Grammar, Inferences and


Ambiguity
1. Which of the following is not a notion of Context free grammars?
a) Recursive Inference
b) Derivations
c) Sentential forms
d) All of the mentioned

Answer: d
Explanation: The following are the notions to express Context free grammars:
a) Recursive Inferences
b) Derivations
c) Sentential form
d) Parse trees

2. State true or false:


Statement: The recursive inference procedure determines that string w is in the language of the
variable A, A being the starting variable.
a) true
b) false

Answer: a
Explanation: We apply the productions of CFG to infer that certain strings are in the language
of a certain variable.

3. Which of the following is/are the suitable approaches for inferencing?


a) Recursive Inference
b) Derivations
c) Both Recursive Inference and Derivations
d) None of the mentioned

Answer: c
Explanation: Two inference approaches:
1. Recursive inference, using productions from body to head
2. Derivations, using productions from head to body
4. If w belongs to L(G), for some CFG, then w has a parse tree, which defines the syntactic structure
of w. w could be:
a) program
b) SQL-query
c) XML document
d) All of the mentioned

Answer: d
Explanation: Parse trees are an alternative representation to derivations and recursive
inferences. There can be several parse trees for the same string.

5. Is the following statement correct?


Statement: Recursive inference and derivation are equivalent.
a) Yes
b) No

Answer: a
Explanation: Yes, they are equivalent. Both the terminologies represent the two approaches
of recursive inferencing.

6. A->aA| a| b
The number of steps to form aab:
a) 2
b) 3
c) 4
d) 5

Answer: b
Explanation: A->aA=>aaA=>aab

7. An expression is mentioned as follows. Figure out number of incorrect notations or symbols, such
that a change in those could make the expression correct.
L(G)={w in T*|S→*w}
a) 0 Errors
b) 1 Error
c) 2 Error
d) Invalid Expression

Answer: a
Explanation: For the given expression, L(G)={w in T*|S→*w}, If G(V, T, P, S) is a CFG, the
language of G, denoted by L(G), is the set of terminal strings that have derivations from the
start symbol.

8. The language accepted by Push down Automaton:


a) Recursive Language
b) Context free language
c) Linearly Bounded language
d) All of the mentioned

Answer: b
Explanation: Push down automata accepts context free language.

9. Which among the following is the correct option for the given grammar?
G->X111|G1,X->X0|00
a) {0a1b|a=2,b=3}
b) {0a1b|a=1,b=5}
c) {0a1b|a=b}
d) More than one of the mentioned is correct

Answer: a
Explanation: Using the recursive approach, we can conclude that option a is the correct
answer, and its not possible for a grammar to have more than one language.

10. Which of the following the given language belongs to?


L={ambmcm| m>=1}
a) Context free language
b) Regular language
c) Both (a) and (b)
d) None of the mentioned

Answer: d
Explanation: The given language is neither accepted by a finite automata or a push down
automata. Thus, it is neither a context free language nor a regular language.

11. Choose the correct option:


Statement: There exists two inference approaches:
a) Recursive Inference
b) Derivation

a) true
b) partially true
c) false
d) none of the mentioned

Answer: a
Explanation: We apply the productions of a CFG to infer that certain strings are in a language
of certain variable.

12. Choose the correct option:


Statement 1: Recursive Inference, using productions from head to body.
Statement 2: Derivations, using productions from body to head.
a) Statement 1 is true and Statement 2 is true
b) Statement 1 and Statement 2, both are false
c) Statement 1 is true and Statement 2 is false
d) Statement 2 is true and Statement 1 is true

Answer: b
Explanation: Both the statements are false. Recursive Inference, using productions from
body to head. Derivations, using productions from head to body.

13. Which of the following statements are correct for a concept called inherent ambiguity in CFL?
a) Every CFG for L is ambiguous
b) Every CFG for L is unambiguous
c) Every CFG is also regular
d) None of the mentioned

Answer: a
Explanation: A CFL L is said to be inherently ambiguous if every CFG for L is ambiguous.

14. Which of the theorem defines the existence of Parikhs theorem?


a) Parikh’s theorem
b) Jacobi theorem
c) AF+BG theorem
d) None of the mentioned

Answer: a
Explanation: Rohit Parikh in 1961 proved in his MIT research paper that some context free
language can only have ambiguous grammars.

From Grammars to Push Down Automata


1. The production of the form A->B , where A and B are non terminals is called
a) Null production
b) Unit production
c) Greibach Normal Form
d) Chomsky Normal Form

Answer: b
Explanation: A->ε is termed as Null production while A->B is termed as Unit production.

2. Halting states are of two types. They are:


a) Accept and Reject
b) Reject and Allow
c) Start and Reject
d) None of the mentioned
Answer: a
Explanation: Halting states are the new tuple members introduced in turing machine and is
of two types: Accept Halting State and Reject Halting State.

3. A push down automata can be represented as:


PDA= ε-NFA +[stack] State true or false:
a) true
b) false

Answer: a
Explanation:

4. A pushdown automata can be defined as: (Q, ∑, G, q0, z0, A, d)


What does the symbol z0 represents?
a) an element of G
b) initial stack symbol
c) top stack alphabet
d) all of the mentioned

Answer: d
Explanation: z0 is the initial stack symbol, is an element of G. Other symbols like d
represents the transition function of the machine.

5. Which of the following correctly recognize the symbol ‘|-‘ in context to PDA?
a) Moves
b) transition function
c) or/not symbol
d) none of the mentioned

Answer: a
Explanation: Using this notation, we can define moves and further acceptance of a string by
the machine.

6. Which among the following is true for the given statement?


Statement :If there are strings R and T in a language L so that R is prefix of T and R is not equivalent
to T.
a) No DPDA can accept L by empty stack
b) DPDA can accept L by an empty stack
c) L is regular
d) None of the mentioned
Answer: a
Explanation: If M is a DPDA accepting L by an empty stsck, R and T are distinct strings in L,
and R is a prefix of T, then the sequence of moves M must make in order to accept R leaves
the stack empty, since R∈L. But then T cannot be accepted, since M cant move with an empty
stack.

7. 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}
c) {xxc| where c stands for the complement,{0,1}}
d) None of the mentioned

Answer: d
Explanation: Theorem: The language pal of palindromes over the alphabet {0,1} cannot be
accepted by any finite automaton , and it is therefore not regular.

8. For a counter automaton, with the symbols A and Z0, the string on the stack is always in the form
of __________
a) A
b) AnZ0, n>=0
c) Z0An, n>=0
d) None of the mentioned

Answer: b
Explanation:The possible change in the stack contents is a change in the number of A’s on the
stack.

9. State true or false:


Statement: Counter Automaton can exist for the language L={0i1i|i>=0}
a) true
b) false

Answer: a
Explanation: The PDA works as follows. Instead of saving excess 0’s or 1’s on the stack, we
save *’s and use two different states to indicate which symbol there is currently a surplus of.
The state q0 is the initial state and the only accepting state.

10. Let ∑={0,1}* and the grammar G be:


S->ε
S->SS
S->0S1|1S0
State which of the following is true for the given
a) Language of all and only Balanced strings
b) It contains equal number of 0’s and 1’s
c) Ambiguous Grammar
d) All of the mentioned

Answer: d
Explanation: A string is said to be balanced if it consist of equal number of 0’s and 1’s.

Deterministic PDA
1. The transition a Push down automaton makes is additionally dependent upon the:
a) stack
b) input tape
c) terminals
d) none of the mentioned

Answer: a
Explanation: A PDA is a finite machine which has an additional stack storage. Its transitions
are based not only on input and the correct state but also on the stack.

2. A PDA machine configuration (p, w, y) can be correctly represented as:


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
Explanation: A machine configuration is an element of K×Σ*×Γ*.
(p,w,γ) = (current state, unprocessed input, stack content).

3. |-* is the __________ closure of |-


a) symmetric and reflexive
b) transitive and reflexive
c) symmetric and transitive
d) none of the mentioned

Answer: b
Explanation: A string w is accepted by a PDA if and only if (s,w, e) |-* (f, e, e)

4. 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
b) end in final state
c) end with an empty stack
d) all of the mentioned

Answer: d
Explanation: The empty stack in the end is our requirement relative to finite state
automatons.
5. 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
c) Atleast one state has more than one transitions
d) None of the mentioned

Answer: a
Explanation: A Deterministic Push Down Automata is a Push Down Automata in which no
state p has two or more transitions.

6. State true or false:


Statement: For every CFL, G, there exists a PDA M such that L(G) = L(M) and vice versa.
a) true
b) false

Answer: a
Explanation: There exists two lemma’s such that:
a) Given a grammar G, construct the PDA and show the equivalence
b) Given a PDA, construct a grammar and show the equivalence

7. If the PDA does not stop on an accepting state and the stack is not empty, the string is:
a) rejected
b) goes into loop forever
c) both (a) and (b)
d) none of the mentioned

Answer: a
Explanation: To accept a string, PDA needs to halt at an accepting state and with a stack
empty, else it is called rejected. Given a PDA M, we can construct a PDA M’ that accepts the
same language as M, by both acceptance criteria.

8. A language accepted by Deterministic Push down automata is closed under which of the
following?
a) Complement
b) Union
c) Both (a) and (b)
d) None of the mentioned

Answer: a
Explanation: Deterministic Context free languages(one accepted by PDA by final state), are
drastically different from the context free languages. For example they are closed under
complementation and not union.

9. Which of the following is a simulator for non deterministic automata?


a) JFLAP
b) Gedit
c) FAUTO
d) None of the mentioned

Answer: a
Explanation: JFLAP is a software for experimenting with formal topics including NFA, NPDA,
multi-tape turing machines and L-systems.

10. Finite-state acceptors for the nested words can be:


a) nested word automata
b) push down automata
c) ndfa
d) none of the mentioned

Answer: a
Explanation: The linear encodings of languages accepted by finite nested word automata
gives the class of ‘visibly pushdown automata’.
1:
Number of states of the FSM required to simulate behaviour of a computer with a memory
capable of storing "m" words, each of length 'n'

A. m x 2n

B. 2mn

C. 2m+n

D. all of these

Answer Report Discuss


Option: B

Explanation :

For every data here length is ‘n’ and memory's states are defined in terms of power of 2,
Here the total memory capability for all the words = mn
Hence number of states are 2mn

Click on Discuss to view users comments.

2:
An FSM with

A. 1 stack is more powerful than an FSM with no stack


B. 2 stacks is more powerful than a FSM with 1 stack
C. both (a) and (b)
D. None of these
Answer Report Discuss
Option: C

Explanation :

Click on Discuss to view users comments.

3:
If two finite states machine M and N are isomorphic, then

A. M can be transformed to N, merely re-labelling its states


B. M can be transformed to N, merely re-labelling its edges
C. Both (a) and (b)
D. None of these
Answer Report Discuss
Option: A

Explanation :

Click on Discuss to view users comments.

4:
Power of

A. DFSM and NDFSM are same


B. DFSM and NDFSM are different
C. DPDM and NDPDM are diferent
D. Both (A) and (C)
Answer Report Discuss
Option: D

Explanation :

Click on Discuss to view users comments.

5:
Which of the folowing pairs of regular expressions are equivalent ?

A. 1 (01)* and (10)* 1

B. x (xx) * and (xx) * x

C. x+ and x+x*+

D. All of these

Answer Report Discuss


Option: D

6:
A finite state machine with the following state table has a single input x and a single
output z. If initial state is unknown, then shortest input sequence to reach the inal state C
is

Present
Next state, z
state

X=1 X =0

A D, 0 B, 0

B B, 1 C, 1

C B, 0 D, 1

D B, 1 C, 0

A. 01

B. 10
C. 110

D. 110

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

7:
An FSM can be used to add how many given integers ?

A. 1

B. 3

C. 4

D. 2

Answer Report Discuss


Option: D

Explanation :

Finite Automata (FA) or Finite State Machine to add two integers can be constructed using
two states:
q0: Start state to represent carry bit is 0
q1: State to represent carry bit is 1

Click on Discuss to view users comments.

8:
If two finite state machines are equivalent, they should have the same number of

A. states
B. edges
C. states and edges
D. none of these
Answer Report Discuss
Option: D

Explanation :

Click on Discuss to view users comments.

9:
For which of the following applications regular expressions can be used ?

A. Designing compilers

B. Developing text editors


C. Simulating sequential circuits

D. All of these

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

10:
L = {aP | p ; } is prime is

A. regular
B. not regular
C. accepted by DFA
D. accepted by PDA
Answer Report Discuss
Option: B

Explanation :

Click on Discuss to view users comments.

11:
In an incompletely specified automata

A. no edge should be labelled epsilon


B. from any given state, there can't be any token leading to two different states
C. both (a) and (b)
D. start state may not be there
Answer Report Discuss
Option: D

Explanation :

Click on Discuss to view users comments.

12:
If f : {a, b}* —> (a, b}* be given by f (n) = ax for every value of n ∈ (a, b}, then f is

A. one to one not onto

B. one to one and onto

C. not one to one and not onto

D. not one to one and onto

Answer Report Discuss


Option: A

Explanation :
Click on Discuss to view users comments.

13:
The word 'formal' in formal languages means

A. the symbols used have well-defined meaning


B. they are unnecessary, in reality
C. only form of the string of symbols is significant
D. Both (a) and (b)
Answer Report Discuss
Option: C

Explanation :

Click on Discuss to view users comments.

14:
Running time of NFA to DFA conversion including the case where NFA has e-transition is

A. 0 (n3)

B. 0 (n332)

C. 0 (n32n)

D. 0 (n22n)

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

15:
Which of the following statements is/are false ?

A. The task of lexical analyzer is to translate the input source language text into tokens
and determine the groups of tokens are inter-related.
B. Two basic approaches to translation are generation and interpretation.
C. A load-and-go compiler is capable o translating the source language text on a host
machine A that can be later run on any target machine B.
D. None of these

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

16:
Which of the following are not regular ?

A. String of 0's whose length is a perfect square


B. Set of all palindromes made up of 0's and 1's
C. Strings of 0's, whose length is a prime number
D. All of these

Answer Report Discuss


Option: D

Explanation :
Strings of odd number of zeroes can be generated by the regular expression (00) *0.Pumping
lemma can be used to prove the non-regularity of the other options.

Click on Discuss to view users comments.

17:
The main difference between a DFSA and an NDFSA is

A. in DFSA, ε transition may be present

B. in NDFSA, ε transitions may be present

C. in DFSA, from any given state, there can't be any alphabet leading to two
diferent states

D. in NDFSA, from any given state, there can't be any alphabet leading to two
diferent states

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

18:
If w ∈ (a, b)* satisfy abw = wab, then (w) is

A. even

B. odd

C. null

D. none of these

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

19:
A PDM behaves like an FSM wnen the number of auxiliary memory it has, is

A. 0
B. 1
C. 2
D. None of these
Answer Report Discuss
Option: A

Explanation :

Click on Discuss to view users comments.

20:
Finite state machine can recognize

A. any grammar
B. only context-free grammar
C. Both (a) and (b)
D. only regular grammar
Answer Report Discuss
Option: D

Explanation :

Click on Discuss to view users comments.

21:
The major difference between a moore and mealy machine is that

A. output of the former depends on the present state and present input

B. output of the former depends only on the present state

C. output of former depends only on the present input

D. all of these

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

22:
Any given transition graph has an equivalent

A. regular expression

B. DFSM

C. NDFSM
D. all of these

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

23:
For which of the following application, regular expressions cannot be used ?

A. Designing computers

B. Designing compilers

C. Both (a) and (b)

D. Developing computers

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

24:
If S be an infinite set and be sets such that S1 ∪ S2 ∪ .....∪ SN = S, then

A. atleast one of the set Si is a finite set

B. not more than one of the sets Si can be finite

C. atleast one of the sets Si is an infinite set

D. not more than one of the sets Si can be infinite

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

25:
Vienna Definition Language is an example of language definition facility based on

A. Mathematical semantics
B. Interpretative semantics

C. Translational semantics

D. Axiomatic semantics

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

26:
Which of the following regular expressions denotes a language comprising all possible
strings over the alphabet {a, b } ?

A. a* b*

B. (a | b)*

C. (ab)+

D. (a | b*)

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

27:
An FSM (Finite State Machine) can be considered to be a TM (Turing Machine) of finite
tape length

A. without rewinding capability and unidirectional tape movement.

B. rewinding capacity, and unidirectional tape movement

C. without rewinding capability and bidirectional tape movement

D. rewinding capability and bidirectional tape movement

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

28:
Palindromes can't be recognized by any FSM because
A. FSM can't remember arbitrarily large of information

B. FSM can't deterministically fix the mid-point

C. even if mid-point is known, FSM be can't be found whether, second half of


the string matches the first half

D. all of these

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

29:
If ∑ = {a, b, c, d, e, f } then number of strings in ∑ of length 4 such that no symbol is used
more than once in a string is

A. 35

B. 360

C. 49

D. 720

Answer Report Discuss


Option: B

Explanation :

Here string length is 4 so we can create string of length 4 by 6 values. Suppose at first place
we can arrange any value by 6 methods.so 6. then Remaining total numbers are 5 so we can
arrange them by 5 methods at second place. then remaining total numbers are 4 so we can
arrange them by 4 methods. now remaining total numbers are 3 and we can arrange them by
3 methods. so according to permutation technique. We multiply them i.e. 6*5*4*3=360. So, 'B'

Click on Discuss to view users comments.

30:
A language L is accepted by a finite automaton if and only if it is

A. context - free

B. context-sensitive

C. recursive

D. Right-linear

Answer Report Discuss


Option: D
Explanation :

Click on Discuss to view users comments.

31:
Can a DFA simulate NFA?

A. NO

B. YES

C. SOMETIMES

D. Depends on NFA

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

32:
Which of the following statements is wrong ?

A. The language accepted by finite automata are the languages denoted by


regular expressions

B. For every DFA there is a regular expression denoting its language

C. For a regular expression r, there does not exist NFA with L(r) any transit that
accept

D. None of these

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

33:
Regular expression a / b denotes the set

A. {a}

B. { ∈ , a, b }

C. {a, b}

D. { ab }
Answer Report Discuss
Option: C

Explanation :

Click on Discuss to view users comments.

34:
Regular expression (a | b ) (a | b) denotes the set

A. { a, b, ab, aa }

B. { a, b, ba, bb }

C. { a, b }

D. { aa, ab, ba, bb }

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

35:
Which of the following regular expressions denotes zero or more instances of an a or b ?

A. a| b

B. (ab)*

C. (a | b)*

D. a* I b

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

36:
Which of the following regular expressions denotes a language comprising all possible
strings of even length over the alphabet ( 0 , 1 ) ?

A. (0 | 1) *

B. (0 | 1) (0 | 1)*

C. (00 01 10 11 )*

D. (0 | 1 ) (0 | 1)(0 | 1 ) *
Answer Report Discuss
Option: C

Explanation :

Click on Discuss to view users comments.

37:
The regular expression (a | b)* denotes the set of all strings

A. with zero or more instances of a or b

B. with one or more instances of a or b

C. equal to regular expression (a* b*)*

D. both (a) and (c)

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

38:
The string (a) | ((b) * (c)) is equivalent to

A. set of strings with either a or zero or more b's and one c

B. set of strings with either a or one or more b's and one c

C. b* c l a

D. both (a) and (c)

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

39:
An automation is a __________ device and a grammar is a __________ device.

A. generative, cognitive

B. generative, acceptor
C. acceptor, cognitive

D. cognitive, generative

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

40:
In the figure given below, a deterministic finite automation M has start state A and
accepting state D. Which of the following regular expression denoted the set of all words
accepted by
M?

A. 001

B. 10 * 1 * 0

C. ( 0 | 1) * 011

D. 1* 0 * 001

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

41:
The regular sets are closed under

A. union

B. concatenation

C. Kleene's closure
D. all of these

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

42:
Dynamic errors can be detected at

A. compile time

B. Run time

C. both (a) and (b)

D. none of these

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

43:
If a and b be the regular expressions, then ( a* ∪ b* ) * is equivalent to

A. (a ∪ b) *

B. (b* ∪ a*)*

C. (b ∪ a)*

D. All of above

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

44:
Finite state machines _________ recognize palindromes

A. can

B. can't

C. may
D. may not

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

45:
If S and T be language over Σ = {a, b } represented by regular expression (a + b * ) * and
(a + b) * , respectively, then

A. S⊂T

B. T⊂ S

C. S=T

D. S ∩ T= φ

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

46:
Consider regular expression (0 + 1) (0 + 1) ....... n times. Minimum state finite automaton
that recognizes the language represented by this regular expression contains

A. n states

B. n + 1 states

C. n + 2 states

D. none of these

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

47:
If regular set A is represented by A = (01 + 1)* and the regular set 'B' is represented by B =
((01)*1*)*, then

A. A ⊂B

B. B⊂A
C. A and B are uncomparable

D. A=B

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

48:
Which of the following can be recognized by a Deterministic Finite-state Automaton ?

A. Numbers, 1,2,4, ....... zN ..... written in binary.

B.

Numbers 1, 2, 4, ........, zN ...... written in unbinary.


C. Set of binary string in which number of zeros is same as the number of
ones.

D. Set (1,101,11011,1110111, ......}

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

49:
Which of the following are not regular ?

A. String of 0’s whose length is a perfect square

B. Set of all palindromes made up of 0’s and 1's

C. Strings of 0’s, whose length is a prime number

D. All of these

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

50:
An FSM with

A. 1 stack is more powerful than an FSM with no stack

B. 2 stacks is more powerful than a FSM with 1 stack


C. both (a) and (b)

D. none of these

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

51:
If w ∈ (a, b)* satisfy abw = wab, then (w) is

A. even

B. odd

C. null

D. none of these

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

52:
A PDM behaves like an FSM wnen the number of auxiliary memory it has, is

A. 0

B. 1

C. 2

D. none of these

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

53:
A finite state machine with the following state table has a single input x and a single
output z
Present
Next state, z
state
If the initial state is unknown, then shortest
x= x = input sequence to reach the final state C is
1 0
A. 01
A D, 0 B, 0 B. 10

C. 10
B B,1 C,1
D. 110
C B, 0 D, 1 Answer Report Discuss
Option: B

D B, 1 C, 0 Explanation :

Click on Discuss to view users comments.

54:
FSM shown in the

figure

A. all strings

B. no string

C. ε- alone

D. none of these

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

55:
If f : {a, b}* ---> {a , b } * be given by f(n) = ax for every value of n ∈ {a, b}, then f is

A. one to one not onto


B. one to one and onto

C. not one to one and not onto

D. not one to one and onto

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

56:
If two finite states machine M and N are isomorphic, then

A. M can be transformed to N, merely re-labelling its states

B. M can be transformed to N, merely re-labelling its edges

C. M can be transformed to N, merely re-labelling its edges

D. none of these

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

57:
Regular expression corresponding to the state diagram given in the figure is

A. (0+1(1 + 01)* 00)*

B. (1 + 0 (0 + 10) 00)*
C. (0 + 1 (1 + 10) 00)*

D. (1 + 0(1 + 00) 11)*

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

58:
Two finite state machines are said to be equivalent if they

A. have same number of states

B. have same number of edges

C. have same number of states and edges

D. recognize same set of tokens

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

1:
Correct hierarchical relationship among context- free, right-linear, and context-sensitive
language is

A. context-free ⊂ right-linear ⊂ context-sensitive

B. context-free ⊂ context-sensitive ⊂ right-linear

C. context-sensitive ⊂ right-inear ⊂context-free

D. right-linear ⊂context-free ⊂context-sensitive

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

2:
In the following grammar :

x::=x ⊕y| 4
y::=z*yI2
z : : = id

which of the folowing is true ?


A. ⊕ is left associative while * is right associative

B. Both ⊕ and * are left associative

C. ⊕ is right associative while * is left associative

D. None of these

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

3:
Which of the following CFG's can't be simulated by an FSM ?

A. S --> Sa | b

B. S --> aSb | ab

C. S --> abX, X --> cY, Y --> d | aX

D. None of these

Answer Report Discuss


Option: B

Explanation :

Option (b) generates the set {an bn ,n=1,2,3 ....}which is not regular ,Option (a) is left linear
where as option (C) is right linear .

Click on Discuss to view users comments.

4:
ADG is said to be in Chomsky Form (CNF), if all the productions are of the form A --> BC
or
A --> a. Let G be a CFG in CNF. To derive a string of terminals of length x , the number of
productions to be used is

A. 2x - 1
B. 2x
C. 2x + I
D. None of these
Answer Report Discuss
Option: A

Explanation :

Click on Discuss to view users comments.

5:
Which of the following statements is correct?

A. A = { If an bn | n = 0,1, 2, 3 ..} is regular language

B. Set B of all strings of equal number of a's and b's deines a regular language

C. L (A* B*)∩ B gives the set A

D. None of these

Answer Report Discuss


Option: C

6:
P, Q, R are three languages, if P and R are regular and if PQ = R, then

A. Q has to be regular
B. Q cannot be regular
C. Q need not be regular
D. Q cannot be a CFL
Answer Report Discuss
Option: C

Explanation :

Click on Discuss to view users comments.

7:
A class of language that is closed under

A. union and complementation has to be closed under intersection


B. intersection and complement has to be closed under union
C. union and intersection has to be closed under complementation
D. both (A) and (B)
Answer Report Discuss
Option: D

Explanation :

Click on Discuss to view users comments.

8:
The productions
E—>E+E
E—>E—E
E-->E*E
E —> E / E
E —> id

A. generate an inherently ambiguous language

B. generate an ambiguous language but not inherently so

C. are unambiguous

D. can generate all possible fixed length valid computation for carrying out addition,
subtraction, multipication and division, which can be expressed in one expression
Answer Report Discuss
Option: B

Explanation :

Click on Discuss to view users comments.

9:
Which of the folowing definitions below generates the same language as L, where
L = {xn yn such that n > = 1} ?

I. E —> xEy | xy

II. xy | (x+ xyy+)

III .x+y+

A. I only
B. I and II
C. II and III
D. II only
Answer Report Discuss
Option: A

Explanation :
II generates strings like xxyyy, which are not supposed to be.

III generates strings like xyy, which are not supposed to be.
I can be verified to generate all the strings in L and only those.

Click on Discuss to view users comments.

10:
Following context free grammar
S —> aB | bA
A —>b | aS | bAA
B —> b | bS | aBB
generates strings of terminals that have

A. equal number of a's and b's


B. odd number of a's and odd number b's
C. even number of a's and even number of b's
D. odd number of a's and even number of a's
Answer Report Discuss
Option: A

11:
Define for the context free language
L< {0;1} init (L) = { u | u v ε L for some v in {0, 1}}

If L { w | w is nonempty and has an equal number of 0's and 1's}, then init (L) is set of all
binary strings
A. with unequal numbers of 0's and 1's.

B. including the null string.

C. Both (a) and (b)

D. None of these

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

12:
Which of the following CFG's can't be simulated by an FSM ?

A. s ---> sa | a
B. s ---> abX , X --> cY, Y --> a | axY
C. s ---> a sb | ab
D. none of these
Answer Report Discuss
Option: C

Explanation :

Click on Discuss to view users comments.

13:
Basic limitation of FSM is that it

A. cannot remember arbitrary large amount of information


B. sometimes fails to recognize grammars that are regular
C. sometimes recognizes grammars are not regular
D. None of these
Answer Report Discuss
Option: A

Explanation :

Click on Discuss to view users comments.

14:
Which of the following is not possible algorithmically ?

A. Regular grammar to context free grammar


B. Non-deterministic FSA to deterministic FSA
C. Non-deterministic PDA to deterministic PDA
D. None of these
Answer Report Discuss
Option: C

Explanation :
Click on Discuss to view users comments.

15:
The set {anbn | n = 1, 2, 3 ...} can be generated by the CFG

A. S �>ab | aSb
B. S �>aaSbb + abS
C. S�> ab | aSb | E
D. S �>aaSbb | ab | aabb
Answer Report Discuss
Option: D

16:
The CFG
s---> as | bs | a | b

is equivalent to regular expression

A. (a + b)
B. (a + b) (a + b)*
C. (a + b) (a + b)
D. None of these
Answer Report Discuss
Option: B

Explanation :

Click on Discuss to view users comments.

17:
Consider the grammar :

S —> ABCc | Abc


BA —> AB
Bb —> bb
Ab —> ab
Aa —> aa

Which of the following sentences can be derived by this grammar

A. abc
B. aab
C. abcc
D. abbb
Answer Report Discuss
Option: A

Explanation :

Click on Discuss to view users comments.

18:
Pumping lemma is generally used for proving that

A. given grammar is regular


B. given grammar is not regular
C. whether two given regular expressions are equivalent or not
D. None of these
Answer Report Discuss
Option: B

Explanation :

Click on Discuss to view users comments.

19:
The language of all words with at least 2 a's can be described by the regular expression

A. (ab)*a and a (ba)*


B. (a + b)* ab* a (a + b)*
C. b* ab* a (a + b)*
D. all of these
Answer Report Discuss
Option: D

Explanation :

Click on Discuss to view users comments.

20:
Any string of terminals that can be generated by the following CFG is
S-> XY
X--> aX | bX | a
Y-> Ya | Yb | a

A. has atleast one 'b'


B. should end in a 'a'
C. has no consecutive a's or b's
D. has atleast two a's
Answer Report Discuss
Option: D

21:
L = (an bn an | n = 1,2,3) is an example of a language that is

A. context free
B. not context free
C. not context free but whose complement is CF
D. both (b) and (c)
Answer Report Discuss
Option: D

Explanation :

Click on Discuss to view users comments.

22:
If Σ = (0, 1), L = Σ* and R = (0n 1nsuch that n > 0 )

then languages L ∪ R and R respectively are


A. Regular, Regular

B. Regular, Not regular

C. Not regular, Not regular

D. None of these

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

23:
FSM can recognize

A. any grammar
B. only CG
C. Both (a) and ( b )
D. only regular grammar
Answer Report Discuss
Option: D

Explanation :

Click on Discuss to view users comments.

24:
Set of regular languages over a given alphabet set is closed under

A. union

B. complementation

C. intersection

D. All of these

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

25:
Which of the following statement is correct?

A. All languages can not be generated by CFG

B. Any regular language has an equivalent CFG

C. Some non regular languages can't be generated by CFG


D. both (b) and (c)

Answer Report Discuss


Option: D

26:
Given A = (0,1) and L = A*. If R = (0n 1n, n > 0) , then language L ∪ R and R are
respectively

A. regular, regular

B. not regular, regular

C. regular, not regular

D. context free, not regular

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

27:
Define for a context free language

L ≤ {0 ; 1} init (L) = {u/uv ε L for some v in {0,1}}

(in other words, init (L) is the set of prefixes of L)

Let L {w/w is noempty and has an equal number of 0’s and 1’s)

Then init (L) is

A. set of all binary strings with unequal number of 0’s and 1’s

B. set of all binary strings including the null string

C. set of all binary strings with exactly one more 0’s than the number of 1’s or 1
more than the number of 0’s

D. none of these

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

28:
If L1 and L2 are context free language and R a regular set, then which one of the
languages below is not necessarily a context free language?
A. L1 L2

B. L1 ∩ L2

C. L1 ∩ R

D. L1 ∪ L2

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

29:
Consider a grammar with the following productions

S--> aab | bac | aB


S --> α S | b
S --> α b b | ab
Sα --> bdb | b

The above grammar is

A. Context free

B. regular

C. context sensitive

D. LR ( k )

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

30:
What can be said about a regular language L over {a} whose minimal finite state
automation has two states?

A. L must be { an | n is odd}

B. L must be { an | n is even}

C. L must be {an | > 0}

D. Either L must be {an | n is odd}, or L must be {an | n is even}

Answer Report Discuss


Option: B

36:
Let L be a language recognizable by a finite automaton. The language

REVERSE (L) = {w such that w is the reverse of v where v ∈ L } is a

A. regular language

B. context-free language

C. context-sensitive language

D. recursively enumerable language

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

37:
The grammars G = ( { s }, { 0, 1 }, p , s)
where p = (s —> 0S1, S —> OS, S —> S1, S —>0} is a

A. recursively enumerable language

B. regular language

C. context-sensitive language

D. context-free language

Answer Report Discuss

38:
The logic of pumping lemma is a good example of

A. pigeon-hole principle

B. divide-and-conquer technique

C. recursion

D. iteration

Answer Report Discuss


Option: A

Explanation :

The pigeon hole principle is nothing more than the obvious remark: if you have fewer pigeon
holes than pigeons and you put every pigeon in a pigeon hole, then there must result at least
one pigeon hole with more than one pigeon. It is surprising how useful this can be as a proof
strategy.
In the theory of formal languages in computability theory, a pumping lemma or pumping
argument states that, for a particular language to be a member of a language class, any
sufficiently long string in the language contains a section, or sections, that can be removed, or
repeated any number of times, with the resulting string remaining in that language. The proofs
of these lemmas typically require counting arguments such as the pigeonhole principle. So the
answer is 'A'
Click on Discuss to view users comments.

39:
The intersection of CFL and regular language

A. is always regular

B. is always context free

C. both (a) and (b)

D. need not be regular

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

40:
For two regular languages

L1 = (a + b)* a and L2 = b (a + b ) *
,
the intersection of L1 and L2 is given by

A. (a + b ) * ab

B. ab (a + b ) *

C. a(a+b)*b

D. b (a + b ) * a

Answer Report Discuss


Option: D

31:
In a context-sensitive grammar, number of grammar symbols on the left hand side of a
production can't be greater than the number of

A. grammar symbols on the right hand side

B. terminals on the right hand side

C. non-terminals on the right hand side

D. all of these

Answer Report Discuss


Option: C
Explanation :

Click on Discuss to view users comments.

32:
In a context-free grammar

A. ε can't be the right hand side of any production

B. terminal symbols can't be present in the left hand side of any production

C. number of grammar symbols in the left hand side is not greater than the
number of grammar symbols in the right hand side

D. all of these

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

33:
CFG can be recognized by a

A. push-down automata

B. 2-way linear bounded automata

C. both (a) and (b)

D. none of these

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

34:
Which of the following statements are true?
I. The set of all odd integers is a monoid under multiplication.
II. The set of all complex number is a group under multiplication
III. The set of all integers under the operation * given by a * b = a+b-ab is a monoid
IV. Zs under symmetric difference defined by
A B = (A-B) ∪ (B-A) is an abelian group

A. I and II

B. I, III and IV

C. I, II and III
D. I, II and IV

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

35:
A given grammar is called ambiguous if

A. two or more productions have the same non-terminal on the left hand side

B. a derivation tree has more than one associated sentence

C. there is a sentence with more than one derivation tree corresponding to it

D. brackets are not present in the grammar

Answer Report Discuss


Option: C

41:
Context free grammar is not closed under

A. product

B. union

C. complementation

D. kleen star

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

42:
If L be a language recognizable by a finite automaton, then language front

{L} = { w such that w is prefix of v where v ∈ L }, is a

A. regular language

B. context-free language

C. context-sensitive language

D. recursive enumeration language

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

43:
For which of the following application, regular expressions can not be used ?

A. Designing computers

B. Designing compilers

C. Both (a) and (b)

D. Developing computers

Answer Report Discuss


Option: C

Explanation :

For Reference Link Click Here

Click on Discuss to view users comments.

44:
Consider the following grammar

S --> Ax / By
A --> By/Cw
B --> x / Bw
C--> y

Which of the regular expressions describe the same set of strings as the grammar ?

A. xw * y + xw * yx + ywx

B. xwy + xw * xy + ywx

C. xw * y + xw x yx + ywx

D. xw xy + xww * y + ywx

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

45:
Which of the following statements is (are) correct ?

A. Recursive languages are closed under complementation.


B. If a language and its complement are both regular, the language is recursive

C. Set of recursively enumerable language is closed under union

D. All of these

Answer Report Discuss


Option: D

46:
Which of the following statement is wrong ?

A. Any regular language has an equivalent context-free grammar.

B. Some non-regular languages can’t be generated by any context-free


grammar

C. Intersection of context free language and a regular language is always


context-free

D. All languages can be generated by context- free grammar

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

47:
Consider a grammar :

G = ( { x , y ) , { s , x , y } , p , s)

where elements of parse :

S--> x y
S -->y x
x--> x z
x--> x
y--> y
z--> z

The language L generated by G most accurately is called

A. Chomsky type 0

B. Chomsky type 1

C. Chomsky type 2

D. Chomsky type 3

Answer Report Discuss


Option: D
Explanation :

Click on Discuss to view users comments.

48:
Consider a grammar :

G={{S},{0,1},p,s}

where elements of p are:

S --> ss
S--> 0S1
S--> 1S0
S--> empty

The grammer will generate

A. regular language

B. context-free language

C. context-sensitive language

D. recursive enumerable language

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

49:
A grammar that produces more than one parse tree for some sentence is called

A. ambiguos

B. unambigous

C. regular

D. none of these

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

50:
Given a grammar G a production of G with a dot at some position of the right side is
called

A. LR (0) item of G
B. LR (1) item of G

C. both (a) and (b)

D. none of these

Answer Report Discuss


Option: A

56:
Context-free grammar can be recognized by

A. finite state automation

B. 2-way linear bounded automata

C. push down automata

D. both (b) and (c)

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

57:
The language L = (0n 1n 2n where n > 0) is a

A. context free language

B. context-sensitive language

C. regular language

D. recursive enumerable language

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

58:
Context free language are closed under

A. union, intersection

B. union, kleene closure

C. intersection, complement

D. complement, kleene closure


Answer Report Discuss
Option: B

Explanation :

For Reference Click Here

Click on Discuss to view users comments.

59:
If G = ({S}, {a}, {S -> SS), S),

then language generated by G is

A. L (G) = φ

B. L(G) = an

C. L (G) = a*

D. L (G) = anban

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

60:
Grammar
S —> a,
S —> A3A4 ,
A3 —> A1, A3, A2 ,
A3 —> A1 A2, A1
A2—> aA2A1 ,
A1a —> a A1,
A2a —> aA2,
A1A4 —> A4a,
A2A4 —> A5a,
A2A5 —> A5a,
A5 —> a
generates

A. an^2

B. n2a

C. 2an

D. none of these

Answer Report Discuss


Option: A

61:
If L1 = {x | x is a palindrome in (0 + 1)*}
L2 = {letter (letter + digit)* };
L3 = (0n 1n 2n | n > 1}
L4 = {ambnam+n | m, n > 1}

then which of the following statement is correct ?

A. L1 is context free language and L3 is context sensitive language

B. L2 is a regular set and L4 is not a context free language

C. Both L1 and L2 are regular sets

D. Both L3 and L4 are context-sensitive languages

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

62:
A grammar to generate
{ (ab)n I n ≥ 1 } ∪ { (ba)n I n ≥ 1 }
is constructed as

A. S ---> S1, S1 ---> abS1, S1 ---> ab, S ---> S2, S2 —> baS2, S2 —> ba

B. S ---> S1 , Sl ---> aS1, S1 ---> ab, S ---> S2, S2 ---> bS2, S2 —> bc

C. S —> S1, S1—>S2, S2 —> S1a, S1 —> ab, S2 —> ba

D. none of these

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

63:
Consider the grammar
S ---> PQ | SQ | PS
P ---> x
Q--> y
To get a string of n terminals, the number of productions to be used is

A. n2

B. n+1

C. 2n
D. 2n - 1

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

64:
What is the highest type number which can be applied to the following grammar ?
S —> Aa, A —> Ba, B —> abc

A. Type 0

B. Type 1

C. Type 2

D. Type 3

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

65:
Following syntax-directed translation scheme is used with a shift reduction (bottom up)
parser that perform the action in braces immediately after a reduction by
the corresponding production

A —> aB {print “(1)” A —> c {print “1”),


B —> Ab {print *2”}.

When parser is aaacbbb, then string printed

A. 0202021

B. 1202020

C. 1020202

D. none of these

Answer Report Discuss


Option: A

1:
Which of the following is complement of a?

A. Recursive language is recursive

B. Recursively enumerable language is recursively enumerable


C. Recursive language is either recursive or recursively enumerable

D. None of these

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

2:
If nL can be recognized by a multitape TM with time complexity f, then L can be
recognized by a one-tape machine with time complexity DSD

A. O( f 2)

B. o( f 2)

C. o(h)

D. O(h2)

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

3:
If T is a TM recognizing L, and T reads every symbol in the input string, τT(n) ≥ 2n +
2, then any language that can be accepted by a TM T with τT(n) = 2n + 2 is

A. regular

B. not regular

C. uncertain

D. none of these

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

4:
Consider an alternate Turing machine model, in which there is an input tape on which the
tape head can move in both directions but cannot write, and one or more work tapes, one
of which serves as an output tape. For a function f, denoted by DSpace ( f ) , the set of
languages that can be recognized by a Turning machine of this type which uses no more
than f(n) squares on any work tape for any input string of length n. The only restriction we
need to make on f is that f(n) > 0 for every n. The language of balanced strings of
parentheses are in

A. DSpace (1+ ⌈log2 (n + 1 ⌉). (⌈ x ⌉) means the smallest integer greater than or
equal to x.

B. DSpace (1+ ⌈log2 n⌉)

C. DSpace ( 1+ ⌈ log2 n2⌉)

D. none of these

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

5:
Which of the following problems is solvable ?

A. Writing a universal Turing machine

B. Determining of an arbitrary turing machine is an universal turing machine

C. Determining of a universal turing machine can be written for fewer than k


instructions for some k

D. Determining of a universal turing machine and some input will halt

Answer Report Discuss


Option: A

6:
Which of the following is not primitive recursive but partially recursive ?

A. Carnot's function

B. Ricmann function

C. Bounded function

D. Ackermann's function

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

7:
Turing machine (TM) is more powerful than FMS (Finite State Machine) because
A. tape movement is confined to one direction

B. it has no finite state

C. it has the capability to remember arbitrarily long sequences of input symbols

D. none of these

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

8:
If f : N--> N. If L can be recoognized by a TM T, so that τT(n) ≤ f (n) for all but finitely many
n, then ( Time (f) means Time ( max ( f, 2n +2))).

A. L ∈Time (f)

B. L ∈ Time(cf)

C. L ∈ Time (h)

D. none of these

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

9:
Let s is a step-counting function satisfying s(n) ≥ n, and L be a language accepted by a
(multitape) TM T. If tape heads of T do not move past square s(n) on any of the tapes for
an input string of length n, then T ∈

A. Space(s)

B. F(n)

C. Time(f)

D. Time(h)

Answer Report Discuss


Option: A

Explanation :

Click on Discuss to view users comments.

10:
Which of the following statements is false ?
A. Halting problem of Turing machines is undecidable

B. Determining whether a context-free grammar is ambiguous is undecidable

C. Given two arbitrary context-free grammars G1 G2 and it is undecidable


whether L (G1) = L (G2).

D. Given two regular grammars G1 G2 and it is undecidable whether L (G1) = L


(G2)

Answer Report Discuss


Option: D

11:
Bounded minimalization is a technique for

A. proving whether a promotive recursive function is turning computable or not

B. proving whether a primitive recursive function is a total function or not

C. generating primitive recursive functions

D. generating partial recursive functions

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

12:
If there exists a language L, for which there exists a TM, T, that accepts every word in L
and either rejects or loops for every word that is not in L, is called

A. recursive

B. recursively enumerable

C. NP-HARD

D. none of these

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

13:
Which of the following statement(s) is/are correct?

A. L = {an bn an | n = 1, 2, 3...} is recursively enumerable


B. Recursive languages are closed under union

C. Every recursive is closed under union

D. All of these

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

14:
Universal TM influenced the concept of

A. stored program computers

B. interpretative implementation of programming language

C. computability

D. all of these

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

15:
Number of external states of a UTM should be atleast

A. 1

B. 2

C. 3

D. 4

Answer Report Discuss


Option: B

16:
The statement, “A TM can’t solve halting problem” is

A. true

B. false

C. still an open question

D. all of these
Answer Report Discuss
Option: A

Explanation :

Click on Discuss to view users comments.

17:
If there exists a TM which when applied to any problem in the class, terminates, if correct
answer is yes and may or may not terminate otherwise is called

A. stable

B. unsolvable

C. partially solvable

D. unstable

Answer Report Discuss


Option: C

Explanation :

Click on Discuss to view users comments.

18:
Given a Turing machine T and a step-counting function f, is the language accepted by T in
Time(f) ? This decision problem is

A. solvable

B. unsolvable

C. uncertain

D. none of these

Answer Report Discuss


Option: B

Explanation :

Click on Discuss to view users comments.

19:
A total recursive function is a

A. partial recursive function

B. premitive recursive function

C. both (a) and (b)

D. none of these
Answer Report Discuss
Option: D

Explanation :

Click on Discuss to view users comments.

20:
The running time T (n), where 'n' is input size of a recursive algorithm, is given as
T (n) = c + T (n - 1), if n > 1
= d, if n ≤ 1
The order of the algorithm is

A. n2

B. n

C. n3

D. nn

Answer Report Discuss


Option: B

21:
Next move function δ of a Turing machine M = (Q, Σ , Γ, δ, q0, B, F) is a mapping

A. δ : Q x Σ --> Q x Γ

B. δ : Q x Γ ---> Q x Σ x {L, R}

C. δ : Q x Σ ---> Q x Γ x {L, R}

D. δ : Q x Γ ---> Q x Γ x {L, R}

Answer Report Discuss


Option: D

Explanation :

Click on Discuss to view users comments.

22:
If L can be recognized by a TM T with a doubly infinite tape, and τ t = f, then L can be recognized by an ordinary
TM with time complexity

A. O(f)

B. o(f)

C. O(h)

D. o(h)
Answer Report Discuss
Option: A
1. Given the following expressions of a grammar

E --> E * F / F + E / F
F --> F - F / id

Which of the following is true ?

a. * has higher precedence than +

b. - has higher precedence than *

c. + and - have same precedence

d. + has higher precedence than *

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).- has higher precedence than *

2. Which of the following is true while converting CFG to LL(1) grammar ?

a. Remove left recursion alone

b. Factoring grammar alone

c. Both of the above

d. None of the above

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).Both of the above

3. Let L be a set accepted by a non deterministic finite automaton. The number of states in non-deterministic f
of states in equivalent finite automaton that accepts L is

a. |Q|

b. 2|Q|

c. 2^|Q| – 1

d. 2^|Q|

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).2^|Q|
4. The grammar ‘G1’

S ---> OSO| ISI | 0|1|∈

and the grammar ‘G2’ is


S ---> as |asb| X,
X -----> Xa | a.

Which is the correct statement ?

a. G1 is ambiguous, G2 is unambiguous

b. G1 is unambiguous, G2 is ambiguous

c. Both G1 and G2 are ambiguous

d. Both G1 and G2 are unambiguous

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).G1 is unambiguous, G2 is ambiguous

5. Which of the following regular expression identities are true ?

a. (r + s)* = r* s*

b. (r + s)* = r* + s*

c. (r + s)* = (r*s*)*

d. r* s* = r* + s*

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).(r + s)* = (r*s*)*

6. The minimum number of states of the non-deterministic finite automation which accepts the language
{a b a bn| n ≥ 0} ∪ {a b an|n ≥ 0} is

a. 3

b. 4

c. 5

d. 6
View Answer Report Discuss Too Difficult! Search Google

Answer: (c).5

7. Which of the following definitions generates the same Language as L, where


L = {WWR | W ∈ {a, b}*}

a. S ∈ asb|bsa|∈

b. S ∈ asa|bsb|∈

c. S ∈ asb|bsa|asa|bsb|∈

d. S ∈ asb|bsa|asa|bsb

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).S ∈ asa|bsb|∈

8. If the parse tree of a word w generated by a Chomsky normal form grammar has no path of length greater t

a. no greater than 2^(i+1)

b. no greater than 2^i

c. no greater than 2^(i–1)

d. no greater than i

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).no greater than 2^(i–1)

9. Given the following statements :

S1: SLR uses follow information to guide reductions.In case of LR and LALR parsers, the look-aheads are a
of the left context available to the parser.
S2: LR grammar is a larger sub-class of context free grammar as compared to that SLR and LALR gramma

Which of the following is true ?

a. S1 is not correct and S2 is not correct

b. S1 is not correct and S2 is correct


c. S1 is correct and S2 is not correct

d. SI is correct and S2 is correct

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).S1 is correct and S2 is not correct

10. The context free grammar for the language

L= {anbm | n ≤ m+3,n ≥ 0 ,m≥ 0 } : is

a. S → aaa; A → aAb | B, B → Bb | λ

b. S → aaaA | λ ; A → aAb | B; B → Bb | λ ;

c. S → aaaA | aaA | λ ; A → aAb | B; B → Bb | λ ;

d. S → aaaA | aaA | aA | λ ; A → aAb | B; B → Bb | λ ;

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).S → aaaA | aaA | λ ; A → aAb | B; B → Bb | λ ;

11. Given the following statements:

S1: If L is a regular language then the language {uv | u ∈ L, v ∈ LR } is also regular.


S2: L = {wwR} is regular language.

Which of the following is true?

a. S1 is not correct and S2 is not correct

b. S1 is not correct and S2 is correct

c. S 1 is correct and S2 is not correct

d. S1 is correct and S2 is correct

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).S1 is correct and S2 is correct

12. Given the following statements.

S1: The grammars S → asb | bsa |ss I a and s→ asb | bsa| a are not equivalent.
S2: The grammars S→. ss| sss | asb | bsa| λ and S → ss |asb |bsa| λ are equivalent.
Which of the following is true?

a. Sl is correct anet S2 is not correct

b. Both S1 and S2 are correct

c. S1 is not Correct and S2 is correct

d. Both S1 and S2 are not correct

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Both S1 and S2 are correct

13. Pumping -lemma for context-free languages states :


Let Lbe an infinite context free language. Then there exists some positive integer m such that any w ∈ L wit
with Ivxyl_________ and Ivy I such that uvz, xyZ
Z ∈ L for all z = 0, 1,2, .......

a. ≤m, ≤1

b. ≤m,≥1

c. ≥m,≤1

d. ≥m, ≥1

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).≤m,≥1

14. The Greibach normal form grammar for the language L = {an bn+1 | n ≥ 0 } is

a. S → aSB, B →bB I λ

b. S → aSB, B →bB I b

c. S → aSB I b, B→b

d. S → aSB I b

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).S → aSB I b, B→b


15. Given the following statements:

S1: Every context-sensitive language L is recursive.


S2: There exists a recursive language that is not context sensitive.

Which statement is correct?

a. S1 is not correct and S2 is not correct

b. S1 is not correct and S2 is correct

c. S1 is correct and S2 is not correct

d. S1 is correct and S2 is correct

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).S1 is correct and S2 is correct

16. Shift-Reduce parsers perform the following :

a. Shift step that advances in the input stream by K(K > 1) symbols and Reduce step that applies a completed
joining them together as one tree with a new root symbol.

b. Shift step that advances in the input stream by one symbol and Reduce step that applies a completed gram
them together as one tree with a new root symbol.

c. Shift step that advances in the input stream by K(R = 2) symbols and Reduce step that applies a completed

d. Shift step that does not advance in the input stream and Reduce step that applies a completed grammar rul

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Shift step that advances in the input stream by one symbol and Reduce step that applies a completed
joining them together as one tree with a new root symbol.

17. The following Context-Free Grammar (CFG) :

S → aB | bA

A → a | as | bAA

B → b | bs | aBB

will generate

a. odd numbers of a's and odd numbers of b's

b. even numbers of a's and even numbers of b's


c. equal numbers of a's and b's

d. different numbers of a's and b's

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).equal numbers of a's and b's

18. Which of the following is true?

a. Canonical LR parser is LR (1) parser with single look ahead terminal

b. All LR(K) parsers with K > 1 can be transformed into LR( 1) parsers

c. Both a and b

d. None of the above

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).Both a and b

19. The pushdown automation M = ( {q0, q1, q2}',{a, b}, {0, 1}, δ, q0,0, {q0}) with

δ (q0, a, 0) = {(q1,10)}

δ (q1,a, 1) = {(q1,11)}

δ (q1,b, 1) = {(q2 , λ)}

δ(q2 , b, 1) = {(q2 , λ)}

δ (q2 , A, 0) = {(q0, λ)}

Accepts the language

a. L= {a^nb^m l n,m >=0}

b. L= {a^nb^n l n >=0}

c. L= {a^nb^m l n,m >0}

d. L= {a^nb^n l n >0}

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).L= {a^nb^m l n,m >=0}


20. Given two languages:

L1= {(ab)n,ak I n> k, k >=0}

L2 = {an bm l n ≠ m}

Using pumping lemma for regular language, it can be shown that

a. L1 is regular and L2 is not regular

b. L1 is not regular and L2 is regular

c. L1 is regular and L2 is regular

d. L1 is not regular and L2 is not regular

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).L1 is regular and L2 is not regular

21. Regular expression for the complement of language L = {a^n b^m I n ≥ 4, m ≤ 3} is

a. (a + b)* ba(a + b)*

b. a* bbbbb*

c. (λ + a + aa + aaa)b* + (a + b)* ba(a + b)*

d. None of the above

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).None of the above

22. We can show that the clique problem is NP-hard by proving that

a. CLIQUE ≤ P 3-CNF SAT

b. CLIQUE ≤ PVERTEX_COVER

c. CLIQUE ≤ P SUBSET_SUM

d. None of the above

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).None of the above


23. Given the recursively enumerable language (LRE), the context sensitive language (LCS) the recursive langu
and deterministic context free language (LDCF) The relationship between these families is given by

a. LCF ⊆ LDCF ⊆ LCS ⊆ LRE ⊆ LREC

b. LCF ⊆ LDCF ⊆ LCS ⊆ LREC ⊆ LRE

c. LDCF ⊆ LCF ⊆ LCS ⊆ LRE ⊆ LREC

d. LDCF ⊆ LCF ⊆ LCS ⊆ LREC ⊆ LRE

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).LCF ⊆ LDCF ⊆ LCS ⊆ LREC ⊆ LRE

24. Match the following:

List- I List -II


a. Context free grammar i. Linear bounded automaton
b. Regular grammar ii. Pushdown automaton
c. Context sensitive grammar iii. Turing machine
d. Unrestricted grammar iv. Deterministic finite automaton

code:
a b c d

a. ii iv iii i

b. ii iv i iii

c. iv i ii iii

d. i iv iii ii

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).ii iv i iii

25. According to pumping lemma for context free languages:


Let L be an infinite context free language, then there exists some positive integer m such that any w ∈ L with
z

a. with I vxy I ≤ m such that uvi xyi z ∈ L for all i = 0,1,2

b. with I vxy I ≤ m and I vy I ≥ 1 such that uvi xyi z ∈ L for all i = 0,1,2,.....

c. with I vxy I ≥ m and I vy I ≤ 1 such that uvi xyi z ∈ L for all i = 0,1,2,.....
d. with I vxy I ≥ m and I vy I ≥ 1 such that uvi xyi z ∈ L for all i = 0,1,2,.....

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).with I vxy I ≥ m and I vy I ≥ 1 such that uvi xyi z ∈ L for all i = 0,1,2,.....

26. The equivalent production rules corresponding to the production rules

S → Sα1 | Sα2 | β1 | β2

a. S → β1 | β2 , A → α1A | α2 A | λ

b. S → β1 | β2 | β1 A | β2 A , A → α1A | α2 A

c. S → β1 | β2 , A → α1A | α2 A

d. S → β1 | β2 | β1A | β2A , A → α1A | α2 A | λ

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).S → β1 | β2 | β1A | β2A , A → α1A | α2 A | λ

27. If all the production rules have single non - terminal symbol on the left side, the grammar defined is :

a. context free grammar

b. context sensitive grammar

c. unrestricted grammar

d. phrase grammar

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).context free grammar

28. Minimal deterministic finite automaton for the language L = {0n | n ≥ 0 , n ≠ 4} will have

a. 4 final states among 5 states

b. 1 final state among 6 states

c. 3 final state among 6 states

d. 5 final state among 6 states


View Answer Report Discuss Too Difficult! Search Google

Answer: (d).5 final state among 6 states

29. The regular expression corresponding to the language L where L = { x ∈{0, 1}* | x ends with 1 and does not

a. (1 + 01)* (10 + 01)

b. (1 + 01)* 01

c. (1 + 01)* (1 + 01)

d. (10 + 01)* 01

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).(1 + 01)* (1 + 01)

30. A context free grammar for L = { w | n0 (w) > n1 (w)} is given by :

a. S→0|0S|1SS

b. S→0S|1S|0SS|1SS|0|1

c. S → 0 | 0 S | 1 S S | S 1 S |S S 1

d. S→0S|1S|0|1

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).

31. Given the following two statements :

S1: If L1 and L2 are recursively enumerable languages over Σ, then L1 ⋃ L2 and L1 ⌒ L2 are also recursiv

S2: The set of recursively enumerable languages is countable.

Which of the following is correct?

a. S1 is correct and S2 is not correct

b. S1 is not correct and S2 is correct

c. Both S1 and S2 are not correct

d. Both S1 and S2 are correct

View Answer Report Discuss Too Difficult! Search Google


Answer: (d).Both S1 and S2 are correct

32. Given the following grammars :

G1: S → AB|aaB

A → aA | ∈

B → bB | ∈

G2: S → A | B

A → a A b | ab

B→abB|∈

Which of the following is correct?

a. G1 is ambiguous and G2 is unambiguous grammars

b. G1 is unambiguous and G2 is ambiguous grammars

c. both G1 and G2 are ambiguous grammars

d. both G1 and G2 are unambiguous grammars

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).both G1 and G2 are ambiguous grammars

33. Let L be any language. Define even (W) as the strings obtained by extracting from W the letters in the eve
(W) | W ԑ L}. We define another language Chop (L) by removing the two leftmost symbols of every string in
2}.

If L is regular language then

a. even (L) is regular and Chop(L) is not regular

b. Both even(L) and Chop(L) are regular

c. even(L) is not regular and Chop(L) is regular

d. Both even (L) and Chop(L) are not regular

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Both even(L) and Chop(L) are regular


34. Given the following two grammars :

G1 : S → AB | aaB

A → a | Aa

B→b

G2: S→ aSbS|bSaS|λ

Which statement is correct ?

a. G1 is unambiguous, and G2 is unambiguous

b. G1 is unambiguous and G2 is ambiguous

c. G1 is ambiguous and G2 is unambiguous

d. G1 is ambiguous and G2 is ambiguous

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).G1 is ambiguous and G2 is ambiguous

35. Match the following:

List-I List-II

a. Chomsky Normal form i. S→ bSS|aS|c

b. Greibach Normal form ii. S→ aSb|ab

c. S-grammar iii. S→ AS|a

A→ SA|b

d. |LL grammar iv. S→ aBSB

B→ b

Codes:
a b c d

a. iv iii i ii

b. iv iii ii i

c. iii iv i ii

d. iii iv ii i
View Answer Report Discuss Too Difficult! Search Google

Answer: (c).iii iv i ii

36. Given the following two languages :

L1 = {anbn |n≥1} ∪ {a}

L2= {w C wR|we {a,b}*}

Which statement is correct ?

a. Both L1 and L2 are not deterministic

b. L1 not deterministic and L2 is deterministic

c. L1 is deterministic and L2 is not deterministic

d. Both L1 and L2 are deterministic

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).Both L1 and L2 are deterministic

37. The solution of the recurrence relation of T(n) = 3T ( floor (n/4) ) + n is

a. 0(n^2)

b. O(n/gn)

c. O(n)

d. O(lgn)

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).O(n)

38. The number of strings of length 4 that are generated by the regular expression (0|?) 1+2* (3|?), where | is a
characters, and ? is the null string, is:

a. 8

b. 10
c. 11

d. 12

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).12

39. Which of the following is FALSE ?

a. The grammar S ? aSb|bSa|SS|?, where S is the only non-terminal symbol and ? is the null string, is ambigu

b. SLR is powerful than LALR

c. An LL(1) parser is a top-down parser

d. YACC tool is an LALR(1) parser generator

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).SLR is powerful than LALR

40. Consider the languages L1 = ϕ, and L2 = {1}. Which one of the following represents
L1* U L2* L1* ?

a. {ε}

b. {ε,1}

c. ϕ

d. 1*

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).

41. Given the following statements :


(A) A class of languages that is closed under union and complementation has to be closed under intersectio
(B) A class of languages that is closed under union and intersection has to be closed under complementatio
Which of the following options is correct?

a. Both (A) and (B) are false

b. Both (A) and (B) are true

c. (A) is true, (B) is false


d. (A) is false, (B) is true

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).(A) is true, (B) is false

42. Let G = (V,T,S,P) be a context-free grammar such that every one of its productions is of the form A→v, with
has a height h such that

a. 1

b. 2

c. 3

d. 4

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).4

43. Given the following two languages:

L1 = {a^nb^n|n≥0, n≠100}
L2 = {w ϵ {a,b,c}*| na(w) = nb(w) = nc(w)}

Which of the following options is correct?

a. Both L1 and L2 are not context free language

b. Both L1 and L2 are context free language

c. L1 is context free language, L2 is not context free language

d. L1 is not context free language, L2 is context free language


View Answer Report Discuss Too Difficult! Search Google

Answer: (c).L1 is context free language, L2 is not context free language

44. Given the following two statements:

A. L = {w|na(w) = nb(w)} is deterministic context free language, but not linear.


B. L = {an bn} U {an b2n} is linear, but not deterministic context free language.

Which of the following options is correct?

a. Both (A) and (B) are false

b. Both (A) and (B) are true

c. (A) is true, (B) is false

d. (A) is false, (B) is true

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Both (A) and (B) are true

45. Which of the following pairs have different expressive power?

a. Single-tape-turing machine and multi-dimensional turing machine

b. Multi-tape turing machine and multi-dimensional turing machine

c. Deterministic push down automata and non-deterministic pushdown automata

d. Deterministic finite automata and Non-deterministic finite automata

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).Deterministic push down automata and non-deterministic pushdown automata

46. Which of the following statements is false?

a. Every context-sensitive language is recursive

b. The set of all languages that are not recursively enumerable is countable

c. The family of recursively enumerable languages is closed under union


d. The families of recursively enumerable and recursive languages are closed under reversal

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).The set of all languages that are not recursively enumerable is countable

47. Let C be a binary linear code with minimum distance 2t + 1 then it can correct upto ............bits of error.

a. t+1

b. t

c. t-2

d. t/2

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).t

48. A t-error correcting q-nary linear code must satisfy the following, Where M is the number of code words and

a. q^n

b. q^t

c. q^-n

d. q^-t

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).q^n

49. From the given data below:

abbaabbaab

which one of the following is not a word in the dictionary created by LZ-coding (the initial words are a, b)?

a. ab
b. bb

c. ba

d. baab

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).b a a b

50. The number of strings of length 4 that are generated by the regular expression (0+1+|2+3+)*, where | is an
quantification characters, is:

a. 08

b. 09

c. 10

d. 12

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).

51. Which of the following is FALSE ?

a. The grammar S→aS|aSbS|Î, where S is the only non-terminal symbol, and Î is the null string, is ambiguous.

b. An unambiguous grammar has same left most and right most derivation.

c. An ambiguous grammar can never be LR(k) for any k.

d. Recursive descent parser is a top-down parser.

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).An unambiguous grammar has same left most and right most derivation.

52. The regular grammar for the language L = {a^nb^m | n + m is even} is given by

(A) S → S1 | S2
S1 → a S1 | A1
A1 → b A1 | λ
S2 → aaS2 | A2
A2 → b A2 | λ
(B) S → S1 | S2
S1 → a S1 | a A1
S2 → aa S2 | A2
A1 → bA1 | λ
A2 → bA2 | λ
(C) S → S1 | S2
S1 → aaa S1 | aA1
S2 → aaS2 | A2
A1 → bA1 | λ
A2 → bA2 | λ
(D) S → S1 | S2
S1 → aa S1 | A1
S2 → aaS2 | aA2
A1 → bbA1 | λ
A2 → bbA2 | b

a. A

b. B

c. C

d. D

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).D

53. Let Σ = {a, b} and language L = {aa, bb}. Then, the complement of L is

a. {λ, a, b, ab, ba} U {w ϵ {a, b}* | |w| > 3}

b. {a, b, ab, ba} U {w ϵ {a, b}* | |w| ≥ 3}

c. {w ϵ { a, b}* | |w| > 3} U {a, b, ab, ba}

d. {λ, a, b, ab, ba} U {w ϵ {a, b}* | |w| ≥ 3}

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).{λ, a, b, ab, ba} U {w ϵ {a, b}* | |w| ≥ 3}

54. Consider the following identities for regular expressions :

(a) (r + s)* = (s + r)*


(b) (r*)* = r*
(c) (r* s*)* = (r + s)*

Which of the above identities are true ?

a. (a) and (b) only


b. (b) and (c) only

c. (c) and (a) only

d. (a), (b) and (c)

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).(a), (b) and (c)

55. Given the following two languages:

L1 = {uww^Rn | u, v, w ϵ {a, b}+}


L2 = {uwwR^n | u, v, w ϵ {a, b}+, |u| ≥ |v|}

Which of the following is correct ?

a. L1 is regular language and L2 is not regular language

b. L1 is not regular language and L2 is regular language

c. Both L1 and L2 are regular languages

d. Both L1 and L2 are not regular languages

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).L1 is regular language and L2 is not regular language

56. Given a Turing Machine:

M = ({q0, q1}, {0, 1}, {0, 1, B}, δ, B, {q1})


Where δ is a transition function defined as
δ (q0, 0) = (q0, 0, R)
δ (q0, B) = (q1, B, R)

The language L(M) accepted by Turing machine is given as :

a. 0* 1*

b. 00*

c. 10*

d. 1*0*

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).00*
57. Let G = (V, T, S, P) be a context-free grammar such that every one of its productions is of the form A → n, w
string W ϵ L (G) has a height such that

a. A

b. B

c. C

d. D

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).D

58. Consider the following linear programming problem:

Max. z = 0.50x2 – 0.10x1


Subject to the constraints
2x1 + 5x2 ≤ 80
x1 + x2 ≤ 20
and x1, x2 ≥ 0

The total maximum profit (z) for the above problem is:

a. 6

b. 8

c. 10

d. 12

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).8

59. The regular expression for the complement of the language L = {anbm|n≥4, m≤3} is:

a. (λ + a + aa + aaa)b* + a*bbbb* + (a + b)*ba(a + b)*


b. (λ + a + aa + aaa)b* + a*bbbbb* + (a + b)*ab(a + b)*

c. (λ + a + aa + aaa) + a*bbbbb* + (a + b)*ab(a + b)*

d. (λ + a + aa + aaa)b* + a*bbbbb* + (a + b)*ba(a + b)*

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).(λ + a + aa + aaa)b* + a*bbbbb* + (a + b)*ba(a + b)*

60. Consider the following two languages:

L1 = {0i1j | gcd(i,j)=1}
L2 is any subset of 0*.

Which of the following is correct?

a. L1 is regular and L2* is not regular

b. L1 is not regular and L2* is regular

c. Both L1 and L2* are regular languages

d. Both L1 and L2* are not regular languages

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).

61. Let L be the language generated by regular expression 0*10* and accepted by the deterministic finite autom
As all states are reachable from the start state, RM has ................ equivalence classes.

a. 2

b. 4

c. 5

d. 6

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).6

62. Let L = {0^n1^n | n≥0} be a context free language.


Which of the following is correct?

a. L’ is context free and L^k is not context free for any k≥1
b. L’ is not context free and L^k is context free for any k≥1

c. Both L’ and L^k is for any k≥1 are context free

d. Both L’ and L^k is for any k≥1 are not context free

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).Both L’ and L^k is for any k≥1 are context free

63. Given a Turing Machine

M = ({q0,q1,q2,q3}, {a,b}, {a,b,B}, δ, B, {q3})

Where δ is a transition function defined as

δ(q0,a) = (q1,a,R)
δ(q1,b) = (q2,b,R)
δ(q2,a) = (q2,a,R)
δ(q2,b) = (q3,b,R)

The language L(M) accepted by the Turing Machine is given as:

a. aa*b

b. abab

c. aba*b

d. aba*

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).aba*b

64. Match the following :

List - I List - II
(a) {a^n b^n|n > 0} is a deterministic (i) but not recursive language
context free language
(b) The complement of {a^n b^n a^n|n > 0} (ii) but not context free language
is a context free language
(c) {a^n b^n a^n} is context sensitive language (iii) but can not be accepted by a deterministic pushdown au
(d) L is a recursive language (iv) but not regular

Codes :
(a) (b) (c) (d)

a. (i) (ii) (iii) (iv)


b. (i) (ii) (iv) (iii)

c. (iv) (iii) (ii) (i)

d. None of the above is correct match

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).None of the above is correct match

65. The language of all non-null strings of a’s can be defined by a context free grammar as
follow :

S→a S|S a| a

The word a^3 can be generated by ................ different trees.

a. Two

b. Three

c. Four

d. Five

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).Four

66. The context free grammar given by

S→XYX
X→aX|bX|λ
Y→bbb

generates the language which is defined by regular expression:

a. (a+b)*bbb

b. abbb(a+b)*

c. (a+b)*(bbb)(a+b)*

d. (a+b)(bbb)(a+b)*

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).(a+b)*(bbb)(a+b)*
67. There are exactly ................ different finite automata with three states x, y and z over the alphabet {a, b} wh

a. 64

b. 256

c. 1024

d. 5832

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).5832

68. Given the following two languages :

L1={a^n b a^n|n>0}
L2={a^n b a^n b^n+1|n>0}

Which of the following is correct?

a. L1 is context free language and L2 is not context free language

b. L1 is not context free language and L2 is context free language

c. Both L1 and L2 are context free languages

d. Both L1 and L2 are not context free languages

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).L1 is context free language and L2 is not context free language

69. Consider a language A defined over the alphabet ∑={0, 1} as A = {0^[n/2] 1^n: n >= 0} .
The expression [n/2] means the floor of n/2, or what you get by rounding n/2 down to the nearest integer.

Which of the following is not an example of a string in A ?

a. 011

b. 0111

c. 0011

d. 001111
View Answer Report Discuss Too Difficult! Search Google

Answer: (c).0011

70. A grammar G is LL(1) if and only if the following conditions hold for two distinct productions A → α | β

I. First (α) ∩ First (β) ≠ {a} where a is some terminal symbol of the grammar.
II. First (α) ∩ First (β) ≠ λ
III. First (α) ∩ Follow(A) = φ if λ є First (β)

a. I and II

b. I and III

c. II and III

d. I, II and III

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).

71. A shift reduce parser suffers from

a. shift reduce conflict only

b. reduce reduce conflict only

c. both shift reduce conflict and reduce reduce conflict

d. shift handle and reduce handle conflicts

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).both shift reduce conflict and reduce reduce conflict

72. The context free grammar for language L = {a^nb^mc^k | k = |n - m|, n≥0,m≥0,k≥0} is

a. S→S1S3, S1→aS1c |S2|λ, S2→aS2b|λ, S3→aS3b|S4| λ, S4→bS4c|λ

b. S→S1S3, S1→aS1S2c |λ, S2→aS2b|λ, S3→aS3b|S4| λ, S4→bS4c|λ

c. S→S1|S2, S1→aS1S2c|λ, S2→aS2b|λ, S3→aS3b|S4| λ, S4→bS4c|λ

d. S→S1|S3, S1→aS1c |S2|λ, S2→aS2b|λ, S3→aS3b|S4| λ, S4→bS4c|λ

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).S→S1|S3, S1→aS1c |S2|λ, S2→aS2b|λ, S3→aS3b|S4| λ, S4→bS4c|λ


73. The number of states in a minimal deterministic finite automaton corresponding to the language L = { an | n≥

a. 3

b. 4

c. 5

d. 6

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).5

74. Regular expression for the language L = { w ∈ {0, 1}* | w has no pair of consecutive zeros} is

a. (1 + 010)*

b. (01 + 10)*

c. (1 + 010)* (0 + λ)

d. (1 + 01)* (0 + λ)

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).(1 + 01)* (0 + λ)

75. Consider the following two languages:

L1 = {a^n b^l a^k | n + l +k>5 }


L2 = {a^n b^l a^k |n>5, l >3, k≤ l }

Which of the following is true?

a. L1 is regular language and L2 is not regular language

b. Both L1 and L2 are regular languages

c. Both L1 and L2 are not regular languages

d. L1 is not regular language and L2 is regular language

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).L1 is regular language and L2 is not regular language


76. LL grammar for the language L = {a^n b^m c^n+m | m≥0, n≥0} is

a. S → aSc | S1 ; S1 → bS1c | λ

b. S → aSc | S1| λ ; S1 → bS1c

c. S → aSc | S1| λ ; S1 → bS1c| λ

d. S → aSc | λ ; S1 → bS1c| λ

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).S → aSc | S1| λ ; S1 → bS1c| λ

77. Assume the statements S1 and S2 given as:

S1: Given a context free grammar G, there exists an algorithm for determining whether L(G) is infinite.
S2: There exists an algorithm to determine whether two context free grammars generate the same languag

Which of the following is true?

a. S1 is correct and S2 is not correct

b. Both S1 and S2 are correct

c. Both S1 and S2 are not correct

d. S1 is not correct and S2 is correct

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).S1 is correct and S2 is not correct

78. Assume, L is regular language. Let statements S1 and S2 be defined as :

S1 : SQRT(L) = { x| for some y with |y| = |x|^2, xy ∈L}


S2 : LOG(L) = { x| for some y with |y| = 2^|x|, xy ∈ L}

Which of the following is true ?

a. S1 is correct and S2 is not correct

b. Both S1 and S2 are correct

c. Both S1 and S2 are not correct


d. S1 is not correct and S2 is correct

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Both S1 and S2 are correct

79. A regular grammar for the language L = {a^nb^m | n is even and m is even}is given by

a. S→aSb | S1; S1 → bS1a | λ

b. S→aaS | S1; S1 → bSb | λ

c. S→aSb | S1; S1 → S1ab | λ

d. S→aaS | S1; S1 → bbS1 | λ

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).S→aaS | S1; S1 → bbS1 | λ

80. Given the following productions of a grammar :

S→ aA| aBB;
A→aaA |λ ;
B→ bB| bbC;
C→ B

Which of the following is true ?

a. The language corresponding to the given grammar is a set of even number of a’s.

b. The language corresponding to the given grammar is a set of odd number of a’s.

c. The language corresponding to the given grammar is a set of even number of a’s followed by odd number o

d. The language corresponding to the given grammar is a set of odd number of a’s followed by even number o

View Answer Report Discuss Too Difficult! Search Google

Answer: (b)

81. The language accepted by the nondeterministic pushdown automaton

M= ({q0, q1, q2}, {a, b}, {a, b, z}, δ, q0, z, {q2}) with transitions
δ (q0 a, z) = { (q1 a), (q2 λ)};
δ (q1, b, a) = { (q1, b)}
δ (q1, b, b) ={ (q1 b)}, δ (q1, a, b) = { (q2, λ)}
is

a. L(abb*a)

b. {a} U L(abb*a)

c. L(ab*a)

d. {a} U L(ab*a)

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).{a} U L(abb*a)

82. The language L = {a^n b^n a^m b^m | n ≥ 0, m ≥ 0} is

a. Context free but not linear

b. Context free and linear

c. Not Context free and not linear

d. Not Context free but linear

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).Context free but not linear

83. Assume statements S1 and S2 defined as :

S1 : L2-L1 is recursive enumerable where L1 and L2 are recursive and recursive enumerable respectively.
S2 : The set of all Turing machines is countable.

Which of the following is true ?

a. S1 is correct and S2 is not correct

b. Both S1 and S2 are correct

c. Both S1 and S2 are not correct

d. S1 is not correct and S2 is correc

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Both S1 and S2 are correct


84. Non-deterministic pushdown automaton that accepts the language generated by the grammar:

S→aSS | ab is

(A) δ(q0, λ, z) = { (q1, z)};


δ(q0, a, S) = { (q1, SS)}, (q1, B) }
δ(q0, b, B) = { (q1, λ)},
δ(q1, λ, z) = { (qf, λ)}

(B) δ(q0, λ, z) = { (q1, Sz)};


δ(q0, a, S) = { (q1, SS)}, (q1, B) }
δ(q0, b, B) = { (q1, λ)},
δ(q1, λ, z) = { (qf, λ)}

(C) δ(q0, λ, z) = { (q1, Sz)};


δ(q0, a, S) = { (q1, S)}, (q1, B) }
δ(q0, b, λ) = { (q1, B)},
δ(q1, λ, z) = { (qf, λ)}

(D) δ(q0, λ, z) = { (q1, z)};


δ(q0, a, S) = { (q1, SS)}, (q1, B) }
δ(q0, b, λ) = { (q1, B)},
δ(q1, λ, z) = { (qf, λ)}

a. A

b. B

c. C

d. D

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).B

85. Given L1 = L(a*baa*) and L2 = L(ab*)


The regular expression corresponding to language L3 = L1/L2 (right quotient) is given by

a. a*b

b. a*baa*

c. a*ba*

d. None of the above

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).a*ba*
86. Given the production rules of a grammar G1 as

S1→AB | aaB
A→a | Aa
B→b

and the production rules of a grammar G2 as

S2→aS2bS2 | bS2aS2 | λ

Which of the following is correct statement?

a. G1 is ambiguous and G2 is not ambiguous

b. G1 is ambiguous and G2 is ambiguous

c. G1 is not ambiguous and G2 is ambiguous

d. G1 is not ambiguous and G2 is not ambiguous

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).G1 is ambiguous and G2 is ambiguous

87. Given a grammar : S1→Sc, S→SA|A, A→aSb|ab, there is a rightmost derivation S1=>Sc =>SAC=>SaSbc.
handle is

a. SaS

b. be

c. Sbe

d. aSb

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).aSb

88. The equivalent production rules corresponding to the production rules

S→Sα1|Sα2|β1|β2 is

a. S→β1 | β2, A→α1A | α2A | λ

b. S→β1 | β2 | β1A | β2A, A→α1A | α2A

c. S→β1 | β2, A→α1A | α2A


d. S→β1 | β2 | β1A | β2A, A→α1A | α2A | λ

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).S→β1 | β2 | β1A | β2A, A→α1A | α2A | λ

89. Given a Non-deterministic Finite Automation (NFA) with states p and r as initial and final states respectively

The minimum number of states required in Deterministic Finite Automation (DFA) equivalent to NFA is

a. 5

b. 4

c. 3

d. 2

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).3

90. The grammar with production rules S → aSb |SS|λ generates language L given by:

a. L = {w∈{a, b}* | na(w) = nb(w) and na(v) ≥ nb(v) where v is any prefix of w}

b. L = {w∈{a, b}* | na(w) = nb(w) and na(v) ≤ nb(v) where v is any prefix of w}

c. L = {w∈{a, b}* | na(w) ≠ nb(w) and na(v) ≥ nb(v) where v is any prefix of w}

d. L = {w∈{a, b}* | na(w) ≠ nb(w) and na(v) ≤ nb(v) where v is any prefix of w}

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).

91. A pushdown automation M = (Q, Σ, Γ, δ, q0, z, F) is set to be deterministic subject to which of the following
∈Γ
(s1) δ(q, a, b) contains at most one element
(s2) if δ(q, λ, b) is not empty then δ(q, c, b) must be empty for every c ∈ Σ

a. only s1

b. only s2

c. both s1 and s2

d. neither s1 nor s2
View Answer Report Discuss Too Difficult! Search Google

Answer: (c).both s1 and s2

92. For every context free grammar (G) there exists an algorithm that passes any w ∈ L(G) in number of steps p

a. ln|w|

b. |w|

c. |w|^2

d. |w|^3

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).|w|^3

93. Match the following:

a. Context sensitive language i. Deterministic finite automation


b. Regular grammar ii. Recursive enumerable
c. Context free grammar iii. Recursive language
d. Unrestricted grammar iv. Pushdown automation

Codes:
a b c d

a. ii i iv iii

b. iii iv i ii

c. iii i iv ii

d. ii iv i iii

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).iii i iv ii

94. The statements s1 and s2 are given as:

s1: Context sensitive languages are closed under intersection, concatenation, substitution and inverse hom
s2: Context free languages are closed under complementation, substitution and homomorphism.
Which of the following is correct statement?

a. Both s1 and s2 are correct

b. s1 is correct and s2 is not correct

c. s1 is not correct and s2 is correct

d. Both s1 and s2 are not correct

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).s1 is correct and s2 is not correct

95. Consider the following statements :

I. Recursive languages are closed under complementation.


II. Recursively enumerable languages are closed under union.
III. Recursively enumerable languages are closed under complementation.

Which of the above statements are true ?

a. I only

b. I and II

c. I and III

d. II and III

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).I and II

96. Given the following statements :

(i) The power of deterministic finite state machine and nondeterministic finite state machine are same.
(ii) The power of deterministic pushdown automaton and nondeterministic pushdown automaton are same.

Which of the above is the correct statement(s) ?

a. Both (i) and (ii)

b. Only (i)

c. Only (ii)

d. Neither (i) nor (ii)


View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Only (i)

97. Let Q(x, y) denote “x + y = 0” and let there be two quantifications given as follows, where x & y are real num

a. (i) is true & (ii) is false

b. (i) is false & (ii) is true

c. (i) is false & (ii) is also false

d. both (i) & (ii) are true

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).(i) is false & (ii) is true

98. Which is not the correct statement(s) ?

(i) Every context sensitive language is recursive.


(ii) There is a recursive language that is not context sensitive.

a. (i) is true, (ii) is false

b. (i) is true and (ii) is true

c. (i) is false, (ii) is false

d. (i) is false and (ii) is true

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).(i) is true and (ii) is true

99. Which one of the following is not a Greibach Normal form grammar?

(i) S ->a|bA|aA|bB
A->a
B->b
(ii) S->a|aA|AB
A->a
B->b
(iii) S->a|A|aA
A->a

a. (i) and (ii)

b. (i) and (iii)

c. (ii) and (iii)

d. (i), (ii) and (iii)

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).(ii) and (iii)

100. The equivalent grammar corresponding to the grammar G:S→aA,A→BB,B→aBb∣εG:S→aA,A→BB,B→aBb

a. S→aA,A→BB,B→aBb

b. S→a∣aA,A→BB,B→aBb∣ab

c. S→a∣aA,A→BB∣B,B→aBb

d. S→a∣aA,A→BB∣B,B→aBb∣ab

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).

101. Consider the regular expression (a + b) (a + b) … (a + b) (n-times). The minimum number of states in finite
represented by this regular expression contains

a. n states

b. n + 1 states

c. n + 2 states

d. 2^n states

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).n + 1 states

102. The following CFG


S->aB|bA, A->a|as|bAA, B->b|bs|aBB

generates strings of terminals that have

a. odd number of a’s and odd number of b’s

b. even number of a’s and even number of b’s

c. equal number of a’s and b’s

d. not equal number of a’s and b’s

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).equal number of a’s and b’s

103. The regular expression for the following DFA is

a. ab*(b + aa*b)*

b. a*b(b + aa*b)*

c. a*b(b* + aa*b)

d. a*b(b * + aa*b)*

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).a*b(b * + aa*b)*

104. Match the following :

(i) Regular Grammar (a) Pushdown automaton


(ii) Context free Grammar (b) Linear bounded automaton
(iii) Unrestricted Grammar (c) Deterministic finite automaton
(iv) Context Sensitive Grammar (d) Turing machine

(i) (ii) (iii) (iv)

a. (c) (a) (b) (d)


b. (c) (a) (d) (b)

c. (c) (b) (a) (d)

d. (c) (b) (d) (a)

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).(c) (a) (d) (b)

105. Which one of the following statement is false?

a. Context-free languages are closed under union.

b. Context-free languages are closed under concatenation.

c. Context-free languages are closed under intersection.

d. Context-free languages are closed under Kleene closure.

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).Context-free languages are closed under Kleene closure.

106. Which of the following grammar is LR (1)?

a. A->aAb, A->bAb, A->a , A->b

b. A->aAa, A->aAb, A->c

c. A->A+A, A->a

d. Both a and b

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).Both a and b

107. Context-free Grammar (CFG) can be recognized by

a. Finite state automata

b. 2-way linear bounded automata

c. push down automata


d. both b and c

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).both b and c

108. A context free grammar is:

a. type 0

b. type 1

c. type 2

d. type 3

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).type 2

109. Let e: B˄m→B˄n is a group code. The minimum distance of ‘e’ is equal to:

a. the maximum weight of a non zero code word

b. the minimum weight of a non zero code word

c. m

d. n

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).the minimum weight of a non zero code word

110. Consider a Moore Machine M whose digraph is given below. Then L(M), the language accepted by the ma

a. two or more b’s

b. three or more b’s


c. two or more a’s

d. three or more a’s

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).

111. A WFF that is equivalent to the WFF x=>y is:

a. y=>x

b. ~y=>x

c. ~y=>~x

d. y=>~x

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).~y=>x

112. The following deterministic finite automata recognizes:

a. Set of all strings containing ‘ab’

b. Set of all strings containing ‘aab’

c. Set of all strings ending in ‘abab’

d. None of the above

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).None of the above

113. The regular expression given below describes:

r=(1+01)*(0+λ)
a. Set of all string not containing ‘11’

b. Set of all string not containing ‘00’

c. Set of all string containing ‘01’

d. Set of all string ending in ‘0’

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).Set of all string ending in ‘0’

114. Which of the following language is regular?

a. L={a^nb^n|n≥1}

b. L={a^nb^mc^nd^m|n,m≥1}

c. L={a^nb^m|n,m≥1}

d. L={anbmcn|n,m≥1}

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).L={a^nb^m|n,m≥1}

115. Which of the regular expressions corresponds to this grammar ?

S → AB / AS, A → a / aA, B → b

a. aa*b+

b. aa*b

c. (ab)*

d. a(ab)*

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).aa*b

116. Which of the following strings is in the language defined by grammar S→0A, A→1A/0A/1

a. 01100
b. 00101

c. 10011

d. 11111

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).00101

117. The logic of pumping lemma is a good example of:

a. pigeon hole principle

b. recursion

c. divide and conquer technique

d. iteration

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).pigeon hole principle

118. Let A = {x | -1< x< 1} = B. The function f(x)=x/2 from A to B is:

a. injective

b. surjective

c. both injective and surjective

d. neither injective nor surjective

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).both injective and surjective

119. Which sentence can be generated by S→d/bA, A→d/ccA:

a. bccddd

b. aabccd

c. ababccd
d. abbbd

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).bccddd

120. Regular expression a+b denotes the set:

a. {a}

b. {ϵ, a, b}

c. {a, b}

d. None of these

View Answer Report Discuss Too Difficult! Search Google

Answer: (c)

121. Which of the following is not true?

a. Power of deterministic automata is equivalent to power of non-deterministic automata.

b. Power of deterministic pushdown automata is equivalent to power of non-deterministic pushdown automata

c. Power of deterministic Turing machine is equivalent to power of non-deterministic Turing machine.

d. All the above

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Power of deterministic pushdown automata is equivalent to power of non-deterministic pushdown aut

122. Identify the language which is not context - free.

a. L = {ωωR|ωϵ{0,1}*}

b. L = {a^nb^n|n≥0}

c. L = {ωω|ωϵ{0,1}*}

d. L = {a^nb^mc^md^n | n, m≥0 }

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).L = {a^nb^n|n≥0}


123. The context-free languages are closed for:

(i) Intersection (ii) Union


(iii) Complementation (iv) Kleene Star

a. (i) and (iv)

b. (i) and (iii)

c. (ii) and (iv)

d. (ii) and (iii)

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).(ii) and (iv)

124. Grammars that can be translated to DFAs:

a. Left linear grammar

b. Right linear grammar

c. Generic grammar

d. All of these

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Right linear grammar

125. The language accepted by a Push down Automata:

a. Type0

b. Type1

c. Type2

d. Type3

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).Type2
126. In parallel algorithm design, the process of grouping tasks into larger tasks in order to improve performance

a. Agglomeration

b. Domain Decomposition

c. Mapping

d. None of these

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).Agglomeration

127. Recursive Descent Parsers are a type of:

a. LL parsers

b. LR parsers

c. LALR parsers

d. SLR parsers

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).LL parsers

128. If language L={0,1}*, then the reversed language L^R =

a. {0,1}*

b. {}

c. {0}*

d. {1}*

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).{0,1}*

129. Let r = a(a + b)*, s = aa*b and t = a*b be three regular expressions.
Consider the following:
(i) L(s) ⊆ L(r) and L(s) ⊆ L(t)
(ii) L(r) ⊆ L(s) and L(s) ⊆ L(t)

Choose the correct answer from given below:

a. Only (i) is correct

b. Only (ii) is correct

c. Both (i) and (ii) are correct

d. Neither (i) nor (ii) is correct

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).Only (i) is correct

130. Consider the language L given by

L = {2^(nk) ∣ k>0, and n is non-negative integer number}

The minimum number of states of finite automaton which accepts the language L is

a. n

b. n+1

c. n(n+1)/2

d. 2^n

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).

131. The number of substrings that can be formed from string given by

adefbghnmp

is

a. 10

b. 45

c. 55

d. 56

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).56
132. Consider the following two languages:

L1 = {x ∣ for some y with ∣y∣ = 2^∣x∣,xy ∈ L and L is regular language}


L2 = {x ∣ for some y such that ∣x∣ = ∣y∣, xy ∈ L and L is regular language}

Which one of the following is correct?

a. Only L1 is regular language

b. Only L2 is regular language

c. Both L1 and L2 are regular languages

d. Both L1 and L2 are not regular languages

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).Both L1 and L2 are regular languages

133. Consider the following languages:

L1 = {a^(n+m) b^n a^m ∣ n,m ≥ 0}


L2 = {a^(n+m) b^(n+m) a^(n+m) ∣ n,m ≥ 0}

Which of the following is correct?

a. Only L1 is context-free language

b. Only L2 is context-free language

c. Both L1 and L2 are context free languages

d. Both L1 and L2 are not context free languages

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).Only L1 is context-free language

134. Consider R to be any regular language and L1, L2 be any two context-free languages. Which of the followin

a. L1’ is context free

b. (L1 ∪ L2)’ – R is context free

c. L1 ∩ L2 is context free
d. L1 – R is context free

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).L1 – R is context free

135. Consider the following problems:

(i) Whether a finite state automaton halts on all inputs?


(ii) Whether a given context free language is regular?
(iii) Whether a Turing machine computes the product of two numbers?

Which one of the following is correct?

a. Only (i) and (iii) are undecidable problems

b. Only (ii) and (iii) are undecidable problems

c. Only (i) and (ii) are undecidable problems

d. (i), (ii) and (iii) are undecidable problems

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Only (ii) and (iii) are undecidable problems

136. Which of the following problems is decidable for recursive languages (L)?

a. Is L = ϕ?

b. Is w ∈ L, where w is a string?

c. Is L = Σ*?

d. Is L = R, where R is a given regular set?

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Is w ∈ L, where w is a string?

137. Consider the following grammar G:

S→A∣B
A→a∣c
B→b∣c
where {S, A, B} is the set of non-terminals, {a, b, c,} is the set of terminals.

Which of the following statement(s) is/are correct?


S1: LR(1) can parse all strings that are generated using grammar G.
S2: LL(1) can parse all strings that are generated using grammar G.

a. Only S1

b. Only S2

c. Both S1 and S2

d. Neither S1 nor S2

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).Neither S1 nor S2

138. The grammar S → (S) ∣ SS ∣ ϵ is not suitable for predictive parsing because the grammar is

a. Right recursive

b. Left recursive

c. Ambiguous

d. An operator grammar

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).Ambiguous

139. Two finite state machines are said to be equivalent if they:

a. Have the same number of edges

b. Have the same number of states

c. Recognize the same set of tokens

d. Have the same number of states and edges

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).Recognize the same set of tokens


140. The finite state machine given in figure below recognizes:

a. any string of odd number of a’s

b. any string of odd number of b’s

c. any string of even number of a’s and odd number of b’s

d. any string of odd number of a’s and odd number of b’s

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).

141. A pushdown automata behaves like a Turing machine when the number of auxiliary memory is:

a. 0

b. 1

c. 1 or more

d. 2 or more

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).2 or more

142. Pushdown automata can recognize language generated by ................

a. Only context free grammar

b. Only regular grammar

c. Context free grammar or regular grammar

d. Only context sensitive grammar

View Answer Report Discuss Too Difficult! Search Google


Answer: (c).Context free grammar or regular grammar

143. To obtain a string of n Terminals from a given Chomsky normal form grammar, the number of productions t

a. 2n−1

b. 2n

c. n+1

d. n^2

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).2n−1

144. Consider the following two Grammars:

G1 : S → SbS | a
G2 : S → aB | ab, A→GAB | a, B→ABb | b

Which of the following option is correct?

a. Only G1 is ambiguous

b. Only G2 is ambiguous

c. Both G1 and G2 are ambiguous

d. Both G1 and G2 are not ambiguous

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).Both G1 and G2 are ambiguous

145. Context sensitive language can be recognized by a:

a. Finite state machine

b. Deterministic finite automata

c. Non-deterministic finite automata

d. Linear bounded automata


View Answer Report Discuss Too Difficult! Search Google

Answer: (d).Linear bounded automata

146. The set A={ 0^n 1^n 2^n | n=1, 2, 3, ......... } is an example of a grammar that is:

a. Context sensitive

b. Context free

c. Regular

d. None of the above

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).Context sensitive

147. A bottom-up parser generates:

a. Left-most derivation in reverse

b. Right-most derivation in reverse

c. Left-most derivation

d. Right-most derivation

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Right-most derivation in reverse

148. Consider the following statements:

S1 : There exists no algorithm for deciding if any two Turing machines M1 and M2 accept the same langua
S2 : The problem of determining whether a Turing machine halts on any input is undecidable.

Which of the following options is correct?

a. Both S1 and S2 are correct

b. Both S1 and S2 are not correct

c. Only S1 is correct
d. Only S2 is correct

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).Both S1 and S2 are correct

149. Which of the following regular expressions, each describing a language of binary numbers (MSB to LSB) th
does not include even values? (Where {+, *} are quantification characters.)

a. 0*1+0*1*

b. 0*1*0+1*

c. 0*1*0*1+

d. 0+1*0*1*

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).0*1*0*1+

150. Which of the following statements is/ are TRUE?

(a) The grammar S → SS a is ambiguous. (Where S is the start symbol)


(b) The grammar S → 0S1 | 01S | ϵ is ambiguous. (The special symbol ϵ represents the empty string) (Whe
(c) The grammar (Where S is the start symbol)
S → T/U
T → x S y | xy | ϵ
U → yT
generates a language consisting of the string yxxyy.

a. Only (a) and (b) are TRUE.

b. Only (a) and (c) are TRUE.

c. Only (b) and (c) are TRUE.

d. All of (a), (b) and (c) are TRUE.

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).

151. Pumping lemma for regular language is generally used for proving:

a. whether two given regular expressions are equivalent

b. a given grammar is ambiguous


c. a given grammar is regular

d. a given grammar is not regular

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).whether two given regular expressions are equivalent

152. Which of the following problems is undecidable?

a. To determine if two finite automata are equivalent

b. Membership problem for context free grammar

c. Finiteness problem for finite automata

d. Ambiguity problem for context free grammar

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).Ambiguity problem for context free grammar

153. Finite state machine can recognize language generated by ....................

a. Only context free grammar

b. Only context sensitive grammar

c. Only regular grammar

d. any unambiguous grammar

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).Only regular grammar

154. The language L = {a^i b c^i | i ≥ 0} over the alphabet {a, b, c} is:

a. a regular language.

b. not a deterministic context free language but a context free language.

c. recursive and is a deterministic context free language.

d. not recursive.
View Answer Report Discuss Too Difficult! Search Google

Answer: (c).recursive and is a deterministic context free language.

155. Which of the following statements is not correct?

a. Every recursive language is recursively enumerable.

b. L = {0^n 1^n 0^n | n=1, 2 , 3, ....} is recursively enumerable.

c. Recursive languages are closed under intersection.

d. Recursive languages are not closed under intersection.

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).Recursive languages are not closed under intersection.

156. Context free grammar is not closed under :

a. Concatenation

b. Complementation

c. Kleene Star

d. Union

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Complementation

157. Consider the following languages :

L1 = {a^m b^n | m ≠ n}
L2 = {a^m b^n | m = 2n+1}
L3 = {a^m b^n | m ≠ 2n}

Which one of the following statement is correct?

a. Only L1 and L2 are context free languages

b. Only L1 and L3 are context free languages

c. Only L2 and L3 are context free languages


d. L1, L2 and L3 are context free languages

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).L1, L2 and L3 are context free languages

158. Given a Non-deterministic Finite Automation (NFA) with states p and r as initial and final states respectively
number of states required in Deterministic Finite Automation (DFA) equivalent to NFA is

a. 5

b. 4

c. 3

d. 2

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).
(1) From the options given below, the pair having different expressive power is

(A) Deterministic Push Down Automata (DPDA) and Non-deterministic Push Down
Automata (NPDA)
(B) Deterministic Finite Automata (DFA) and Non-deterministic Finite Automata(NFA)
(C) Single tape turning machine and multi tape turning machine.
(D) Deterministic single tape turning machine and Non-Deterministic single tape
turning machine

View Answer / Hide Answer

ANSWER: Deterministic Push Down Automata (DPDA) and Non-deterministic


Push Down Automata (NPDA)

(2) The problem that is undecidable -

(A) Finiteness problem for FSA’s


(B) Membership problem for CFG’s
(C) Equivalence problem for FSA’s
(D) Ambiguity problem for CFG’s

View Answer / Hide Answer

ANSWER: Ambiguity problem for CFG’s

(3) The language which is generated by the grammar S-> aSa I bSb I a I b over
the alphabet {a, b} is the set of

(A) Strings that begin and end with the same symbol
(B) All odd and even length palindromes
(C) All odd length palindromes
(D) All even length palindromes

View Answer / Hide Answer

ANSWER: All odd length palindromes

(4) Two persons X and Y have been asked to show that a certain problem p is
NP-complete. X shows a polynomial time reduction from the 3-SAT problem to
p and Y shows a polynomial time reduction from p to 3-SAT. From these
reduction it can be inferred that
(A) π is NP-complete
(B) π is NP-hard but not NP-complete
(C) π is in NP but not NP-complete
(D) π is neither NP-hard nor in NP

View Answer / Hide Answer

ANSWER: π is NP-complete

(5) Out of the three problems S, Q and R, S is an NP-complete problem and Q


and R are the two other problems not known to be in NP. Which one of the
following statements is true if Q is polynomial time reducible to S and S is the
polynomial time reducible to R?

(A) Q is NP-complete
(B) R is NP-complete
(C) Q is NP-hard
(D) R is NP-hard

View Answer / Hide Answer

ANSWER: R is NP-complete

(6) From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that is
recursively enumerable but not recursive is

(A) X2 ∩ X1 is recursively enumerable


(B) X2 ∪ X1 is recursively enumerable
(C) X2 – X1 is recursively enumerable
(D) X1 – X3 is recursively enumerable

View Answer / Hide Answer

ANSWER: X1 – X3 is recursively enumerable

(7) For the language {ap I P is a prime}, the statement which hold true is

(A) It is not regular but context free


(B) It is regular but not context free
(C) It is neither regular nor context free, but accepted by a turing machine
(D) It is not accepted by turing machine
View Answer / Hide Answer

ANSWER: It is neither regular nor context free, but accepted by a turing machine

(8) The statement that holds true is

(A) Infinite union of finite sets is regular


(B) The union of two non-regular set is not regular
(C) Every finite subset of a non-regular set is regular
(D) Every subset of a regular set is regular

View Answer / Hide Answer

ANSWER: Every finite subset of a non-regular set is regular

(9) The language described by the regular expression (0+1)*0(0+1)*0(0+1)* over


the alphabet {0 1} is the set of

(A) All strings containing at least two 1’s


(B) All strings containing at least two 0’s
(C) All strings that begin and end with either 0’s or 1’s
(D) All strings containing the substring 00

View Answer / Hide Answer

ANSWER: All strings containing at least two 0’s

(10) 3-SAT and 2-SAT problems are

(A) NP-complete and in P respectively


(B) Undecidable and NP-complete
(C) Both NP-complete
(D) Both in P

View Answer / Hide Answer

ANSWER: NP-complete and in P respectively

(11) Which one of the following statement is true?


(A) The intersection of two context free languages is context free
(B) A context free language can always be accepted by a deterministic push down
automaton

(C) The union of two context free languages is context free


(D) The complement of a context free language is context free.

View Answer / Hide Answer

ANSWER: The union of two context free languages is context free

(12) Let n be the positive integer constant and L be the language with alphabet
{a}. To recognize L the minimum number of states required in a DFA will be

(A) 2k + 1
(B) k + 1
(C) 2n + 1
(D) n + 1

View Answer / Hide Answer

ANSWER: n + 1

(13) Consider a stack, which is limited to 10 items. The language accepted by a


push- down automaton in such stack is best described as

(A) Regular
(B) Deterministic context free
(C) Context free
(D) Recursive

View Answer / Hide Answer

ANSWER: Regular

(14) Which one of the following statement is true if L denotes the language
generated by the grammar S->0S0/00?

(A) L is not context free


(B) L is regular but not 0+
(C) L = 0+
(D) L is context free but not regular
View Answer / Hide Answer

ANSWER: L is regular but not 0+

(15) Consider the regular expression 0 * (10 *) which is similar to the same set
as

(A) 0 + (0 + 10) *
(B) (0 +1) * 10 (0 + 1) *
(C) (1 * 0) * 1*
(D) None of the above

View Answer / Hide Answer

ANSWER: None of the above

(16) W is any string whose length is n in {0, 1}* and L is the set of all sub-
strings of W. The minimum number of states in a non-deterministic finite
automaton that accepts L is

(A) n
(B) 2n
(C) n + 1
(D) n - 1

View Answer / Hide Answer

ANSWER: n + 1

(17) The DFA shown below accepts the set of all strings over {0, 1} that

(A) End with 00


(B) End with 0
(C) Begin either with 0 or 1
(D) Contain the substring 00

View Answer / Hide Answer

ANSWER: End with 00

(18) We have two statements S1 and S2 whose definition are as follows:

S1 – {02n In ≥ I} is a regular language.


S2 – {0m 1n 0 1m+n Im=1 and n≥1I is a regular language.

Which one of the following statements is correct?

(A) Both S1 and S2 are correct


(B) Only S2 is correct
(C) Only S1 is correct
(D) Neither S1 nor S2 is correct

View Answer / Hide Answer

ANSWER: Only S1 is correct

(19) Consider a string s over (0+1)*. The number of 0’s in s is denoted by no(s)
and the number of 1’s in s is denoted by n1(s). The language that is not regular
is

(A) L = {s ∈ (0+1)* I for every prefix s’ of s, I no(s’)-n1(s’) I ≤ 2}

(B) L = {s ∈ (0+1)* I no(s) mod 7 = n1(s) mod 5 = 0}


(C) L = {s ∈ (0+1)* I no(s) is a 3 digit prime}
(D) L = {s ∈ (0+1)* I no(s)-n1(s) I ≤ 4

View Answer / Hide Answer

ANSWER: L = {s ∈ (0+1)* I no(s)-n1(s) I ≤ 4

(20) Which one of the following statement is false?

(A) In Chomsky Normal Form the derivative trees of strings generated by a context-
free grammar are always binary trees
(B) If W is the string of a terminals and Y is a non-terminal, the language generated
by a context free grammar, all of whose productions are of the form x->W or X->WY
is always regular
(C) By using suitable transformation all ε-productions can be removed from any
context-free grammar.
(D) Every left recursive grammar can be converted to a right recursive grammar and
vice-versa

View Answer / Hide Answer

ANSWER: If W is the string of a terminals and Y is a non-terminal, the language


generated by a context free grammar, all of whose productions are of the form x-
>W or X->WY is

always regular

(21) State table of an FSM is given below. There are two states A And B, one
input and one output.

Let the initial state be A = 0 and B = 0. To take the machine to the state A = 0 and B
= 1 with output = 1 the minimum length of input string required will be

(A) 2
(B) 7
(C) 4
(D) 3

View Answer / Hide Answer

ANSWER: 3

For questions 22 and 23 refer to the data given below:

The figure shown below is a finite state automaton


(22) Which one of the following is true for this automaton?

(A) b*ab*ab*ab*
(B) b*a(a+b)*
(C) b*ab*ab*
(D) (a+b)*

View Answer / Hide Answer

ANSWER: b*a(a+b)*

(23) For the above FSA the equivalent minimum state automaton has the
following number of states

(A) 1
(B) 2
(C) 3
(D) 4

View Answer / Hide Answer

ANSWER: 2

(24) Out of the three decision problems P1, P2 and P3, P1 is decidable and P2
is undecidable. The statement that holds true is

(A) P3 is decidable if P3 is reducible to compliment of P2


(B) P3 is decidable if P1 is reducible to P3
(C) P3 is undecidable if P1 is reducible to P3
(D) P3 is undecidable if P2 is reducible to P3

View Answer / Hide Answer

ANSWER: P3 is undecidable if P2 is reducible to P3


(25) G = {S->SS, S->ab, S->ba, S->?} is the context free grammar whose
statements are given below:

a. G is ambiguous
b. G produces all strings with equal number of a’s and b’s.
c. Deterministic PDA accepts G

Which of the following statement is true about G?

(A) a, b, c all are true


(B) Only and b are true
(C) Only b and c are true
(D) Only a is true

View Answer / Hide Answer

ANSWER: a, b, c all are true

(26) The minimum number of states in any DFA accepting the regular language
L = (111+11111)* is

(A) 5
(B) 7
(C) 9
(D) 11

View Answer / Hide Answer

ANSWER: 9

(27) Consider the language L = {W I W ∈ {0, 1}*, where 0’s and 1’s in W are
divisible by 3 and 5 respectively. The minimum state deterministic finite
automaton accepting the language L has

(A) 20 states
(B) 5 states
(C) 10 states
(D) 15 states

View Answer / Hide Answer

ANSWER: 15 states
(28) We have an undirected graph G(V, E) with two problems given below:
α – Does G have an independent set of size IVI – 4?
β – Does G have an independent set of size 5?
The statement that holds true is

(A) α is NP-complete and β is in P


(B) α is in P and β is NP-complete
(C) Both α and β are NP-complete
(D) Both α and β are in P

View Answer / Hide Answer

ANSWER: α is in P and β is NP-complete

(29) Figure shows deterministic finite state automaton M. Let the set of seven
bit binary strings whose 1st, 4th and the last bits are 1 is denoted by S. How
many strings in S is accepted by M?

(A) 1
(B) 9
(C) 3
(D) 5

View Answer / Hide Answer

ANSWER: 5

(30) Which one of the following statement is true for a regular language L over
{a} whose minimal finite state automation has two states?

(A) L must be either {an I n is odd} or {an I n is even}


(B) L must be {an I n is odd}
(C) L must be {an I n is even}
(D) L must be {an I n = 0}
View Answer / Hide Answer

ANSWER: L must be either {an I n is odd} or {an I n is even}

(31) Consider a graph G = (V, E) where I V I is divisible by 3. The problem of


finding a Hamiltonian cycle in a graph is denoted by SHAM3 and the problem
of determining if a Hamiltonian cycle exits in such graph is denoted by
DHAM3. The option, which holds true, is

(A) Only DHAM3 is NP-hard


(B) Only SHAM3 is NP-hard
(C) Both SHAM3 and DHAM3 are NP-hard
(D) Neither SHAM3 nor DHAM3 is NP-hard

View Answer / Hide Answer

ANSWER: Both SHAM3 and DHAM3 are NP-hard

(32) Which one of the following is true for the language {am bn c m+n I m, n≥1}?

(A) It is context-free but not regular


(B) It is regular
(C) It is type-0 but not context-sensitive
(D) It is context-sensitive but not context-free

View Answer / Hide Answer

ANSWER: It is regular

(33) We have decision problems P1 and P2 as described below:

P1: Does a given finite state machine accept a given string?


P2: Does a given context-free grammar generate an infinite number of strings?

The statement that holds true for P1 and P2 is

(A) Only P2 is decidable


(B) Only P1 is decidable
(C) Neither P1 nor P2 are decidable
(D) Both P1 and P2 are decidable

View Answer / Hide Answer


ANSWER: Both P1 and P2 are decidable

(34) Problem X is given below:

We have a turing machine M over the input alphabet ∑, any state q of M and a word
W ∈ ∑*, does the computation of M on W visit the state q? The statement, which
holds true

about X, is

(A) X is undecidable but partially decidable


(B) X is decidable
(C) X is not a decision problem
(D) X is undecidable and not even partially decidable.

View Answer / Hide Answer

ANSWER: X is undecidable but partially decidable

(35) The state diagram describes the finite state machine. A is the starting
state and an arc label is x/y where x stands for 1 bit input and y stands for 2 bit
output

(A) Whenever the input sequence is 10 it outputs 00


(B) Whenever the input sequence is 11 it outputs 01
(C) It outputs the sum of the present and the previous bits of the input
(D) None of the above

View Answer / Hide Answer

ANSWER: It outputs the sum of the present and the previous bits of the input

(36) Which one of the following statement is true for the C language?
(A) It is a regular language
(B) It is context-sensitive language
(C) It is context-free language
(D) It is parsable fully only by a turing machine

View Answer / Hide Answer

ANSWER: It is context-free language

(37) How many states are present in the smallest finite automaton which
accepts the language {x I length of x is divisible by 3}?

(A) 5
(B) 4
(C) 3
(D) 2

View Answer / Hide Answer

ANSWER: 4

(38) The last two symbols of L which is the set of all binary strings are same. In
the minimum state deterministic finite state automaton, which is accepting L
_____, states are present

(A) 4
(B) 6
(C) 3
(D) 5

View Answer / Hide Answer

ANSWER: 5

(39) The true regular expression is

(A) (r*s*)* = (r+s)*


(B) (r+s)* = r* + s*
(C) r*s* = r* + s*
(D) r(*) = r*

View Answer / Hide Answer


ANSWER: (r*s*)* = (r+s)*

(40) Let n be the length of a character string. How many substrings (of all
lengths inclusive) can be formed from n?

(A) n(n-1)/2
(B) n²
(C) (n (n+1)/2) + 1
(D) n

View Answer / Hide Answer

ANSWER: (n (n+1)/2) + 1

(41) The set which is not countable if we have ∑ = {a, b}, is

(A) Set of all languages over ∑ accepted by turing machine


(B) Set of all regular languages over ∑
(C) Set of all strings over ∑
(D) Set of all languages over ∑

View Answer / Hide Answer

ANSWER: Set of all languages over ∑

(42) How many states are present in the minimum state finite automaton that
recognizes the language represented by the regular expression (0+1)(0+1)…..N
times?

(A) n+1
(B) n+2
(C) n
(D) 2n

View Answer / Hide Answer

ANSWER: n+2

(43) Consider the state table of a finite state machine that has input x and a
single output z. The shortest input sequence to reach the final state C if the
initial state is unknown is

(A) 10
(B) 01
(C) 101
(D) 110

View Answer / Hide Answer

ANSWER: 10

(44) The set that can be recognized by a deterministic finite state automaton is

(A) The set {1, 101, 11011, 1110111, …….}


(B) The set of binary string in which the number of 0’s is same as the number of 1’s
(C) 1, 2, 4, 8……2n ….. written in binary
(D) 1, 2, 4, 8……2n ….. written in unary

View Answer / Hide Answer

ANSWER: 1, 2, 4, 8……2n ….. written in binary

(45) Consider the four regular expressions given below;

a. (00)*( ε+0)
b. (00)*
c. 0*
d. 0(00)*

The equivalent regular expression out of the four is

(A) b and c
(B) c and d
(C) a and b
(D) a and c

View Answer / Hide Answer


ANSWER: a and c

(46) L1 = Φ and L2 = {a} are the two languages. Out of the following four
options the one that represents L1L2* U L1* is

(A) Φ
(B) a*
(C) {ε}
(D) {ε, a}

View Answer / Hide Answer

ANSWER: {ε}

(47) We have the language L = {ab, aa, baa} and the four strings given below:

I) abaabaaabaa
II) aaaabaaaa
III) baaaaabaaaab
IV) baaaaabaa

The strings present in L* are

(A) I, II and IV
(B) I, II and III
(C) II, III and IV
(D) I, III and IV

View Answer / Hide Answer

ANSWER: I, II and IV

(48) Which one of the following is true regarding FOTRAN?

(A) It is a context free language


(B) It is a context sensitive language
(C) It is a regular language
(D) None of the above

View Answer / Hide Answer

ANSWER: It is a context sensitive language


(49) The feature that cannot be captured by context free grammar is

(A) Recursive procedure Syntax


(B) Syntax of if-then-else statement
(C) Arbitrary length of variable names
(D) Variable declared before its use

View Answer / Hide Answer

ANSWER: Variable declared before its use

(50) Which one of the following is applicable for context free languages?

(A) These are closed under union, Kleene closure


(B) These are closed under complement, Kleene closure
(C) These are closed under union, intersection
(D) These are closed under intersection, complement

View Answer / Hide Answer

ANSWER: These are closed under union, Kleene closure

(51) S -> a α b I b a c I ab
S -> α S I b
S -> α bb I ab
S -> bdb I b

The grammar described above is

(A) Context free


(B) Context sensitive
(C) Regular
(D) LR(k)

View Answer / Hide Answer

ANSWER: Context sensitive

(52) Match the following


a. Regular expression I. Syntax analysis
b. Pushdown automata II Code generation
c. Dataflow analysis III Lexical analysis
d. Register allocation IV Code optimization

(A) a - III, b - IV, c - I, d - II


(B) a - IV, b - III, c - I, d - II
(C) a - III, b - I, c - IV, d - II
(D) a - II, b - III, c - IV, d - I

View Answer / Hide Answer

ANSWER: a - III, b - I, c - IV, d - II

(53) Which of the following statement is false for a turing machine?

(A) There exists an equivalent deterministic turing machine for every non-
deterministic turing machine
(B) Turing decidable languages are closed under intersection and complementation
(C) Turing recognizable languages are closed under union and intersection
(D) Turing recognizable languages are closed under union and complementation

View Answer / Hide Answer

ANSWER: Turing recognizable languages are closed under union and


complementation

(54) The problem, which is not NP-hard, is

(A) Finding bi-connected problem of a graph


(B) The graph colouring problem
(C) Hamiltonian circuit problem
(D) The 0/1 Knapsack problem

View Answer / Hide Answer

ANSWER: Hamiltonian circuit problem

(55) If P≠NP the statement which holds true is

(A) NP-hard = NP
(B) NP-complete ∩ P = Φ
(C) P=NP-complete
(D) NP-complete=NP

View Answer / Hide Answer

ANSWER: NP-complete ∩ P = Φ
FOR ALL SANFOUNDRY MCQ (1000+ MCQ)
JOIN telegram group >> https://t.me/edcsppu
Theory of Computation Questions and Answers –
Finite Automata-Introduction
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “Finite
Automata-Introduction”.

1. Assume the R is a relation on a set A, aRb is partially ordered such that a and b are
_____________
a) reflexive
b) transitive
c) symmetric
d) reflexive and transitive
View Answer

Answer: d
Explanation: A partially ordered relation refers to one which is Reflexive, Transitive and
Antisymmetric.
advertisement

2. The non- Kleene Star operation accepts the following string of finite length over set A =
{0,1} | where string s contains even number of 0 and 1
a) 01,0011,010101
b) 0011,11001100
c) ε,0011,11001100
d) ε,0011,11001100
View Answer

Answer: b
Explanation: The Kleene star of A, denoted by A*, is the set of all strings obtained by
concatenating zero or more strings from A.

3. A regular language over an alphabet ∑ is one that cannot be obtained from the basic
languages using the operation
a) Union
b) Concatenation
c) Kleene*
d) All of the mentioned
View Answer

Answer: d
Explanation: Union, Intersection, Concatenation, Kleene*, Reverse are all the closure properties
of Regular Language.
4. Statement 1: A Finite automata can be represented graphically; Statement 2: The nodes can be
its states; Statement 3: The edges or arcs can be used for transitions
Hint: Nodes and Edges are for trees and forests too.
Which of the following make the correct combination?
a) Statement 1 is false but Statement 2 and 3 are correct
b) Statement 1 and 2 are correct while 3 is wrong
c) None of the mentioned statements are correct
d) All of the mentioned
View Answer

Answer: d
Explanation: It is possible to represent a finite automaton graphically, with nodes for states, and
arcs for transitions.

5. The minimum number of states required to recognize an octal number divisible by 3 are/is
a) 1
b) 3
c) 5
d) 7
View Answer

Answer: b
Explanation: According to the question, minimum of 3 states are required to recognize an octal
number divisible by 3.
advertisement

6. Which of the following is a not a part of 5-tuple finite automata?


a) Input alphabet
b) Transition function
c) Initial State
d) Output Alphabet
View Answer

Answer: d
Explanation: A FA can be represented as FA= (Q, ∑, δ, q0, F) where Q=Finite Set of States,
∑=Finite Input Alphabet, δ=Transition Function, q0=Initial State, F=Final/Acceptance State).

7. If an Infinite language is passed to Machine M, the subsidiary which gives a finite solution to
the infinite input tape is ______________
a) Compiler
b) Interpreter
c) Loader and Linkers
d) None of the mentioned
View Answer

Answer: a
Explanation: A Compiler is used to give a finite solution to an infinite phenomenon. Example of
an infinite phenomenon is Language C, etc.
8. The number of elements in the set for the Language L={xϵ(∑r) *|length if x is at most 2} and
∑={0,1} is_________
a) 7
b) 6
c) 8
d) 5
View Answer

Answer: a
Explanation: ∑r= {1,0} and a Kleene* operation would lead to the following
set=COUNT{ε,0,1,00,11,01,10} =7.

9. For the following change of state in FA, which of the following codes is an incorrect option?
a) δ (m, 1) =n
b) δ (0, n) =m
c) δ (m,0) =ε
d) s: accept = false; cin >> char;
if char = “0” goto n;
View Answer

Answer: b
Explanation: δ(QX∑) = Q1 is the correct representation of change of state. Here, δ is called the
Transition function.
advertisement

10. Given: ∑= {a, b}


L= {xϵ∑*|x is a string combination}
∑4 represents which among the following?

a) {aa, ab, ba, bb}


b) {aaaa, abab, ε, abaa, aabb}
c) {aaa, aab, aba, bbb}
d) All of the mentioned
View Answer

Answer: b
Explanation: ∑* represents any combination of the given set while ∑x represents the set of
combinations with length x where x ϵ I.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
» Next - Automata Theory Questions and Answers – Moore Machine
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Stability Analysis of Finite Slopes
Geotechnical Engineering Questions and Answers – The Swedish Slip Circle Method
advertisement
advertisement

Recommended Posts:

1. Computer Science Questions and Answers


2. C Algorithms, Problems & Programming Examples
3. Artificial Intelligence Questions and Answers
4. Software Architecture & Design Questions and Answers
5. Cryptography and Network Security Questions and Answers
6. Control Systems Questions and Answers
7. Discrete Mathematics Questions and Answers
8. Ruby Programming Questions and Answers
9. VLSI Questions and Answers
10. Geotechnical Engineering I Questions and Answers
11. Home
12. Theory of Machines Questions and Answers
13. C++ Programming Examples on Set & String Problems & Algorithms
14. Electromagnetic Theory Questions and Answers
15. Java Programming Examples on Set & String Problems & Algorithms
16. C Programming Examples on Set & String Problems & Algorithms
17. Compilers Questions and Answers
18. Network Theory Questions and Answers
19. Automata Theory Questions and Answers
20. Automata Theory Questions and Answers – Programming Techniques-Storage and
Subroutines
advertisement

Automata Theory Questions and Answers


– Moore Machine
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Moore Machine”.

1. Moore Machine is an application of:


a) Finite automata without input
b) Finite automata with output
c) Non- Finite automata with output
d) None of the mentioned
View Answer

Answer: b
Explanation: Finite automaton with an output is categorize din two parts: Moore M/C and Mealy
M/C.
advertisement

2. In Moore machine, output is produced over the change of:


a) transitions
b) states
c) Both
d) None of the mentioned
View Answer

Answer: b
Explanation: Moore machine produces an output over the change of transition states while
mealy machine does it so for transitions itself.

3. For a give Moore Machine, Given Input=’101010’, thus the output would be of length:
a) |Input|+1
b) |Input|
c) |Input-1|
d) Cannot be predicted
View Answer

Answer: a
Explanation: Initial state, from which the operations begin is also initialized with a value.

4. Statement 1: Null string is accepted in Moore Machine.


Statement 2: There are more than 5-Tuples in the definition of Moore Machine.

Choose the correct option:


a) Statement 1 is true and Statement 2 is true
b) Statement 1 is true while Statement 2 is false
c) Statement 1 is false while Statement 2 is true
d) Statement 1 and Statement 2, both are false
View Answer

Answer: a
Explanation: Even ε, when passed as an input to Moore machine produces an output.
advertisement

5. The total number of states and transitions required to form a moore machine that will produce
residue mod 3.
a) 3 and 6
b) 3 and 5
c) 2 and 4
d) 2 and 5
View Answer
Answer: a
Explanation:

6. Complete the given table according to the given Moore machine.

Present State
Next State
Output

0
1

Q0
Q1
Q2
1
Q1
Q2
advertisement

1
Q2

Q0

a) Q0, Q2, 0
b) Q0, Q2, 1
c) Q1, Q2, 1
d) Q1, Q0, 0
View Answer

Answer: a
Explanation: The table can be filled accordingly seeing the graph.
7. What is the output for the given language?
Language: A set of strings over ∑= {a, b} is taken as input and it prints 1 as an output “for every
occurrence of a, b as its substring. (INPUT: abaaab)
a) 0010001
b) 0101010
c) 0111010
d) 0010000
View Answer

Answer: a
Explanation: The outputs are as per the input, produced.

8. The output alphabet can be represented as:


a) δ
b) ∆
c) ∑
d) None of the mentioned
View Answer

Answer: b
Explanation: Source-The tuple definition of Moore and mealy machine comprises one new
member i.e. output alphabet as these are finite machines with output.
advertisement

9. The O/P of Moore machine can be represented in the following format:


a) Op(t)=δ(Op(t))
b) Op(t)=δ(Op(t)i(t))
c) Op(t): ∑
d) None of the mentioned
View Answer

Answer: a
Explanation: Op(t)=δ(Op(t)) is the defined definition of how the output is received on giving a
specific input to Moore machine.

10. Which of the following is a correct statement?


a) Moore machine has no accepting states
b) Mealy machine has accepting states
c) We can convert Mealy to Moore but not vice versa
d) All of the mentioned
View Answer

Answer: a
Explanation: Statement a and b is correct while c is false. Finite machines with output have no
accepting states and can be converted within each other.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.
Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Finite Automata-Introduction
» Next - Automata Theory Questions and Answers – Mealy Machine
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – The Swedish Slip Circle Method
Geotechnical Engineering Questions and Answers – Friction Circle Method
advertisement
advertisement

Recommended Posts:

1. VLSI Questions and Answers


2. Computer Science Questions and Answers
3. Wireless & Mobile Communications Questions & Answers
4. Geotechnical Engineering I Questions and Answers
5. Network Theory Questions and Answers
6. VHDL Questions and Answers
7. Machine Dynamics Questions and Answers
8. Machine Design Questions and Answers
9. Machine Drawing Questions and Answers
10. Compilers Questions and Answers
11. Electromagnetic Theory Questions and Answers
12. Machine Kinematics Questions and Answers
13. Theory of Machines Questions and Answers
14. Machine Tools & Machining Questions and Answers
15. Java Programming Examples on Set & String Problems & Algorithms
16. C Programming Examples on Set & String Problems & Algorithms
17. C++ Programming Examples on Set & String Problems & Algorithms
18. Automata Theory Questions and Answers
19. Automata Theory Questions and Answers – Uses of Epsilon-Transitions
20. Automata Theory Questions and Answers – From Grammars to Push Down Automata
advertisement

Automata Theory Questions and Answers – Mealy


Machine
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “Mealy
Machine”.

1. In mealy machine, the O/P depends upon?


a) State
b) Previous State
c) State and Input
d) Only Input
View Answer

Answer: c
Explanation: Definition of Mealy Machine.
advertisement

2. Which of the given are correct?


a) Moore machine has 6-tuples
b) Mealy machine has 6-tuples
c) Both Mealy and Moore has 6-tuples
d) None of the mentioned
View Answer

Answer: c
Explanation: Finite Automaton with Output has a common definition for both the categories.

3. The following mealy machine outputs which of the following?

a) 9’s Complement
b) 2’s Complement
c) 1’s Complement
d) 10’s Complement
View Answer

Answer: b
Explanation: The input can be taken in form of a binary string and can be verified.

4. The O/P of Mealy machine can be represented in the following format:


a) Op(t)= δ(Op(t))
b) Op(t)= δ(Op(t)i(t))
c) Op(t): ∑
d) None of the mentioned
View Answer

Answer: b
Explanation: The output of mealy machine depends on the present state as well as the input to
that state.
advertisement

5.The ratio of number of input to the number of output in a mealy machine can be given as:
a) 1
b) n: n+1
c) n+1: n
d) None of the mentioned
View Answer

Answer: a
Explanation: The number of output here follows the transitions in place of states as in Moore
machine.

6. Mealy and Moore machine can be categorized as:


a) Inducers
b) Transducers
c) Turing Machines
d) Linearly Bounder Automata
View Answer

Answer: b
Explanation: They are collectively known as Transducers.

7. The major difference between Mealy and Moore machine is about:


a) Output Variations
b) Input Variations
c) Both
d) None of the mentioned
View Answer

Answer: a
Explanation: Mealy and Moore machine vary over how the outputs depends on prior one
(transitions) and on the latter one(states).
advertisement

8. Statement 1: Mealy machine reacts faster to inputs.


Statement 2: Moore machine has more circuit delays.
Choose the correct option:
a) Statement 1 is true and Statement 2 is true
b) Statement 1 is true but Statement 2 is false
c) Statement 1 is false and Statement 2 is true
d) None of the mentioned is true
View Answer

Answer: a
Explanation: Being an input dependent and output capable FSM, Mealy machine reacts faster to
inputs.
9. Which of the following does the given Mealy machine represents?

a) 9’s Complement
b) 2’s Complement
c) 1’s Complement
d) 10’s Complement
View Answer

Answer: c
Explanation: Inputs can be taken and can be verified.

10. Which one among the following is true?


A mealy machine
a) produces a language
b) produces a grammar
c) can be converted to NFA
d) has less circuit delays
View Answer

Answer: d
Explanation: It does not produce a language or a grammar or can be converted to a NFA.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Moore Machine
» Next - Automata Theory Questions and Answers – Mealy Machine-II
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Friction Circle Method
Automata Theory Questions and Answers – Mealy Machine-II
advertisement
advertisement

Recommended Posts:

1. VLSI Questions and Answers


2. Information Science Questions and Answers
3. Agricultural Engineering Questions and Answers
4. Discrete Mathematics Questions and Answers
5. Artificial Intelligence Questions and Answers
6. Computer Science Questions and Answers
7. Compilers Questions and Answers
8. Java Programming Examples on Set & String Problems & Algorithms
9. Network Theory Questions and Answers
10. Machine Dynamics Questions and Answers
11. Machine Design Questions and Answers
12. Machine Kinematics Questions and Answers
13. Electromagnetic Theory Questions and Answers
14. Theory of Machines Questions and Answers
15. Machine Drawing Questions and Answers
16. VHDL Questions and Answers
17. C++ Programming Examples on Set & String Problems & Algorithms
18. C Programming Examples on Set & String Problems & Algorithms
19. Machine Tools & Machining Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers – Mealy


Machine-II
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “Mealy
Machine-II”.

1. Which of the following does not belong to input alphabet if S={a, b}* for any language?
a) a
b) b
c) e
d) none of the mentioned
View Answer

Answer: c
Explanation: The automaton may be allowed to change its state without reading the input
symbol using epsilon but this does not mean that epsilon has become an input symbol. On the
contrary, one assumes that the symbol epsilon does not belong to any alphabet.
advertisement

2. The number of final states we need as per the given language?


Language L: {an| n is even or divisible by 3}
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: b
Explanation:

3. An e-NFA is ___________ in representation.


a) Quadruple
b) Quintuple
c) Triple
d) None of the mentioned
View Answer

Answer: b
Explanation: An e-NFA consist of 5 tuples: A=(Q, S, d, q0. F)
Note: e is never a member of S.

4. State true or false:


Statement: Both NFA and e-NFA recognize exactly the same languages.
a) true
b) false
View Answer

Answer: a
Explanation: e-NFA do come up with a convenient feature but nothing new.They do not extend
the class of languages that can be represented.
advertisement

5. Design a NFA for the language:


L: {an| n is even or divisible by 3}
Which of the following methods can be used to simulate the same.
a) e-NFA
b) Power Construction Method
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: It is more convenient to simulate a machine using e-NFA else the method of Power
Construction is used from the union-closure of DFA’s.

6. Which of the following belongs to the epsilon closure set of a?

a) {f1, f2, f3}


b) {a, f1, f2, f3}
c) {f1, f2}
d) none of the mentioned
View Answer

Answer: b
Explanation: The epsilon closure of the set q is the set that contains q, together with all the states
which can be reached starting at q by following only epsilon transitions.

7. The number of elements present in the e-closure(f2) in the given diagram:

a) 0
b) 1
c) 2
d) 3
View Answer
Answer: c
Explanation: The epsilon closure set of f2 consist of the elements:{f2, f3}. Thus the count of the
element in the closure set is 2.
advertisement

8. Which of the steps are non useful while eliminating the e-transitions for the given diagram?

a) Make a as accepting state of N’ if ECLOSE(p) contains an accepting state of N


b) Add an arc a to f1 labelled a if there is an arc labelled a in N from some state in ECLOSE(a)
to f1
c) Delete all arcs labelled as e
d) None of the mentioned
View Answer

Answer: d
Explanation: The given are the steps followed while eliminating epsilon transitions from a NFA
or converting an e-NFA to just NFA.

9. Is the language preserved in all the steps while eliminating epsilon transitions from a NFA?
a) yes
b) no
View Answer

Answer: a
Explanation: Yes, the language is preserved during the dteps of construction:
L(N)=L(N1)=L(N2)=L(3).

10. Remove all the epsilon transitions in the given diagram and compute the number of a-
transitions in the result?
a) 5
b) 7
c) 9
d) 6
View Answer

Answer: b
Explanation:

advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Mealy Machine
» Next - Automata Theory Questions and Answers – Deterministic Finite Automata-
Introduction and Definition
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Mealy Machine
Automata Theory Questions and Answers – Deterministic Finite Automata-Introduction and
Definition
advertisement
advertisement

Recommended Posts:

1. VLSI Questions and Answers


2. Information Science Questions and Answers
3. Computer Science Questions and Answers
4. C Algorithms, Problems & Programming Examples
5. Artificial Intelligence Questions and Answers
6. Chemical Engineering Questions and Answers
7. CSS Questions and Answers
8. C++ Programming Examples on Set & String Problems & Algorithms
9. Discrete Mathematics Questions and Answers
10. Machine Dynamics Questions and Answers
11. Machine Design Questions and Answers
12. Machine Kinematics Questions and Answers
13. Machine Tools & Machining Questions and Answers
14. Machine Drawing Questions and Answers
15. Solid State Chemistry Questions and Answers
16. Electromagnetic Theory Questions and Answers
17. Network Theory Questions and Answers
18. Theory of Machines Questions and Answers
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Deterministic Finite Automata-Introduction and
Definition
« Prev
Next »

This set of Automata Theory Interview Questions and Answers focuses on “Deterministic Finite
Automata-Introduction and Definition”.

1. Which of the following not an example Bounded Information?


a) fan switch outputs {on, off}
b) electricity meter reading
c) colour of the traffic light at the moment
d) none of the mentioned
View Answer

Answer: b
Explanation: Bounded information refers to one whose output is limited and it cannot be said
what were the recorded outputs previously until memorized.
advertisement

2. A Language for which no DFA exist is a________


a) Regular Language
b) Non-Regular Language
c) May be Regular
d) Cannot be said
View Answer

Answer: b
Explanation: A language for which there is no existence of a deterministic finite automata is
always Non Regular and methods like Pumping Lemma can be used to prove the same.

3. A DFA cannot be represented in the following format


a) Transition graph
b) Transition Table
c) C code
d) None of the mentioned
View Answer

Answer: d
Explanation: A DFA can be represented in the following formats: Transition Graph, Transition
Table, Transition tree/forest/Any programming Language.

4. What the following DFA accepts?

a) x is a string such that it ends with ‘101’


b) x is a string such that it ends with ‘01’
c) x is a string such that it has odd 1’s and even 0’s
d) x is a strings such that it has starting and ending character as 1
View Answer

Answer: a
Explanation: Strings such as {1101,101,10101} are being accepted while {1001,11001} are not.
Thus, this conclusion leads to option a.
advertisement

5. When are 2 finite states equivalent?


a) Same number of transitions
b) Same number of states
c) Same number of states as well as transitions
d) Both are final states
View Answer

Answer: c
Explanation: Two states are said to be equivalent if and only if they have same number of states
as well as transitions.

6. What does the following figure most correctly represents?

a) Final state with loop x


b) Transitional state with loop x
c) Initial state as well as final state with loop x
d) Insufficient Data
View Answer

Answer: c
Explanation: The figure represents the initial as well as the final state with an iteration of x.

7. Which of the following will not be accepted by the following DFA?


a) ababaabaa
b) abbbaa
c) abbbaabb
d) abbaabbaa
View Answer

Answer: a
Explanation: All the Strings are getting accepted except ‘ababaabaa’ as it is directed to dumping
state. Dumping state also refers to the reject state of the automata.
advertisement

8. Which of the following will the given DFA won’t accept?

a) ε
b) 11010
c) 10001010
d) String of letter count 11
View Answer

Answer: a
Explanation: As the initial state is not made an acceptance state, thus ε will not be accepted by
the given DFA. For the automata to accept ε as an entity, one should make the initial state as
also the final state.

9. Can a DFA recognize a palindrome number?


a) Yes
b) No
c) Yes, with input alphabet as ∑*
d) Can’t be determined
View Answer

Answer: b
Explanation: Language to accept a palindrome number or string will be non-regular and thus, its
DFA cannot be obtained. Though, PDA is possible.
10. Which of the following is not an example of finite state machine system?
a) Control Mechanism of an elevator
b) Combinational Locks
c) Traffic Lights
d) Digital Watches
View Answer

Answer: d
Explanation: Proper and sequential combination of events leads the machines to work in hand
which includes The elevator, Combinational Locks, Traffic Lights, vending machine, etc. Other
applications of Finite machine state system are Communication Protocol Design, Artificial
Intelligence Research, A Turnstile, etc.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory for Interviews, here is complete set of 1000+ Multiple
Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Mealy Machine-II
» Next - Automata Theory Questions and Answers – DFA Processing Strings
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Mealy Machine-II
Geotechnical Engineering Questions and Answers – Taylor’s Stability Number and Curves
advertisement
advertisement

Recommended Posts:

1. VLSI Questions and Answers


2. Solid State Chemistry Questions and Answers
3. Artificial Intelligence Questions and Answers
4. Ruby Programming Questions and Answers
5. C Algorithms, Problems & Programming Examples
6. C# Questions and Answers
7. Home
8. C Programming Examples on Strings
9. Python Questions and Answers
10. PHP Questions and Answers
11. C# Programming Examples on Strings
12. Electromagnetic Theory Questions and Answers
13. Java Programming Examples on String Handling
14. Theory of Machines Questions and Answers
15. Network Theory Questions and Answers
16. Java Programming Examples on Set & String Problems & Algorithms
17. Compilers Questions and Answers
18. C Programming Examples on Set & String Problems & Algorithms
19. C++ Programming Examples on Set & String Problems & Algorithms
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers – DFA


Processing Strings
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “DFA
Processing Strings”.

1. The password to the admins account=”administrator”. The total number of states required to
make a password-pass system using DFA would be __________
a) 14 states
b) 13 states
c) 12 states
d) A password pass system cannot be created using DFA
View Answer

Answer: a
Explanation: For a string of n characters with no repetitive substrings, the number of states
required to pass the string is n+1.
advertisement

2. Which of the following is the corresponding Language to the given DFA?

a) L= {x ϵ {0, 1} * | x ends in 1 and does not contain substring 01}


b) L= {x ϵ {0,1} * |x ends in 1 and does not contain substring 00}
c) L= {x ϵ {0,1} |x ends in 1 and does not contain substring 00}
d) L= {x ϵ {0,1} * |x ends in 1 and does not contain substring 11}
View Answer

Answer: b
Explanation: The Language can be anonymously checked and thus the answer can be predicted.
The language needs to be accepted by the automata (acceptance state) in order to prove its
regularity.

3. Let ∑= {a, b, …. z} and A = {Hello, World}, B= {Input, Output}, then (A*∩B) U (B*∩A)
can be represented as:
a) {Hello, World, Input, Output, ε}
b) {Hello, World, ε}
c) {Input, Output, ε}
d) {}
View Answer

Answer: d
Explanation: Union operation creates the universal set by combining all the elements of first and
second set while intersection operation creates a set of common elements of the first and the
second state.

4. Let the given DFA consist of x states. Find x-y such that y is the number of states on
minimization of DFA?

a) 3
b) 2
c) 1
d) 4
View Answer

Answer: b
Explanation: Use the equivalence theorem or Myphill Nerode theorem to minimize the DFA.
advertisement
5. For a machine to surpass all the letters of alphabet excluding vowels, how many number of
states in DFA would be required?
a) 3
b) 2
c) 22
d) 27
View Answer

Answer: a
Explanation:

6. For the DFA given below compute the following:


Union of all possible combinations at state 7,8 and 9.

a) {aba, ac, cc, ca, cb, bc, bab, ca}


b) {bab, bc, ac, aba, ca, aac, ccb}
c) {cc, ca, cb, aba, bab, ac}
d) {aba, ac, cc, ca, cb, bc, bab, caa}
View Answer

Answer: d
Explanation: The string a state receives is the combination of all input alphabets which lie across
the path covered.

7. Given L= {Xϵ∑*= {a, b} |x has equal number of a, s and b’s}.


Which of the following property satisfy the regularity of the given language?
a) Regularity is dependent upon the length of the string
b) Regularity is not dependent upon the length of the string
c) Can’t be said for a particular string of a language
d) It may depend on the length of the string
View Answer

Answer: b
Explanation: DFA can be made for infinite language with an infinite length. Thus, dependency
over length is unfruitful.
advertisement

8. Given:
L= {xϵ∑= {0,1} |x=0n1n for n>=1}; Can there be a DFA possible for the language?
a) Yes
b) No
View Answer

Answer: b
Explanation: It is not possible to have a count of equal number of 0 and 1 at any instant in DFA.
Thus, It is not possible to build a DFA for the given Language.

9. δ(A,1) = B, δ(A,0) =A
Δ (B, (0,1)) =C
δ(C,0) = A (Initial state =A)
String=”011001” is transit at which of the states?
a) A
b) C
c) B
d) Invalid String
View Answer

Answer: a
Explanation: It is east and simple to create the table and then the corresponding transition graph
in order to get the result, at which state the given string would be accepted.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.
advertisement
Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Deterministic Finite Automata-Introduction
and Definition
» Next - Automata Theory Questions and Answers – Simpler Notations
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Minimum Depth of Foundation: Rankine’s
Analysis
Automata Theory Questions and Answers – Simpler Notations
advertisement
advertisement

Recommended Posts:

1. Artificial Intelligence Questions and Answers


2. Computer Science Questions and Answers
3. LISP Questions and Answers
4. Solid State Chemistry Questions and Answers
5. Java Programming Examples on Java.Lang
6. Java Programming Examples on String Handling
7. Compilers Questions and Answers
8. Java Programming Examples on Set & String Problems & Algorithms
9. Theory of Machines Questions and Answers
10. Digital Signal Processing Questions and Answers
11. Electromagnetic Theory Questions and Answers
12. Network Theory Questions and Answers
13. Digital Image Processing Questions and Answers
14. C++ Programming Examples on Set & String Problems & Algorithms
15. C Programming Examples on Set & String Problems & Algorithms
16. C Programming Examples on Strings
17. C# Programming Examples on Strings
18. Automata Theory Questions and Answers
19. Automata Theory Questions and Answers – Uses of Epsilon-Transitions
20. Automata Theory Questions and Answers – Regular Language & Expression – 2
advertisement

Automata Theory Questions and Answers –


Simpler Notations
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Simpler Notations”.
1.Given Language: L= {xϵ∑= {a, b} |x has a substring ‘aa’ in the production}. Which of the
corresponding representation notate the same?
a)

advertisement

b)

c)

d)

View Answer
Answer: a
Explanation: The states transited has been written corresponding to the transitions as per the row
and column. The row represents the transitions made and the ultimate.

2.Let u=’1101’, v=’0001’, then uv=11010001 and vu= 00011101.Using the given information
what is the identity element for the string?
a) u-1
b) v-1
c) u-1v-1
d) ε
View Answer

Answer: d
Explanation: Identity relation: εw = wε = w, thus the one satisfying the given relation will be the
identity element.
advertisement

3.Which of the following substring will the following notation result?


a) 0101011
b) 0101010
c) 010100
d) 100001
View Answer

Answer: c
Explanation: The given DFA notation accepts the string of even length and prefix ‘01’.

4.Predict the following step in the given bunch of steps which accepts a strings which is of even
length and has a prefix=’01’
δ (q0, ε) =q0 < δ(q0,0) =δ (δ (q0, ε),0) =δ(q0,0) =q1 < _______________
a) δ (q0, 011) =δ (δ (q0,1), 1) =δ (q2, 1) =q3
b) δ (q0, 01) =δ (δ (q0, 0), 1) = δ (q1, 1) =q2
c) δ (q0, 011) =δ (δ (q01, 1), 1) =δ (q2, 0) =q3
d) δ (q0, 0111) =δ (δ (q0, 011), 0) = δ (q3, 1) =q2
View Answer

Answer: b
Explanation: Here, δ refers to transition function and results into new state or function when an
transition is performed over its state.

5. Fill the missing blank in the given Transition Table:


Language L= {xϵ∑= {0,1} |x accepts all the binary strings not divisible by 3}

a) Q0
b) Q1
c) Q2
d) No Transition
View Answer

Answer: Q1
Explanation: The tabular representation of DFA is quite readable and can be used to some ore
complex problems. Here, we need to form the transition graph and fill up the given blank.
advertisement

6.Which among the following is the missing transition in the given DFA?
L= {xϵ∑= {a, b} | x starts with a and ends with b}
a) δ (q0, a) =q0
b) δ (F, a) =q1
c) δ (F, a) =D
d) δ (q1, a) =D
View Answer

Answer: b
Explanation: For the given Language, the transition missing is δ (F, a) =q1.

7.The complement of a language will only be defined when and only when the __________ over
the language is defined.
a) String
b) Word
c) Alphabet
d) Grammar
View Answer

Answer: c
Explanation: It is not possible to define the complement of a language without defining the input
alphabets. Example: A language which does not consist of substring ‘ab’ while the complement
would be the language which does contain a substring ‘ab’.

8.Which among the following is not notated as infinite language?


a) Palindrome
b) Reverse
c) Factorial
d) L={ab}*
View Answer

Answer: Factorial
Explanation: Factorial, here is the most appropriate non-infinite domain. Otherwise, palindrome
and reverse have infinite domains.
9.Which among the following states would be notated as the final state/acceptance state?
L= {xϵ∑= {a, b} | length of x is 2}

a) q1
b) q2
c) q1, q2
d) q3
View Answer

Answer: b
Explanation: According to the given language, q2 Is to become the final/acceptance state in
order to satisfy.
advertisement

10.Which of the following are the final states in the given DFA according to the Language
given.?
L= {xϵ∑= {a, b} |length of x is at most 2}

a) q0, q1
b) q0, q2
c) q1, q2
d) q0, q1, q2
View Answer

Answer: d
Explanation: According to the given language, the length is at most 2, thus the answer is found
accordingly.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – DFA Processing Strings
» Next - Automata Theory Questions and Answers – The Language of DFA
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – DFA Processing Strings
Geotechnical Engineering Questions and Answers – Types of Bearing Capacity Failures
advertisement
advertisement

Recommended Posts:

1. Information Science Questions and Answers


2. Artificial Intelligence Questions and Answers
3. Computer Science Questions and Answers
4. C# Programming Examples on Strings
5. Java Programming Examples on Set & String Problems & Algorithms
6. Compilers Questions and Answers
7. Solid State Chemistry Questions and Answers
8. C Programming Examples on Strings
9. Java Programming Examples on String Handling
10. Theory of Machines Questions and Answers
11. C++ Programming Examples on Set & String Problems & Algorithms
12. Electromagnetic Theory Questions and Answers
13. C Programming Examples on Set & String Problems & Algorithms
14. Network Theory Questions and Answers
15. Automata Theory Questions and Answers
16. Automata Theory Questions and Answers – Uses of Epsilon-Transitions
17. Automata Theory Questions and Answers – Testing Emptiness and Membership
18. Automata Theory Questions and Answers – Pumping Lemma for Regular Language
19. Automata Theory Questions and Answers – Regular Expression-Introduction
20. Automata Theory Questions and Answers – Moore Machine
advertisement
Automata Theory Questions and Answers – The
Language of DFA
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “The
Language of DFA”

1. How many languages are over the alphabet R?


a) countably infinite
b) countably finite
c) uncountable finite
d) uncountable infinite
View Answer

Answer: d
Explanation: A language over an alphabet R is a set of strings over A which is uncountable and
infinite.
advertisement

2. According to the 5-tuple representation i.e. FA= {Q, ∑, δ, q, F}


Statement 1: q ϵ Q’; Statement 2: FϵQ
a) Statement 1 is true, Statement 2 is false
b) Statement 1 is false, Statement 2 is true
c) Statement 1 is false, Statement 2 may be true
d) Statement 1 may be true, Statement 2 is false
View Answer

Answer: b
Explanation: Q is the Finite set of states, whose elements i.e. the states constitute the finite
automata.

3. δˆ tells us the best:


a) how the DFA S behaves on a word u
b) the state is the dumping state
c) the final state has been reached
d) Kleene operation is performed on the set
View Answer

Answer: a
Explanation: δ or the Transition function describes the best, how a DFA behaves on a string
where to transit next, which direction to take.

4. Which of the following option is correct?


A= {{abc, aaba}. {ε, a, bb}}
a) abcbb ₵ A
b) ε₵A
c) ε may not belong to A
d) abca ₵ A
View Answer

Answer: b
Explanation: As the question has dot operation, ε will not be a part of the concatenated set. Had
it been a union operation, ε would be a part of the operated set.
advertisement

5. For a DFA accepting binary numbers whose decimal equivalent is divisible by 4, what are all
the possible remainders?
a) 0
b) 0,2
c) 0,2,4
d) 0,1,2,3
View Answer

Answer: d
Explanation: All the decimal numbers on division would lead to only 4 remainders i.e. 0,1,2,3
(Property of Decimal division).

6. Which of the following x is accepted by the given DFA (x is a binary string ∑= {0,1})?

a) divisible by 3
b) divisible by 2
c) divisible by 2 and 3
d) divisible by 3 and 2
View Answer

Answer: d
Explanation: The given DFA accepts all the binary strings such that they are divisible by 3 and
2.Thus, it can be said that it also accepts all the strings which is divisible by 6.

7. Given:
L1= {xϵ ∑*|x contains even no’s of 0’s}
L2= {xϵ ∑*|x contains odd no’s of 1’s}
No of final states in Language L1 U L2?
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: c
Explanation:

advertisement

8. The maximum number of transition which can be performed over a state in a DFA?
∑= {a, b, c}
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: c
Explanation: The maximum number of transitions which a DFA allows for a language is the
number of elements the transitions constitute.

9. The maximum sum of in degree and out degree over a state in a DFA can be determined as:
∑= {a, b, c, d}
a) 4+4
b) 4+16
c) 4+0
d) depends on the Language
View Answer

Answer: d
Explanation: The out degree for a DFA I fixed while the in degree depends on the number of
states in the DFA and that cannot be determined without the dependence over the Language.
10. The sum of minimum and maximum number of final states for a DFA n states is equal to:
a) n+1
b) n
c) n-1
d) n+2
View Answer

Answer: a
Explanation: The maximum number of final states for a DFA can be total number of states itself
and minimum would always be 1, as no DFA exits without a final state. Therefore, the solution
is n+1.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Simpler Notations
» Next - Automata Theory Questions and Answers – Finite Automata
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Types of Bearing Capacity Failures
Automata Theory Questions and Answers – Finite Automata
advertisement
advertisement

Recommended Posts:

1. Geotechnical Engineering I Questions and Answers


2. Artificial Intelligence Questions and Answers
3. Hydraulic Machines Questions and Answers
4. Information Science Questions and Answers
5. Thermodynamics Questions and Answers
6. Computer Science Questions and Answers
7. Simple Java Programs
8. Electric Circuits Questions and Answers
9. Ruby Programming Questions and Answers
10. VLSI Questions and Answers
11. Simple C Programs
12. Discrete Mathematics Questions and Answers
13. Java Programming Examples on Set & String Problems & Algorithms
14. Theory of Machines Questions and Answers
15. C++ Programming Examples on Set & String Problems & Algorithms
16. Electromagnetic Theory Questions and Answers
17. Compilers Questions and Answers
18. C Programming Examples on Set & String Problems & Algorithms
19. Network Theory Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers – Finite


Automata
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Regular Language & Expression”.

1. There are ________ tuples in finite state machine.


a) 4
b) 5
c) 6
d) unlimited
View Answer

Answer:b
Explanation: States, input symbols,initial state,accepting state and transition function.
advertisement

2. Transition function maps.


a) Σ * Q -> Σ
b) Q * Q -> Σ
c) Σ * Σ -> Q
d) Q * Σ -> Q
View Answer

Answer:d
Explanation: Inputs are state and input string output is states.

3. Number of states require to accept string ends with 10.


a) 3
b) 2
c) 1
d) can’t be represented.
View Answer

Answer:a
Explanation: This is minimal finite automata.

4. Extended transition function is .


a) Q * Σ* -> Q
b) Q * Σ -> Q
c) Q* * Σ* -> Σ
d) Q * Σ -> Σ
View Answer

Answer:a
Explanation: This takes single state and string of input to produce a state.

5. δ*(q,ya) is equivalent to .
a) δ((q,y),a)
b) δ(δ*(q,y),a)
c) δ(q,ya)
d) independent from δ notation
View Answer

Answer:b
Explanation: First it parse y string after that it parse a.
advertisement

6. String X is accepted by finite automata if .


a) δ*(q,x) E A
b) δ(q,x) E A
c) δ*(Q0,x) E A
d) δ(Q0,x) E A
View Answer

Answer:c
Explanation: If automata starts with starting state and after finite moves if reaches to final step
then it called accepted.

7. Languages of a automata is
a) If it is accepted by automata
b) If it halts
c) If automata touch final state in its life time
d) All language are language of automata
View Answer

Answer:a
Explanation: If a string accepted by automata it is called language of automata.

8. Language of finite automata is.


a) Type 0
b) Type 1
c) Type 2
d) Type 3
View Answer

Answer:d
Explanation: According to Chomsky classification.

9. Finite automata requires minimum _______ number of stacks.


a) 1
b) 0
c) 2
d) None of the mentioned
View Answer

Answer:b
Explanation: Finite automata doesn’t require any stack operation .
advertisement

10. Number of final state require to accept Φ in minimal finite automata.


a) 1
b) 2
c) 3
d) None of the mentioned
View Answer

Answer:d
Explanation: No final state requires.

11. Regular expression for all strings starts with ab and ends with bba is.
a) aba*b*bba
b) ab(ab)*bba
c) ab(a+b)*bba
d) All of the mentioned
View Answer

Answer:c
Explanation: Starts with ab then any number of a or b and ends with bba.

12. How many DFA’s exits with two states over input alphabet {0,1} ?
a) 16
b) 26
c) 32
d) 64
View Answer

Answer:d
Explanation: Number of DFA’s = 2n * n(2*n).

13. The basic limitation of finite automata is that


a) It can’t remember arbitrary large amount of information.
b) It sometimes recognize grammar that are not regular.
c) It sometimes fails to recognize regular grammar.
d) All of the mentioned
View Answer

Answer:a
Explanation:Because there is no memory associated with automata.
advertisement
14. Number of states require to simulate a computer with memory capable of storing ‘3’ words
each of length ‘8’.
a) 3 * 28
b) 2(3*8)
c) 2(3+8)
d) None of the mentioned
View Answer

Answer:b
Explanation: 2(m*n) states requires .

15. FSM with output capability can be used to add two given integer in binary representation.
This is
a) True
b) False
c) May be true
d) None of the mentioned
View Answer

Answer:a
Explanation: Use them as a flip flop output .

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – The Language of DFA
» Next - Automata Theory Questions and Answers – Non Deterministic Finite Automata –
Introduction
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – The Language of DFA
Geotechnical Engineering Questions and Answers – Terzaghi’s Analysis
advertisement
advertisement

Recommended Posts:

1. Computer Science Questions and Answers


2. C# Programming Examples on Strings
3. C# Programming Examples on Functions
4. R Programming Questions and Answers
5. Ruby Programming Questions and Answers
6. Discrete Mathematics Questions and Answers
7. LISP Questions and Answers
8. C Programming Examples on Strings
9. VLSI Questions and Answers
10. C Questions and Answers
11. C++ Questions and Answers
12. C Algorithms, Problems & Programming Examples
13. Theory of Machines Questions and Answers
14. Compilers Questions and Answers
15. Electromagnetic Theory Questions and Answers
16. Network Theory Questions and Answers
17. Java Programming Examples on Set & String Problems & Algorithms
18. C++ Programming Examples on Set & String Problems & Algorithms
19. C Programming Examples on Set & String Problems & Algorithms
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers – Non


Deterministic Finite Automata – Introduction
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “Non
Deterministic Finite Automata – Introduction”

1. Which of the following options is correct?


Statement 1: Initial State of NFA is Initial State of DFA.
Statement 2: The final state of DFA will be every combination of final state of NFA.
a) Statement 1 is true and Statement 2 is true
b) Statement 1 is true and Statement 2 is false
c) Statement 1 can be true and Statement 2 is true
d) Statement 1 is false and Statement 2 is also false
View Answer

Answer: a
Explanation: Statement 1 and 2 always true for a given Language.
advertisement

2. Given Language: L= {ab U aba}*


If X is the minimum number of states for a DFA and Y is the number of states to construct the
NFA,
|X-Y|=?
a) 2
b) 3
c) 4
d) 1
View Answer

Answer: a
Explanation: Construct the DFA and NFA individually, and the attain the difference of states.
3. An automaton that presents output based on previous state or current input:
a) Acceptor
b) Classifier
c) Transducer
d) None of the mentioned.
View Answer

Answer: c
Explanation: A transducer is an automaton that produces an output on the basis of what input
has been given currently or previous state.

4. If NFA of 6 states excluding the initial state is converted into DFA, maximum possible
number of states for the DFA is ?
a) 64
b) 32
c) 128
d) 127
View Answer

Answer: c
Explanation: The maximum number of sets for DFA converted from NFA would be not greater
than 2n.

5. NFA, in its name has ’non-deterministic’ because of :


a) The result is undetermined
b) The choice of path is non-deterministic
c) The state to be transited next is non-deterministic
d) All of the mentioned
View Answer

Answer: b
Explanation: Non deterministic or deterministic depends upon the definite path defined for the
transition from one state to another or undefined(multiple paths).
advertisement

6. Which of the following is correct proposition?


Statement 1: Non determinism is a generalization of Determinism.
Statement 2: Every DFA is automatically an NFA

a) Statement 1 is correct because Statement 2 is correct


b) Statement 2 is correct because Statement 2 is correct
c) Statement 2 is false and Statement 1 is false
d) Statement 1 is false because Statement 2 is false
View Answer

Answer: b
Explanation: DFA is a specific case of NFA.

7. Given Language L= {xϵ {a, b}*|x contains aba as its substring}


Find the difference of transitions made in constructing a DFA and an equivalent NFA?
a) 2
b) 3
c) 4
d) Cannot be determined.
View Answer

Answer: a
Explanation: The individual Transition graphs can be made and the difference of transitions can
be determined.

8. The construction time for DFA from an equivalent NFA (m number of node)is:
a) O(m2)
b) O(2m)
c) O(m)
d) O(log m)
View Answer

Answer: b
Explanation: From the coded NFA-DFA conversion.
advertisement

9. If n is the length of Input string and m is the number of nodes, the running time of DFA is x
that of NFA.Find x?
a) 1/m2
b) 2m
c) 1/m
d) log m
View Answer

Answer: a
Explanation: Running time of DFA: O(n) and Running time of NFA =O(m2n).

10. Which of the following option is correct?


a) NFA is slower to process and its representation uses more memory than DFA
b) DFA is faster to process and its representation uses less memory than NFA
c) NFA is slower to process and its representation uses less memory than DFA
d) DFA is slower to process and its representation uses less memory than NFA
View Answer

Answer: c
Explanation: NFA, while computing strings, take parallel paths, make different copies of input
and goes along different paths in order to search for the result. This creates the difference in
processing speed of DFA and NFA.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!
Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Finite Automata
» Next - Automata Theory Questions and Answers – Extended Transition Function
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Terzaghi’s Analysis
Automata Theory Questions and Answers – Extended Transition Function
advertisement
advertisement

Recommended Posts:

1. Information Science Questions and Answers


2. Computer Science Questions and Answers
3. Java Programming Examples on Set & String Problems & Algorithms
4. Compilers Questions and Answers
5. Theory of Machines Questions and Answers
6. C++ Programming Examples on Set & String Problems & Algorithms
7. C Programming Examples on Set & String Problems & Algorithms
8. Network Theory Questions and Answers
9. Electromagnetic Theory Questions and Answers
10. Automata Theory Questions and Answers
11. Automata Theory Questions and Answers – PDA-Acceptance by Final State
12. Automata Theory Questions and Answers – Regular Expression-Introduction
13. Automata Theory Questions and Answers – Applications of DFA
14. Automata Theory Questions and Answers – Conversion by Eliminating states
15. Automata Theory Questions and Answers – Extended Transition Function
16. Automata Theory Questions and Answers – From PDA to Grammars
17. Automata Theory Questions and Answers – Moore Machine
18. Automata Theory Questions and Answers – Uses of Epsilon-Transitions
19. Automata Theory Questions and Answers – Non Deterministic Polynomial Time
20. Automata Theory Questions and Answers – Non Deterministic Turing Machines
advertisement

Automata Theory Questions and Answers –


Extended Transition Function
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Extended Transition Function”.

1. The number of tuples in an extended Non Deterministic Finite Automaton:


a) 5
b) 6
c) 7
d) 4
View Answer
Answer: a
Explanation: For NFA or extended transition function on NFA, the tuple elements remains same
i.e. 5.
advertisement

2. Choose the correct option for the given statement:


Statement: The DFA shown represents all strings which has 1 at second last position.

a) Correct
b) Incorrect, Incomplete DFA
c) Wrong proposition
d) May be correct
View Answer

Answer: c
Explanation: The given figure is an NFA. The statement contradicts itself.

3. What is wrong in the given definition?


Def: ({q0, q1, q2}, {0,1}, δ, q3, {q3})
a) The definition does not satisfy 5 Tuple definition of NFA
b) There are no transition definition
c) Initial and Final states do not belong to the Graph
d) Initial and final states can’t be same
View Answer

Answer: c
Explanation: q3 does not belong to Q where Q= set of finite states.

4. If δ is the transition function for a given NFA, then we define the δ’ for the DFA accepting
the same language would be:
Note: S is a subset of Q and a is a symbol.
a) δ’ (S, a) =Upϵs δ (p, a)
b) δ’ (S, a) =Up≠s δ (p, a)
c) δ’ (S, a) =Upϵs δ(p)
d) δ’ (S) =Up≠s δ(p)
View Answer

Answer: a
Explanation: According to subset construction, equation 1 holds true.

5. What is the relation between DFA and NFA on the basis of computational power?
a) DFA > NFA
b) NFA > DFA
c) Equal
d) Can’t be said
View Answer
Answer: c
Explanation: DFA is said to be a specific case of NFA and for every NFA that exists for a given
language, an equivalent DFA also exists.
advertisement

6. If a string S is accepted by a finite state automaton, S=s1s2s3……sn where siϵ∑ and there
exists a sequence of states r0, r1, r2…… rn such that δ(r(i), si+1) =ri+1 for each 0, 1, …n-1, then
r(n) is:
a) initial state
b) transition symbol
c) accepting state
d) intermediate state
View Answer

Answer: c
Explanation: r(n) is the final state and accepts the string S after the string being traversed
through r(i) other states where I ϵ 01,2…(n-2).

7. According to the given table, compute the number of transitions with 1 as its symbol but not
0:

a) 4
b) 3
c) 2
d) 1
View Answer

Answer: d
Explanation: The transition graph is made and thus the answer can be found.

8. From the given table, δ*(q0, 011) =?

a) {q0}
b) {q1} U {q0, q1, q2}
c) {q2, q1}
d) {q3, q1, q2, q0}
View Answer

Answer: b
Explanation: δ*(q0,011) = Urϵδ*(q0,01) δ (r, 1) = {q0, q1, q2}.
9. Number of times the state q3 or q2 is being a part of extended 6 transition state is

a) 6
b) 5
c) 4
d) 7
View Answer

Answer: a
Explanation: According to the question, presence of q2 or q1 would count so it does and the
answer according to the diagram is 6.
advertisement

10. Predict the missing procedure:

1.Δ(Q0, ε) ={Q0},
2.Δ(Q0, 01) = {Q0, Q1}
3.δ(Q0, 010) =?

a) {Q0, Q1, Q2}


b) {Q0, Q1}
c) {Q0, Q2}
d) {Q1, Q2}
View Answer

Answer: c
Explanation: According to given table and extended transition state implementation, we can find
the state at which it rests.
Sanfoundry Global Education & Learning Series – Automata Theory.
To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Non Deterministic Finite Automata –
Introduction
» Next - Automata Theory Questions and Answers – The Language of NFA
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Non Deterministic Finite Automata – Introduction
Automata Theory Questions and Answers – The Language of NFA
advertisement
advertisement

Recommended Posts:

1. Discrete Mathematics Questions and Answers


2. Aerodynamics Questions and Answers
3. VLSI Questions and Answers
4. RDBMS Questions and Answers
5. SQL Server Questions and Answers
6. Solid State Chemistry Questions and Answers
7. Theory of Machines Questions and Answers
8. Electromagnetic Theory Questions and Answers
9. Java Programming Examples on Set & String Problems & Algorithms
10. C Programming Examples on Set & String Problems & Algorithms
11. C++ Programming Examples on Set & String Problems & Algorithms
12. Compilers Questions and Answers
13. Network Theory Questions and Answers
14. Automata Theory Questions and Answers
15. Automata Theory Questions and Answers – Operators of Regular Expression
16. Theory of Computation – Nondeterministic Finite Automata (NFA) – Definitions,
Programming, Examples
17. Automata Theory Questions and Answers – Simpler Notations
18. Automata Theory Questions and Answers -Turing Machine and Halting
19. Compilers Questions and Answers – Finite Automata – 1
20. Automata Theory Questions and Answers – Conversion by Eliminating states
advertisement

Automata Theory Questions and Answers – The


Language of NFA
« Prev
Next »
This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “The
Language of NFA”.

1. Subset Construction method refers to:


a) Conversion of NFA to DFA
b) DFA minimization
c) Eliminating Null references
d) ε-NFA to NFA
View Answer

Answer: a
Explanation: The conversion of a non-deterministic automata into a deterministic one is a
process we call subset construction or power set construction.
advertisement

2. Given Language:
Ln= {xϵ {0,1} * | |x|≥n, nth symbol from the right in x is 1}
How many state are required to execute L3 using NFA?
a) 16
b) 15
c) 8
d) 7
View Answer

Answer: b
Explanation: The finite automaton for the given language is made and thus, the answer can be
obtained.

3. Which of the following does the given NFA represent?

a) {11, 101} * {01}


b) {110, 01} * {11}
c) {11, 110} * {0}
d) {00, 110} * {1}
View Answer
Answer: c
Explanation: The given diagram can be analysed and thus the option can be seeked.

4. The number of transitions required to convert the following into equivalents DFA:

a) 2
b) 3
c) 1
d) 0
View Answer

Answer: a
Explanation:

advertisement

5. If L is a regular language, Lc and Lr both will be:


a) Accepted by NFA
b) Rejected by NFA
c) One of them will be accepted
d) Cannot be said
View Answer

Answer: a
Explanation: If L is a regular Language, Lc and Lr both are regular even.

6. In NFA, this very state is like dead-end non final state:


a) ACCEPT
b) REJECT
c) DISTINCT
d) START
View Answer

Answer: b
Explanation: REJECT state will be like a halting state which rejects a particular invalid input.

7. We can represent one language in more one FSMs, true or false?


a) TRUE
b) FALSE
c) May be true
d) Cannot be said
View Answer

Answer: a
Explanation: We can represent one language in more one FSMs, example for a same language
we have a DFA and an equivalent NFA.
advertisement

8. The production of form non-terminal -> ε is called:


a) Sigma Production
b) Null Production
c) Epsilon Production
d) All of the mentioned
View Answer

Answer: b
Explanation: The production of form non-terminal ->ε is call null production.

9. Which of the following is a regular language?


a) String whose length is a sequence of prime numbers
b) String with substring wwr in between
c) Palindrome string
d) String with even number of Zero’s
View Answer

Answer: d
Explanation: DFSM’s for the first three option is not possible; hence they aren’t regular.

10. Which of the following recognizes the same formal language as of DFA and NFA?
a) Power set Construction
b) Subset Construction
c) Robin-Scott Construction
d) All of the mentioned
View Answer

Answer: d
Explanation: All the three option refers to same technique if distinguishing similar constructions
for different type of automata.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Extended Transition Function
» Next - Automata Theory Questions and Answers – Equivalence of NFA and DFA
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Extended Transition Function
Geotechnical Engineering Questions and Answers – General Bearing Capacity Equation: Brinch
Hansen’s Analysis
advertisement
advertisement

Recommended Posts:

1. PHP Questions and Answers


2. Computer Science Questions and Answers
3. Engineering Drawing Questions and Answers
4. C# Programming Examples on Strings
5. Python Programming Examples on Stacks & Queues
6. Java Programming Examples on String Handling
7. Python Questions and Answers
8. Bioprocess Engineering Questions and Answers
9. C# Programming Examples on Data Structures
10. C Programming Examples on Strings
11. Home
12. C# Programming Examples on Functions
13. Java Programming Examples on Set & String Problems & Algorithms
14. Theory of Machines Questions and Answers
15. C++ Programming Examples on Set & String Problems & Algorithms
16. C Programming Examples on Set & String Problems & Algorithms
17. Electromagnetic Theory Questions and Answers
18. Compilers Questions and Answers
19. Network Theory Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Equivalence of NFA and DFA
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Equivalence of NFA and DFA”.

1. Under which of the following operation, NFA is not closed?


a) Negation
b) Kleene
c) Concatenation
d) None of the mentioned
View Answer
Answer: d
Explanation: NFA is said to be closed under the following operations:
a) Union
b) Intersection
c) Concatenation
d) Kleene
e) Negation
advertisement

2. It is less complex to prove the closure properties over regular languages using
a) NFA
b) DFA
c) PDA
d) Can’t be said
View Answer

Answer: a
Explanation: We use the construction method to prove the validity of closure properties of
regular languages. Thus, it can be observe, how tedious and complex is the construction of a
DFA as compared to an NFA with respect to space.

3. Which of the following is an application of Finite Automaton?


a) Compiler Design
b) Grammar Parsers
c) Text Search
d) All of the mentioned
View Answer

Answer: d
Explanation: There are many applications of finite automata, mainly in the field of Compiler
Design and Parsers and Search Engines.

4. John is asked to make an automaton which accepts a given string for all the occurrence of
‘1001’ in it. How many number of transitions would John use such that, the string processing
application works?
a) 9
b) 11
c) 12
d) 15
View Answer

Answer: a
Explanation:
advertisement

5. Which of the following do we use to form an NFA from a regular expression?


a) Subset Construction Method
b) Power Set Construction Method
c) Thompson Construction Method
d) Scott Construction Method
View Answer

Answer: c
Explanation: Thompson Construction method is used to turn a regular expression in an NFA by
fragmenting the given regular expression through the operations performed on the input
alphabets.

6. Which among the following can be an example of application of finite state machine(FSM)?
a) Communication Link
b) Adder
c) Stack
d) None of the mentioned
View Answer

Answer: a
Explanation: Idle is the state when data in form of packets is send and returns if NAK is
received else waits for the NAK to be received.

7. Which among the following is not an application of FSM?


a) Lexical Analyser
b) BOT
c) State charts
d) None of the mentioned
View Answer

Answer: d
Explanation: Finite state automation is used in Lexical Analyser, Computer BOT (used in
games), State charts, etc.
advertisement

8. L1= {w | w does not contain the string tr }


L2= {w | w does contain the string tr}
Given ∑= {t, r}, The difference of the minimum number of states required to form L1 and L2?
a) 0
b) 1
c) 2
d) Cannot be said
View Answer
Answer: a
Explanation:

9. Predict the number of transitions required to automate the following language using only 3
states:
L= {w | w ends with 00}
a) 3
b) 2
c) 4
d) Cannot be said
View Answer

Answer: a
Explanation:

10. The total number of states to build the given language using DFA:
L= {w | w has exactly 2 a’s and at least 2 b’s}
a) 10
b) 11
c) 12
d) 13
View Answer

Answer: a
Explanation: We need to make the number of a as fixed i.e. 2 and b can be 2 or more. Thus,
using this condition a finite automata can be created using 1 states.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – The Language of NFA
» Next - Automata Theory Questions and Answers – Applications of DFA
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Effect of Water Table on Bearing Capacity
Geotechnical Engineering Questions and Answers – IS Code Method for Computing Bearing
Capacity
advertisement
advertisement

Recommended Posts:

1. Computational Fluid Dynamics Questions and Answers


2. Information Science Questions and Answers
3. Numerical Methods Questions and Answers
4. C Algorithms, Problems & Programming Examples
5. C Programming Examples on Strings
6. Computer Science Questions and Answers
7. Prestressed Concrete Structures Questions and Answers
8. VLSI Questions and Answers
9. Java Programming Examples on String Handling
10. Engineering Drawing Questions and Answers
11. C# Programming Examples on Functions
12. Geotechnical Engineering I Questions and Answers
13. Theory of Machines Questions and Answers
14. Electromagnetic Theory Questions and Answers
15. Network Theory Questions and Answers
16. Java Programming Examples on Set & String Problems & Algorithms
17. Compilers Questions and Answers
18. C Programming Examples on Set & String Problems & Algorithms
19. C++ Programming Examples on Set & String Problems & Algorithms
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Applications of DFA
« Prev
Next »
This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Applications of DFA”.

1. Given Language: {x | it is divisible by 3}


The total number of final states to be assumed in order to pass the number constituting {0, 1} is
a) 0
b) 1
c) 2
d) 3
View Answer

Answer: c
Explanation: The DFA for the given language can be constructed as follows:

advertisement

2. A binary string is divisible by 4 if and only if it ends with:


a) 100
b) 1000
c) 1100
d) 0011
View Answer

Answer: a
Explanation: If the string is divisible by four, it surely ends with the substring ‘100’ while a
binary string divisible by 2 would surely end with the substring ‘10’.

3. Let L be a language whose FA consist of 5 acceptance states and 11 non final states. It further
consists of a dumping state. Predict the number of acceptance states in Lc.
a) 16
b) 11
c) 5
d) 6
View Answer

Answer: a
Explanation: If L leads to FA1, then for Lc, the FA can be obtained by exchanging the final and
non-final states.

4. If L1 and L2 are regular languages, which among the following is an exception?


a) L1 U L2
b) L1 – L2
c) L1 ∩ L2
d) All of the mentioned
View Answer
Answer: d
Explanation: It the closure property of Regular language which lays down the following
statement:
If L1, L2 are 2- regular languages, then L1 U L2, L1 ∩ L2, L1C, L1 – L2 are regular language.
advertisement

5. Predict the analogous operation for the given language:


A: {[p, q] | p ϵ A1, q does not belong to A2}
a) A1-A2
b) A2-A1
c) A1.A2
d) A1+A2
View Answer

Answer: a
Explanation: When set operation ‘-‘ is performed between two sets, it points to those values of
prior set which belongs to it but not to the latter set analogous to basic subtraction operation.

6. Which among the following NFA’s is correct corresponding to the given Language?
L= {xϵ {0, 1} | 3rd bit from right is 0}

a)

b)
c)
d) None of the mentioned
View Answer

Answer: a
Explanation: The NFA accepts all binary strings such that the third bit from right end is 1 and if
not, is send to Dumping state. Note: It is assumed that the input is given from the right end bit
by bit.

7. Statement 1: NFA computes the string along parallel paths.


Statement 2: An input can be accepted at more than one place in an NFA.
Which among the following options are most appropriate?
a) Statement 1 is true while 2 is not
b) Statement 1 is false while is not
c) Statement 1 and 2, both are true
d) Statement 1 and 2, both are false
View Answer

Answer: c
Explanation: While the machine runs on some input string, if it has the choice to split, it goes in
all possible way and each one is different copy of the machine. The machine takes subsequent
choice to split further giving rise to more copies of the machine getting each copy run parallel. If
any one copy of the machine accepts the strings, then NFA accepts, otherwise it rejects.
advertisement

8. Which of the following options is correct for the given statement?


Statement: If K is the number of states in NFA, the DFA simulating the same language would
have states less than 2k.
a) True
b) False
View Answer

Answer: a
Explanation: If K is the number of states in NFA, the DFA simulating the same language would
have states equal to or less than 2k.

9. Let N (Q, ∑, δ, q0, A) be the NFA recognizing a language L. Then for a DFA (Q’, ∑, δ’, q0’,
A’), which among the following is true?
a) Q’ = P(Q)
b) Δ’ = δ’ (R, a) = {q ϵ Q | q ϵ δ (r, a), for some r ϵ R}
c) Q’={q0}
d) All of the mentioned
View Answer

Answer: d
Explanation: All the optioned mentioned are the instruction formats of how to convert a NFA to
a DFA.

10. There exists an initial state, 17 transition states, 7 final states and one dumping state, Predict
the maximum number of states in its equivalent DFA?
a) 226
b) 224
c) 225
d) 223
View Answer

Answer: a
Explanation: The maximum number of states an equivalent DFA can comprise for its respective
NFA with k states will be 2k.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Equivalence of NFA and DFA
» Next - Automata Theory Questions and Answers – Finite Automata with Epsilon Transition
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – IS Code Method for Computing Bearing
Capacity
Geotechnical Engineering Questions and Answers – Bearing Capacity – Plate Load Test
advertisement
advertisement

Recommended Posts:

1. Java Programming Examples on Java.Lang


2. Home
3. C Algorithms, Problems & Programming Examples
4. Ruby Programming Questions and Answers
5. Artificial Intelligence Questions and Answers
6. Bachelor of Computer Applications Questions and Answers
7. Master of Computer Applications Questions and Answers
8. Compilers Questions and Answers
9. Java Programming Examples on Set & String Problems & Algorithms
10. Electromagnetic Theory Questions and Answers
11. Theory of Machines Questions and Answers
12. C Programming Examples on Set & String Problems & Algorithms
13. Network Theory Questions and Answers
14. C++ Programming Examples on Set & String Problems & Algorithms
15. Automata Theory Questions and Answers
16. Automata Theory Questions and Answers – Pumping Lemma for Regular Language
17. Automata Theory Questions and Answers – DFA to Regular Expressions
18. Automata Theory Questions and Answers – Simpler Notations
19. Automata Theory Questions and Answers – Testing Emptiness and Membership
20. Automata Theory Questions and Answers – DFA Processing Strings
advertisement

Automata Theory Questions and Answers – Finite


Automata with Epsilon Transition
« Prev
Next »

This set of Automata Theory test focuses on “Finite Automata with Epsilon Transition”.

1. According to the given transitions, which among the following are the epsilon closures of q1
for the given NFA?
Δ (q1, ε) = {q2, q3, q4}
Δ (q4, 1) =q1
Δ (q1, ε) =q1
a) q4
b) q2
c) q1
d) q1, q2, q3, q4
View Answer

Answer: d
Explanation: The set of states which can be reached from q using ε-transitions, is called the ε-
closure over state q.
advertisement

2. State true or false?


Statement: An NFA can be modified to allow transition without input alphabets, along with one
or more transitions on input symbols.
a) True
b) False
View Answer

Answer: a
Explanation: It is possible to construct an NFA with ε-transitions, presence of no input symbols,
and that is called NFA with ε-moves.
3. State true or false?
Statement: ε (Input) does not appears on Input tape.
a) True
b) False
Answer: a
View Answer

Explanation: ε does not appears on Input tape, ε transition means a transition without scanning a
symbol i.e. without moving the read head.

4. Statement 1: ε- transition can be called as hidden non-determinism.


Statement 2: δ (q, ε) = p means from q it can jump to p with a shift in read head.
Which among the following options is correct?
a) Statement 1 and 2, both are correct
b) Statement 1 and 2, both are wrong
c) Statement 1 is correct while Statement 2 is wrong
d) Statement 1 is wrong while Statement 2 is correct
View Answer

Answer: c
Explanation: The transition with ε leads to a jump but without any shift in read head. Further,
the method can be called one to introduce hidden non-determinism.

5. ε- closure of q1 in the given transition graph:


a) {q1}
b) {q0, q2}
c) {q1, q2}
d) {q0, q1, q2}
View Answer

Answer: c
Explanation: ε-closure is defined as the set of states being reached through ε-transitions from a
starting state.
advertisement

6. Predict the total number of final states after removing the ε-moves from the given NFA?
a) 1
b) 2
c) 3
d) 0
View Answer

Answer: c
Explanation: The NFA which would result after eliminating ε-moves can be shown
diagramatically.

7. For NFA with ε-moves, which among the following is correct?


a) Δ: Q X (∑ U {ε}) -> P(Q)
b) Δ: Q X (∑) -> P(Q)
c) Δ: Q X (∑*) -> P(Q)
d) All of the mentioned
View Answer

Answer: a
Explanation: Due to the presence of ε symbol, or rather an epsilon-move, the input alphabets
unites with it to form a set including ε.

8. Which among the following is false?


ε-closure of a subset S of Q is:
a) Every element of S ϵ Q
b) For any q ϵ ε(S), every element of δ (q, ε) is in ε(S)
c) No other element is in ε(S)
d) None of the mentioned
View Answer

Answer: d
Explanation: All the mentioned are the closure properties of ε and encircles all the elements if it
satisfies the following options:
a) Every element of S ϵ Q
b) For any q ϵ ε(S), every element of δ (q, ε) is in ε(S)
c) No other element is in ε(S)

9. The automaton which allows transformation to a new state without consuming any input
symbols:
a) NFA
b) DFA
c) NFA-l
d) All of the mentioned
View Answer

Answer: c
Explanation: NFA-l or e-NFA is an extension of Non deterministic Finite Automata which are
usually called NFA with epsilon moves or lambda transitions.
advertisement

10. e-transitions are


a) conditional
b) unconditional
c) input dependent
d) none of the mentioned
View Answer

Answer: b
Explanation: An epsilon move is a transition from one state to another that doesnt require any
specific condition.

11. The __________ of a set of states, P, of an NFA is defined as the set of states reachable from
any state in P following e-transitions.
a) e-closure
b) e-pack
c) Q in the tuple
d) None of the mentioned
View Answer

Answer: a
Explanation: The e-closure of a set of states, P, of an NFA is defined as the set of states
reachable from any state in P following e-transitions.

12. The e-NFA recognizable languages are not closed under :


a) Union
b) Negation
c) Kleene Closure
d) None of the mentioned
View Answer

Answer: d
Explanation: The languages which are recognized by an epsilon Non deterministic automata are
closed under the following operations:
a) Union
b) Intersection
c) Concatenation
d) Negation
e) Star
f) Kleene closure

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory for tests, here is complete set of 1000+ Multiple
Choice Questions and Answers.
advertisement

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Applications of DFA
» Next - Automata Theory Questions and Answers – Uses of Epsilon-Transitions
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Bearing Capacity – Plate Load Test
Geotechnical Engineering Questions and Answers – Bearing Capacity – Standard Penetration
Test
advertisement
advertisement

Recommended Posts:

1. Computational Fluid Dynamics Questions and Answers


2. C# Programming Examples on Matrix
3. C# Programming Examples on Sorting
4. Java Programming Examples on Set & String Problems & Algorithms
5. C Programming Examples on Trees
6. C++ Programming Examples on Graph Problems & Algorithms
7. C# Programming Examples on Arrays
8. Network Theory Questions and Answers
9. Chemical Engineering Questions and Answers
10. Electromagnetic Theory Questions and Answers
11. C Programming Examples on Set & String Problems & Algorithms
12. C++ Programming Examples on Set & String Problems & Algorithms
13. Theory of Machines Questions and Answers
14. Solid State Chemistry Questions and Answers
15. CSS Questions and Answers
16. Compilers Questions and Answers
17. Automata Theory Questions and Answers
18. Automata Theory Questions and Answers – Eliminating Epsilon Productions
19. Automata Theory Questions and Answers – Conversions among Representations
20. Automata Theory Questions and Answers – Moore Machine
advertisement

Automata Theory Questions and Answers – Uses


of Epsilon-Transitions
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “Uses
of Epsilon-Transitions”.

1. The automaton which allows transformation to a new state without consuming any input
symbols:
a) NFA
b) DFA
c) NFA-l
d) All of the mentioned
View Answer

Answer: c
Explanation: NFA-l or e-NFA is an extension of Non deterministic Finite Automata which are
usually called NFA with epsilon moves or lambda transitions.
advertisement

2. e-transitions are
a) conditional
b) unconditional
c) input dependent
d) none of the mentioned
View Answer
Answer: b
Explanation: An epsilon move is a transition from one state to another that doesn’t require any
specific condition.

3. The __________ of a set of states, P, of an NFA is defined as the set of states reachable from
any state in P following e-transitions.
a) e-closure
b) e-pack
c) Q in the tuple
d) None of the mentioned
View Answer

Answer: a
Explanation: The e-closure of a set of states, P, of an NFAis defined as the set of states
reachable from any state in P following e-transitions.

4. The e-NFA recognizable languages are not closed under :


a) Union
b) Negation
c) Kleene Closure
d) None of the mentioned
View Answer

Answer: The languages which are recognized by an epsilon Non deterministic automata are
closed under the following operations:
a) Union
b) Intersection
c) Concatenation
d) Negation
e) Star
f) Kleene closure
advertisement

5. Is the language preserved in all the steps while eliminating epsilon transitions from a NFA?
a) yes
b) no
View Answer

Answer: a
Explanation: Yes, the language is preserved during the dteps of construction:
L(N)=L(N1)=L(N2)=L(3).

6. An e-NFA is ___________ in representation.


a) Quadruple
b) Quintuple
c) Triple
d) None of the mentioned
View Answer
Answer: b
Explanation: An e-NFA consist of 5 tuples: A=(Q, S, d, q0, F)
Note: e is never a member of S.

7. State true or false:


Statement: Both NFA and e-NFA recognize exactly the same languages.
a) true
b) false
View Answer

Answer: a
Explanation: e-NFA do come up with a convenient feature but nothing new.They do not extend
the class of languages that can be represented.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Finite Automata with Epsilon Transition
» Next - Automata Theory Questions and Answers – Epsilon Closures
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Bearing Capacity – Standard Penetration
Test
Geotechnical Engineering Questions and Answers – Bearing Capacity – Permissible Total and
Differential Settlements
advertisement
advertisement

Recommended Posts:

1. Java Programming Examples on Set & String Problems & Algorithms


2. Chemical Engineering Questions and Answers
3. C++ Algorithms, Problems & Programming Examples
4. CSS Questions and Answers
5. C++ Programming Examples on Set & String Problems & Algorithms
6. C Algorithms, Problems & Programming Examples
7. C++ Programming Examples on STL
8. Computer Science Questions and Answers
9. C Programming Examples on Set & String Problems & Algorithms
10. Information Science Questions and Answers
11. C Programming Examples on Stacks & Queues
12. Discrete Mathematics Questions and Answers
13. Python Programming Examples on Stacks & Queues
14. Solid State Chemistry Questions and Answers
15. Home
16. Compilers Questions and Answers
17. Electromagnetic Theory Questions and Answers
18. Theory of Machines Questions and Answers
19. Network Theory Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Epsilon Closures
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Epsilon Closures”.

1. Which of the following does not belong to input alphabet if S={a, b}* for any language?
a) a
b) b
c) e
d) none of the mentioned
View Answer

Answer: c
Explanation: The automaton may be allowed to change its state without reading the input
symbol using epsilon but this does not mean that epsilon has become an input symbol. On the
contrary, one assumes that the symbol epsilon does not belong to any alphabet.
advertisement

2. The number of final states we need as per the given language?


Language L: {an| n is even or divisible by 3}
a) 1
b) 2
c) 3
d) 4
View Answer
Answer: b
Explanation:

3. State true or false:


Statement: Both NFA and e-NFA recognize exactly the same languages.
a) true
b) false
View Answer

Answer: a
Explanation: e-NFA do come up with a convenient feature but nothing new.They do not extend
the class of languages that can be represented.

4. Design a NFA for the language:


L: {an| n is even or divisible by 3}
Which of the following methods can be used to simulate the same.
a) e-NFA
b) Power Construction Method
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: It is more convenient to simulate a machine using e-NFA else the method of Power
Construction is used from the union-closure of DFA’s.
advertisement
5. Which of the following belongs to the epsilon closure set of a?

a) {f1, f2, f3}


b) {a, f1, f2, f3}
c) {f1, f2}
d) none of the mentioned
View Answer

Answer: b
Explanation: The epsilon closure of the set q is the set that contains q, together with all the states
which can be reached starting at q by following only epsilon transitions.

6. The number of elements present in the e-closure(f2) in the given diagram:

a) 0
b) 1
c) 2
d) 3
View Answer

Answer: c
Explanation: The epsilon closure set of f2 consist of the elements:{f2, f3}. Thus the count of the
element in the closure set is 2.

7. Which of the steps are non useful while eliminating the e-transitions for the given diagram?

a) Make a as accepting state of N’ if ECLOSE(p) contains an accepting state of N


b) Add an arc a to f1 labelled a if there is an arc labelled a in N from some state in ECLOSE(a)
to f1
c) Delete all arcs labelled as e
d) None of the mentioned
View Answer

Answer: d
Explanation: The given are the steps followed while eliminating epsilon transitions from a NFA
or converting an e-NFA to just NFA.
advertisement

8. Remove all the epsilon transitions in the given diagram and compute the number of a-
transitions in the result?
a) 5
b) 7
c) 9
d) 6
View Answer

Answer: b
Explanation:

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!
Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Uses of Epsilon-Transitions
» Next - Automata Theory Questions and Answers – Union, Intersection & Complement
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Bearing Capacity – Permissible Total and
Differential Settlements
Automata Theory Questions and Answers – Union, Intersection & Complement
advertisement
advertisement

Recommended Posts:

1. C Programming Examples on Set & String Problems & Algorithms


2. CSS Questions and Answers
3. C Algorithms, Problems & Programming Examples
4. Discrete Mathematics Questions and Answers
5. Home
6. Solid State Chemistry Questions and Answers
7. Electromagnetic Theory Questions and Answers
8. Network Theory Questions and Answers
9. Theory of Machines Questions and Answers
10. Compilers Questions and Answers
11. Automata Theory Questions and Answers
12. Automata Theory Questions and Answers – Simpler Notations
13. Automata Theory Questions and Answers – Moore Machine
14. Automata Theory Questions and Answers – Intersection with Regular Languages
15. Automata Theory Questions and Answers – Closure Properties under Boolean Operations
16. Automata Theory Questions and Answers – Non Deterministic Finite Automata –
Introduction
17. Automata Theory Questions and Answers – Conversion by Eliminating states
18. Automata Theory Questions and Answers – Applications of NFA
19. Automata Theory Questions and Answers – Reversal-Homomorphism and Inverse
Homomorphism
20. Automata Theory Questions and Answers – Equivalence of NFA and DFA
advertisement

Automata Theory Questions and Answers – Union,


Intersection & Complement
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Union, intersection and complement of Regular Language & Expression”.

1. Regular sets are closed under union,concatenation and kleene closure.


a) True
b) False
c) Depends on regular set
d) Can’t say
View Answer

Answer:a
Explanation: Regular sets are closed under these three operation.
advertisement

2. Complement of a DFA can be obtained by


a) making starting state as final state.
b) no trival method.
c) making final states non-final and non-final to final.
d) make final as a starting state.
View Answer

Answer:c
Explanation: String accepted in previous DFA will not be accepted and non accepting string will
be accepted .

3. Complement of regular sets are _________


a) Regular
b) CFG
c) CSG
d) RE
View Answer

Answer:a
Explanation: Regular sets are closed under complement operation.

4. If L1 and L2 are regular sets then intersection of these two will be


a) Regular
b) Non Regular
c) Recursive
d) Non Recursive
View Answer

Answer:a
Explanation: Regular expression are also colsed under intersection.

5. If L1 is regular L2 is unknown but L1-L2 is regular ,then L2 must be


a) Empty set
b) CFG
c) Decidable
d) Regular
View Answer

Answer:d
Explanation: Regular is closed under difference.
advertisement
6. Reverse of a DFA can be formed by
a) using PDA
b) making final state as non-final
c) making final as starting state and starting state as final state
d) None of the mentioned
View Answer

Answer:c
Explanation: By making final state as starting state string starting from end will be accepted.

7. Reverse of (0+1)* will be


a) Phi
b) Null
c) (0+1)*
d) (0+1)
View Answer

Answer:c
Explanation: There is only one state which is start and final state of DFA so interchanging
starting start and final state doesn’t change DFA.

8. A ___________ is a substitution such that h(a) contains a string for each a.


a) Closure
b) Interchange
c) Homomorphism
d) Inverse Homomorphism
View Answer

Answer:c
Explanation: This operation replace using a function .

9. Homomorphism of a regular set is _______


a) Universal set
b) Null set
c) Regular set
d) Non regular set
View Answer

Answer:c
Explanation: Regular set are closed under homomorphism.
advertisement

10. (a ^ 5b ^ 5)* is example of ________


a) Type 0 language
b) Type 1 language
c) Type 2 language
d) Type 3 language
View Answer
Answer:d
Explanation: It is a regular expression.

11. Which of the following is type 3 language ?


a) Strings of 0’s whose length is perfect square
b) Palindromes string
c) Strings of 0’s having length prime number
d) String of odd number of 0’s
View Answer

Answer:d
Explanation: Only d is regular language.

12. a ^ nb ^ n where (n+m) is even .


a) Type 0
b) Type 1
c) Type 2
d) Type 3
View Answer

Answer:d
Explanation: It is a regular expression.

13. Complement of a ^ nb ^ m where n >= 4 and m <= 3 is example of


a) Type 0
b) Type 1
c) Type 2
d) Type 3
View Answer

Answer:d
Explanation: It is a regular expression.
advertisement

14. a ^ nb ^ m where n >= 1, m >= 1, nm >= 3 is example of


a) Type 0
b) Type 1
c) Type 2
d) Type 3
View Answer

Answer:d
Explanation: It is a regular expression.

15. Complement of (a + b)* will be


a) phi
b) null
c) a
d) b
View Answer
Answer:a
Explanation: Given expression accept all string so complement will accept nothing.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Epsilon Closures
» Next - Automata Theory Questions and Answers – Regular Expression-Introduction
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Epsilon Closures
Geotechnical Engineering Questions and Answers – Types of Foundation
advertisement
advertisement

Recommended Posts:

1. Java Programming Examples on Utility Classes


2. Information Science Questions and Answers
3. C Programming Examples on Strings
4. Java Questions and Answers
5. PHP Questions and Answers
6. Discrete Mathematics Questions and Answers
7. Computer Science Questions and Answers
8. Python Questions and Answers
9. Java Programming Examples on String Handling
10. Java Programming Examples on Java.Lang
11. LISP Questions and Answers
12. Theory of Machines Questions and Answers
13. C Programming Examples on Set & String Problems & Algorithms
14. C# Programming Examples on Functions
15. Electromagnetic Theory Questions and Answers
16. C++ Programming Examples on Set & String Problems & Algorithms
17. Java Programming Examples on Set & String Problems & Algorithms
18. Network Theory Questions and Answers
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Regular Expression-Introduction
« Prev
Next »
This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Regular Expression-Introduction”.

1. L is a regular Language if and only If the set of __________ classes of IL is finite.


a) Equivalence
b) Reflexive
c) Myhill
d) Nerode
View Answer

Answer: a
Explanation: According to Myhill Nerode theorem, the corollary proves the given statement
correct for equivalence classes.
advertisement

2. A language can be generated from simple primitive language in a simple way if and only if
a) It is recognized by a device of infinite states
b) It takes no auxiliary memory
c) Both are correct
d) Both are wrong
View Answer

Answer: b
Explanation: A language is regular if and only if it can be accepted by a finite automaton.
Secondly, It supports no concept of auxiliary memory as it loses the data as soon as the device is
shut down.

3. Which of the following does not represents the given language?


Language: {0,01}
a) 0+01
b) {0} U {01}
c) {0} U {0}{1}
d) {0} ^ {01}
View Answer

Answer: d
Explanation: The given option represents {0, 01} in different forms using set operations and
Regular Expressions. The operator like ^, v, etc. are logical operation and they form invalid
regular expressions when used.

4. According to the given language, which among the following expressions does it corresponds
to?
Language L={xϵ{0,1}|x is of length 4 or less}

a) (0+1+0+1+0+1+0+1)4
b) (0+1)4
c) (01)4
d) (0+1+ε)4
View Answer
Answer: d
Explanation: The extended notation would be (0+1)4 but however, we may allow some or all the
factors to be ε. Thus ε needs to be included in the given regular expression.
advertisement

5. Which among the following looks similar to the given expression?


((0+1). (0+1)) *
a) {xϵ {0,1} *|x is all binary number with even length}
b) {xϵ {0,1} |x is all binary number with even length}
c) {xϵ {0,1} *|x is all binary number with odd length}
d) {xϵ {0,1} |x is all binary number with odd length}
View Answer

Answer: a
Explanation: The given regular expression corresponds to a language of binary strings which is
of even length including a length of 0.

6. If R represents a regular language, which of the following represents the Venn-diagram most
correctly?

a) An Irregular Set
b) R*
c) R complement
d) R reverse
View Answer

Answer: b
Explanation: The given diagram represents the Kleene operation over the Regular Language R
in which the final states become the initial and the initial state becomes final.

7. The given NFA corresponds to which of the following Regular expressions?

a) (0+1) *(00+11) (0+1) *


b) (0+1) *(00+11) *(0+1) *
c) (0+1) *(00+11) (0+1)
d) (0+1) (00+11) (0+1) *
View Answer

Answer: a
Explanation: The transition states shown are the result of breaking down the given regular
expression in fragments. For dot operation, we change a state, for union (plus) operation, we
diverge into two transitions and for Kleene Operation, we apply a loop.

8. Concatenation Operation refers to which of the following set operations:


a) Union
b) Dot
c) Kleene
d) Two of the options are correct
View Answer

Answer: b
Explanation: Two operands are said to be performing Concatenation operation AB = A•B = {xy:
x ∈ A & y ∈ B}.
advertisement

9. Concatenation of R with Ф outputs:


a) R
b) Ф
c) R.Ф
d) None of the mentioned
View Answer

Answer: b
Explanation: By distributive property (Regular expression identities), we can prove the given
identity to be Ф.

10. RR* can be expressed in which of the forms:


a) R+
b) R-
c) R+ U R-
d) R
View Answer

Answer: a
Explanation: RR*=R+ as R+ means the occurrence to be at least once.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Union, Intersection & Complement
» Next - Automata Theory Questions and Answers – Operators of Regular Expression
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Types of Foundation
Geotechnical Engineering Questions and Answers – Shallow Foundations – Settlement of
Footings
advertisement
advertisement

Recommended Posts:

1. C Programming Examples on Linked List


2. C Programming Examples without using Recursion
3. C Tutorials
4. C Programming Examples on Graph Problems & Algorithms
5. Database Management System Questions and Answers
6. C Programming Examples on Set & String Problems & Algorithms
7. C++ Programming Examples on Data-Structures
8. C Programming Examples on Strings
9. Data Structure Questions and Answers
10. C# Programming Examples on Data Structures
11. C# Programming Examples on Functions
12. Data Science Questions and Answers
13. RDBMS Questions and Answers
14. Theory of Machines Questions and Answers
15. Python Questions and Answers
16. Network Theory Questions and Answers
17. Electromagnetic Theory Questions and Answers
18. PHP Questions and Answers
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Operators of Regular Expression
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Operators of Regular Expression”.

1. A finite automaton accepts which type of language:


a) Type 0
b) Type 1
c) Type 2
d) Type 3
View Answer
Answer: d
Explanation: Type 3 refers to Regular Languages which is accepted by a finite automaton.
advertisement

2. Which among the following are incorrect regular identities?


a) εR=R
b) ε*=ε
c) Ф*=ε
d) RФ=R
View Answer

Answer: d
Explanation: There are few identities over Regular Expressions which include: RФ=ФR=Ф≠R

3. Simplify the following regular expression:


ε+1*(011) *(1*(011) *) *
a) (1+011) *
b) (1*(011) *)
c) (1+(011) *) *
d) (1011) *
View Answer

Answer: a
Explanation: ε+1*(011) *(1*(011) *) *
ε + RR*= ε + R*R= ε + R+= R*

4. P, O, R be regular expression over ∑, P is not ε, then


R=Q + RP has a unique solution:

a) Q*P
b) QP*
c) Q*P*
d) (P*O*) *
View Answer

Answer: b
Explanation: The given statement is the Arden’s Theorem and it tends to have a unique solution
as QP*.
Let P and Q be regular expressions,
R=Q+RP
R=Q+(Q+RP) P
R=Q+((Q+RP) +RP) +P=Q+QP+RPP+RPP=Q+QP+(Q+RP) PP+(Q+RP)
PP=Q+QP+QPP+RPPP+QPP+RPPP,
If we do this recursively, we get:
R= QP*
advertisement

5. Arden’s theorem is true for:


a) More than one initial states
b) Null transitions
c) Non-null transitions
d) None of the mentioned
View Answer

Answer: c
Explanation: Arden’s theorem strictly assumes the following;
a) No null transitions in the transition diagrams
b) True for only single initial state

6. The difference between number of states with regular expression (a + b) and (a + b) * is:
a) 1
b) 2
c) 3
d) 0
View Answer

Answer: a
Explanation:

7. In order to represent a regular expression, the first step to create the transition diagram is:
a) Create the NFA using Null moves
b) Null moves are not acceptable, thus should not be used
c) Predict the number of states to be used in order to construct the Regular expression
d) None of the mentioned
View Answer

Answer: a
Explanation: Two steps are to be followed while converting a regular expression into a
transition diagram:
a) Construct the NFA using null moves.
b) Remove the null transitions and convert it into its equivalent DFA.

8. (0+ε) (1+ε) represents


a) {0, 1, 01, ε}
b) {0, 1, ε}
c) {0, 1, 01 ,11, 00, 10, ε}
d) {0, 1}
View Answer

Answer: a
Explanation: The regular expression is fragmented and the set of the strings eligible is formed.
‘+’ represents union while ‘.’ Represents concatenation.
advertisement

9. The minimum number of states required to automate the following Regular Expression:
(1) *(01+10) (1) *
a) 4
b) 3
c) 2
d) 5
View Answer

Answer: a

10. Regular Expression denote precisely the ________ of Regular Language.


a) Class
b) Power Set
c) Super Set
d) None of the mentioned
View Answer

Answer: a
Explanation: Regular Expression denote precisely the class of regular language. Given any
regular expression, L(R) is a regular language. Given any regular language L, there is a regular
expression R, such that L(R)=L.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Regular Expression-Introduction
» Next - Automata Theory Questions and Answers – Building Regular Expressions
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Shallow Foundations – Settlement of
Footings
Geotechnical Engineering Questions and Answers – Shallow Foundations – Combined Footing
and Strap Footing
advertisement
advertisement

Recommended Posts:

1. RDBMS Questions and Answers


2. Mechanical Behaviour & Testing of Materials Questions and Answers
3. Python Questions and Answers
4. C Tutorials
5. Database Management System Questions and Answers
6. C Programming Examples on Set & String Problems & Algorithms
7. Information Science Questions and Answers
8. Java Programming Examples on Set & String Problems & Algorithms
9. Computer Science Questions and Answers
10. C++ Programming Examples on Set & String Problems & Algorithms
11. Solid State Chemistry Questions and Answers
12. LISP Questions and Answers
13. PHP Questions and Answers
14. C# Programming Examples on Functions
15. CSS Questions and Answers
16. Theory of Machines Questions and Answers
17. Network Theory Questions and Answers
18. Electromagnetic Theory Questions and Answers
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Building Regular Expressions
« Prev
Next »

This set of Automata Theory Quiz focuses on “Building Regular Expressions”.

1. Which of the following is correct?


Statement 1: ε represents a single string in the set.
Statement 2: Ф represents the language that consist of no string.
a) Statement 1 and 2 both are correct
b) Statement 1 is false but 2 is correct
c) Statement 1 and 2 both are false
d) There is no difference between both the statements, ε and Ф are different notation for same
reason
View Answer

Answer: a
Explanation: ε represents a single string in the set namely, the empty string while Statement 2 is
also correct.
advertisement

2. The appropriate precedence order of operations over a Regular Language is


a) Kleene, Union, Concatenate
b) Kleene, Star, Union
c) Kleene, Dot, Union
d) Star, Union, Dot
View Answer

Answer: c
Explanation: If a regular language expression is given, the appropriate order of precedence if the
parenthesis is ignored is: Star or Kleene, Dot or Concatenation, Union or Plus.

3. Regular Expression R and the language it describes can be represented as:


a) R, R(L)
b) L(R), R(L)
c) R, L(R)
d) All of the mentioned
View Answer

Answer: c
Explanation: When we wish to distinguish between a regular expression R and the language it
represents; we write L(R) to be the language of R.

4. Let for ∑= {0,1} R= (∑∑∑) *, the language of R would be


a) {w | w is a string of odd length}
b) {w | w is a string of length multiple of 3}
c) {w | w is a string of length 3}
d) All of the mentioned
View Answer

Answer: b
Explanation: This regular expression can be used to eliminate the answers and get the result.
The length can be even and as well more than 3 when R= (∑∑∑) (∑∑∑) (particular case).

5. If ∑= {0,1}, then Ф* will result to:


a) ε
b) Ф
c) ∑
d) None of the mentioned
View Answer

Answer: a
Explanation: The star operation brings together any number of strings from the language to get a
string in the result. If the language is empty, the star operation can put together 0 strings,
resulting only the empty string.
advertisement

6. The given NFA represents which of the following NFA


a) (ab U a) *
b) (a*b* U a*)
c) (ab U a*)
d) (ab)* U a*
View Answer

Answer: a
Explanation: The Regular expression (ab U a) * is converted to NFA in a sequence of stages as
it can be clearly seen in the diagram. This NFA consist of 8 stated while its minimized form
only contains 2 states.

7. Which of the following represents a language which has no pair of consecutive 1’s if ∑=
{0,1}?
a) (0+10)*(1+ε)
b) (0+10)*(1+ε)*
c) (0+101)*(0+ε)
d) (1+010)*(1+ε)
View Answer
Answer: a
Explanation: All the options except ‘a’ accept those strings which comprises minimum one pair
of 1’s together.

8. The finite automata accept the following languages:


a) Context Free Languages
b) Context Sensitive Languages
c) Regular Languages
d) All the mentioned
View Answer

Answer: c
Explanation: A finite automaton accepts the languages which are regular and for which a DFA
can be constructed.

9. (a + b*c) most correctly represents:


a) (a +b) *c
b) (a)+((b)*.c)
c) (a + (b*)).c
d) a+ ((b*).c)
View Answer

Answer: d
Explanation: Following the rules of precedence, Kleene or star operation would be done first,
then concatenation and finally union or plus operation.
advertisement

10. Which of the following regular expressions represents the set of strings which do not contain
a substring ‘rt’ if ∑= {r, t}
a) (rt)*
b) (tr)*
c) (r*t*)
d) (t*r*)
View Answer

Answer: d
Explanation: As Kleene operation is not on the whole of the substring, it will not repeat and
maintain the order of t, r.

11. According to the precedence rules, x-y-z is equivalent to which of the following?
a) (x-y)-z
b) x-(y-z)
c) Both (x-y)-z and x-(y-z)
d) None of the mentioned
View Answer

Answer: a
Explanation: In arithmetic, we group two of the same operators from the left, hence x-y-z is
equivalent to (x-y)-z and not x-(y—z).
12. Dot operator in regular expression resembles which of the following?
a) Expressions are juxtaposed
b) Expressions are multiplied
c) Cross operation
d) None of the mentioned
View Answer

Answer: a
Explanation: Dot operation or concatenation operation means that the two expressions are
juxtaposed i.e. there are no intervening operators in between. In fact, UNIX regular expressions
use the dot for an entirely different purpose: representing any ASCII character.

13. Which among the following is not an associative operation?


a) Union
b) Concatenation
c) Dot
d) None of the mentioned
View Answer

Answer: d
Explanation: It does not matter in which order we group the expression with the operators as
they are associative. If one gets a chance to group the expression, one should group them from
left for convenience. For instance, 012 is grouped as (01)2.
advertisement

14.Which among the following is equivalent to the given regular expression?


01*+1
a) (01)*+1
b) 0((1)*+1)
c) (0(1)*)+1
d) ((0*1)1*)*
View Answer

Answer: c
Explanation: Using the rules of precedence on the give expression, c is the appropriate choice
with the order of: Bracket>Kleene>Dot>Union

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory for Quizzes, here is complete set of 1000+ Multiple
Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Operators of Regular Expression
» Next - Automata Theory Questions and Answers – DFA to Regular Expressions
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Shallow Foundations – Combined Footing
and Strap Footing
Geotechnical Engineering Questions and Answers – Shallow Foundations – Mat or Raft Footing
advertisement
advertisement

Recommended Posts:

1. Database Management System Questions and Answers


2. Java Programming Examples on String Handling
3. Information Science Questions and Answers
4. C Programming Examples on Strings
5. Construction & Building Materials Questions and Answers
6. C Tutorials
7. Java Programming Examples on Set & String Problems & Algorithms
8. Java Programming Examples on Utility Classes
9. RDBMS Questions and Answers
10. LISP Questions and Answers
11. C++ Programming Examples on Set & String Problems & Algorithms
12. Theory of Machines Questions and Answers
13. Python Questions and Answers
14. C Programming Examples on Set & String Problems & Algorithms
15. C# Programming Examples on Functions
16. Electromagnetic Theory Questions and Answers
17. PHP Questions and Answers
18. Network Theory Questions and Answers
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers – DFA


to Regular Expressions
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “DFA
to Regular Expressions”.

1. Which of the following is same as the given DFA?

a) (0+1)*001(0+1)*
b) 1*001(0+1)*
c) (01)*(0+0+1)(01)*
d) None of the mentioned
View Answer

Answer: a
Explanation: There needs to be 001 together in the string as an essential substring. Thus, the
other components can be anything, 0 or 1 or e.
advertisement

2. Which of the following statements is not true?


a) Every language defined by any of the automata is also defined by a regular expression
b) Every language defined by a regular expression can be represented using a DFA
c) Every language defined by a regular expression can be represented using NFA with e moves
d) Regular expression is just another representation for any automata definition
View Answer

Answer: b
Explanation: Using NFA with e moves, we can represent all the regular expressions as an
automata. As regular expressions include e, we need to use e moves.

3. The total number of states required to automate the given regular expression
(00)*(11)*
a) 3
b) 4
c) 5
d) 6
View Answer

Answer: c

Explanation:
4. Which of the given regular expressions correspond to the automata shown?

a) (110+1)*0
b) (11+110)*1
c) (110+11)*0
d) (1+110)*1
View Answer

Answer: c
Explanation: There is no state change for union operation, but has two different paths while for
concatenation or dot operation, we have a state change for every element of the string.
advertisement

5. Generate a regular expression for the following problem statement:


Password Validation: String should be 8-15 characters long. String must contain a number, an
Uppercase letter and a Lower case letter.
a) ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,15}$
b) ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{9,16}$
c) ^(?=.[a-z])(?=.[A-Z])(?=.\d).{8,15}$
d) None of the mentioned
View Answer

Answer: a
Explanation: Passwords like abc123, 123XYZ, should not be accepted . If one also wants to
include special characters as one of the constraint, one can use the following regular expression:
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-za-Z]).{8,15}$

6. Generate a regular expression for the following problem statement:


P(x): String of length 6 or less for å={0,1}*
a) (1+0+e)6
b) (10)6
c) (1+0)(1+0)(1+0)(1+0)(1+0)(1+0)
d) More than one of the mentioned is correct
View Answer

Answer: a
Explanation: As the input variables are under Kleene Operation, we need to include e,thus
option c is not correct,thereby option (a) is the right answer.

7. The minimum number of states required in a DFA (along with a dumping state) to check
whether the 3rd bit is 1 or not for |n|>=3
a) 3
b) 4
c) 5
d) 1
View Answer

Answer: c

Explanation:
advertisement

8. Which of the regular expressions corresponds to the given problem statement:


P(x): Express the identifiers in C Programming language
l=letters
d=digits
a) (l+_)(d+_)*
b) (l+d+_)*
c) (l+_)(l+d+_)*
d) (_+d)(l+d+_)*
View Answer

Answer: c
Explanation: Identifiers in C Programming Language follows the following identifiers rule:
a) The name of the identifier should not begin with a digit.
b) It can only begin with a letter or a underscore.
c) It can be of length 1 or more.

9. Generate a regular expression for the given language:l


L(x): {xÎ{0,1}*| x ends with 1 nd does not contain a substring 01}
a) (0+01)*
b) (0+01)*1
c) (0+01)*(1+01)
d) All of the mentioned
View Answer

Answer: c
Explanation: (a) and (b) are the general cases where we restrict the acceptance of a string witrh
substring 00 but we ignore the case where the string needs to end with 1 which therby, does not
allows the acceptance of e.

10. The minimum number of transitions to pass to reach the final state as per the following
regular expression is:
{a,b}*{baaa}
a) 4
b) 5
c) 6
d) 3
View Answer

Answer: a

Explanation:
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Building Regular Expressions
» Next - Automata Theory Questions and Answers – Conversion by Eliminating states
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Shallow Foundations – Mat or Raft Footing
Geotechnical Engineering Questions and Answers – IS Code of Practice for Design of Raft
Foundations
advertisement
advertisement

Recommended Posts:

1. Java Questions and Answers


2. Database Management System Questions and Answers
3. Javascript Questions and Answers
4. C Programming Examples on Strings
5. C++ Questions and Answers
6. C Questions and Answers
7. Java Programming Examples on String Handling
8. RDBMS Questions and Answers
9. LISP Questions and Answers
10. Theory of Machines Questions and Answers
11. Python Questions and Answers
12. Java Programming Examples on Set & String Problems & Algorithms
13. C# Programming Examples on Functions
14. Electromagnetic Theory Questions and Answers
15. Network Theory Questions and Answers
16. C Programming Examples on Set & String Problems & Algorithms
17. PHP Questions and Answers
18. C++ Programming Examples on Set & String Problems & Algorithms
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Conversion by Eliminating states
« Prev
Next »

This set of Automata Theory MCQs focuses on “Conversion by Eliminating states”.

1. Which of the following is an utility of state elimination phenomenon?


a) DFA to NFA
b) NFA to DFA
c) DFA to Regular Expression
d) All of the mentioned
View Answer

Answer: c
Explanation: We use this algorithm to simplify a finite automaton to regular expression or vice
versa. We eliminate states while converting a given finite automata to its corresponding regular
expression.
advertisement
2. If we have more than one accepting states or an accepting state with an outdegree, which of
the following actions will be taken?
a) addition of new state
b) removal of a state
c) make the newly added state as final
d) more than one option is correct
View Answer

Answer: d
Explanation: If there is more than one accepting state or if the single accepting state as an out
degree , add a new accepting state, make all other states non accepting, and hold an e-transitions
from each former accepting state to the new accepting state.

3. Which of the following is not a step in elimination of states procedure?


a) Unifying all the final states into one using e-transitions
b) Unify single transitions to multi transitions that contains union of input
c) Remove states until there is only starting and accepting states
d) Get the resulting regular expression by direct calculation
View Answer

Answer: b
Explanation: While eliminating the states, we unify multiple transitions to one transition that
contains union of input and not the vice versa.

4. Can the given state diagram be reduced?

a) Yes
b) No
View Answer

Answer: a
Explanation: The state q2 can be eliminated with ease and the reduced state diagram can be
represented as:

advertisement
5. Which of the following methods is suitable for conversion of DFA to RE?
a) Brzozowski method
b) Arden’s method
c) Walter’s method
d) All of the mentioned
View Answer

Answer: a
Explanation: Brzozowski method takes a unique approach to generating regular expressions. We
create a system of regular expressions with one regular expression unknown for each state in M,
and then we solve the system for Rλ where Rλ is the regular expression associated with starting
state qλ.

6. State true or false:


Statement: The state removal approach identifies patterns within the graph and removes state,
building up regular expressions along each transition.
a) true
b) false
View Answer

Answer: a
Explanation: This method has the advantage over the transitive closure technique as it can easily
be visualized.

7. The behaviour of NFA can be simulated using DFA.


a) always
b) never
c) sometimes
d) none of the mentioned
View Answer

Answer: a
Explanation: For every NFA, there exists an equivalent DFA and vice versa.
advertisement

8. It is suitable to use ____________ method/methods to convert a DFA to regular expression.


a) Transitive Closure properties
b) Brzozowski method
c) State elimination method
d) All of the mentioned
View Answer

Answer: d
Explanation: For converting RE to DFA , first we convert RE to NFA (Thompson
Construction), and then NFA is converted into DFA(Subset Construction).

9. State true or false:


Statement: For every removed state, there is a regular expression produced.
a) true
b) false
View Answer

Answer: a
Explanation: For every state which is eliminated, a new regular expression is produced. The
newly generated regular expression act as an input for a state which is next to removed state.

10. Is it possible to obtain more than one regular expression from a given DFA using the state
elimination method?
a) Yes
b) No
View Answer

Answer: a
Explanation: Using different sequence of removal of state, we can have different possible
solution of regular expressions. For n-state deterministic finite automata excluding starting and
final states, n! Removal sequences are there. It is very tough to try all the possible removal
sequences for smaller expressions.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice MCQs on all areas of Automata Theory, here is complete set of 1000+ Multiple
Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – DFA to Regular Expressions
» Next - Automata Theory Questions and Answers – Regular Language & Expression – 1
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – IS Code of Practice for Design of Raft
Foundations
Automata Theory Questions and Answers – Regular Language & Expression – 1
advertisement
advertisement

Recommended Posts:

1. Computer Science Questions and Answers


2. Numerical Methods Questions and Answers
3. Java Algorithms, Problems & Programming Examples
4. Java Programming Examples on String Handling
5. C++ Programming Examples on Numerical Problems & Algorithms
6. C Programming Examples on Numerical Problems & Algorithms
7. RDBMS Questions and Answers
8. C# Programming Examples on Functions
9. PHP Questions and Answers
10. Solid State Chemistry Questions and Answers
11. Java Programming Examples on Numerical Problems & Algorithms
12. Python Questions and Answers
13. Java Programming Examples on Set & String Problems & Algorithms
14. C Programming Examples on Set & String Problems & Algorithms
15. Theory of Machines Questions and Answers
16. Electromagnetic Theory Questions and Answers
17. C++ Programming Examples on Set & String Problems & Algorithms
18. Network Theory Questions and Answers
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Regular Language & Expression – 1
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Regular Language & Expression”.

1. A regular language over an alphabet a is one that can be obtained from


a) union
b) concatenation
c) kleene
d) All of the mentioned
View Answer

Answer: d
Explanation: None.
advertisement

2. Regular expression {0,1} is equivalent to


a) 0 U 1
b) 0 / 1
c) 0 + 1
d) All of the mentioned
View Answer

Answer: d
Explanation: All are equivalent to union operation.

3. Precedence of regular expression in decreasing order is


a) * , . , +
b) . , * , +
c) . , + , *
d) + , a , *
View Answer
Answer: a
Explanation: None.

4. Regular expression Φ* is equivalent to


a) ϵ
b) Φ
c) 0
d) 1
View Answer

Answer: a
Explanation: None.
advertisement

5. a? is equivalent to
a) a
b) a+Φ
c) a+ϵ
d) wrong expression
View Answer

Answer: c
Explanation: Zero or one time repetition of previous character .

6. ϵL is equivalent to
a) ϵ
b) Φ
c) L
d) Lϵ
View Answer

Answer: c,d
Explanation: None.

7. (a+b)* is equivalent to
a) b*a*
b) (a*b*)*
c) a*b*
d) none of the mentioned
View Answer

Answer: b
Explanation: None.
advertisement

8. ΦL is equivalent to
a) LΦ
b) Φ
c) L
d) ϵ
View Answer

Answer: a,b
Explanation: None.

9. Which of the following pair of regular expression are not equivalent?


a) 1(01)* and (10)*1
b) x(xx)* and (xx)*x
c) (ab)* and a*b*
d) x+ and x*x+
View Answer

Answer: c
Explanation: (ab)*=(a*b*)*.

10. Consider following regular expression


i) (a/b)* ii) (a*/b*)* iii) ((ϵ/a)b*)*
Which of the following statements is correct
a) i,ii are equal and ii,iii are not
b) i,ii are equal and i,iii are not
c) ii,iii are equal and i,ii are not
d) all are equal
View Answer

Answer: d
Explanation: All are equivalent to (a+b)*.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Conversion by Eliminating states
» Next - Automata Theory Questions and Answers – Regular Language & Expression – 2
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Conversion by Eliminating states
Automata Theory Questions and Answers – Regular Language & Expression – 2
advertisement
advertisement

Recommended Posts:

1. C# Programming Examples on Data Structures


2. Java Programming Examples on Collections
3. C++ Programming Examples on Data-Structures
4. Java Programming Examples on Set & String Problems & Algorithms
5. C Programming Examples on Linked List
6. Python Programming Examples on Linked Lists
7. C Programming Examples on Strings
8. Simple C Programs
9. Java Programming Examples on Utility Classes
10. C Programming Examples on Data-Structures
11. C# Programming Examples on Functions
12. Java Programming Examples on Data-Structures
13. Theory of Machines Questions and Answers
14. Electromagnetic Theory Questions and Answers
15. Network Theory Questions and Answers
16. Compilers Questions and Answers
17. C Programming Examples on Stacks & Queues
18. Home
19. Python Programming Examples on Stacks & Queues
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Regular Language & Expression – 2
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Regular Language & Expression”.

1. How many strings of length less than 4 contains the language described by the regular
expression (x+y)*y(a+ab)*?
a) 7
b) 10
c) 12
d) 11
View Answer

Answer: c
Explanation: string of length 0 = Not possible (because y is always present).
string of length 1 = 1 (y)
string of length 2 = 3 (xy,yy,ya)
string of length 3 = 8 (xxy,xyy,yxy,yyy,yaa,yab,xya,yya)
advertisement

2. Which of the following is true?


a) (01)*0 = 0(10)*
b) (0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*
c) (0+1)*01(0+1)*+1*0* = (0+1)*
d) All of the mentioned
View Answer

Answer: d
Explanation: None.

3. A language is regular if and only if


a) accepted by DFA
b) accepted by PDA
c) accepted by LBA
d) accepted by Turing machine
View Answer

Answer: a
Explanation: All of above machine can accept regular language but all string accepted by
machine is regular only for DFA.

4. Regular grammar is
a) context free grammar
b) non context free grammar
c) english grammar
d) none of the mentioned
View Answer

Answer: a
Explanation: Regular grammar is subset of context free grammar.
advertisement

5. Let the class of language accepted by finite state machine be L1 and the class of languages
represented by regular expressions be L2 then
a) L1<L2
b) L1>=L2
c) L1 U L2 = .*
d) L1=L2
View Answer

Answer: d
Explanation: Finite state machine and regular expression have same power to express a
language.

6. Which of the following is not a regular expression?


a) [(a+b)*-(aa+bb)]*
b) [(0+1)-(0b+a1)*(a+b)]*
c) (01+11+10)*
d) (1+2+0)*(1+2)*
View Answer

Answer: b
Explanation: Except b all are regular expression*.
7. Regular expression are
a) Type 0 language
b) Type 1 language
c) Type 2 language
d) Type 3 language
View Answer

Answer: a
Explanation: According to Chomsky hierarchy .
advertisement

8. Which of the following is true?


a) Every subset of a regular set is regular
b) Every finite subset of non-regular set is regular
c) The union of two non regular set is not regular
d) Infinite union of finite set is regular
View Answer

Answer: b
Explanation: None.

9. L and ~L are recursive enumerable then L is


a) Regular
b) Context free
c) Context sensitive
d) Recursive
View Answer

Answer: d
Explanation:If L is recursive enumerable and its complement too if and only if L is recursive.

10. Regular expressions are closed under


a) Union
b) Intersection
c) Kleen star
d) All of the mentioned
View Answer

Answer: d
Explanation: According to definition of regular expression.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Regular Language & Expression – 1
» Next - Automata Theory Questions and Answers – Converting Regular Expressions to
Automata
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Regular Language & Expression – 1
Geotechnical Engineering Questions and Answers – Types of Piles
advertisement
advertisement

Recommended Posts:

1. Java Programming Examples on Utility Classes


2. PHP Questions and Answers
3. C Programming Examples on Stacks & Queues
4. Python Programming Examples on Stacks & Queues
5. Java Programming Examples on Java.Lang
6. C# Programming Examples on Strings
7. C Tutorials
8. LISP Questions and Answers
9. C# Programming Examples on Functions
10. C Programming Examples on Strings
11. Network Theory Questions and Answers
12. Java Programming Examples on String Handling
13. C++ Programming Examples on Set & String Problems & Algorithms
14. Theory of Machines Questions and Answers
15. Electromagnetic Theory Questions and Answers
16. C Programming Examples on Set & String Problems & Algorithms
17. Java Programming Examples on Set & String Problems & Algorithms
18. Home
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Converting Regular Expressions to Automata
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Converting Regular Expressions to Automata”.

1. What kind of expressions do we used for pattern matching?


a) Regular Expression
b) Rational Expression
c) Regular & Rational Expression
d) None of the mentioned
View Answer
Answer: c
Explanation: In automata theory, Regular Expression(sometimes also called the Rational
Expression ) is a sequence or set of characters that define a search pattern, mainly for the use in
pattern matching with strings or string matching.
advertisement

2. Which of the following do Regexps do not find their use in?


a) search engines
b) word processors
c) sed
d) none of the mentioned
View Answer

Answer: d
Explanation: Regexp processors are found in several search engines, seach and replace
mechanisms, and text processing utilities.

3. Which of the following languages have built in regexps support?


a) Perl
b) Java
c) Python
d) C++
View Answer

Answer: a
Explanation: Many languages come with built in support of regexps like Perl, Javascript, Ruby
etc. While some provide support using standard libraries like .NET, Java, Python, C++, C and
POSIX.

4. The following is/are an approach to process a regexp:


a) Contruction of NFA and subsequently, a DFA.
b) Thompson’s Contruction Algorithm
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: A regexp processor translates the syntax into internal representation which can be
executed and matched with a string and that internal representation can have several approaches
like the ones mentioned.

5. Are the given two patterns equivalent?


(1) gray|grey
(2) gr(a|e)y
a) yes
b) no
View Answer
Answer: a
Explanation: Paranthesis can be used to define the scope and precedence of operators. Thus,
both the expression represents the same pattern.
advertisement

6. Which of the following are not quantifiers?


a) Kleene plus +
b) Kleene star *
c) Question mark ?
d) None of the mentioned
View Answer

Answer: d
Explanation: A quantifier after a token specifies how often the preceding element is allowed to
occur. ?, *, +, {n}, {min, }, {min, max} are few quantifiers we use in regexps implementations.

7. Which of the following cannot be used to decide whether and how a given regexp matches a
string:
a) NFA to DFA
b) Lazy DFA algorithm
c) Backtracking
d) None of the mentioned
View Answer

Answer: d
Explanation: There are at least three algorithms which decides for us, whether and how a regexp
matches a string which included the transformation of Non deterministic automaton to
deterministic finite automaton, The lazy DFA algorithm where one simulates the NFA directly,
building each DFA on demand and then discarding it at the next step and the process of
backtracking whose running time is exponential.

8. What does the following segment of code output?


$string1 = "Hello World\n";
if ($string1 =~ m/(H..).(l..)/) {
print "We matched '$1' and '$2'.\n";
}

a) We matched ‘Hel’ and ‘ld’


b) We matched ‘Hel’ and ‘lld’
c) We matched ‘Hel’ and ‘lo ‘
d) None of the mentioned
View Answer

Answer: c
Explanation: () groups a series of pattern element to a single element.
When we use pattern in parenthesis, we can use any of ‘$1’, ‘$2’ later to refer to the previously
matched pattern.
advertisement

9. Given segment of code:


$string1 = "Hello\nWorld\n";
if ($string1 =~ m/d\n\z/) {
print "$string1 is a string ";
print "that ends with 'd\\n'.\n";
}

What does the symbol /z does?


a) changes line
b) matches the beginning of a string
c) matches the end of a string
d) none of the mentioned
View Answer

Answer: c
Explanation: It matches the end of a string and not an internal line.The given segment of code
outputs:
Hello
World
is a string that ends with ‘d\n’
advertisement

10. Conversion of a regular expression into its corresponding NFA :


a) Thompson’s Construction Algorithm
b) Powerset Construction
c) Kleene’s algorithm
d) None of the mentioned
View Answer

Answer: a
Explanation: Thompson construction algorithm is an algorithm in automata theory used to
convert a given regular expression into NFA. Similarly, Kleene algorithm is used to convert a
finite automaton to a regular expression.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Regular Language & Expression – 2
» Next - Automata Theory Questions and Answers – Regular Expression in UNIX
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Types of Piles
Geotechnical Engineering Questions and Answers – Load Carrying Capacity of Piles
advertisement
advertisement

Recommended Posts:
1. VLSI Questions and Answers
2. Python Programming Examples on Stacks & Queues
3. Cryptography and Network Security Questions and Answers
4. Java Programming Examples on Numerical Problems & Algorithms
5. Java Programming Examples on Utility Classes
6. Neural Networks Questions and Answers
7. LISP Questions and Answers
8. C++ Algorithms, Problems & Programming Examples
9. Java Algorithms, Problems & Programming Examples
10. Theory of Machines Questions and Answers
11. C# Programming Examples on Functions
12. Network Theory Questions and Answers
13. Electromagnetic Theory Questions and Answers
14. Java Programming Examples on String Handling
15. Compilers Questions and Answers
16. C Programming Examples on Strings
17. C++ Programming Examples on Set & String Problems & Algorithms
18. C Programming Examples on Set & String Problems & Algorithms
19. Java Programming Examples on Set & String Problems & Algorithms
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Regular Expression in UNIX
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Regular Expression in UNIX”.

1. Which among the following is not a UNIX command for regular expressions?
a) ed
b) sed
c) vi
d) none of the mentioned
View Answer

Answer: d
Explanation: Regular expressions are used by different commands in Unix like ed, sed, grep,
awk, vi, etc. Sed stands for stream editor which is exclusively used for executing scripts.
advertisement

2. What is the significance of $ used in regular expression in UNIX?


a) Matches the beginning of the line
b) Matches the end of lines
c) Matches any single character
d) None of the mentioned
View Answer

Answer: b
Explanation: Regular expression provides more flexibility while matching string patterns.
Special characters like ^, $, *, . are very useful.

3. Generate the regular expression to match blank lines


a) / */
b) /bl
c) /^?/
d) /^$/
View Answer

Answer: d
Explanation: There are few expressions which provide the utility of matching metacharacters
including /^$/ for blank lines, / */ for matching one or more spaces, /^.*$/ for matching an entire
line whatever it is.

4. For the given syntax of sed, which among the following is not a correct option?
General syntax of sed: /pattern/action
a) / are used as delimiters
b) pattern refers to a regular expression
c) pattern refers to the string to be matched
d) action refers to the command
View Answer

Answer: c
Explanation: In the general syntax of sed, pattern is the regular expression and action refers to
the command given (p: prints the line, d: deletes the line, etc).
advertisement

5. What does grep do in UNIX?


a) It is an editor in UNIX
b) It searches for text patterns
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: b
Explanation: The grep is a standard UNIX utility program that searches through a set of files in
search of a text pattern,specified through a regular expression.

6. State true or false:


Statement: A regular expression is a sequence of characters that represent a pattern.
a) true
b) false
View Answer
Answer: a
Explanation: Such a generated pattern could be a fixed word or describe something like more
general.

7. Which of the following options support the given statement?


Statement: A regular expression could be a fixed word or describe something like more general.
a) This flexibility makes Regular expression invaluable.
b) This flexibility makes the Regular expression unvaluable.
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: a
Explanation: Regular expressions are very much invaluable tools; they can be used to find a
particular segment of line in a file and instruct to take certain actions.
advertisement

8. What does the following segment of code does?


grep -i man heroes.txt
a) manually opens a file called heroes.txt
b) manages heroes.txt
c) search for “man” in the file “heroes.txt”
d) none of the mentioned
View Answer

Answer: c
Explanation: grep is a command which finds the pattern in a particular text segment.Here, it
scans each line in heroes.txt and looks for an m followed by a and then followed by n.

9. What does “X?” do regular expression operator?


a) Matches zero or more capital X’s.
b) Matches no or one occurence of the capital letter X.
c) Matches one or more capital X’s.
d) All of the mentioned
View Answer

Answer: b
Explanation: There are many other common regular expression operators like $, ^, etc. Which
have their own respective purposes.

10. Which of the following does not support regular expressions?


a) sed
b) awk
c) emacs
d) none of the mentioned
View Answer

Answer: d
Explanation: There are many UNIX tools including vi, Emacs, sed, awk and modern
programming languages which support regular expressions.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Converting Regular Expressions to
Automata
» Next - Automata Theory Questions and Answers – Lexical Analysis
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Load Carrying Capacity of Piles
Geotechnical Engineering Questions and Answers – Pile Load Tests
advertisement
advertisement

Recommended Posts:

1. VLSI Questions and Answers


2. Javascript Questions and Answers
3. C Programming Examples on Strings
4. Java Programming Examples on String Handling
5. C# Programming Examples on Functions
6. RDBMS Questions and Answers
7. PHP Questions and Answers
8. Information Science Questions and Answers
9. Computer Science Questions and Answers
10. Python Questions and Answers
11. Linux Questions and Answers
12. Network Theory Questions and Answers
13. Theory of Machines Questions and Answers
14. C Programming Examples on Set & String Problems & Algorithms
15. C++ Programming Examples on Set & String Problems & Algorithms
16. Electromagnetic Theory Questions and Answers
17. Java Programming Examples on Set & String Problems & Algorithms
18. Compilers Questions and Answers
19. Unix Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Lexical Analysis
« Prev
Next »
This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Lexical Analysis”.

1. Lexemes can be referred to as:


a) elements of lexicography
b) sequence of alphanumeric characters in a token
c) lexical errors
d) none of the mentioned
View Answer

Answer: b
Explanation: A lexeme is a string of characters that form a syntactic unit. It is reasonable to say
that is the sequence of alphanumeric characters in a token.
advertisement

2. If the lexical analyser finds a lexeme with the same name as that of a reserved word,it
_________
a) overwrites the word
b) overwrites the functionality
c) generates an error
d) something else
View Answer

Answer: c
Explanation: Reserved words are known as keywords and they are specific and reserved with its
functionality to a language. Thus, getting an input with the same name by the analyzer will
generate an error.

3. The methodology to show an error when the analyzer faces a keyword over an user’s input is
based on:
a) rule priority
b) longest match rule
c) keyword-out rule
d) none of mentioned
View Answer

Answer: a
Explanation: The lexical analyzer follows the rule priority where its prioritizes keywords over
an input it gets with the same name as that of the keyword and thus generates an error.

4. State true or false:


Statement: A lexical analyzer reads the source code line by line.
a) True
b) False
View Answer

Answer: b
Explanation: A lexical analyzer reads the source code letter by letter and when it encounters a
space or an operator or any special character, it decides that the word is completed.
5.Which among the following statement is correct?
Statement 1: When the analyzer scans ‘int’ and ‘intvalue’, it is not able to decide whether the int
leads to a keyword or an identifier.
Statement 2: Longest Match Rule
advertisement

a) Statement 1 is assertion, Statement 2 is the reason


b) Statement 1 is assertion, Statement 2 is the solution
c) There is no such Statement 2
d) This is not a function of Lexical Analyzer
View Answer

Answer: b
Explanation: The Longest Match rule states that the lexeme scanned should be determined on
the basis of longest match among all the token available.

6. The output of the lexical and syntax analyzer can stated as:
a) parse stream, parse tree
b) token tree, parse tree
c) token stream, parse tree
d) all of the mentioned
View Answer

Answer: c
Explanation: The lexical analyzer outputs the stream of token which is taken up by syntax
analyzer one by one against the production rule and parse tree is generated.

7. Which among the following is not a tool to construct lexical analyzer from a regular
expression?
a) lex
b) flex
c) jflex
d) none of the mentioned
View Answer

Answer: d
Explanation: Lexical analysis is done using few tools such as lex, flex and jflex. Jflex is a
computer program that generates lexical analyzers (also known as lexers or scanners) and works
apparently like lex and flex. Lex is commonly used with yacc parser generator.

8. A program that performs lexical analysis is termed as:


a) scanner
b) lexer
c) tokenizer
d) all of the mentioned
View Answer
Answer: d
Explanation: A program which performs lexical analysis is called lexer, scanner or lexer.
Nowadays, lexer is combined with a parser which allows syntactic analysis.

9. Lexers and parsers are not found in which of the following?


a) compiler front end processing
b) prettyprinters
c) linters
d) none of the mentioned
View Answer

Answer: d
Explanation: Lexers and parsers are most commonly used in compilers, but it has more
application elsewhere like in prettyprinters or linters(application of stylistic formatting
conventions to textfiles, source code, etc.).
advertisement

10. Which phase of compiler includes Lexical Analysis?


a) 1
b) 2
c) 3
d) Its primary function, not in any phase
View Answer

Answer: a
Explanation: The first phase of compilation process is called lexical analysis. It fragments the
source code into token which is the smallest programming unit of a program.

11. Which of the following characters are ignored while lexical analysis?
a) .
b) =
c) #
d) WhiteSpace
View Answer

Answer: d
Explanation: The lexical analyzer ignores all the whitespaces and fragments the program into
tokens.

12. ____________ is used for grouping up of characters into token.


a) Lexical Analyzer
b) oolex
c) jflex
d) All of the mentioned
View Answer

Answer: d
Explanation: oolex, flex, lex, jflex, all are lexical analyzer tools which perform the following
function.
13. The action of parsing the source code into proper syntactic classes is known as:
a) Parsing
b) Interpretation analysis
c) Lexicography
d) Lexical Analysis
View Answer

Answer: d
Explanation: Lexical analysis or scanning is the process of parsing the source code into proper
syntactic classes. It gets things ready for the parser with lexemes to built the parse tree.

14. Which of the following is the task of lexical analysis?


a) To build the uniform symbol table
b) To initialize the variables
c) To organize the variables in a lexical order
d) None of the mentioned
View Answer

Answer: a
Explanation: Lexical analysis involves the following task:
a) Building a uniform symbol table
b) Parsing the source code into tokens
c) Building a literal and identifier table
advertisement

15. The scanner outputs:


a) Stream of tokens
b) Image file
c) Intermediate code
d) Machine code
View Answer

Answer: a
Explanation: A scanner or a lexical analyzer takes a source code as input and outputs a stream of
token after fragmenting the code.

16. The phase of compilation which involves type checking is:


a) Parsing
b) Scanning
c) Syntax directed translation
d) Semantic Analyzer
View Answer

Answer: c
Explanation: Type checking is a process which is performed during Syntax directed translation.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.
Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Regular Expression in UNIX
» Next - Automata Theory Questions and Answers – Finding Patterns in Text,Algebric Laws
and Derivatives
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Pile Load Tests
Automata Theory Questions and Answers – Finding Patterns in Text,Algebric Laws and
Derivatives
advertisement
advertisement

Recommended Posts:

1. MATLAB Questions and Answers


2. Python Programming Examples on Graphs
3. Home
4. C Programming Examples on Linked List
5. C++ Algorithms, Problems & Programming Examples
6. Java Algorithms, Problems & Programming Examples
7. C Programming Examples using Recursion
8. LISP Questions and Answers
9. C# Programming Examples on Data Structures
10. C Programming Examples
11. Python Programming Examples on Trees
12. Electromagnetic Theory Questions and Answers
13. C Programming Examples on Trees
14. C Programming Examples without using Recursion
15. Theory of Machines Questions and Answers
16. Javascript Questions and Answers
17. Structural Analysis Questions and Answers
18. Network Theory Questions and Answers
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Finding Patterns in Text,Algebric Laws and
Derivatives
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Finding Patterns in Text,Algebric Laws and Derivatives”.
1. The minimum length of a string {0,1}* not in the language corresponding to the given regular
expression:
(0*+1*)(0*+1*)(0*+1*)
a) 3
b) 4
c) 5
d) 6
View Answer

Answer: b
Explanation: 0101 or 1010 the strings with minimum length on {0,1}* which does not belong to
the language of the given regular expression.Other strings like 111, 000, 1101, etc are accepted
by the language .
advertisement

2. Which of the following regular expression is equivalent to R(1,0)?


R(1,0)={111*}*
a) (11+111)*
b) (111+1111)*
c) (111+11*)*
d) All of the mentioned
View Answer

Answer: a
Explanation: What we observe from the question is that, it includes e and 11 and any number of
1’s then. Therefore, its simplifies when we write the same reg. Expression as (11+111)*.

3. The minimum number of 1’s to be used in a regular expression of the given language:
R(x): The language of all strings containing exactly 2 zeroes.
a) 2
b) 3
c) 0
d) 1
View Answer

Answer: b
Explanation: It is not required to automate the question if asked theoretically.The number of
zeroes fixed is 2. Therefore, we can represent the regular expression as 1*01*01*.

4. The given regular language corresponds to which of the given regular language
e+1+(1+0)*0+(0+1)*11
a) The language of all strings that end with 11 or 00
b) The language of all strings that end with 0 or 1
c) The language of all strings which does not end with 01
d) None of the mentioned
View Answer

Answer: c
Explanation: According to the given regular expression, e is accepted by its language and it does
not end with 00 or 11 or 0 or 1. Thus option a and b are eliminated. Further, the regular
expression is valid for the third option.
advertisement

5. Statement: If we take the union of two identical expression, we can replace them by one copy
of the expression.
Which of the following is a correct option for the given statement?
a) Absorption Law
b) Idempotent Law
c) Closure Law
d) Commutative Law
View Answer

Answer: b
Explanation: Idempotent Law states that if we take the union of two like expression, we can use
a copy of the expression instead i.e. L+L=L. The common arithmetic operators are not
idempotent.

6. Which among the following can be an annihilator for multiplication operation?


a) 0
b) 1
c) 100
d) 22/7
View Answer

Answer: a
Explanation: An annihilator for an operator is a value such that when the operator is applied to
the annihilator and some other value, the result is the annihilator.

7. Statement: A digit, when used in the CFG notation, will always be used as a terminal.
State true or false?
a) True
b) False
View Answer

Answer: a
Explanation: Lowercase letters near the beginning of an alphabet, a, b and so on are terminal
symbols. We shall also assume that digits and other characters such as + or parenthesis are
terminals.
advertisement

8. Choose the incorrect process to check whether the string belongs to the language of certain
variable or not?
a) recursive inference
b) derivations
c) head to body method
d) All of the mentioned
View Answer
Answer: d
Explanation: There are two approaches to infer that certain string are in the language of a certain
variable. The most conventional way is to use the rules from body to head, recursive inference.
The second approach is expanding the starting variable using one of its productions whose head
is tart symbol and derive a string consisting entirely of terminals(head to body or derivations).

9. Statement: Left most derivations are lengthy as compared to Right most derivations.
Choose the correct option:
a) correct statement
b) incorrect statement
c) may or may not be correct
d) depends on the language of the grammar
View Answer

Answer: c
Explanation: It completely depends on the person who develops the grammar of any language,
how to make use of the tools i.e. leftmost and rightmost derivations.

10. A->aAa|bAb|a|b|e
Which among the following is the correct option for the given production?
a) Left most derivation
b) Right most derivation
c) Recursive Inference
d) None of the mentioned
View Answer

Answer: a
Explanation: The given form represents leftmost derivations in which at each step we replace
the leftmost variable by one of its production bodies.

advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!
Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Lexical Analysis
» Next - Automata Theory Questions and Answers – Properties-Non Regular Languages
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Lexical Analysis
Geotechnical Engineering Questions and Answers – Group Action in Piles
advertisement
advertisement

Recommended Posts:

1. Java Programming Examples on Classes


2. LISP Questions and Answers
3. C Tutorials
4. C# Questions and Answers
5. Theory of Machines Questions and Answers
6. Ruby Programming Questions and Answers
7. Java Programming Examples on Utility Classes
8. C# Programming Examples on Functions
9. Network Theory Questions and Answers
10. Electromagnetic Theory Questions and Answers
11. PHP Questions and Answers
12. C# Programming Examples on Strings
13. Python Questions and Answers
14. C++ Programming Examples on Set & String Problems & Algorithms
15. C Programming Examples on Set & String Problems & Algorithms
16. Java Programming Examples on Set & String Problems & Algorithms
17. C Programming Examples on Strings
18. Java Programming Examples on String Handling
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Properties-Non Regular Languages
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers focuses on “Properties-Non
Regular Languages”.

1. All the regular languages can have one or more of the following descriptions:
i) DFA ii) NFA iii) e-NFA iv) Regular Expressions
Which of the following are correct?
a) i, ii, iv
b) i, ii, iii
c) i, iv
d) i, ii, iii, iv
View Answer

Answer: d
Explanation: The class of languages known as the regular language has atleast four different
descriptions: i) DFA ii) NFA iii) e-NFA iv) Regular Expressions
advertisement

2. Which of the technique can be used to prove that a language is non regular?
a) Ardens theorem
b) Pumping Lemma
c) Ogden’s Lemma
d) None of the mentioned
View Answer

Answer: b
Explanation: We use the powerful technique called Pumping Lemma, for showing certain
languages not to be regular. We use Ardens theorem to find out a regular expression out of a
finite automaton.

3. Which of the following language regular?


a) {aibi|i>=0}
b) {aibi|0<i<5}
c) {aibi|i>=1}
d) None of the mentioned
View Answer

Answer: b
Explanation: Here, i has limits i.e. the language is finite, contains few elements and can be
graphed using a deterministic finite automata. Thus, it is regular. Others can be proved non
regular using Pumping lemma.

4. Which of the following are non regular?


a) The set of strings in {a,b}* with an even number of b’s
b) The set of strings in {a, b, c}* where there is no c anywhere to the left of a
c) The set of strings in {0, 1}* that encode, in binary, an integer w that is a multiple of 3.
Interpret the empty strings e as the number 0.
d) None of the mentioned
View Answer

Answer: d
Explanation: All of the given languages are regular and finite and thus, can be represented using
respective deterministic finite automata. We can also use mealy or moore machine to represent
remainders for option c.
advertisement

5. If L is DFA-regular, L’ is
a) Non regular
b) DFA-regular
c) Non-finite
d) None of the mentioned
View Answer

Answer: b
Explanation: This is a simple example of a closure property: a property saying that the set of
DFA-regular languages is closed under certain operations.

6. Which of the following options is incorrect?


a) A language L is regular if and only if ~L has finite number of equivalent classes.
b) Let L be a regular language. If ~L has k equivalent classes, then any DFA that recognizes L
must have atmost k states.
c) A language L is NFA-regular if and only if it is DFA-regular.
d) None of the mentioned
View Answer

Answer: b
Explanation: Let L be a regular language. If ~L has k equivalent classes, then any DFA that
recognizes L must have atleast k states.

7. Myphill Nerode does the following:


a) Minimization of DFA
b) Tells us exactly when a language is regular
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: In automata theory, the Myphill Nerode theorem provides a necessary and
sufficient condition for a language to be regular. The Myphill Nerode theorem can be used to
show a language L is regular by proving that the number of equivalence classes of RL(relation)
is finite.
advertisement

8. Which of the following are related to tree automaton?


a) Myphill Nerode Theorem
b) State machine
c) Courcelle’s Theorem
d) All of the mentioned
View Answer

Answer: d
Explanation: The myphill nerode theorem can be generalized to trees and an application of tree
automata prove an algorithmic meta theorem about graphs.

9. Given languages:
i) {anbn|n>=0}
ii) <div>n</div>n
iii) {w∈{a,b}∗| #a(w)=#b(w)}, # represents occurrences
Which of the following is/are non regular?
a) i, iii
b) i
c) iii
d) i, ii, iii
View Answer

Answer: d
Explanation: There is no regular expression that can parse HTML documents. Other options are
also non-regular as they cannot be drawn into finite automaton.

10. Finite state machine are not able to recognize Palindromes because:
a) Finite automata cannot deterministically find the midpoint
b) Finite automata cannot remember arbitarily large amount of data
c) Even if the mid point is known, it cannot find whether the second half matches the first
d) All of the mentioned
View Answer

Answer: d
Explanation: It is the disadvantage or lack of property of a DFA that it cannot remember an
arbitrarily such large amount of data which makes it incapable of accepting such languages like
palindrome, reversal, etc.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Finding Patterns in Text,Algebric Laws and
Derivatives
» Next - Automata Theory Questions and Answers – Pumping Lemma for Regular Language
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Under-Reamed Pile Foundations
Geotechnical Engineering Questions and Answers – Construction of Under-Reamed Pile
Foundation
advertisement
advertisement

Recommended Posts:

1. VLSI Questions and Answers


2. Engineering Mathematics Questions and Answers
3. PHP Questions and Answers
4. Java Programming Examples on Set & String Problems & Algorithms
5. Probability and Statistics Questions and Answers
6. Discrete Mathematics Questions and Answers
7. Computer Science Questions and Answers
8. C++ Programming Examples on Set & String Problems & Algorithms
9. C Programming Examples on Set & String Problems & Algorithms
10. Information Science Questions and Answers
11. Aerodynamics Questions and Answers
12. Theory of Machines Questions and Answers
13. Electromagnetic Theory Questions and Answers
14. Network Theory Questions and Answers
15. Compilers Questions and Answers
16. Automata Theory Questions and Answers
17. Automata Theory Questions and Answers – Pumping Lemma for Context Free Language
18. Automata Theory Questions and Answers – Testing Emptiness and Membership
19. Automata Theory Questions and Answers – Markup Languages
20. Automata Theory Questions and Answers – DPDA and Context Free Languages
advertisement

Automata Theory Questions and Answers –


Pumping Lemma for Regular Language
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Pumping Lemma for Regular Language”.

1. Relate the following statement:


Statement: All sufficiently long words in a regular language can have a middle section of words
repeated a number of times to produce a new word which also lies within the same language.
a) Turing Machine
b) Pumping Lemma
c) Arden’s theorem
d) None of the mentioned
View Answer

Answer: b
Explanation: Pumping lemma defines an essential property for every regular language in
automata theory. It has certain rules which decide whether a language is regular or not.
advertisement

2. While applying Pumping lemma over a language, we consider a string w that belong to L and
fragment it into _________ parts.
a) 2
b) 5
c) 3
d) 6
View Answer

Answer: c
Explanation: We select a string w such that w=xyz and |y|>0 and other conditions. However,
there exists an integer n such that |w|>=n for any wÎL.
3. 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
b) y
c) z
d) all of the mentioned
View Answer

Answer: b
Explanation: The lemma says, the portion y in xyz cannot be zero or empty i.e. |y|>0, this
condition needs to be fulfilled to check the conclusion condition.

4. Let w= xyz and y refers to the middle portion and |y|>0.What do we call the process of
repeating y 0 or more times before checking that they still belong to the language L or not?
a) Generating
b) Pumping
c) Producing
d) None of the mentioned
View Answer

Answer: b
Explanation: The process of repeatation is called pumping and so, pumping is the process we
perform before we check whether the pumped string belongs to L or not.
advertisement

5. There exists a language L. We define a string w such that w∈L and w=xyz and |w| >=n for
some constant integer n.What can be the maximum length of the substring xy i.e. |xy|<=?
a) n
b) |y|
c) |x|
d) none of the mentioned
View Answer

Answer: a
Explanation: It is the first conditional statement of the lemma that states that |xy|<=n, i.e. the
maximum length of the substring xy in w can be n only.

6. Fill in the blank in terms of p, where p is the maximum string length in L.


Statement: Finite languages trivially satisfy the pumping lemma by having n = ______
a) p*1
b) p+1
c) p-1
d) None of the mentioned
View Answer

Answer: b
Explanation: Finite languages trivially satisfy the pumping lemma by having n equal to the
maximum string length in l plus 1.
7. Answer in accordance to the third and last statement in pumping lemma:
For all _______ xyiz ∈L
a) i>0
b) i<0
c) i<=0
d) i>=0
View Answer

Answer: d
Explanation: Suppose L is a regular language . Then there is an integer n so that for any x∈L
and |x|>=n, there are strings u,v,w so that
x= uvw
|uv|<=n
|v|>0
for any m>=0, uvmw ∈L.
advertisement

8. If d is a final state, which of the following is correct according to the given diagram?

a) x=p, y=qr, z=s


b) x=p, z=qrs
c) x=pr, y=r, z=s
d) All of the mentioned
View Answer

Answer: a
Explanation: The FSA accepts the string pqrs. In terms of pumping lemma, the string pqrs is
broken into an x portion an a, a y portion qr and a z portion s.

9. Let w be a string and fragmented by three variable x, y, and z as per pumping lemma. What
does these variables represent?
a) string count
b) string
c) both (a) and (b)
d) none of the mentioned
View Answer

Answer: a
Explanation: Given: w =xyz. Here, xyz individually represents strings or rather substrings which
we compute over conditions to check the regularity of the language.
10. Which of the following one can relate to the given statement:
Statement: If n items are put into m containers, with n>m, then atleast one container must
contain more than one item.
a) Pumping lemma
b) Pigeon Hole principle
c) Count principle
d) None of the mentioned
View Answer

Answer: b
Explanation: Pigeon hole principle states the following example: If there exists n=10 pigeons in
m=9 holes, then since 10>9, the pigeonhole principle says that at least one hole has more than
one pigeon.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Properties-Non Regular Languages
» Next - Automata Theory Questions and Answers – Applications of Pumping
Lemma/Pigeonhole principle
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Construction of Under-Reamed Pile
Foundation
Geotechnical Engineering Questions and Answers – Cased Cast-in-Situ Concrete Piles
advertisement
advertisement

Recommended Posts:

1. Java Questions and Answers


2. Java Programming Examples on String Handling
3. Environmental Engineering Questions and Answers
4. Information Science Questions and Answers
5. LISP Questions and Answers
6. C Programming Examples on Strings
7. Java Programming Examples on Set & String Problems & Algorithms
8. PHP Questions and Answers
9. Strength of Materials Questions and Answers
10. Computer Science Questions and Answers
11. C++ Programming Examples on Set & String Problems & Algorithms
12. Engineering Physics II Questions and Answers
13. C Programming Examples on Set & String Problems & Algorithms
14. C# Programming Examples on Functions
15. Ruby Programming Questions and Answers
16. Electromagnetic Theory Questions and Answers
17. Compilers Questions and Answers
18. Network Theory Questions and Answers
19. Theory of Machines Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Applications of Pumping Lemma/Pigeonhole
principle
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Applications of Pumping Lemma/Pigeonhole principle”.

1. Which kind of proof is used to prove the regularity of a language?


a) Proof by contradiction
b) Direct proof
c) Proof by induction
d) None of the mentioned
View Answer

Answer: a
Explanation: We use the method of proof by contradiction in pumping lemma to prove that a
language is regular or not.
advertisement

2. The language of balanced paranthesis is


a) regular
b) non regular
c) may be regular
d) none of the mentioned
View Answer

Answer: b
Explanation: Given n, there is a string of balanced parentheses that begins with more than p left
parentheses, so that y will contain entirely of left parentheses. By repeating y, we can produce a
string that does not contain the same number of left and right parentheses, and so they cannot be
balanced.

3. State true or false:


Statement: Pumping lemma gives a necessary but not sufficient condition for a language to be
regular.
a) true
b) false
View Answer

Answer: a
Explanation: The converse of the lemma is not true. There may exists some language which
satisfy all the conditions of the lemma and still be non-regular.

4. Which of the following is/are an example of pigeon hole principle?


a) Softball team
b) Sock picking
c) Hair counting
d) All of the mentioned
View Answer

Answer: d
Explanation: There are several applications of pigeonhole principle:
Example: The softball team: Suppose 7 people who want to play softball(n=7 items), with a
limitation of only 4 softball teams to choose from. The pigeonhole principle tells us that they
cannot all play for different teams; there must be atleast one team featuring atleast two of the
seven players.
advertisement

5. Pigeonhole principle can be applied in the following computer science algorithms:


a) hashing algorithm
b) lossless compression algorithm
c) both (a) and (b)
d) none of the mentioned
View Answer

Answer: c
Explanation: Collisions are inevitable in a hash table because the number of possible keys
exceeds the number of indices in the array.

6. If n objects are distributed over m places, and n < m, then some of the places receive:
a) at least 2 objects
b) at most 2 objects
c) no object
d) none of the mentioned
View Answer

Answer: c
Explanation: This is one of the alternative formulations of the pigeon hole principle. As n < m,
there will exist some place which will not receive any of the object.

7. Which of the following fields may have pigeonhole principle violated?


a) Discrete mathematics
b) Computer Science
c) Quantum Mechanics
d) None of the mentioned
View Answer
Answer: c
Explanation: Y Aharonov proved mathematically the violation of pigeon hole principle in
Quantum mechanics and proposed inferometric experiments to test it.
advertisement

8. Which of the following is not an application of Pumping Lemma?


a) {0i1i|i>=0}
b) {0ix|i>=0, x∈{0, 1}* and |x|<=i}
c) {0n| n is prime}
d) None of the mentioned
View Answer

Answer: d
Explanation: None of the mentioned are regular language and are an application to the technique
Pumping Lemma. Each one of the mentioned can be proved non regular using the steps in
Pumping lemma.

9. Which of the following can refer a language to be non regular?


a) Pumping Lemma
b) Myphill Nerode
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: On the contrary, the typical way to prove that a language is to construct either a
finite state machine or a regular expression for the language.

10. Which of the following is not an example of counting argument?


a) Pigeonhole principle
b) Dirichlet’s drawer principle
c) Dirichlet’s box principle
d) None of the mentioned
View Answer

Answer: d
Explanation: Pigeon hole principle or Dirichlet’s drawer principle or Dirichlet’s box principle is
an example of counting argument whose field is called Combinatorics.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Pumping Lemma for Regular Language
» Next - Automata Theory Questions and Answers – Closure Properties under Boolean
Operations
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Cased Cast-in-Situ Concrete Piles
Geotechnical Engineering Questions and Answers – Uncased Cast-in-Situ Concrete Piles
advertisement
advertisement

Recommended Posts:

1. Machine Tools & Machining Questions and Answers


2. C Programming Examples on Searching and Sorting
3. Information Science Questions and Answers
4. PHP Questions and Answers
5. Computer Science Questions and Answers
6. Engineering Physics II Questions and Answers
7. Discrete Mathematics Questions and Answers
8. Bachelor of Computer Applications Questions and Answers
9. Master of Computer Applications Questions and Answers
10. Network Theory Questions and Answers
11. Electromagnetic Theory Questions and Answers
12. Compilers Questions and Answers
13. Theory of Machines Questions and Answers
14. Automata Theory Questions and Answers – Context Free Grammar-Derivations and
Definitions
15. Discrete Mathematics Questions and Answers – Counting – Pigeonhole Principle
16. Automata Theory Questions and Answers – Operators of Regular Expression
17. Automata Theory Questions and Answers
18. Automata Theory Questions and Answers – Reversal-Homomorphism and Inverse
Homomorphism
19. Automata Theory Questions and Answers – The Language of NFA
20. Automata Theory Questions and Answers – Intersection with Regular Languages
advertisement

Automata Theory Questions and Answers –


Closure Properties under Boolean Operations
« Prev
Next »

This set of Automata Theory online test focuses on “Closure Properties under Boolean
Operations”.

1. 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
b) closed
c) decidable
d) none of the mentioned
View Answer

Answer: b
Explanation: If two regular languages are closed under an operation op, then the resultant of the
languages over an operation op will also be regular.
advertisement

2. Suppose a regular language L is closed under the operation halving, then the result would be:
a) 1/4 L will be regular
b) 1/2 L will be regular
c) 1/8 L will be regular
d) Al of the mentioned
View Answer

Answer: d
Explanation: At first stage 1/2 L will be regular and subsequently, all the options will be regular.

3. If L1′ and L2′ are regular languages, then L1.L2 will be


a) regular
b) non regular
c) may be regular
d) none of the mentioned
View Answer

Answer: a
Explanation: Regular language is closed under complement operation. Thus, if L1′ and L2′ are
regular so are L1 and L2. And if L1 and L2 are regular so is L1.L2.

4. If L1 and L2′ are regular languages, L1 ∩ (L2′ U L1′)’ will be


a) regular
b) non regular
c) may be regular
d) none of the mentioned
View Answer

Answer: a
Explanation: If L1 is regular, so is L1′ and if L1′ and L2′ are regular so is L1′ U L2′. Further,
regular languages are also closed under intersection operation.
advertisement

5. If A and B are regular languages, !(A’ U B’) is:


a) regular
b) non regular
c) may be regular
d) none of the mentioned
View Answer
Answer: a
Explanation: If A and B are regular languages, then A Ç B is a regular language and A ∩ B is
equivalent to !(A’ U B’).

6. Which among the following are the boolean operations that under which regular languages
are closed?
a) Union
b) Intersection
c) Complement
d) All of the mentioned
View Answer

Answer: d
Explanation: Regular languages are closed under the following operations:
a) Regular expression operations
b) Boolean operations
c) Homomorphism
d) Inverse Homomorphism

7. Suppose a language L1 has 2 states and L2 has 2 states. After using the cross product
construction method, we have a machine M that accepts L1 ∩ L2. The total number of states in
M:
a) 6
b) 4
c) 2
d) 8
View Answer

Answer: 4
Explanation: M is defined as: (Q, S, d, q0, F)
where Q=Q1*Q2 and F=F1*F2
advertisement

8. If L is a regular language, then (L’)’ U L will be :


a) L
b) L’
c) f
d) none of the mentioned
View Answer

Answer: a
Explanation: (L’)’ is equivalent to L and L U L is subsequently equivalent to L.

9. If L is a regular language, then (((L’)r)’)* is:


a) regular
b) non regular
c) may be regular
d) none of the mentioned
View Answer
Answer: a
Explanation: If L is regular so is its complement, if L’ is regular so is its reverse, if (L’) r is
regular so is its Kleene.

10. Which among the following is the closure property of a regular language?
a) Emptiness
b) Universality
c) Membership
d) None of the mentioned
View Answer

Answer: d
Explanation: All the following mentioned are decidability properties of a regular language. The
closure properties of a regular language include union, concatenation, intersection, Kleene,
complement , reverse and many more operations.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory for online tests, here is complete set of 1000+ Multiple
Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Applications of Pumping
Lemma/Pigeonhole principle
» Next - Automata Theory Questions and Answers – Reversal-Homomorphism and Inverse
Homomorphism
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Uncased Cast-in-Situ Concrete Piles
Geotechnical Engineering Questions and Answers – Bored Piles
advertisement
advertisement

Recommended Posts:

1. Software Architecture & Design Questions and Answers


2. RDBMS Questions and Answers
3. C# Questions and Answers
4. R Programming Questions and Answers
5. PHP Questions and Answers
6. Computer Science Questions and Answers
7. Java Programming Examples on Utility Classes
8. C# Programming Examples on Functions
9. Information Science Questions and Answers
10. Home
11. Petroleum Production Operations Questions and Answers
12. Theory of Machines Questions and Answers
13. C Programming Examples on Bitwise Operations
14. Network Theory Questions and Answers
15. Electromagnetic Theory Questions and Answers
16. Compilers Questions and Answers
17. Heat Transfer Operations Questions and Answers
18. Food Processing Unit Operations Questions and Answers
19. Mechanical Operations Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Reversal-Homomorphism and Inverse
Homomorphism
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Reversal-Homomorphism and Inverse Homomorphism”.

1. If L is a language, the reversal of the language can be represented as:


a) L’
b) Lc
c) Lr
d) more than one option is correct
View Answer

Answer: c
Explanation: Lr is defined as the reversal of a language. Lr is a set of strings whose reversal is in
L.
Example: L={0, 01, 100}
Lr={0, 10, 001}
advertisement

2. If L is a regular language, ____ is also regular.


a) Lr
b) L’
c) L*
d) All of the mentioned
View Answer

Answer: d
Explanation: Lr, L’, L* i.e. reversal, complementation and kleene all are the closure properties
of regular language.

3. If E=F+G;
Er=?
a) Fr+Gr
b) (F+G)r
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: a
Explanation: If E is a symbol a, e, or f, then Er=E. Other inductive properties include union of
reversals, concatenation and Kleene.

4. If E= FG, Er=?
a) FrGr
b) GrFr
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: b
Explanation: If E= FG, Er=GrFr . Example: (01*)R=(1*)R(0)R
advertisement

5. Simplify the following identity:


E=01*+10*
ER=?
a) (1*0+0*1)
b) (01*10*)R
c) (0*1+10*)
d) All of the mentioned
View Answer

Answer: a
Explanation: 01*+10*
ER=(01*)R+(10*)R=>(1*)R0R+(0*)R1R=>1*0+0*1

6. Which of the following obey the closure properties of Regular language?


a) Homomorphism
b) Inverse Homomorphism
c) Reversal
d) All of the mentioned
View Answer

Answer: d
Explanation: Homomorphism on an aphabet is a function that gives a string for each symbol in
that alphabet. Example: h(0)=ab, etc.

7. Let h(L) be a language of regular expression abe*+e(ab)*. Simplify the h(L)


a) (ab)*+eab*
b) abe*+ea*b*
c) (ab)*
d) None of the mentioned
View Answer
Answer:
abe*+e(ab)*(Using the identities e=e*, eE=Ee=E)
=ab+(ab)*=> ab will contain inside (ab)*, thus =>(ab)*.
advertisement

8. Let h(0)=ab; h(1)=e


Let L={abab,baba}
h-1(L)=_______
a) the language of two one’s and any number of zeroes
b) the language of two zeroes and any number of one’s
c) the language of two zeroes and two one’s
d) none of the mentioned
View Answer

Answer: b
Explanation: h-1(L) is the language with two 0’s and any number of 1’s=>(1*01*01*).

9. While proving Inverse Homomorphism, which of the following steps are needed?
a) Start with a DFA Ain L
b) Construct a DFA B for h-1(L)
c) The set of states, initial and final states should be same.
d) All of the mentioned
View Answer

Answer: d
Explanation: While constructing DFA B, we need to take care of the following:
a) The same set of states
b) The same start state
c) The same final state
d) Input alphabet = the symbols to which homomorphism h applies.

10. 8. Let h(0)=ab; h(1)=e


Let L={abab,baba}
h-1(L)= the language of two zeroes and any number of one’s.
The given example belongs to which of the following?
a) Homomorphism
b) Inverse Homomorphism
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: b
Explanation: Let h be a homomorphism and L a language whose alphabet is the output language
of h.
h-1(L) = {w | h(w) is in L}.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.
Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Closure Properties under Boolean
Operations
» Next - Automata Theory Questions and Answers – Conversions among Representations
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Bored Piles
Geotechnical Engineering Questions and Answers – Shapes of Wells and Component Parts
advertisement
advertisement

Recommended Posts:

1. LISP Questions and Answers


2. Information Science Questions and Answers
3. Computer Science Questions and Answers
4. C# Programming Examples on Strings
5. PHP Questions and Answers
6. Python Questions and Answers
7. C Programming Examples
8. Theory of Machines Questions and Answers
9. C# Programming Examples on Functions
10. Compilers Questions and Answers
11. Network Theory Questions and Answers
12. Electromagnetic Theory Questions and Answers
13. Automata Theory Questions and Answers – Sentential Forms
14. Automata Theory Questions and Answers – Regular Expression-Introduction
15. Automata Theory Questions and Answers – PDA-acceptance by Empty Stack
16. Automata Theory Questions and Answers – Context Free Grammar-Derivations and
Definitions
17. Automata Theory Questions and Answers – From Grammars to Push Down Automata
18. Automata Theory Questions and Answers – Deterministic Finite Automata-Introduction
and Definition
19. Automata Theory Questions and Answers – Operators of Regular Expression
20. Automata Theory Questions and Answers – Finite Automata-Introduction
advertisement

Automata Theory Questions and Answers –


Conversions among Representations
« Prev
Next »

This set of Automata Theory online quiz focuses on “Conversions among Representations”.
1. Which of the following conversion is not feasible?
a) Regular expression to automaton conversion
b) Automaton to Regular Expression Conversion
c) NFA to DFA
d) None of the mentioned
View Answer

Answer: d
Explanation: Each of the four formats of representation of the regular language be it, DFA,
NFA, Regular Expression or e-NFA can be converted to the rest three forms.
advertisement

2. The computation of e-closure of n-states takes ______ time.


a) O(n2)
b) O(n3)
c) O(2n)
d) None of the mentioned
View Answer

Answer: b
Explanation: We must search from each of the n states along all arcs labelled e. If there are n
states, there can be no more than n2 states.

3. For a _________ state DFA, the time taken for DFA-NFA conversion is O(n).
a) n
b) n1/2
c) n2
d) 2n
View Answer

Answer: a
Explanation: The conversion DFA to NFA is simple, and takes O(n) time on an n-state DFA.

4. With reference to Automaton to Regular Expression Conversion, for each of the n rounds,
where n is the number of states of DFA, we can _________ the size of the regular expression
constructed.
a) double
b) triple
c) quadruple
d) none of the mentioned
View Answer

Answer: c
Explanation: We can quadruple the size of the regular expression per round. Thus, we can
simply write n3 expressions can take time O(n34n), where n =number of states of the DFA.
advertisement

5. Conversion of regular expression to e-NFA takes ___________ time.


a) linear
b) exponential
c) logarithmic
d) none of the mentioned
View Answer

Answer: a
Explanation: It is possible to parse the expression efficiently, using a technique that takes only
O(n) time on a expression of length n3.

6. The conversion of NFA to DFA can be done in:


a) exponential time
b) linear time
c) logarithmic time
d) all of the mentioned
View Answer

Answer: a
Explanation: We can eliminate e-transitions from an n state epsilon-NFA to build an ordinary
NFA in O(n3) time, without changing the number of states.Next, producing to DFA can take
exponential time.

7. Which of the following cannot be converted in an ordinary NFA?


a) DFA
b) Regular Expression
c) e-NFA
d) None of the mentioned
View Answer

Answer: d
Explanation: Each of the following can expressed in terms of ordinary NFA with different time
complexities.
advertisement

8. NFA to DFA conversion is done via


a) Subset Construction method
b) Warshalls Algorithm
c) Ardens theorem
d) None of the mentioned
View Answer

Answer: a
Explanation: Powerset or subset construction method is a standard method for converting a non
deterministic finite automata into DFA which recognizes the same formal language.

9. State true or false:


Statement: Regular expression can directly be converted to DFA without intermediate steps.
a) true
b) false
View Answer
Answer: b
Explanation: There exists subsequent steps like formation of epsilon-NFA and NFA before the
formation of corresponding DFA.

10. Is the following statement correct?


Statement: Thompson construction is used to convert Regular expression to finite automata.
a) Yes
b) No
View Answer

Answer: a
Explanation: Thompson’s Construction is used to find out a Finite Automaton from a Regular
Expression. We will reduce the regular expression into smallest regular expressions and convert
them to NFA and finally to DFA.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory for online Quizzes, here is complete set of 1000+
Multiple Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Reversal-Homomorphism and Inverse
Homomorphism
» Next - Automata Theory Questions and Answers – Testing Emptiness and Membership
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Shapes of Wells and Component Parts
Best Reference Books – M.Sc. – Anthropology
advertisement
advertisement

Recommended Posts:

1. Electric Drives Questions and Answers


2. Prestressed Concrete Structures Questions and Answers
3. Data Structure Questions and Answers
4. Information Science Questions and Answers
5. Computer Science Questions and Answers
6. Transformers Questions and Answers
7. Home
8. Engineering Drawing Questions and Answers
9. Theory of Machines Questions and Answers
10. Electromagnetic Theory Questions and Answers
11. Network Theory Questions and Answers
12. C Programming Examples on Set & String Problems & Algorithms
13. Compilers Questions and Answers
14. Java Programming Examples on Set & String Problems & Algorithms
15. C++ Programming Examples on Set & String Problems & Algorithms
16. C# Programming Examples on Conversions
17. Automata Theory Questions and Answers
18. Automata Theory Questions and Answers – Uses of Epsilon-Transitions
19. Automata Theory Questions and Answers – Union, Intersection & Complement
20. Theory of Computation – Regular Grammars
advertisement

Automata Theory Questions and Answers –


Testing Emptiness and Membership
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Testing Emptiness and Membership”.

1. Language classes have the following property:


a) Closure property
b) Decision property
c) Closure & Decision property
d) None of the mentioned
View Answer

Answer: c
Explanation: A decision property of a language class is an algorithm that takes a formal
description of a language(e.g., a DFA) and tells whether or not some property holds.
advertisement

2. Which of the following are decision properties?


a) Emptiness
b) Infiniteness
c) Membership
d) All of the mentioned
View Answer

Answer: d
Explanation: Emptiness, Infiniteness and Membership are the decision properties of any
language class. Example: Is the language L empty? Or Is w, a string belongs to the regular
language L?

3. Pick the odd one out of the given properties of a regular language:
a) Kleene
b) Reversal
c) Homomorphism
d) Membership
View Answer
Answer: d
Explanation: Membership is a decision property of language class while others mentioned like
Kleene, Reversal and Homomorphism are Closure properties of language class.

4. For an automata, which of the following are equivalent variants?


DFA,NFA and NFA with epsilon transitions
a) DFA and NFA
b) NFA and epsilon NFA
c) DFA and epsilon NFA
d) All of the mentioned
View Answer

Answer: d
Explanation: For a given automata, all the formats of representation be it deterministic finite
automata or non deterministic finite automata or non deterministic finite automata with epsilon
transitions, all are equivalent variants.
advertisement

5. Which of the following are not meant to specify a regular language?


a) Regular Expression
b) DFA
c) NDFA and epsilon-NFA
d) All of the mentioned
View Answer

Answer: d
Explanation: It is possible to convert from one specification to another. We can express a
regular language in all the given four variants.

6. Which of the following problems do not belong to decision properties?


a) Given two languages, are there strings that are in both
b) Is the language a subset of another regular language
c) Is the language same as another regular language
d) None of the mentioned
View Answer

Answer: d
Explanation: To give a solution to the mentioned problems, we require decision properties and
for some, we need additional tools like minimized automaton and Pumping lemma.

7. Which of the following is a function of Closure properties?


a) Helps construct representations
b) Helps show informally described languages not to be in class
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: Using closure properties we can give a=solution to many problems like :
Is the regular languages L1 and L2 closed on concatenation operation?, etc.
advertisement

8. Suppose there is a string w=abbab, and there exists a DFA which accepts w. How many stepts
will be required to test its membership?
a) 2
b) 1
c) 4
d) None of the mentioned
View Answer

Answer: If a string belongs to a language, the number of steps required to test that member ship
is equal to the length of string i.e. 5.

9. If a DFA has n states and the language contains any string of length n or more, the language is
termed as:
a) Infinite
b) Empty
c) Non regular
d) None of the mentioned
View Answer

Answer: The language is surely finite if it is limited to string of length n or less. This is because
there are atleast n+1 states along the path while traversing w(string).

10. State true or false:


Statement: If an n-state DFA accepts a string w of length n or more, then there must be a state
that appears twice on the path labeled w from the start state to the final state.
a) true
b) false
View Answer

Answer: a
Explanation: This occurs because there are atleast n+1 states along the path while traversing the
string w.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Conversions among Representations
» Next - Automata Theory Questions and Answers – Context Free Grammar-Derivations and
Definitions
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Analysis of Well Foundation
Best Reference Books – M.Sc. – Biochemistry
advertisement
advertisement

Recommended Posts:

1. PHP Questions and Answers


2. Spring Questions and Answers
3. C++ Algorithms, Problems & Programming Examples
4. Solid State Chemistry Questions and Answers
5. Java Programming Examples on Java.Lang
6. Javascript Questions and Answers
7. LISP Questions and Answers
8. Artificial Intelligence Questions and Answers
9. Discrete Mathematics Questions and Answers
10. C Algorithms, Problems & Programming Examples
11. C Programming Examples on Set & String Problems & Algorithms
12. C++ Programming Examples on Set & String Problems & Algorithms
13. Java Programming Examples on Set & String Problems & Algorithms
14. Theory of Machines Questions and Answers
15. Network Theory Questions and Answers
16. Electromagnetic Theory Questions and Answers
17. C# Programming Examples on Functions
18. Mechanical Behaviour & Testing of Materials Questions and Answers
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Context Free Grammar-Derivations and
Definitions
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Context Free Grammar-Derivations and Definitions”.

1. The entity which generate Language is termed as:


a) Automata
b) Tokens
c) Grammar
d) Data
View Answer

Answer: c
Explanation: The entity which accepts a language is termed as Automata while the one which
generates it is called Grammar. Tokens are the smallest individual unit of a program.
advertisement

2. Production Rule: aAb->agb belongs to which of the following category?


a) Regular Language
b) Context free Language
c) Context Sensitive Language
d) Recursively Ennumerable Language
View Answer

Answer: c
Explanation: Context Sensitive Language or Type 1 or Linearly Bounded Non deterministic
Language has the production rule where the production is context dependent i.e. aAb->agb.

3. Which of the following statement is false?


a) Context free language is the subset of context sensitive language
b) Regular language is the subset of context sensitive language
c) Recursively ennumerable language is the super set of regular language
d) Context sensitive language is a subset of context free language
View Answer

Answer: d
Explanation: Every regular language can be produced by context free grammar and context free
language can be produced by context sensitive grammar and so on.

4. The Grammar can be defined as: G=(V, ∑, p, S)


In the given definition, what does S represents?
a) Accepting State
b) Starting Variable
c) Sensitive Grammar
d) None of these
View Answer

Answer: b
Explanation: G=(V, ∑, p, S), here V=Finite set of variables, ∑= set of terminals, p= finite
productions, S= Starting Variable.
advertisement

5. Which among the following cannot be accepted by a regular grammar?


a) L is a set of numbers divisible by 2
b) L is a set of binary complement
c) L is a set of string with odd number of 0
d) L is a set of 0n1n
View Answer
Answer: d
Explanation: There exists no finite automata to accept the given language i.e. 0n1n. For other
options, it is possible to make a dfa or nfa representing the language set.

6. Which of the expression is appropriate?


For production p: a->b where a∈V and b∈_______
a) V
b) S
c) (V+∑)*
d) V+ ∑
View Answer

Answer: c
Explanation: According to the definition, the starting variable can produce another variable or
any terminal or a variable which leads to terminal.

7. For S->0S1|e for ∑={0,1}*, which of the following is wrong for the language produced?
a) Non regular language
b) 0n1n | n>=0
c) 0n1n | n>=1
d) None of the mentioned
View Answer

Answer: d
Explanation: L={e, 01, 0011, 000111, ……0n1n }. As epsilon is a part of the set, thus all the
options are correct implying none of them to be wrong.
advertisement

8. The minimum number of productions required to produce a language consisting of


palindrome strings over ∑={a,b} is
a) 3
b) 7
c) 5
d) 6
View Answer

Answer: c
Explanation: The grammar which produces a palindrome set can be written as:
S-> aSa | bSb | e | a | b
L={e, a, b, aba, abbbaabbba…..}

9. Which of the following statement is correct?


a) All Regular grammar are context free but not vice versa
b) All context free grammar are regular grammar but not vice versa
c) Regular grammar and context free grammar are the same entity
d) None of the mentioned
View Answer
Answer: a
Explanation: Regular grammar is a subset of context free grammar and thus all regular
grammars are context free.

10. Are ambiguous grammar context free?


a) Yes
b) No
View Answer

Answer: a
Explanation: A context free grammar G is ambiguous if there is atleast one string in L(G) which
has two or more distinct leftmost derivations.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Testing Emptiness and Membership
» Next - Automata Theory Questions and Answers – The Language of a Grammar, Inferences
and Ambiguity
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Well Curb, Cutting Edge, Steining and
Bottom Plug
Geotechnical Engineering Questions and Answers – Well Sinking
advertisement
advertisement

Recommended Posts:

1. Engineering Physics II Questions and Answers


2. Java Programming Examples on Set & String Problems & Algorithms
3. C Tutorials
4. Statistical Quality Control Questions and Answers
5. Information Science Questions and Answers
6. PHP Questions and Answers
7. Computer Science Questions and Answers
8. Python Questions and Answers
9. C Programming Examples on Set & String Problems & Algorithms
10. C++ Programming Examples on Set & String Problems & Algorithms
11. Home
12. Theory of Machines Questions and Answers
13. Network Theory Questions and Answers
14. Electromagnetic Theory Questions and Answers
15. Compilers Questions and Answers
16. Automata Theory Questions and Answers
17. Compilers Questions and Answers – Regular Grammar – 1
18. Automata Theory Questions and Answers – Chomsky Normal Form
19. Automata Theory Questions and Answers – Inferences to Trees, Trees to Derivations
20. Automata Theory Questions and Answers – DPDA and Ambiguous Grammars
advertisement

Automata Theory Questions and Answers – The


Language of a Grammar, Inferences and
Ambiguity
« Prev
Next »

This set of Automata Theory Problems focuses on “The Language of a Grammar, Inferences and
Ambiguity”.

1. Which of the following is not a notion of Context free grammars?


a) Recursive Inference
b) Derivations
c) Sentential forms
d) All of the mentioned
View Answer

Answer: d
Explanation: The following are the notions to express Context free grammars:
a) Recursive Inferences
b) Derivations
c) Sentential form
d) Parse trees
advertisement

2. State true or false:


Statement: The recursive inference procedure determines that string w is in the language of the
variable A, A being the starting variable.
a) true
b) false
View Answer

Answer: a
Explanation: We apply the productions of CFG to infer that certain strings are in the language of
a certain variable.

3. Which of the following is/are the suitable approaches for inferencing?


a) Recursive Inference
b) Derivations
c) Both Recursive Inference and Derivations
d) None of the mentioned
View Answer
Answer: c
Explanation: Two inference approaches:
1. Recursive inference, using productions from body to head
2. Derivations, using productions from head to body

4. If w belongs to L(G), for some CFG, then w has a parse tree, which defines the syntactic
structure of w. w could be:
a) program
b) SQL-query
c) XML document
d) All of the mentioned
View Answer

Answer: d
Explanation: Parse trees are an alternative representation to derivations and recursive inferences.
There can be several parse trees for the same string.

5. Is the following statement correct?


Statement: Recursive inference and derivation are equivalent.
a) Yes
b) No
View Answer

Answer: a
Explanation: Yes, they are equivalent. Both the terminologies represent the two approaches of
recursive inferencing.
advertisement

6. A->aA| a| b
The number of steps to form aab:
a) 2
b) 3
c) 4
d) 5
View Answer

Answer: b
Explanation: A->aA=>aaA=>aab

7. An expression is mentioned as follows. Figure out number of incorrect notations or symbols,


such that a change in those could make the expression correct.
L(G)={w in T*|S→*w}
a) 0 Errors
b) 1 Error
c) 2 Error
d) Invalid Expression
View Answer

Answer: a
Explanation: For the given expression, L(G)={w in T*|S→*w}, If G(V, T, P, S) is a CFG, the
language of G, denoted by L(G), is the set of terminal strings that have derivations from the start
symbol.

8. The language accepted by Push down Automaton:


a) Recursive Language
b) Context free language
c) Linearly Bounded language
d) All of the mentioned
View Answer

Answer: b
Explanation: Push down automata accepts context free language.

9. Which among the following is the correct option for the given grammar?
G->X111|G1,X->X0|00
a) {0a1b|a=2,b=3}
b) {0a1b|a=1,b=5}
c) {0a1b|a=b}
d) More than one of the mentioned is correct
View Answer

Answer: a
Explanation: Using the recursive approach, we can conclude that option a is the correct answer,
and its not possible for a grammar to have more than one language.
advertisement

10. Which of the following the given language belongs to?


L={ambmcm| m>=1}
a) Context free language
b) Regular language
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: d
Explanation: The given language is neither accepted by a finite automata or a push down
automata. Thus, it is neither a context free language nor a regular language.

11. Choose the correct option:


Statement: There exists two inference approaches:
a) Recursive Inference
b) Derivation

a) true
b) partially true
c) false
d) none of the mentioned
View Answer
Answer: a
Explanation: We apply the productions of a CFG to infer that certain strings are in a language of
certain variable.

12. Choose the correct option:


Statement 1: Recursive Inference, using productions from head to body.
Statement 2: Derivations, using productions from body to head.
a) Statement 1 is true and Statement 2 is true
b) Statement 1 and Statement 2, both are false
c) Statement 1 is true and Statement 2 is false
d) Statement 2 is true and Statement 1 is true
View Answer

Answer: b
Explanation: Both the statements are false. Recursive Inference, using productions from body to
head. Derivations, using productions from head to body.
advertisement

13. Which of the following statements are correct for a concept called inherent ambiguity in
CFL?
a) Every CFG for L is ambiguous
b) Every CFG for L is unambiguous
c) Every CFG is also regular
d) None of the mentioned
View Answer

Answer: a
Explanation: A CFL L is said to be inherently ambiguous if every CFG for L is ambiguous.

14. Which of the theorem defines the existence of Parikhs theorem?


a) Parikh’s theorem
b) Jacobi theorem
c) AF+BG theorem
d) None of the mentioned
View Answer

Answer: a
Explanation: Rohit Parikh in 1961 proved in his MIT research paper that some context free
language can only have ambiguous grammars.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory Problems, here is complete set of 1000+ Multiple
Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Context Free Grammar-Derivations and
Definitions
» Next - Automata Theory Questions and Answers – Sentential Forms
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Well Sinking
Best Reference Books – M.Sc. – Microbiology
advertisement
advertisement

Recommended Posts:

1. C Programming Examples on Set & String Problems & Algorithms


2. Data Science Questions and Answers
3. Ruby Programming Questions and Answers
4. Artificial Intelligence Questions and Answers
5. Network Theory Questions and Answers
6. Theory of Machines Questions and Answers
7. C Tutorials
8. C# Programming Examples on Data Structures
9. Electromagnetic Theory Questions and Answers
10. Home
11. Compilers Questions and Answers
12. Automata Theory Questions and Answers
13. Automata Theory Questions and Answers – The Language of NFA
14. Automata Theory Questions and Answers – Intersection with Regular Languages
15. Automata Theory Questions and Answers – Pumping Lemma for Regular Language
16. Automata Theory Questions and Answers – The Language of DFA
17. Automata Theory Questions and Answers – CFG-Eliminating Useless Symbols
18. Automata Theory Questions and Answers – Sentential Forms
19. Automata Theory Questions and Answers – PDA-acceptance by Empty Stack
20. Compilers Questions and Answers – Right Left Linear Grammar – 2
advertisement

Automata Theory Questions and Answers –


Sentential Forms
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Sentential Forms”.

1. State true or false:


Statement: Every right-linear grammar generates a regular language.
a) True
b) False
View Answer
Answer: a
Explanation: A CFG is said to right linear if each production body has at most one variable, and
that variable is at the right end. That is, all productions of a right linear grammar are of the form
A->wB or A->w, where A and B are variables while w is some terminal.
advertisement

2. What the does the given CFG defines?


S->aSbS|bSaS|e and w denotes terminal
a) wwr
b) wSw
c) Equal number of a’s and b’s
d) None of the mentioned
View Answer

Answer: c
Explanation: Using the derivation approach, we can conclude that the given grammar produces a
language with a set of string which have equal number of a’s and b’s.

3. If L1 and L2 are context free languages, which of the following is context free?
a) L1*
b) L2UL1
c) L1.L2
d) All of the mentioned
View Answer

Answer: d
Explanation: The following is a theorem which states the closure property of context free
languages which includes Kleene operation, Union operation and Dot operation.

4. For the given Regular expression, the minimum number of variables including starting
variable required to derive its grammar is:
(011+1)*(01)*
a) 4
b) 3
c) 5
d) 6
View Answer

Answer: c
Explanation: The grammar can be written as:
S->BC
B->AB|ε
A->011|1
C->DC|ε
D->01
advertisement

5. For the given Regular expression, the minimum number of terminals required to derive its
grammar is:
(011+1)*(01)*
a) 4
b) 3
c) 5
d) 6
View Answer

Answer: b
Explanation: The grammar can be written as:
S->BC
B->AB|ε
A->011|1
C->DC|ε
D->01
6. A grammar G=(V, T, P, S) is __________ if every production taken one of the two forms:
B->aC
B->a

a) Ambiguous
b) Regular
c) Non Regular
d) None of the mentioned
View Answer

Answer: b
Explanation: The following format of grammar is of Regular grammar and is a part of Context
free grammar i.e. like a specific form whose finite automata can be generated.

7. Which among the following is a CFG for the given Language:


L={x∈{0,1}*|number of zeroes in x=number of one’s in x}
a) S->e|0S1|1S0|SS
b) S->0B|1A|e A->0S B->1S
c) All of the mentioned
View Answer

Answer: c
Explanation: We can build context free grammar through different approaches, recursively
defining the variables and terminals inorder to fulfil the conditions.
advertisement

8. Which of the following languages are most suitable for implement context free languages ?
a) C
b) Perl
c) Assembly Language
d) None of the mentioned
View Answer

Answer: a
Explanation: The advantage of using high level programming language like C and Pascal is that
they allow us to write statements that look more like English.
9. Which among the following is the correct grammar for the given language?
L={x∈{0,1}*|number of zeroes in x¹number of one’s in x}
a) S-> 0|SS|1SS|SS1|S1S
b) S-> 1|0S|0SS|SS0|S0S
c) S-> 0|0S|1SS|SS1|S1S
d) None of the mentioned
View Answer

Answer: c
Explanation: L={0, 1, 00, 11, 001, 010,…}
The grammar can be framed as: S-> 0|0S|1SS|SS1|S1S

10. L={0i1j2k | j>i+k}


Which of the following satisfies the language?
a) 0111100
b) 011100
c) 0001100
d) 0101010
View Answer

Answer: a
Explanation: It is just required to put the value in the variables in the question and check if it
satisfies or not.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – The Language of a Grammar, Inferences
and Ambiguity
» Next - Automata Theory Questions and Answers – Construction and Yield of a Parse Tree
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Well Foundations – Pneumatic Caissons
Best Reference Books – M.Sc. – Applied Geology
advertisement
advertisement

Recommended Posts:

1. C Questions and Answers


2. C# Questions and Answers
3. Spring Questions and Answers
4. Probability and Statistics Questions and Answers
5. C Tutorials
6. Data Science Questions and Answers
7. Javascript Questions and Answers
8. LISP Questions and Answers
9. Ruby Programming Questions and Answers
10. Computer Science Questions and Answers
11. Python Questions and Answers
12. Information Science Questions and Answers
13. Theory of Machines Questions and Answers
14. PHP Questions and Answers
15. Network Theory Questions and Answers
16. Electromagnetic Theory Questions and Answers
17. Compilers Questions and Answers
18. Automata Theory Questions and Answers – Eliminating Unit Productions
19. Automata Theory Questions and Answers
20. Automata Theory Questions and Answers – CFG-Eliminating Useless Symbols
advertisement

Automata Theory Questions and Answers –


Construction and Yield of a Parse Tree
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Construction and Yield of a Parse Tree”.

1. The most suitable data structure used to represent the derivations in compiler:
a) Queue
b) Linked List
c) Tree
d) Hash Tables
View Answer

Answer: c
Explanation: The tree, known as “Parse tree” when used in a compiler, is the data structure of
choice to represent the source program.
advertisement

2. Which of the following statement is false in context of tree terminology?


a) Root with no children is called a leaf
b) A node can have three children
c) Root has no parent
d) Trees are collection of nodes, with a parent child relationship
View Answer

Answer: a
Explanation: A node has atmost one parent, drawn above the node, and zero or more children
drawn below. Lines connect parents to children. There is one node, one root, that has no parent;
this node appears to be at the top of the tree. Nodes with no children are called leaves. Nodes
that are not leaves are called interior nodes.

3. In which order are the children of any node ordered?


a) From the left
b) From the right
c) Arbitrarily
d) None of the mentioned
View Answer

Answer: a
Explanation: The children of a node are ordered from the left and drawn so. If N is to the left of
node M, then all the descendents of N are considered to be to the left of all the descendents of
M.

4. Which among the following is the root of the parse tree?


a) Production P
b) Terminal T
c) Variable V
d) Starting Variable S
View Answer

Answer: d
Explanation: The root is labelled by the start symbol. All the leaves are either labelled by a a
terminal or with e.
advertisement

5. For the expression E*(E) where * and brackets are the operation, number of nodes in the
respective parse tree are:
a) 6
b) 7
c) 5
d) 2
View Answer

Answer: b

Explanation:

6. The number of leaves in a parse tree with expression E*(E) where * and () are operators
a) 5
b) 2
c) 4
d) 3
View Answer
Answer: a

Explanation:

7. Which of the following does the given parse tree correspond to?

a) P->1100
b) P->0110
c) P->1100ε
d) P->0101
View Answer

Answer: b
Explanation: The following is a parse tree for the production 0110 over {0,1}*.
advertisement

8. A grammar with more than one parse tree is called:


a) Unambiguous
b) Ambiguous
c) Regular
d) None of the mentioned
View Answer

Answer: b
Explanation: A context free grammar G is ambiguous if there is at least one string in L(G)
having two or more distinct derivation trees or equivalently, two or more distinct leftmost
derivations.

9. __________ is the acyclic graphical representation of a grammar.


a) Binary tree
b) Oct tree
c) Parse tree
d) None of the mentioned
View Answer

Answer: c
Explanation: In order to graphically represent a derivation of a grammar we need to use parse
trees.

10. Grammar is checked by which component of compiler


a) Scanner
b) Parser
c) Semantic Analyzer
d) None of the mentioned
View Answer

Answer: Parser or syntax analyzer is the one responsible for checking the grammar and
reporting errors. In this phase, parse tree is generated and syntax is analyzed.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Sentential Forms
» Next - Automata Theory Questions and Answers – Inferences to Trees, Trees to Derivations
Categories Automata Theory MCQsPost navigation
Best Reference Books – M.Sc. – Applied Geology
Geotechnical Engineering Questions and Answers – Machine Foundations – Mass Spring
System
advertisement
advertisement

Recommended Posts:

1. Electromagnetic Theory Questions and Answers


2. Java Programming Examples on Graph Problems & Algorithms
3. C Programming Examples
4. Compilers Questions and Answers
5. C# Programming Examples on Data Structures
6. Network Theory Questions and Answers
7. Java Programming Examples on Data-Structures
8. C++ Programming Examples on Graph Problems & Algorithms
9. Data Structure Questions and Answers
10. C Programming Examples on Graph Problems & Algorithms
11. C Programming Examples using Recursion
12. Python Programming Examples on Graphs
13. C Programming Examples on Data-Structures
14. C Programming Examples on Linked List
15. C++ Programming Examples on Data-Structures
16. C Programming Examples without using Recursion
17. Python Programming Examples on Linked Lists
18. Python Programming Examples on Trees
19. C Programming Examples on Trees
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Inferences to Trees, Trees to Derivations
« Prev
Next »

This set of Automata Theory Question Bank focuses on “Inferences to Trees, Trees to
Derivations”.

1. A symbol X is ________ if there exists : S->* aXb


a) reachable
b) generating
c) context free
d) none of the mentioned
View Answer

Answer: a
Explanation: A symbol X is generating if there exists : X->*w for some w that belongs to T*.
Also, a symbol can never be context free.
advertisement

2. A symbol X is called to be useful if and only if its is:


a) generating
b) reachable
c) both generating and reachable
d) none of the mentioned
View Answer

Answer: c
Explanation: For a symbol X to be useful, it has to be both reachable and generating i.e.
S->* aXb -> * w where w belongs to T*.
3. Which of the following is false for a grammar G in Chomsky Normal Form:
a) G has no useless symbols
b) G has no unit productions
c) G has no epsilon productions
d) None of the mentioned
View Answer

Answer: d
Explanation: G, a CFG is said to be in Chomsky normal form if all its productions are in one of
the following form:
A->BC or A->a

4. Given Checklist:
a) G has no useless symbols
b) G has no unit productions
c) G has no epsilon productions
d) Normal form for production is violated
Is it possible for the grammar G to be in CNF with the following checklisy ?
a) Yes
b) No
View Answer

Answer: b
Explanation: The grammar is not in CNF if it violates the normal form of the productions which
is strictly restricted.
advertisement

5. State true or false:


Statement: A CNF parse tree’s string yield (w) can no longer be 2h-1.
a) true
b) false
View Answer

Answer: a
Explanation: It is the parse tree theorem which states:
Given: Suppose we have a parse tree for a string w, according to a CNF grammar, G=(V, T, P,
S). Let h be the height of the parse tree. Now, Implication: |w|<=2h-1.

6. If |w|>=2h, then its parse tree’s height is at least _____


a) h
b) h+1
c) h-1
d) 2h
View Answer

Answer: b
Explanation: It is the basic implication of Parse tree theorem (assuming CNF). If the height of
the parse tree is h, then |w| <=2h-1.
7. If w belongs to L(G), for some CFG, then w has a parse tree, which tell us the ________
structure of w.
a) semantic
b) syntactic
c) lexical
d) all of the mentioned
View Answer

Answer: b
Explanation: A parse tree or concrete syntactic tree is an ordered, rooted tree that represents the
syntactic structure of a string according to some context free grammar.
advertisement

8. Which of the following are distinct to parse trees?


a) abstract parse trees
b) sentence diagrams
c) both abstract parse trees and sentence diagrams
d) none of the mentioned
View Answer

Answer: c
Explanation: Both of the mentioned are different from parse trees. Sentence diagrams are
pictorial representations of grammatical structure of a sentence.

9. Choose the correct option:


Statement: Unambiguity is the ideal structure of a language.
a) true
b) partially true
c) false
d) cant be said
View Answer

Answer: a
Explanation: Ideally, there should be only one parse tree for each string, i.e. the language should
be unambiguous.

10. Is the given statement correct?


Statement: The mere existence of several derivations is not an issue, its is the existence of
several parse trees that ruins a grammar.
a) Yes
b) No
View Answer

Answer: a
Explanation: It is also true that multiple leftmost or rightmost derivations do cause ambiguity.
Unfortunately, it is not possible to remove the ambiguity always.
advertisement
Sanfoundry Global Education & Learning Series – Automata Theory.
To practice Automata Theory Question Bank, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Construction and Yield of a Parse Tree
» Next - Automata Theory Questions and Answers – Applications – Parsers
Categories Automata Theory MCQsPost navigation
Best Reference Books – M.Sc. – Botany
Geotechnical Engineering Questions and Answers – Machine Foundations – Barkens Method
advertisement
advertisement

Recommended Posts:

1. C Programming Examples using Recursion


2. Python Programming Examples on Searching and Sorting
3. C Programming Examples on Set & String Problems & Algorithms
4. C++ Programming Examples on Set & String Problems & Algorithms
5. C Programming Examples on Combinatorial Problems & Algorithms
6. C Programming Examples on Data-Structures
7. C Programming Examples without using Recursion
8. Discrete Mathematics Questions and Answers
9. Data Structure Questions and Answers
10. Theory of Machines Questions and Answers
11. Electromagnetic Theory Questions and Answers
12. Java Algorithms, Problems & Programming Examples
13. C Programming Examples
14. C++ Algorithms, Problems & Programming Examples
15. Network Theory Questions and Answers
16. C Algorithms, Problems & Programming Examples
17. Compilers Questions and Answers
18. C Programming Examples on Trees
19. Python Programming Examples on Trees
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Applications – Parsers
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Applications – Parsers”.
1. To derive a string using the production rules of a given grammar, we use:
a) Scanning
b) Parsing
c) Derivation
d) All of the mentioned
View Answer

Answer: b
Explanation: Parsing is required to check the acceptability of a string. Further, comes the
syntactical phase which is taken care by other phases of compiler.
advertisement

2. Which of the following parser reaches the root symbol of the tree at last?
a) Top down parser
b) Bottom up parser
c) TOP down and Bottom up parser
d) None of the mentioned
View Answer

Answer: b
Explanation: Bottom up parser starts from the bottom with the string and comes up to the start
symbolusing a parse tree or a derivation tree.

3. Left corner parsing methof uses which of the following?


a) Top down parser
b) Bottom up parser
c) TOP down and Bottom up parser
d) None of the mentioned
View Answer

Answer: c
Explanation: It is a hybrid method which works bottom up along the left edges of each subtree,
and top down on the rest of the parse tree.

4. Which of the following parser performs top down parsing?


a) LALR parser
b) LL parser
c) Recursive Accent parser
d) None of the mentioned
View Answer

Answer: b
Explanation: Bottom up parsing is done by shift reduce parsers like LALR parsers, Operator
precedence parsers, simple precedence parsers, etc.
advertisement

5. Which of the following is true for shift reduce parsers?


a) Scans and parses the input in one forward pass over the text, without any backup.
b) A shift command advances in the input stream by one symbol
c) LALR parser
d) All of the mentioned
View Answer

Answer: d
Explanation: The mentioned are the correct and proper functions of a shift reduce parsers. The
parsing methods are most commonly used for parsing programming languages, etc.

6. State true or false:


Statement: LALR parsers uses tables rather than mutually recursive functions.
a) true
b) false
View Answer

Answer: b
Explanation: It is exactly the opposite case where LALR parsers uses mutually recursive
functions instead of tables. It is a simplified version of canonical left to right parser.

7. LALR in LALR parser stands for:


a) Left aligned left right parser
b) Look ahead left to right parser
c) Language Argument left to right parser
d) None of the mentioned
View Answer

Answer:
Explanation: LALR stands for Look ahead left to right parsers. It has more language recognition
power than LR(0) parser.
advertisement

8. Which of the following can be a LALR parser generator?


a) YACC
b) GNU Bison
c) YACC and GNU Bison
d) None of the mentioned
View Answer

Answer: c
Explanation: YACC is a computer code for UNIX operating system which generates a LALR
parser. On the other hand GNU Bison or Bison can generate LALR and GLR parsers.

9. Which of the following parsers do not relate to Bottom up parsing?


a) LL parser
b) Recursive descent parser
c) Earley parsers
d) All of the mentioned
View Answer

Answer: d
Explanation: All the following mentioned are top down parsers and begin their operation from
the starting symbol.
10. Which of the following is true for a predictive parser?
a) Recursive Descent parser
b) no backtracking
c) Recursive Descent parser and no backtracking
d) None of the mentioned
View Answer

Answer: c
Explanation: Predictive parsing is possible only for the class of LL-grammars, which are the
CFG for which there exists some positive integer k that allows a recursive descent parser to
decide which production to use by examining only the next k tokens of input.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Inferences to Trees, Trees to Derivations
» Next - Automata Theory Questions and Answers – YACC Parser Generator
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Machine Foundations – Barkens Method
Geotechnical Engineering Questions and Answers – Dynamic Analysis of Block Foundations
advertisement
advertisement

Recommended Posts:

1. C Programming Examples on Set & String Problems & Algorithms


2. Home
3. Bachelor of Computer Applications Questions and Answers
4. Master of Computer Applications Questions and Answers
5. Theory of Machines Questions and Answers
6. Network Theory Questions and Answers
7. Electromagnetic Theory Questions and Answers
8. Compilers Questions and Answers
9. Compilers Questions and Answers – L-Attributed Definition – 2
10. Automata Theory Questions and Answers – The Universal Language-Undecidability
11. Automata Theory Questions and Answers – Regular Language & Expression – 2
12. Automata Theory Questions and Answers – Applications of Pumping Lemma/Pigeonhole
principle
13. Automata Theory Questions and Answers – The Language of a Grammar, Inferences and
Ambiguity
14. Compilers Questions and Answers – LR Parser – 1
15. Automata Theory Questions and Answers – Equivalence of NFA and DFA
16. Automata Theory Questions and Answers – Finite Automata
17. Automata Theory Questions and Answers – Finite Automata with Epsilon Transition
18. Automata Theory Questions and Answers
19. Automata Theory Questions and Answers – Chomsky Normal Form
20. Compilers Questions and Answers – Intermediate Code-Generation – 1
advertisement

Automata Theory Questions and Answers – YACC


Parser Generator
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“YACC Parser Generator”.

1. YACC is a computer program for ______ operation system.


a) Windows
b) DOS
c) Unix
d) openSUSE
View Answer

Answer: c
Explanation: YACC technique is a computer code for the Unix operating system. It is a LALR
parser generator, generating a parser, the part of a compiler that tries to make syntactic sense of
the source code.
advertisement

2. YACC is an acronym for:


a) Yes Another Compile Compiler
b) Yet Another Compile Compiler
c) Yet Another Compiler Compiler
d) Yes Another Compiler Compiler
View Answer

Answer: c
Explanation: YACC stands for ‘Yet another compiler compiler’ and it was developed by
Stephen Johnson in B programming language later translated to C.

3. The YACC takes C code as input and outputs_________


a) Top down parsers
b) Bottom up parsers
c) Machine code
d) None of the mentioned
View Answer

Answer: b
Explanation: The YACC takes C code as input and produces shift reduce parsers in C,also
known as Bottom up parsers which execute C snippets with the associated rule.
4. The _______ table is created by YACC.
a) LALR parsing
b) LL parsing
c) GLR parsing
d) None of the mentioned
View Answer

Answer: a
Explanation: LALR parser generator is software tool that reads a BNF grammar and creates a
LALR parser which is capable of parsing files written in programming language identified by
BNF grammar.
advertisement

5. The original YACC as written in __________ language


a) R programming language
b) C programming language
c) B programming language
d) None of the mentioned
View Answer

Answer: c
Explanation: Stephen Johnson wrote this parser generator in B programming language which
was further modified and written in C, JAVA, Python, etc.

6. Which of the following is false for B programming language?


a) Typeless
b) Influenced by PL/I
c) Designed by Dennis Ritchie
d) None of the mentioned
View Answer

Answer: d
Explanation: B was programming language designed by Dennis Ritchie and Ken Thompson for
recursive, non numeric, system and language softwares. It was a typeless language, everything is
a word.

7. Which of the following is false for BNF?


a) BNF means Backus Naur Form
b) It is a normal form used in Data base normalization
c) It is a notation technique for context free grammar
d) None of the mentioned
View Answer

Answer: b
Explanation: The normal form used in Data base normalization is BCNF i.e. Boyce Codd
normal form and NOT Backus Naur Form.
advertisement

8. State true or false:


Statement: BNF is a metasyntax used to express CFG
a) True
b) False
View Answer

Answer: a
Explanation: BNF is a metasyntax used to express context free grammar, moreover a formal
way to express the language.

9. Which of the following are not used to express CFG?


a) BNF
b) EBNF, ABNF
c) Van Wijngaarden form
d) None of the mentioned
View Answer

Answer: d
Explanation: W grammar or van Wijngaarden form is used to define potentially infinite context
free grammars in a finite number of rules. It is an example of larger class of affix grammars.
This technique was used to define the P/L Algol 68.

10. Which of the following version of Unix came up with YACC first?
a) V3
b) V5
c) CB UNIX
d) Unix-RT
View Answer

Answer: a
Explanation: Yacc appeared in version 3 of unix, though full description was published by 1975.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Applications – Parsers
» Next - Automata Theory Questions and Answers – Markup Languages
Categories Automata Theory MCQsPost navigation
Best Reference Books – M.Sc. – Human Development
Geotechnical Engineering Questions and Answers – Flexible Pavement Design – Types
advertisement
advertisement

Recommended Posts:

1. C++ Algorithms, Problems & Programming Examples


2. Java Algorithms, Problems & Programming Examples
3. Javascript Questions and Answers
4. Master of Computer Applications Questions and Answers
5. C Algorithms, Problems & Programming Examples
6. C Programming Examples on Set & String Problems & Algorithms
7. Ruby Programming Questions and Answers
8. R Programming Questions and Answers
9. LISP Questions and Answers
10. Programming Questions and Answers
11. Unix Questions and Answers
12. Network Theory Questions and Answers
13. Computer Science Questions and Answers
14. Electromagnetic Theory Questions and Answers
15. Theory of Machines Questions and Answers
16. Home
17. Information Science Questions and Answers
18. Linux Questions and Answers
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers – CFL- Closure Properties/Decision Properties
advertisement

Automata Theory Questions and Answers –


Markup Languages
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Markup Languages”.

1. XML is a _________ markup language.


a) meta
b) beta
c) octa
d) peta
View Answer

Answer: a
Explanation: Generally speaking, a meta language is a language used to describe a language.
XML is a metalanguage that is used to describe a markup language.
advertisement

2. XML uses _________ principle to formally describe the data.


a) DDL
b) DTD
c) DML
d) None of the mentioned
View Answer
Answer: b
Explanation: A document type definition (DTD) is a set of markup declarations that define a
document type for an SGML-family markup language (SGML, XML, HTML). A Document
Type Definition (DTD) defines the legal building blocks of an XML document. It defines the
document structure with a list of legal elements and attributes.

3. Which among the following are true for an Extensible markup language?
a) Human Readable/ Machine Readable
b) Extended from SGML
c) Developed by www consortium
d) All of the mentioned
View Answer

Answer: d
Explanation: XML is an open format markup language with a filename extension of .xml.

4. Which of them have XML as their default format?


a) IWork
b) LibreOffice
c) OpenOffice
d) All of the mentioned
View Answer

Answer: d
Explanation: More that hundred of document formats using XML syntax have been developed,
including RSS, Atom, SOAP and XHTML.
advertisement

5. A DTD is associated with a XML file by means of ___________


a) Function
b) <!DOCTYPE>
c) Macros
d) None of the mentioned
View Answer

Answer: b
Explanation: A document type definition defines the legal building blocks of an XML document
.

6. Which of the following is not an example of electronic mark up?


a) HTML
b) LaTeX
c) PostScript
d) None of the mentioned
View Answer

Answer: d
Explanation: There are three categories of electronic markup: presentational, procedural, and
descriptive markup. Examples are XML, HTML, LaTeX, etc.
7. troff and nroff are _________ in Unix.
a) functions
b) typesetting tools
c) System sofwares
d) None of the mentioned
View Answer

Answer: b
Explanation: Early examples of computer markup languages can be found in typesetting tools
like troff and nroff in Unix.
advertisement

8. SGML stands for:


a) Standard Generalized Markup Language
b) Standardized General Markup Language
c) Standard General Markup Language
d) Standard Generalized Markdown Language
View Answer

Answer: a
Explanation: SGML is an acronym for Standard Generalized Markup Language.

9. Markup Languages are not used for which of the following?


a) playlists
b) content syndication
c) user interfaces
d) none of the mentioned
View Answer

Answer: d
Explanation: Markup languages originated with text documents, but there is an increasing use of
mark up language in presentation of other types of information, including playlists, vector
graphics, user interfaces and web services.

10. Which of the following is incorrect for HTML5 markup construct?


a) Start tags: <section>
b) End tags: </section>
c) <img src= “abc.jpeg” >ABC</img>
d) None of the mentioned
View Answer

Answer: d
Explanation: All the mentioned options are valid HTML5 arguments and executes properly.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.
Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – YACC Parser Generator
» Next - Automata Theory Questions and Answers – Ambiguous Grammar
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Flexible Pavement Design – Types
Automata Theory Questions and Answers – Ambiguous Grammar
advertisement
advertisement

Recommended Posts:

1. LISP Questions and Answers


2. C Tutorials
3. C++ Programming Examples on STL
4. Spring Questions and Answers
5. Javascript Questions and Answers
6. C# Programming Examples on Networking
7. C Questions and Answers
8. C# Programming Examples on Functions
9. Cryptography and Network Security Questions and Answers
10. Computer Science Questions and Answers
11. Compilers Questions and Answers
12. C++ Questions and Answers
13. Information Science Questions and Answers
14. HTML Questions and Answers
15. Electromagnetic Theory Questions and Answers
16. Theory of Machines Questions and Answers
17. Network Theory Questions and Answers
18. Automata Theory Questions and Answers
19. Automata Theory Questions and Answers – From Grammars to Push Down Automata
20. Automata Theory Questions and Answers – Programming Techniques-Storage and
Subroutines
advertisement

Automata Theory Questions and Answers –


Ambiguous Grammar
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Ambiguous Grammar”.

1. A CFG is ambiguous if
a) It has more than one rightmost derivations
b) It has more than one leftmost derivations
c) No parse tree can be generated for the CFG
d) None of the mentioned
View Answer

Answer: b
Explanation: A context free grammar is ambiguous if it has more than one parse tree generated
or more than one leftmost derivations. An unambiguous grammar is a context free grammar for
which every valid string has a unique leftmost derivation.
advertisement

2. Which of the following are always unambiguous?


a) Deterministic Context free grammars
b) Non-Deterministic Regular grammars
c) Context sensitive grammar
d) None of the mentioned
View Answer

Answer: a
Explanation: Deterministic CFGs are always unambiguous , and are an important subclass of
unambiguous CFGs; there are non-deterministic unambiguous CFGs, however.

3. A CFG is not closed under


a) Dot operation
b) Union Operation
c) Concatenation
d) Iteration
View Answer

Answer: d
Explanation: The closure property of a context free grammar does not include iteration or kleene
or star operation.

4. Which of the following is an real-world programming language ambiguity?


a) dangling else problem
b) halting problem
c) maze problem
d) none of the mentioned
View Answer

Answer: a
Explanation: Dangling else problem: In many languages,the else in an if-then-else statement is
optional, which results into nested conditionals being ambiguous, at least in terms of the CFG.
advertisement

5. Which of the following is a parser for an ambiguous grammar?


a) GLR parser
b) Chart parser
c) All of the mentioned
d) None of the mentioned
View Answer

Answer: c
Explanation: GLR parser: a type of parser for non deterministic and ambiguous grammar
Chart parser: aa type of parser for ambiguous grammar.

6. A language that admits only ambiguous grammar:


a) Inherent Ambiguous language
b) Inherent Unambiguous language
c) Context free language
d) Context Sensitive language
View Answer

Answer: a
Explanation: A context free language for which no unambiguous grammar exists, is called
Inherent ambiguous language.

7. Which of the following is an example of inherent ambiguous language?


a) {an|n>1}
b) {anbncmdm| n,m > 0}
c) {0n1n|n>0}
d) None of the mentioned
View Answer

Answer: b
Explanation: This set is context-free, since the union of two context-free languages is always
context free.
advertisement

8. State true or false:


Statement: R->R|T T->ε is an ambiguous grammar
a) true
b) false
View Answer

Answer: a
Explanation: The production can be either itself or an empty string. Thus the empty string has
more than one leftmost derivations, depending on how many times R->R is being used.

9. In context to ambiguity, the number of times the following programming statement can be
interpreted as:
Statement: if R then if T then P else V
a) 2
b) 3
c) 4
d) 1
View Answer
Answer: a
Explanation: Dangling else problem
if R then (if T then P else V) and if R then (if T then P) else V are the two ways in which the
given if else statement can be parsed.

10. CFGs can be parsed in polynomial time using__________


a) LR parser
b) CYK algorithm
c) SLR parser
d) None of the mentioned
View Answer

Answer: CYK algorithm parses the CFG in polynomial time while LR parsers do the same in
linear time. DCFGs are accepted by DPDAs and parsed using LR parsers or CYK algorithm.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Markup Languages
» Next - Automata Theory Questions and Answers – PDA-Acceptance by Final State
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Markup Languages
Automata Theory Questions and Answers – PDA-Acceptance by Final State
advertisement
advertisement

Recommended Posts:

1. Ruby Programming Questions and Answers


2. C Programming Examples on Set & String Problems & Algorithms
3. Home
4. Theory of Machines Questions and Answers
5. Network Theory Questions and Answers
6. Electromagnetic Theory Questions and Answers
7. Compilers Questions and Answers
8. Automata Theory Questions and Answers – PSPACE
9. Automata Theory Questions and Answers – Inferences to Trees, Trees to Derivations
10. Automata Theory Questions and Answers – Deterministic PDA
11. Automata Theory Questions and Answers – Pumping Lemma for Context Free Language
12. Automata Theory Questions and Answers – DPDA and Context Free Languages
13. Automata Theory Questions and Answers – CFL- Closure Properties/Decision Properties
14. Automata Theory Questions and Answers
15. Automata Theory Questions and Answers – From PDA to Grammars
16. Automata Theory Questions and Answers – Regular Language & Expression – 2
17. Automata Theory Questions and Answers – Construction and Yield of a Parse Tree
18. Automata Theory Questions and Answers – YACC Parser Generator
19. Automata Theory Questions and Answers – CFL- Other Normal Forms
20. Automata Theory Questions and Answers – Intersection with Regular Languages
advertisement

Automata Theory Questions and Answers – PDA-


Acceptance by Final State
« Prev
Next »

This set of Automata Theory Questions and Answers for Entrance exams focuses on “PDA-
Acceptance by Final State”.

1. A push down automaton employs ________ data structure.


a) Queue
b) Linked List
c) Hash Table
d) Stack
View Answer

Answer: d
Explanation: A push down automata uses a stack to carry out its operations. They are more
capable than the finite automatons but less than the turing model.
advertisement

2. State true or false:


Statement: The operations of PDA never work on elements, other than the top.
a) true
b) false
View Answer

Answer: a
Explanation: The term pushdown refers to the fact that the elements are pushed down in the
stack and as per the LIFO principle, the operation is always performed on the top element of the
stack.

3. Which of the following allows stacked values to be sub-stacks rather than just finite symbols?
a) Push Down Automaton
b) Turing Machine
c) Nested Stack Automaton
d) None of the mentioned
View Answer

Answer: c
Explanation: In computational theory, a nested stack automaton is a finite automaton which
makes use of stack containing data which can be additional stacks.
4. A non deterministic two way, nested stack automaton has n-tuple definition. State the value of
n.
a) 5
b) 8
c) 4
d) 10
View Answer

Answer: d
Explanation: The 10-tuple can be stated as: NSA= ‹Q,Σ,Γ,δ,q0,Z0,F,[,],]›.
advertisement

5. Push down automata accepts _________ languages.


a) Type 3
b) Type 2
c) Type 1
d) Type 0
View Answer

Answer: b
Explanation: Push down automata is for Context free languages and they are termed as Type 2
languages according to Chomsky hierarchy.

6. The class of languages not accepted by non deterministic, nonerasing stack automata is
_______
a) NSPACE(n2)
b) NL
c) CSL
d) All of the mentioned
View Answer

Answer: d
Explanation: NSPACE or non deterministic space is the computational resource describing the
memory space for a non deterministic turing machine.

7. A push down automaton with only symbol allowed on the stack along with fixed symbol.
a) Embedded PDA
b) Nested Stack automata
c) DPDA
d) Counter Automaton
View Answer

Answer: d
Explanation: This class of automata can recognize a set of context free languages like {anbn|n
belongs to N}
advertisement

8. Which of the operations are eligible in PDA?


a) Push
b) Delete
c) Insert
d) Pop
View Answer

Answer: a, d
Explanation: Push and pop are the operations we perform to operate a stack. A stack follows the
LIFO principle, which states its rule as: Last In First Out.

9. A string is accepted by a PDA when


a) Stack is empty
b) Acceptance state
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: When we reach the acceptance state and find the stack to be empty, we say, the
string has been accepted by the push down automata.

10. The following move of a PDA is on the basis of:


a) Present state
b) Input Symbol
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: The next operation is performed by PDA considering three factors: present
state,symbol on the top of the stack and the input symbol.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory for Entrance exams, here is complete set of 1000+
Multiple Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Ambiguous Grammar
» Next - Automata Theory Questions and Answers – PDA-acceptance by Empty Stack
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Ambiguous Grammar
Automata Theory Questions and Answers – PDA-acceptance by Empty Stack
advertisement
advertisement

Recommended Posts:

1. C Programming Examples on Data-Structures


2. Computer Science Questions and Answers
3. Discrete Mathematics Questions and Answers
4. C Programming Examples
5. RDBMS Questions and Answers
6. Information Science Questions and Answers
7. Java Programming Examples on Event Handling
8. Java Programming Examples on Exception Handling
9. Theory of Machines Questions and Answers
10. Java Programming Examples on Set & String Problems & Algorithms
11. Network Theory Questions and Answers
12. Electromagnetic Theory Questions and Answers
13. C Programming Examples on Set & String Problems & Algorithms
14. C++ Programming Examples on Set & String Problems & Algorithms
15. Python Programming Examples on Stacks & Queues
16. C Programming Examples on Stacks & Queues
17. Solid State Chemistry Questions and Answers
18. Compilers Questions and Answers
19. C# Programming Examples on Data Structures
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers – PDA-


acceptance by Empty Stack
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “PDA-
acceptance by Empty Stack”.

1. If two sets, R and T has no elements in common i.e. RÇT=Æ, then the sets are called
a) Complement
b) Union
c) Disjoint
d) Connected
View Answer

Answer: c
Explanation: Two sets are called disjoint if they have no elements in common i.e. RÇT=Æ.
advertisement

2. Which among the following is not a part of the Context free grammar tuple?
a) End symbol
b) Start symbol
c) Variable
d) Production
View Answer
Answer: a
Explanation: The tuple definition of context free grammar is: (V, T, P, S) where V=set of
variables, T=set of terminals, P=production, S= Starting Variable.

3. A context free grammar is a ___________


a) English grammar
b) Regular grammar
c) Context sensitive grammar
d) None of the mentioned
View Answer

Answer: c
Explanation: Context free grammar is the set which belongs to the set of context free grammar.
Similarly, Regular grammar is a set which belongs to the the set of Context free grammar.

4. The closure property of context free grammar includes :


a) Kleene
b) Concatenation
c) Union
d) All of the mentioned
View Answer

Answer: d
Explanation: Context free grammars are closed under kleene operation, union and concatenation
too.
advertisement

5. Which of the following automata takes stack as auxiliary storage?


a) Finite automata
b) Push down automata
c) Turing machine
d) All of the mentioned
View Answer

Answer: b
Explanation: Pushdown Automaton uses stack as an auxiliary storage for its operations. Turing
machines use Queue for the same.

6. Which of the following automata takes queue as an auxiliary storage?


a) Finite automata
b) Push down automata
c) Turing machine
d) All of the mentioned
View Answer

Answer: c
Explanation: Pushdown Automaton uses stack as an auxiliary storage for its operations. Turing
machines use Queue for the same.
7. A context free grammar can be recognized by
a) Push down automata
b) 2 way linearly bounded automata
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: A linearly bounded automata is a restricted non deterministic turing machine
which is capable of accepting ant context free grammar.
advertisement

8. A null production can be referred to as:


a) String
b) Symbol
c) Word
d) All of the mentioned
View Answer

Answer: a
Explanation: Null production is always taken as a string in computational theory.

9. The context free grammar which generates a Regular Language is termed as:
a) Context Regular Grammar
b) Regular Grammar
c) Context Sensitive Grammar
d) None of the mentioned
View Answer

Answer: b
Explanation: Regular grammar is a subset of Context free grammar. The CFGs which produces
a language for which a finite automaton can be created is called Regular grammar.

10. NPDA stands for


a) Non-Deterministic Push Down Automata
b) Null-Push Down Automata
c) Nested Push Down Automata
d) All of the mentioned
View Answer

Answer: a
Explanation: NPDA stands for non-deterministic push down automata whereas DPDA stands for
deterministic push down automata.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.
Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – PDA-Acceptance by Final State
» Next - Automata Theory Questions and Answers – From Grammars to Push Down Automata
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – PDA-Acceptance by Final State
Foundation Engineering Questions and Answers – Design of Flexible Pavements – 1
advertisement
advertisement

Recommended Posts:

1. Java Programming Examples on Set & String Problems & Algorithms


2. Information Science Questions and Answers
3. Computer Science Questions and Answers
4. Python Questions and Answers
5. C++ Programming Examples on Set & String Problems & Algorithms
6. C Programming Examples on Set & String Problems & Algorithms
7. C# Programming Examples on Data Structures
8. Theory of Machines Questions and Answers
9. Network Theory Questions and Answers
10. Electromagnetic Theory Questions and Answers
11. Home
12. Compilers Questions and Answers
13. Automata Theory Questions and Answers – DPDA and Context Free Languages
14. Automata Theory Questions and Answers – The Language of a Grammar, Inferences and
Ambiguity
15. Automata Theory Questions and Answers – Chomsky Normal Form
16. Automata Theory Questions and Answers -Turing Machine and Halting
17. Automata Theory Questions and Answers – Intersection with Regular Languages
18. Automata Theory Questions and Answers – The Universal Language-Undecidability
19. Automata Theory Questions and Answers – DPDA and Ambiguous Grammars
20. Automata Theory Questions and Answers – From Grammars to Push Down Automata
advertisement

Automata Theory Questions and Answers – From


Grammars to Push Down Automata
« Prev
Next »

This set of Basic Automata Theory Questions and Answers focuses on “From Grammars to
Push Down Automata”.

1. The production of the form A->B , where A and B are non terminals is called
a) Null production
b) Unit production
c) Greibach Normal Form
d) Chomsky Normal Form
View Answer

Answer: b
Explanation: A->ε is termed as Null production while A->B is termed as Unit production.
advertisement

2. Halting states are of two types. They are:


a) Accept and Reject
b) Reject and Allow
c) Start and Reject
d) None of the mentioned
View Answer

Answer: a
Explanation: Halting states are the new tuple members introduced in turing machine and is of
two types: Accept Halting State and Reject Halting State.

3. A push down automata can be represented as:


PDA= ε-NFA +[stack] State true or false:
a) true
b) false
View Answer

Answer: a
Explanation:

4. A pushdown automata can be defined as: (Q, ∑, G, q0, z0, A, d)


What does the symbol z0 represents?
a) an element of G
b) initial stack symbol
c) top stack alphabet
d) all of the mentioned
View Answer

Answer: d
Explanation: z0 is the initial stack symbol, is an element of G. Other symbols like d represents
the transition function of the machine.
advertisement

5. Which of the following correctly recognize the symbol ‘|-‘ in context to PDA?
a) Moves
b) transition function
c) or/not symbol
d) none of the mentioned
View Answer

Answer: a
Explanation: Using this notation, we can define moves and further acceptance of a string by the
machine.

6. Which among the following is true for the given statement?


Statement :If there are strings R and T in a language L so that R is prefix of T and R is not
equivalent to T.
a) No DPDA can accept L by empty stack
b) DPDA can accept L by an empty stack
c) L is regular
d) None of the mentioned
View Answer

Answer: a
Explanation: If M is a DPDA accepting L by an empty stsck, R and T are distinct strings in L,
and R is a prefix of T, then the sequence of moves M must make in order to accept R leaves the
stack empty, since R∈L. But then T cannot be accepted, since M cant move with an empty stack.

7. 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}
c) {xxc| where c stands for the complement,{0,1}}
d) None of the mentioned
View Answer

Answer: d
Explanation: Theorem: The language pal of palindromes over the alphabet {0,1} cannot be
accepted by any finite automaton , and it is therefore not regular.
advertisement

8. For a counter automaton, with the symbols A and Z0, the string on the stack is always in the
form of __________
a) A
b) AnZ0, n>=0
c) Z0An, n>=0
d) None of the mentioned
View Answer

Answer: b
Explanation:The possible change in the stack contents is a change in the number of A’s on the
stack.

9. State true or false:


Statement: Counter Automaton can exist for the language L={0i1i|i>=0}
a) true
b) false
View Answer

Answer: a
Explanation: The PDA works as follows. Instead of saving excess 0’s or 1’s on the stack, we
save *’s and use two different states to indicate which symbol there is currently a surplus of.
The state q0 is the initial state and the only accepting state.

10. Let ∑={0,1}* and the grammar G be:


S->ε
S->SS
S->0S1|1S0
State which of the following is true for the given
a) Language of all and only Balanced strings
b) It contains equal number of 0’s and 1’s
c) Ambiguous Grammar
d) All of the mentioned
View Answer

Answer: d
Explanation: A string is said to be balanced if it consist of equal number of 0’s and 1’s.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice basic questions and answers on all areas of Automata Theory, here is complete set of
1000+ Multiple Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – PDA-acceptance by Empty Stack
» Next - Automata Theory Questions and Answers – From PDA to Grammars
Categories Automata Theory MCQsPost navigation
Foundation Engineering Questions and Answers – Design of Flexible Pavements – 1
Automata Theory Questions and Answers – From PDA to Grammars
advertisement
advertisement

Recommended Posts:

1. VLSI Questions and Answers


2. Java Programming Examples on Event Handling
3. Java Programming Examples on Set & String Problems & Algorithms
4. Information Science Questions and Answers
5. Cloud Computing Questions and Answers
6. Bioprocess Engineering Questions and Answers
7. Artificial Intelligence Questions and Answers
8. Computer Science Questions and Answers
9. C Programming Examples on Set & String Problems & Algorithms
10. Home
11. C++ Programming Examples on Set & String Problems & Algorithms
12. C Programming Examples on Data-Structures
13. Theory of Machines Questions and Answers
14. Electromagnetic Theory Questions and Answers
15. C Programming Examples on Stacks & Queues
16. Python Programming Examples on Stacks & Queues
17. Network Theory Questions and Answers
18. C# Programming Examples on Data Structures
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers – From


PDA to Grammars
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “From
PDA to Grammars”.

1. The instantaneous PDA is has the following elements


a) State
b) Unconsumed input
c) Stack content
d) All of the mentioned
View Answer

Answer: d
Explanation: The instantaneous description of a PDA is represented by 3 tuple:
(q,w,s)
where q is the state, w is the unconsumed input and s is the stack content.
advertisement

2. The moves in the PDA is technically termed as:


a) Turnstile
b) Shifter
c) Router
d) None of the mentioned
View Answer

Answer: a
Explanation: A turnstile notation is used for connecting pairs od ID’s taht represents one or
many moves of a PDA.
3. Which of the following option resembles the given PDA?

a) {0n1n|n>=0}
b) {0n12n|n>=0}
c) {02n1n|n>=0}
d) None of the mentioned
View Answer

Answer: a

4. Which of the following correctly resembles the given state diagram?

a) {wwr|w=(a+b)*}
b) ε is called the initial stack symbol
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: a
Explanation: Initially we put a special symbol ‘#’ into the empty stack. At state q1, the w is
being read. In state q2, each 0 or 1 is popped when it matches the input. If any other input is
given, the PDA will go to a dead state. When we reach that special symbol ‘#’, we go to the
accepting state q3.
advertisement

5. Which of the following assertion is false?


a) If L is a language accepted by PDA1 by final state, there exist a PDA2 that accepts L by
empty stack i.e. L=L(PDA1)=L(PDA2)
b) If L is a CFL then there exists a push down automata P accepting CF; ; by empty stack i.e.
L=M(P)
c) Let L is a language accepted by PDA1 then there exist a CFG X such that L(X)=M(P)
d) All of the mentioned
View Answer

Answer: d
Explanation:
All the assertions mentioned are theorems or corollary.

6. A push down automata can represented using:


a) Transition graph
b) Transition table
c) ID
d) All of the mentioned
View Answer

Answer: d
Explanation: Yes, a PDA can be represented using a transition diagram, transition table and an
instantaneous description.

7. State true or false:


Statement: Every context free grammar can be transformed into an equvalent non deterministic
push down automata.
a) true
b) false
View Answer

Answer: a
Explanation: Push down automata is the automaton machine for all the context free grammar or
Type 2 languages.
advertisement

8. Which of the following statement is false?


a) For non deterministic PDA, equivalence is undecidable
b) For deterministic PDA, equivalence is decidable
c) For deterministic PDA, equivalence is undecidable.
d) None of the mentioned
View Answer

Answer: c
Explanation: Geraud proved the equivalence problem decidable for Deterministic PDA .

9. Which of the following are the actions that operates on stack top?
a) Pushing
b) Popping
c) Replacing
d) All of the mentioned
View Answer

Answer: d
Explanation: Push, pop and replace are all the basic and only operations that takes place on stack
top.
10. A push down automata is said to be _________ if it has atmost one transition around all
configurations.
a) Finite
b) Non regular
c) Non-deterministic
d) Deterministic
View Answer

Answer: d
Explanation: DPDA or Deterministic Push down automata has atmost one transition applicable
to each configuration.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – From Grammars to Push Down Automata
» Next - Automata Theory Questions and Answers – Deterministic PDA
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – From Grammars to Push Down Automata
Foundation Engineering Questions and Answers – Design of Flexible Pavements – 2
advertisement
advertisement

Recommended Posts:

1. C# Programming Examples on Exceptions


2. VLSI Questions and Answers
3. Home
4. Cloud Computing Questions and Answers
5. Information Science Questions and Answers
6. Java Programming Examples on Set & String Problems & Algorithms
7. Computer Science Questions and Answers
8. C Programming Examples on Data-Structures
9. Discrete Mathematics Questions and Answers
10. Solid State Chemistry Questions and Answers
11. C Programming Examples on Set & String Problems & Algorithms
12. C Programming Examples on Stacks & Queues
13. C++ Programming Examples on Set & String Problems & Algorithms
14. Theory of Machines Questions and Answers
15. Python Programming Examples on Stacks & Queues
16. Network Theory Questions and Answers
17. Compilers Questions and Answers
18. Electromagnetic Theory Questions and Answers
19. C# Programming Examples on Data Structures
20. Automata Theory Questions and Answers – The Language of NFA
advertisement

Automata Theory Questions and Answers –


Deterministic PDA
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Deterministic PDA”

1. The transition a Push down automaton makes is additionally dependent upon the:
a) stack
b) input tape
c) terminals
d) none of the mentioned
View Answer

Answer: a
Explanation: A PDA is a finite machine which has an additional stack storage. Its transitions are
based not only on input and the correct state but also on the stack.
advertisement

2. A PDA machine configuration (p, w, y) can be correctly represented as:


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
View Answer

Answer: a
Explanation: A machine configuration is an element of K×Σ*×Γ*.
(p,w,γ) = (current state, unprocessed input, stack content).

3. |-* is the __________ closure of |-


a) symmetric and reflexive
b) transitive and reflexive
c) symmetric and transitive
d) none of the mentioned
View Answer

Answer: b
Explanation: A string w is accepted by a PDA if and only if (s,w, e) |-* (f, e, e)

4. 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
b) end in final state
c) end with an empty stack
d) all of the mentioned
View Answer

Answer: d
Explanation: The empty stack in the end is our requirement relative to finite state automatons.
advertisement

5. 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
c) Atleast one state has more than one transitions
d) None of the mentioned
View Answer

Answer: a
Explanation: A Deterministic Push Down Automata is a Push Down Automata in which no state
p has two or more transitions.

6. State true or false:


Statement: For every CFL, G, there exists a PDA M such that L(G) = L(M) and vice versa.
a) true
b) false
View Answer

Answer: a
Explanation: There exists two lemma’s such that:
a) Given a grammar G, construct the PDA and show the equivalence
b) Given a PDA, construct a grammar and show the equivalence

7. If the PDA does not stop on an accepting state and the stack is not empty, the string is:
a) rejected
b) goes into loop forever
c) both (a) and (b)
d) none of the mentioned
View Answer

Answer: a
Explanation: To accept a string, PDA needs to halt at an accepting state and with a stack empty,
else it is called rejected. Given a PDA M, we can construct a PDA M’ that accepts the same
language as M, by both acceptance criteria.
advertisement

8. A language accepted by Deterministic Push down automata is closed under which of the
following?
a) Complement
b) Union
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: a
Explanation: Deterministic Context free languages(one accepted by PDA by final state), are
drastically different from the context free languages. For example they are closed under
complementation and not union.

9. Which of the following is a simulator for non deterministic automata?


a) JFLAP
b) Gedit
c) FAUTO
d) None of the mentioned
View Answer

Answer: a
Explanation: JFLAP is a software for experimenting with formal topics including NFA, NPDA,
multi-tape turing machines and L-systems.

10. Finite-state acceptors for the nested words can be:


a) nested word automata
b) push down automata
c) ndfa
d) none of the mentioned
View Answer

Answer: a
Explanation: The linear encodings of languages accepted by finite nested word automata gives
the class of ‘visibly pushdown automata’.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – From PDA to Grammars
» Next - Automata Theory Questions and Answers – Regular Languages and D-PDA
Categories Automata Theory MCQsPost navigation
Foundation Engineering Questions and Answers – Design of Flexible Pavements – 2
Foundation Engineering Questions and Answers – Stresses in Flexible Pavements
advertisement
advertisement

Recommended Posts:

1. Terms of Service
2. C# Programming Examples on Threads
3. C Programming Examples on Data-Structures
4. Java Programming Examples on Exception Handling
5. VLSI Questions and Answers
6. CSS Questions and Answers
7. Information Science Questions and Answers
8. Computer Science Questions and Answers
9. Java Programming Examples on Set & String Problems & Algorithms
10. Solid State Chemistry Questions and Answers
11. Theory of Machines Questions and Answers
12. Python Programming Examples on Stacks & Queues
13. C Programming Examples on Stacks & Queues
14. Network Theory Questions and Answers
15. C++ Programming Examples on Set & String Problems & Algorithms
16. Electromagnetic Theory Questions and Answers
17. C Programming Examples on Set & String Problems & Algorithms
18. C# Programming Examples on Data Structures
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Regular Languages and D-PDA
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Regular Languages and D-PDA”.

1. Which of the following is analogous to the following?


:NFA and NPDA
a) Regular language and Context Free language
b) Regular language and Context Sensitive language
c) Context free language and Context Sensitive language
d) None of the mentioned
View Answer

Answer: a
Explanation: All regular languages can be accepted by a non deterministic finite automata and
all context free languages can be accepted by a non deterministic push down automata.
advertisement

2. Let T={p, q, r, s, t}. The number of strings in S* of length 4 such that no symbols can be
repeated.
a) 120
b) 625
c) 360
d) 36
View Answer

Answer: b
Explanation: Using the permutation rule, we can calculate that there will be total of 625
permutations on 5 elements taking 4 as the length.

3. Which of the following relates to Chomsky hierarchy?


a) Regular<CFL<CSL<Unrestricted
b) CFL<CSL<Unrestricted<Regular
c) CSL<Unrestricted<CF<Regular
d) None of the mentioned
View Answer

Answer: a
Explanation: The chomsky hierarchy lays down the following order:
Regular<CFL<CSL<Unrestricted

4. A language is accepted by a push down automata if it is:


a) regular
b) context free
c) both (a) and (b)
d) none of the mentioned
View Answer

Answer: c
Explanation: All the regular languages are the subset to context free languages and thus can be
accepted using push down automata.
advertisement

5. Which of the following is an incorrect regular expression identity?


a) R+f=R
b) eR=e
c) Rf=f
d) None of the mentioned
View Answer

Answer: b
Explanation: e is the identity for concatenation. Thus, eR=R.

6. Which of the following strings do not belong the given regular expression?
(a)*(a+cba)
a) aa
b) aaa
c) acba
d) acbacba
View Answer

Answer: d
Explanation: The string acbacba is unacceptable by the regular expression (a)*(a+cba).
7. Which of the following regular expression allows strings on {a,b}* with length n where n is a
multiple of 4.
a) (a+b+ab+ba+aa+bb+aba+bab+abab+baba)*
b) (bbbb+aaaa)*
c) ((a+b)(a+b)(a+b)(a+b))*
d) None of the mentioned
View Answer

Answer: c
Explanation: Other mentioned options do not many of the combinations while option c seems
most reliable.
advertisement

8. Which of the following strings is not generated by the given grammar:


S->SaSbS|e
a) aabb
b) abab
c) abaabb
d) None of the mentioned
View Answer

Answer: d
Explanation: All the given options are generated by the given grammar. Using the methods of
left and right derivations, it is simpler to look for string which a grammar can generate.

9. abb*c denotes which of the following?


a) {abnc|n=0}
b) {abnc|n=1}
c) {anbc|n=0}
d) {abcn|n>0}
View Answer

Answer: b
Explanation: Here, the first mentioned b is fixed while the other can be zero or can be repeated
any number of time.

10. The following denotion belongs to which type of language:


G=(V, T, P, S)
a) Regular grammar
b) Context free grammar
c) Context Sensitive grammar
d) All of the mentioned
View Answer

Answer: b
Explanation: Ant formal grammar is represented using a 4-tuple definition where V= finite set
of variables, T= set of terminal characters, P=set of productions and S= Starting Variable with
certain conditions based on the type of formal grammar.
advertisement
Sanfoundry Global Education & Learning Series – Automata Theory.
To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Deterministic PDA
» Next - Automata Theory Questions and Answers – DPDA and Context Free Languages
Categories Automata Theory MCQsPost navigation
Foundation Engineering Questions and Answers – Stresses in Flexible Pavements
Foundation Engineering Questions and Answers – Flexible Pavement – Equivalent Wheel and
Axle Load
advertisement
advertisement

Recommended Posts:

1. Home
2. C# Programming Examples on Functions
3. LISP Questions and Answers
4. C# Programming Examples on Data Structures
5. C Tutorials
6. Computer Science Questions and Answers
7. C++ Programming Examples on Set & String Problems & Algorithms
8. C Programming Examples on Set & String Problems & Algorithms
9. Java Programming Examples on Utility Classes
10. C Programming Examples on Strings
11. Information Science Questions and Answers
12. Java Programming Examples on Set & String Problems & Algorithms
13. Java Programming Examples on String Handling
14. Python Questions and Answers
15. Theory of Machines Questions and Answers
16. Network Theory Questions and Answers
17. PHP Questions and Answers
18. Electromagnetic Theory Questions and Answers
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers – DPDA


and Context Free Languages
« Prev
Next »
This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“DPDA and Context Free Languages”.

1. Context free grammar is called Type 2 grammar because of ______________ hierarchy.


a) Greibach
b) Backus
c) Chomsky
d) None of the mentioned
View Answer

Answer: c
Explanation: Chomsky hierarchy decide four type of language :Type 3- Regular Language, Type
2-Context free language, Type 1-Context Sensitive Language, Type 0- Unrestricted or
Recursively Ennumerable language.
advertisement

2. a→b
Restriction: Length of b must be atleast as much length of a.
Which of the following is correct for the given assertion?
a) Greibach Normal form
b) Context Sensitive Language
c) Chomsky Normal form
d) Recursively Ennumerable language
View Answer

Answer: b
Explanation: A context-sensitive grammar (CSG) is a formal grammar in which the left-hand
sides and right-hand sides of any production rules may be surrounded by a context of terminal
and non terminal symbols. Context-sensitive grammars are more general than context-free
grammars, in the sense that there are some languages that cannot be described by context-free
grammars, but can be described by CSG.

3. From the definition of context free grammars,


G=(V, T, P, S)
What is the solution of VÇT?
a) Null
b) Not Null
c) Cannot be determined, depends on the language
d) None of the mentioned
View Answer

Answer: a
Explanation: V is the set of non terminal symbols while T is the st of terminal symbols, their
intersection would always be null.

4. If P is the production, for the given statement, state true or false.


P: V->(V∑T)* represents that the left hand side production rule has no right or left context.
a) true
b) false
View Answer
Answer: a
Explanation: Here the production P is from the definition of Context free grammar and thus, has
no right or left context.

5. There exists a Context free grammar such that:


X->aX
Which among the following is correct with respect to the given assertion?
a) Left Recursive Grammar
b) Right Recursive Grammar
c) Non Recursive Grammar
d) None of the mentioned
View Answer

Answer: b
Explanation: The grammar with right recursive production is known as Right recursive
grammar. Right recursive production is of the form X->aX where a is a terminal and X is a non
terminal.
advertisement

6. If the partial derivation tree contains the root as the starting variable, the form is known as:
a) Chomsky hierarchy
b) Sentential form
c) Root form
d) None of the mentioned
View Answer

Answer: b
Explanation: Example: For any grammar, productions be:
S->AB
A->aaA| ^
B->Bb| ^
The partial derivation tree can be drawn as:

Since it has the root as S, this can be said to be in sentential form.

7. Find a regular expression for a grammar which generates a language which states :
L contains a set of strings starting wth an a and ending with a b, with something in the middle.
a) a(a*Ub*)b
b) a*(aUb)b*
c) a(a*b*)b
d) None of the mentioned
View Answer
Answer: a
Explanation: The grammar for the same language can be stated as :
(1) S → aMb
(2) M → A
(3) M → B
(4) A → e
(5) A → aA
(6) B → e
(7) B → bB

8. Which of the following is the correct representation of grammar for the given regular
expression?
a(aUb)*b

a) (1) S → aMb
(2) M → e
(3) M → aM
(4) M → bM

b) (1) S → aMb
(2) M → Mab
(3) M → aM
(4) M → bM
advertisement

c) (1) S → aMb
(2) M → e
(3) M → aMb
(4) M → bMa

d) None of the mentioned


View Answer

Answer: a
Explanation:
The basic idea of grammar formalisms is to capture the structure of string by
a) using special symbols to stand for substrings of a particular structure
b) using rules to specify how the substrings are combined to form new substrings.

9. A CFG consist of the following elements:


a) a set of terminal symbols
b) a set of non terminal symbols
c) a set of productions
d) all of the mentioned
View Answer

Answer: d
Explanation: A CFG consists of:
a) a set of terminals, which are characters of alphabets that appear in the string generated by the
grammar.
b) a set of non terminals, which are placeholders for patterns of terminal symbols that can be
generated by the nonterminal symbols.
c) a set of productions, which are set of rules to transit from one state to other forming up the
string
d) a start symbol, a special non terminal symbol that appears in the initial string generated in the
grammar.

10. A CFG for a program describing strings of letters with the word “main” somewhere in the
string:
a) -> m a i n
-> | epsilon
-> A | B | … | Z | a | b … | z

b) –> m a i n
–>
–> A | B | … | Z | a | b … | z
advertisement

c) –> m a i n
–> | epsilon
–> A | B | … | Z | a | b … | z

d) None of the mentioned


View Answer

Answer: a
Explanation: None.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Regular Languages and D-PDA
» Next - Automata Theory Questions and Answers – DPDA and Ambiguous Grammars
Categories Automata Theory MCQsPost navigation
Foundation Engineering Questions and Answers – Flexible Pavement – Equivalent Wheel and
Axle Load
Foundation Engineering Questions and Answers – Design of Rigid Pavements
advertisement
advertisement

Recommended Posts:

1. Machine Drawing Questions and Answers


2. C# Questions and Answers
3. C Algorithms, Problems & Programming Examples
4. C++ Questions and Answers
5. Java Programming Examples on Java.Lang
6. Theory of Machines Questions and Answers
7. Network Theory Questions and Answers
8. LISP Questions and Answers
9. C# Programming Examples on Functions
10. C Tutorials
11. Electromagnetic Theory Questions and Answers
12. Java Programming Examples on Set & String Problems & Algorithms
13. C++ Programming Examples on Set & String Problems & Algorithms
14. C Programming Examples on Set & String Problems & Algorithms
15. Ruby Programming Questions and Answers
16. Compilers Questions and Answers
17. Automata Theory Questions and Answers
18. Theory of Computation – Eliminating null production from the productions in the
Context Free Grammar
19. Automata Theory Questions and Answers – CFG-Eliminating Useless Symbols
20. Compilers Questions and Answers – Context Free Grammar – 1
advertisement

Automata Theory Questions and Answers – DPDA


and Ambiguous Grammars
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“DPDA and Ambiguous Grammars”.

1. CFGs are more powerful than:


a) DFA
b) NDFA
c) Mealy Machine
d) All of the mentioned
View Answer

Answer: d
Explanation:
Context-free grammars are strictly more powerful than regular expressions:
1) Any language that can be generated using regular expressions can be generated by a context-
free grammar.
2) There are languages that can be generated by a context-free grammar that cannot be generated
by any regular expression.
As a corollary, CFGs are strictly more powerful than DFAs and NDFAs.
advertisement
2. State true or false:
S-> 0S1|01
Statement: No regular expression exists for the given grammar.
a) true
b) false
View Answer

Answer: a
Explanation: The grammar generates a language L such that L={0n1n|n>=1} which is not
regular. Thus, no regular expression exists for the same.

3. For the given set of code, the grammar representing real numbers in Pascal has error in one of
the six lines. Fetch the error.
(1) ->
(2) -> | epsilon
(3) -> | epsilon
(4) -> ‘E’ | epsilon
(5) -> + | – | epsilon
(6) -> 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
a) 3
b) 4
c) 2
d) No errors
View Answer

Answer: a
Explanation:
–>
–> | epsilon
–> ‘.’ | epsilon
–> ‘E’ | epsilon
–> + | – | epsilon
–> 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

4. Which among the following is incorrect with reference to a derivation tree?


a) Every vertex has a label which is a terminal or a variable.
b) The root has a label which can be a terminal.
c) The label of the internal vertex is a variable.
d) None of the mentioned
View Answer

Answer: b
Explanation: The root or interms of the grammar, starting variable can not be a terminal.
advertisement

5. Let G=(V, T, P, S)
where a production can be written as:
S->aAS|a
A->SbA|ba|SS
Which of the following string is produced by the grammar?
a) aabbaab
b) aabbaa
c) baabab
d) None of the mentioned
View Answer

Answer: b
Explanation: The step wise grammar translation can be written as:
aAS->aSbaA->aabAS->aabbaa

6. Statement 1: Ambiguity is the property of grammar but not the language.


Statement 2: Same language can have more than one grammar.
Which of the following options are correct with respect to the given statements?
a) Statement 1 is true but statement 2 is false
b) Statement 1 is false but statement 2 is true
c) Both the statements are true
d) Both the statements are false
View Answer

Answer: c
Explanation: One language can more than one grammar. Some can be ambiguous and some
cannot.

7. Which of the following are non essential while simplifying a grammar?


a) Removal of useless symbols
b) Removal of unit productions
c) Removal of null production
d) None of the mentioned
View Answer

Answer: d
Explanation: Here are some process used to simplify a CFG but to produce an equivalent
grammar:
a) Removal of useless symbols(non terminal) b) Removal of Unit productions and c) Removal
of Null productions.
advertisement

8. Which of the following are context free language?


a) L={aibi|i>=0}
b) L={wwr| w is a string and r represents reverse}
c) Both (a) and (b)
d) one of the mentioned
View Answer

Answer: a
Explanation: None.

9. The language L ={ai2bi|i>=0} is:


a) recursive
b) deterministic CFL
c) regular
d) Two of the mentioned is correct
View Answer

Answer: d
Explanation: The language is recursive and every recursive language is a CFL.

10. L->rLt|tLr|t|r
The given grammar produces a language which is:
a) All palindrome
b) All even palindromes
c) All odd palindromes
d) Strings with same begin and end symbols
View Answer

Answer: c
Explanation: As there exists no production for the palindrome set, even palindromes like abba,
aabbaa, baaaaaab, etc will not be generated.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – DPDA and Context Free Languages
» Next - Automata Theory Questions and Answers – CFG-Eliminating Useless Symbols
Categories Automata Theory MCQsPost navigation
Foundation Engineering Questions and Answers – Design of Rigid Pavements
Best Reference Books – M.Sc – Agriculture – Agronomy
advertisement
advertisement

Recommended Posts:

1. C++ Programming Examples on Set & String Problems & Algorithms


2. Java Programming Examples on Set & String Problems & Algorithms
3. C# Programming Examples on Functions
4. PHP Questions and Answers
5. Information Science Questions and Answers
6. C Tutorials
7. Advanced Machining Processes Questions and Answers
8. Computer Science Questions and Answers
9. Theory of Machines Questions and Answers
10. Network Theory Questions and Answers
11. Ruby Programming Questions and Answers
12. Electromagnetic Theory Questions and Answers
13. Compilers Questions and Answers
14. Automata Theory Questions and Answers
15. Theory of Computation – Regular Grammars
16. Automata Theory Questions and Answers – Finite Automata with Epsilon Transition
17. Automata Theory Questions and Answers – Testing Emptiness and Membership
18. Automata Theory Questions and Answers – Finite Automata
19. Automata Theory Questions and Answers – Pumping Lemma for Context Free Language
20. Automata Theory Questions and Answers – CFG-Eliminating Useless Symbols
advertisement

Automata Theory Questions and Answers – CFG-


Eliminating Useless Symbols
« Prev
Next »

This set of Automata Theory Assessment Questions and Answers focuses on “CFG-Eliminating
Useless Symbols”.

1. Suppose A->xBz and B->y, then the simplified grammar would be:
a) A->xyz
b) A->xBz|xyz
c) A->xBz|B|y
d) none of the mentioned
View Answer

Answer: a
Explanation: For the first step, substitute B in first production as it only produces terminal and
remove B production as it has already been utilized.
We get A->xBz|xyz and now, as B has no production, we eliminate the terms which hold the
variable B, thus the answer remain A->xyz.
advertisement

2. Given Grammar: S->A, A->aA, A->e, B->bA


Which among the following productions are Useless productions?
a) S->A
b) A->aA
c) A->e
d) B->bA
View Answer

Answer: d
Explanation: Some derivations are not reachable from the starting variable. As B is not
reachable from the starting variable, it is a useless symbol and thus, can be eliminated.

3. Given:
S->…->xAy->…->w
if ____________, then A is useful, else useless symbol.
a) A is a non terminal
b) A is a terminal
c) w Î L
d) w Ë L
View Answer

Answer: c
Explanation: Whatever operation we perform in intermediate stages, if the string produced
belongs to the language, A is termed as useful and if not, not a useful variable.

4. Given:
S->aSb
S->e
S-> A
A->aA
B->C
C->D
The ratio of number of useless variables to number of useless production is:
a) 1
b) 3/4
c) 2/3
d) 0
View Answer

Answer: a
Explanation: A, B, C, D are the useless symbols in the given grammar as they never tend to lead
to a terminal. The productions S-> A, A->aA, B->C, C->D are also termed as useless production
as they will never produce a string to the grammar.

5. Given grammar G:
S->aS|A|C
A->a
B->aa
C->aCb
Find the set of variables thet can produce strings only with the set of terminals.
a) {C}
b) {A,B}
c) {A,B,S}
d) None of the mentioned
View Answer

Answer: c
Explanation: First step: Make a set of variables that directly end up with a terminal
Second step: Modify the set with variables that produce the elements of above
generated set.
The rest variables are termed as useless.
advertisement
6. Given grammar:
S->aS|A
A->a
B->aa
Find the number of variables reachable from the Starting Variable?
a) 0
b) 1
c) 2
d) None of the mentioned
View Answer

Answer: b
Explanation: Use a dependency graph to find which variable is reachable and which is not.

7. Inorder to simplify a context free grammar, we can skip the following operation:
a) Removal of null production
b) Removal of useless symbols
c) Removal of unit productions
d) None of the mentioned
View Answer

Answer: d
Explanation: Inorder to simplify the grammar all of the process including the removal of null
productions, unit productions and useless symbols is necessary.

8. Given a Grammar G:
S->aA
A->a
A->B
B->A
B->bb
Which among the following will be the simplified grammar?
a) S->aA|aB, A->a, B->bb
b) S->aA|aB, A->B, B->bb
c) S->aA|aB, A->a, B->A
d) None of the emntioned
View Answer

Answer: a
Explanation: Step 1: Substitute A->B
Step 2: Remove B->B
Step 3: Substitute B->A
Step 4: Remove Repeated productions
9. Simplify the given grammar:
A-> a| aaA| abBc
B-> abba| b
advertisement

a) A-> a| aaA| ababbAc| abbc


b) A-> a| aaA| ababbAc| abbc, B-> abba|b
c) A-> a| aaA| abbc, B->abba
d) None of the mentioned
View Answer

Answer: a
Explanation: Using the substitution rules, we can simply eradicate what is useless and thus
produce the simplified result i.e. A-> a| aaA| ababbAc| abbc.

10. In context to the process of removing useless symbols, which of the following is correct?
a) We remove the Nullable variables
b) We eliminate the unit productions
c) We eliminate products which yield no terminals
d) All of the mentioned
View Answer

Answer: c
Explanation: In the process of removal of useless symbols, we want to remove productions that
can never take part in any derivation.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory Assessment Questions, here is complete set of 1000+
Multiple Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – DPDA and Ambiguous Grammars
» Next - Automata Theory Questions and Answers – Eliminating Epsilon Productions
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Mechanical Stabilisation
Geotechnical Engineering Questions and Answers – Site Exploration
advertisement
advertisement

Recommended Posts:

1. Java Programming Examples on Classes


2. Computer Science Questions and Answers
3. Engineering Physics I Questions and Answers
4. Machine Drawing Questions and Answers
5. Statistical Quality Control Questions and Answers
6. Advanced Machining Processes Questions and Answers
7. Ruby Programming Questions and Answers
8. Theory of Machines Questions and Answers
9. Network Theory Questions and Answers
10. Electromagnetic Theory Questions and Answers
11. Compilers Questions and Answers
12. Automata Theory Questions and Answers
13. Theory of Computation – Chomsky Normal Form
14. Automata Theory Questions and Answers – From Grammars to Push Down Automata
15. Automata Theory Questions and Answers – Finite Automata
16. Automata Theory Questions and Answers – The Language of a Grammar, Inferences and
Ambiguity
17. Automata Theory Questions and Answers – Regular Languages and D-PDA
18. Automata Theory Questions and Answers – Conversion by Eliminating states
19. Automata Theory Questions and Answers – PDA-acceptance by Empty Stack
20. Automata Theory Questions and Answers – CFL- Closure Properties/Decision Properties
advertisement

Automata Theory Questions and Answers –


Eliminating Epsilon Productions
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Eliminating Epsilon Productions”.

1. The use of variable dependency graph is in:


a) Removal of useless variables
b) Removal of null productions
c) Removal of unit productions
d) None of the mentioned
View Answer

Answer: a
Explanation: We use the concept of dependency graph inorder to check, whether any of the
variable is reachable from the starting variable or not.
advertisement

2. The variable which produces an epsilon is called:


a) empty variable
b) nullable
c) terminal
d) all of the mentioned
View Answer

Answer: b
Explanation: Any variable A for which the derivation: A->*e is possible is called Nullable.
3. Statement:
For A-> e ,A can be erased. So whenever it appears on the left side of a production, replace with
another production without the A.
State true or false:
a) true
b) false
View Answer

Answer: b
Explanation: A can be erased. So whenever it appears on the right side of the production,
replace with another production without the A.

4. Simplify the given grammar:


S->aXb
X->aXb | e
a) S->aXb | ab, X-> aXb | ab
b) S->X | ab, X-> aXb | ab
c) S->aXb | ab, X-> S | ab
d) None of the mentioned
View Answer

Answer: a
Explanation: As X is nullable, we replace every right hand side presence of X with e and
produce the simplified result.
advertisement

5. Consider the following grammar:


A->e
B->aAbC
B->bAbA
A->bB
The number of productions added on the removal of the nullable in the given grammar:
a) 3
b) 4
c) 2
d) 0
View Answer

Answer: b
Explanation: The modified grammar aftyer the removal of nullable can be shown as:
B->aAbC| abC
B->bAbA| bbA| bAb| bb
A->bB

6. Let G=(V, T, P, S) be a CFG such that _____________. Then there exists an equivalent
grammar G’ having no e productions.
a) e ∈ L(G)
b) w ∉ L(G)
c) e ∉ L(G)
d) w ∈ L(G)
View Answer

Answer: c
Explanation: Theorem: Let G = (V, T, S, P) be a CFG such that e ∉ L(G). Then there exists an
equivalent grammar G’ having no e-productions.

7. For each production in P of the form:


A-> x1x2x3…xn
put into P’ that production as well as all those generated by replacing null variables with e in all
possible combinations. If all x(i) are nullable,
a) A->e is put into P’
b) A->e is not put into P’
c) e is a member of G’
d) None of the mentioned
View Answer

Answer: b
Explanation: It is an exception that A->e is not put into P’ if all x(i) are nullable variables.
advertisement

8. For the given grammar G:


S->ABaC
A->BC
B->b| e
C->D| e
D-> d
Remove the e productions and generate the number of productions from S in the modified or
simplified grammar.
a) 6
b) 7
c) 5
d) 8
View Answer

Answer: d
Explanation: The grammar after the removal of epsilon production can be shown as:
S->ABaC| AaC| ABa| Aa| a| aC| Ba| BaC
A->BC| B| C
B->b
C->D
D-> d

9. Consider G=({S,A,B,E}, {a,b,c},P,S), where P consists of S →AB, A →a, B →b and E →c.


Number of productions in P’ after removal of useless symbols:
a) 4
b) 3
c) 2
d) 5
View Answer
Answer: a
Explanation:
P’= S->AB, A->a, B-> b,
V’={S, A, B},
∑’={a, b}

10. Given grammar G:


S->aS| AB
A-> e
B-> e
D-> b
Reduce the grammar, removing all the e productions:
a) S->aS| AB| A| B, D-> b
b) S->aS| AB| A| B| a, D-> b
c) S->aS| AB| A| B
d) None of the mentioned
View Answer

Answer: b
Explanation: We will replace all the nullables wherever they appear in the right hand side of any
production. D will not be erased as we are just removing nullable variables not completely
simplifying the grammar.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – CFG-Eliminating Useless Symbols
» Next - Automata Theory Questions and Answers – Eliminating Unit Productions
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Site Exploration
Geotechnical Engineering Questions and Answers – Method of Site Exploration
advertisement
advertisement

Recommended Posts:

1. Rocket Propulsion Questions and Answers


2. Waste Water Engineering Questions and Answers
3. Java Programming Examples on Classes
4. Python Questions and Answers
5. Probability and Statistics Questions and Answers
6. Information Science Questions and Answers
7. Computer Science Questions and Answers
8. Engineering Physics I Questions and Answers
9. Statistical Quality Control Questions and Answers
10. Javascript Questions and Answers
11. C Programming Examples on Bitwise Operations
12. Advanced Machining Processes Questions and Answers
13. C Programming Examples on File Handling
14. C# Programming Examples on Functions
15. Theory of Machines Questions and Answers
16. Network Theory Questions and Answers
17. Electromagnetic Theory Questions and Answers
18. Compilers Questions and Answers
19. Automata Theory Questions and Answers
20. Automata Theory Questions and Answers – Finite Automata with Epsilon Transition
advertisement

Automata Theory Questions and Answers –


Eliminating Unit Productions
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Eliminating Unit Productions”.

1. Which among the following is the format of unit production?


a) A->B
b) A->b
c) B->Aa
d) None of the mentioned
View Answer

Answer: a
Explanation: Any production of the format A-> B where A and B belongs to the V set, is called
Unit production.
advertisement

2. Given Grammar G:
S->aA
A->a| A
B->B
The number of productions to be removed immediately as Unit productions:
a) 0
b) 1
c) 2
d) 3
View Answer
Answer: c
Explanation: The productions in the format A-> A are removed immediately as they produce
self and that is not a terminal or will not lead to a string. Hence, it is removed immediately.

3. Given grammar:
S->aA
A->a
A->B
B-> A
B->bb
Which of the following is the production of B after simplification by removal of unit
productions?
a) A
b) bb
c) aA
d) A| bb
View Answer

Answer: b
Explanation: The simplified grammar can be presented as follows:
S->aA| aB
A->a
B-> bb

4. If grammar G is unambiguous, G’ produced after the removal of Unit production will be:
a) ambiguous
b) unambiguous
c) finite
d) cannot be said
View Answer

Answer: b
Explanation: With the simplification of Context free grammars, undesirable properties are
introduced. It says, if grammar G, before simplification is unambiguous, after simplification will
also be unambiguous.
advertisement

5. If C is A-derivable, C->B is a production, and B ¹ A, then B is


a) nullable
b) Non-derivable
c) A-derivable
d) None of the mentioned
View Answer

Answer: c
Explanation:
If A-> B is a production, B is called A- derivable.
If C is A-derivable, C->B is a production, and B ¹ A, then B is A -derivable.
No other variables are A-derivable.
6. A can be A-> derivable if and only if __________
a) A-> A is actually a production
b) A->B, B-> A exists
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: a
Explanation: The format says: If A->B is a production, B is called A-derivable.Thus A to be A-
derivable, a production : A-> A need to exist.

7. Given Grammar:
T-> T+R| R
R-> R*V| V
V->(T)| u
When unit productions are deleted we are left with
T-> T+R| _______|(T)| u
R->R*V|(T)| u
V-> (T)| u
Fill in the blank:
a) T*V
b) T+V
c) R*T
d) R*V
View Answer

Answer: d
Explanation: The grammar produced after the elimination of unit production is:
T-> T+R| R*V| (T)| u
R->R*V|(T)| u
V-> (T)| u
advertisement

8. Given grammar G:
S-> ABA, A->aA|e, B-> bB|e
Eliminate e and unit productions. State the number of productions the starting variable holds?
a) 6
b) 7
c) 9
d) 5
View Answer

Answer: b
Explanation: After reduction the grammar looks like:
S->ABA| AB| BA| AA| Aa| a| bB| b
A->aA| a
B->bB| b

9. Given grammar G:
S-> A| B| C
A-> aAa| B
B-> bB|bb
C->aCaa|D
D->baD|abD|aa
Eliminate e and unit productions and state the number of variables left?
a) 5
b) 4
c) 3
d) 2
View Answer

Answer: 5
Explanation: The reduced production:
S->aAa| bB|bb aCaa| baD| abD| aa, A->aAa| bB| bb, B->bB| bb, C->aCaa| baD| abD| aa, D->
baD| abD| aa

10. Which of the following variables in the given grammar is called live variable?
S->AB
A->a
a) S
b) A
c) B
d) None of the mentioned
View Answer

Answer: b
Explanation: Any variable A for which there is a production A-> x with x Ε Σ* is called live.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Eliminating Epsilon Productions
» Next - Automata Theory Questions and Answers – Chomsky Normal Form
Categories Automata Theory MCQsPost navigation
Geotechnical Engineering Questions and Answers – Method of Site Exploration
Best Reference Books – M.Sc. – Bioinformatics
advertisement
advertisement

Recommended Posts:

1. Engineering Physics I Questions and Answers


2. Information Science Questions and Answers
3. Computer Science Questions and Answers
4. Theory of Machines Questions and Answers
5. Network Theory Questions and Answers
6. Electromagnetic Theory Questions and Answers
7. Compilers Questions and Answers
8. Unit Processes Questions and Answers
9. Automata Theory Questions and Answers
10. Automata Theory Questions and Answers – CFL- Closure Properties/Decision Properties
11. Automata Theory Questions and Answers – Conversion by Eliminating states
12. Automata Theory Questions and Answers – Construction and Yield of a Parse Tree
13. Automata Theory Questions and Answers – Regular Languages and D-PDA
14. Automata Theory Questions and Answers – From Grammars to Push Down Automata
15. Automata Theory Questions and Answers – The Language of a Grammar, Inferences and
Ambiguity
16. Automata Theory Questions and Answers – DPDA and Context Free Languages
17. Automata Theory Questions and Answers – CFL- Other Normal Forms
18. Automata Theory Questions and Answers – DPDA and Ambiguous Grammars
19. Automata Theory Questions and Answers – PDA-acceptance by Empty Stack
20. Automata Theory Questions and Answers – Sentential Forms
advertisement

Automata Theory Questions and Answers –


Chomsky Normal Form
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Chomsky Normal Form”.

1. The format: A->aB refers to which of the following?


a) Chomsky Normal Form
b) Greibach Normal Form
c) Backus Naur Form
d) None of the mentioned
View Answer

Answer: b
Explanation: A context free grammar is in Greibach Normal Form if the right hand sides of all
the production rules start with a terminal, optionally followed by some variables.
advertisement

2. Which of the following does not have left recursions?


a) Chomsky Normal Form
b) Greibach Normal Form
c) Backus Naur Form
d) All of the mentioned
View Answer
Answer: b
Explanation: The normal form is of the format:
A->aB where the right hand side production tends to begin with a terminal symbo, thus having
no left recursions.

3. Every grammar in Chomsky Normal Form is:


a) regular
b) context sensitive
c) context free
d) all of the mentioned
View Answer

Answer: c
Explanation: Conversely, every context frr grammar can be converted into Chomsky Normal
form and to other forms.

4. Which of the production rule can be accepted by Chomsky grammar?


a) A->BC
b) A->a
c) S->e
d) All of the mentioned
View Answer

Answer: d
Explanation: in CNF, the production rules are of the form:
A->BC
A-> a
S->e
advertisement

5. Given grammar G:
(1)S->AS
(2)S->AAS
(3)A->SA
(4)A->aa
Which of the following productions denies the format of Chomsky Normal Form?
a) 2,4
b) 1,3
c) 1, 2, 3, 4
d) 2, 3, 4
View Answer

Answer: a
Explanation: The correct format: A->BC, A->a, X->e.

6. Which of the following grammars are in Chomsky Normal Form:


a) S->AB|BC|CD, A->0, B->1, C->2, D->3
b) S->AB, S->BCA|0|1|2|3
c) S->ABa, A->aab, B->Ac
d) All of the mentioned
View Answer

Answer: a
Explanation: We can eliminate the options on the basis of the format we are aware of: A->BC,
B->b and so on.

7. With reference to the process of conversion of a context free grammar to CNF, the number of
variables to be introduced for the terminals are:
S->ABa
A->aab
B->Ac
a) 3
b) 4
c) 2
d) 5
View Answer

Answer: a
Explanation: According to the number of terminals present in the grammar, we need the
corresponding that number of terminal variables while conversion.
advertisement

8. In which of the following, does the CNF conversion find its use?
a) CYK Algorithm
b) Bottom up parsing
c) Preprocessing step in some algorithms
d) All of the mentioned
View Answer

Answer: d
Explanation: Besides the theoretical significance of CNF, it conversion scheme is helpful in
algorithms as a preprocessing step, CYK algorithms and the bottom up parsing of context free
grammars.

9. Let G be a grammar. When the production in G satisfy certain restrictions, then G is said to be
in ___________.
a) restricted form
b) parsed form
c) normal form
d) all of the mentioned
View Answer

Answer: c
Explanation: When the production in G satisfy certain restrictions, then G is said to be in
‘normal form’.

10. Let G be a grammar: S->AB|e, A->a, B->b


Is the given grammar in CNF?
a) Yes
b) No
View Answer

Answer: a
Explanation: e is allowed in CNF only if the starting variable does not occur on the right hand
side of the derivation.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Eliminating Unit Productions
» Next - Automata Theory Questions and Answers – Pumping Lemma for Context Free
Language
Categories Automata Theory MCQsPost navigation
Foundation Engineering Questions and Answers – Soil Samples and Samplers – 1
Best Reference Books – M.Sc. – Computer Science
advertisement
advertisement

Recommended Posts:

1. Probability and Statistics Questions and Answers


2. Engineering Physics II Questions and Answers
3. Information Science Questions and Answers
4. Computer Science Questions and Answers
5. Theory of Machines Questions and Answers
6. Network Theory Questions and Answers
7. Electromagnetic Theory Questions and Answers
8. Compilers Questions and Answers
9. Automata Theory Questions and Answers
10. Automata Theory Questions and Answers – Pumping Lemma for Context Free Language
11. Automata Theory Questions and Answers – YACC Parser Generator
12. Automata Theory Questions and Answers – Eliminating Epsilon Productions
13. Automata Theory Questions and Answers – Finite Automata
14. Automata Theory Questions and Answers – Intersection with Regular Languages
15. Automata Theory Questions and Answers – DPDA and Ambiguous Grammars
16. Automata Theory Questions and Answers – CFG-Eliminating Useless Symbols
17. Automata Theory Questions and Answers – Ambiguous Grammar
18. Automata Theory Questions and Answers – CFL- Closure Properties/Decision Properties
19. Automata Theory Questions and Answers – Regular Language & Expression – 2
20. Automata Theory Questions and Answers – From Grammars to Push Down Automata
advertisement
Automata Theory Questions and Answers –
Pumping Lemma for Context Free Language
« Prev
Next »

This set of Automata Theory Questions and Answers for Campus interviews focuses on
“Pumping Lemma for Context Free Language”.

1. Which of the following is called Bar-Hillel lemma?


a) Pumping lemma for regular language
b) Pumping lemma for context free languages
c) Pumping lemma for context sensitive languages
d) None of the mentioned
View Answer

Answer: b
Explanation: In automata theory, the pumping lemma for context free languages, also kmown as
the Bar-Hillel lemma, represents a property of all context free languages.
advertisement

2. Which of the expressions correctly is an requirement of the pumping lemma for the context
free languages?
a) uvnwxny
b) uvnwnxny
c) uv2nwx2ny
d) All of the mentioned
View Answer

Answer: b
Explanation: Let L be a CFL. Then there is an integer n so that for any u that belong to language
L satisfying |t| >=n, there are strings u, v, w, x, y and z satisfying
t=uvwxy
|vx|>0
|vwx|<=n For any m>=0, uvnwxny ∈ L

3.Let L be a CFL. Then there is an integer n so that for any u that belong to language L
satisfying
|t|>=n, there are strings u, v, w, x, y and z satisfying
t=uvwxy.
Let p be the number of variables in CNF form of the context free grammar. The value of n in
terms of p :
a) 2p
b) 2p
c) 2p+1
d) p2
View Answer
Answer: c
Explanation: This inequation has been derived from derivation tree for t which must have height
at least p+2(It has more than 2p leaf nodes, and therefore its height is >p+1).

4. Which of the following gives a positive result to the pumping lemma restrictions and
requirements?
a) {aibici|i>=0}
b) {0i1i|i>=0}
c) {ss|s∈{a,b}*}
d) None of the mentioned
View Answer

Answer: b
Explanation: A positive result to the pumping lemma shows that the language is a CFL and ist
contradiction or negative result shows that the given language is not a Context Free language.
advertisement

5. Using pumping lemma, which of the following cannot be proved as ‘not a CFL’?
a) {aibici|i>=0}
b) {ss|s∈{a,b}*}
c) The set legal C programs
d) None of the mentioned
View Answer

Answer: d
Explanation: There are few rules in C that are context dependent. For example, declaration of a
variable before it can be used.

6. State true or false:


Statement: We cannot use Ogden’s lemma when pumping lemma fails.
a) true
b) false
View Answer

Answer: b
Explanation: Although the pumping lemma provides some information about v and x that are
pumped, it says little about the location of these substrings in the string t. It can be used
whenever the pumping lemma fails. Example: {apbqcrds|p=0 or q=r=s}, etc.

7. Which of the following cannot be filled in the blank below?


Statement: There are CFLs L1 nad L2 so that ___________is not a CFL.
a) L1∩L2
b) L1′
c) L1*
d) None of the mentioned
View Answer

Answer: c
Explanation: A set of context free language is closed under the following operations:
a) Union
b) Concatenation
c) Kleene
advertisement

8. The pumping lemma is often used to prove that a language is:


a) Context free
b) Not context free
c) Regular
d) None of the mentioned
View Answer

Answer: b
Explanation: The pumping lemma is often used to prove that a given language L is non-context-
free, by showing that arbitrarily long strings s are in L that cannot be “pumped” without
producing strings outside L.

9. What is the pumping length of string of length x?


a) x+1
b) x
c) x-1
d) x2
View Answer

Answer: a
Explanation: There exists a property of all strings in the language that are of length p, where p is
the constant-called the pumping length .For a finite language L, p is equal to the maximum
string length in L plus 1.

10. Which of the following does not obey pumping lemma for context free languages ?
a) Finite languages
b) Context free languages
c) Unrestricted languages
d) None of the mentioned
View Answer

Answer: c
Explanation: Finite languages (which are regular hence context free ) obey pumping lemma
where as unrestricted languages like recursive languages do not obey pumping lemma for
context free languages.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory for Campus Interviews, here is complete set of 1000+
Multiple Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Chomsky Normal Form
» Next - Automata Theory Questions and Answers – CFL- Closure Properties/Decision
Properties
Categories Automata Theory MCQsPost navigation
Foundation Engineering Questions and Answers – Soil Samples and Samplers – 2
Automata Theory Questions and Answers – CFL- Closure Properties/Decision Properties
advertisement
advertisement

Recommended Posts:

1. C Programming Examples on Bitwise Operations


2. Java Programming Examples on Set & String Problems & Algorithms
3. C# Programming Examples
4. Ruby Programming Questions and Answers
5. C Tutorials
6. C Programming Examples
7. PHP Questions and Answers
8. Engineering Physics II Questions and Answers
9. C Programming Examples on Strings
10. Computer Science Questions and Answers
11. C++ Programming Examples on Set & String Problems & Algorithms
12. Information Science Questions and Answers
13. Java Programming Examples on String Handling
14. C# Programming Examples on Strings
15. C Programming Examples on Set & String Problems & Algorithms
16. Theory of Machines Questions and Answers
17. Network Theory Questions and Answers
18. Compilers Questions and Answers
19. Electromagnetic Theory Questions and Answers
20. Automata Theory Questions and Answers – Ambiguous Grammar
advertisement

Automata Theory Questions and Answers – CFL-


Closure Properties/Decision Properties
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “CFL-
Closure Properties/Decision Properties”.

1. The context free languages are closed under:


a) Intersection
b) Complement
c) Kleene
d) None of the mentioned
View Answer
Answer: c
Explanation: Context free languages are closed under the following operation: union, kleene and
concatenation. For regular languages, we can add intersection and complement to the list.
advertisement

2. Given Grammar G1:


S->aSb
S->e
Grammar G2:
R->cRd
R->e
If L(G)=L(G1) U L(G2), the number of productions the new starting variable would have:
a) 2
b) 3
c) 4
d) 1
View Answer

Answer: a
Explanation:
T->S|R
S->aSb
S->e
R->cRd
R->e

3. Context free languages are not closed under:


a) Intersection
b) Intersection with Regular Language
c) Complement
d) All of the mentioned
View Answer

Answer: d
Explanation: It is a theorem which states that, Context free languages are not closed under
operations like intersection and complement.

4. Which of the following is incorrect?


There exists algorithms to decide if:
a) String w is in CFL L
b) CFL L is empty
c) CFL L is infinite
d) All of the mentioned
View Answer

Answer: d
Explanation: These properties are termed as decision properties of a CFL and include a set of
problems like infiniteness problem, emptiness problem and membership problem.
advertisement
5. If the start symbol is one of those symbols which produce no terminal through any sequence,
the CFL is said to be
a) nullable
b) empty
c) eliminated
d) none of the mentioned
View Answer

Answer: b
Explanation: In the process of removing useless symbols, if the starting symbol is also a part,
the CFL can be then termed as empty; otherwise not.

6. Using the pumping constant n, If there is a string in the language of length between _____
and ____ then the language is infite else not.
a) n, 2n-1
b) 2n, n
c) n+1, 3n+6
d) 0, n+1
View Answer

Answer: a
Explanation: If there is a string in the language of length between n and 2n-1 then the language
is infite else not. The idea is essentially the same for regular languages.

7. Which of the following is/are CFL not closed under?


a) Reverse
b) Homomorphism
c) Inverse Homomorphism
d) All of the mentioned
View Answer

Answer: d
Explanation: CFL is closed under union, kleene and concatenation along with the properties
reversal,homomorphism and inverse homomorphism but not difference and intersection.
advertisement

8. If L1 and L2 are context free languages, L1-L2 are context free:


a) always
b) sometimes
c) never
d) none of the mentioned
View Answer

Answer: c
Explanation: Context free languages are not closed under difference, intersection and
complement operations.

9. A___________ is context free grammar with atmost one non terminal in the right handside of
the production.
a) linear grammar
b) linear bounded grammar
c) regular grammar
d) none of the mentioned
View Answer

Answer: a
Explanation: A simple linear grammar is G with N = {S}, Σ = {a, b}, P with start symbol S and
rules
S → aSb
S→ε

10. There is a linear grammar that generates a context free grammar


a) always
b) never
c) sometimes
d) none of the mentioned
View Answer

Answer: c
Explanation: Linear grammar is a subset of context free grammar which has atmost one non
terminal symbol in the right hand side of the production.Thus, there exists some languages
which are generated by Linear grammars.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Pumping Lemma for Context Free
Language
» Next - Automata Theory Questions and Answers – CFL- Other Normal Forms
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Pumping Lemma for Context Free Language
Automata Theory Questions and Answers – CFL- Other Normal Forms
advertisement
advertisement

Recommended Posts:

1. LISP Questions and Answers


2. Mechanical Behaviour & Testing of Materials Questions and Answers
3. Mechanical Operations Questions and Answers
4. Spring Questions and Answers
5. PHP Questions and Answers
6. C Programming Examples on Computational Geometry Problems & Algorithms
7. Engineering Drawing Questions and Answers
8. Java Programming Examples on Utility Classes
9. C++ Algorithms, Problems & Programming Examples
10. R Programming Questions and Answers
11. C Algorithms, Problems & Programming Examples
12. Computer Science Questions and Answers
13. Discrete Mathematics Questions and Answers
14. C# Programming Examples on Functions
15. Information Science Questions and Answers
16. Theory of Machines Questions and Answers
17. Network Theory Questions and Answers
18. Electromagnetic Theory Questions and Answers
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers – Equivalence of NFA and DFA
advertisement

Automata Theory Questions and Answers – CFL-


Other Normal Forms
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “CFL-
Other Normal Forms”.

1. The following format of grammatical notation is accepted by which of the following:


AB->CD
A->BC or
A->B or
A->a
where A, B, C, D are non terminal symbols and a is a terminal symbol.
a) Greibach Normal Form
b) Chomsky Nrmal Form
c) Kuroda Normal Form
d) None of the mentioned
View Answer

Answer: c
Explanation: Linearly Bounded grammar or Kuroda Normal Form allows the following format
of grammatical analysis:
AB->CD
A->BC or
A->B or
A->a
advertisement

2. Every Kuroda Normal form grammar generates ___________


a) Context free grammar
b) Context sensitive grammar
c) Unrestricted grammar
d) None of the mentioned
View Answer

Answer: b
Explanation: Every context sensitive grammar which does not produce an empty string can be
generated by a grammar in Kuroda Normal form.

3. Which of the following can generate Unrestricted grammars?


a) Pentonnen Normal form
b) Floyd Normal form
c) Greibach Normal form
d) None of the mentioned
View Answer

Answer: a
Explanation: Pentonnen Normal form(for Unrestricted grammars) is a special case where there
is a slight modification in the format of Kuroda Normal form.
AB->AD
A->BC
A->a

4. Given a grammar in GNF and a derivable string in the grammar with the length n, any
___________will halt at depth n.
a) top-down parser
b) bottom-up parser
c) multitape turing machine
d) none of the mentioned
View Answer

Answer: a
Explanation: Given a grammar in GNF and a derivable string in the grammar with the length n,
any top-down parser will halt at depth n. As the parameter ‘depth’ is mentioned, we will use a
top-down parser. Example-LL parser.
advertisement

5. Which of the following grammars is similar to Floyd Normal form?


a) Backus Naur Form
b) Kuroda Normal Form
c) Greibach Normal Form
d) Chomsky Normal Form
View Answer

Answer: a
Explanation: Donald Knuth implied a BNF” syntax in which all definitions have such a form
may be said to be in ”Floyd Normal Form”.
A->B|C
A->BC
A->a
6. Which among the following can parse a context free grammar?
a) top down parser
b) bottom up parser
c) CYK algorithm
d) all of the mentioned
View Answer

Answer: d
Explanation: We use certain algorithms to parse a context free grammar which include the most
popular CYK algorithm which employs the concept of bottom up parsing and dynamic parsing.

7. The standard version of CYK algorithm operates only on context free grammars in the
following form:
a) Greibach Normal form
b) Chomsky Normal form
c) Backus Naur form
d) All of the mentioned
View Answer

Answer: b
Explanation: It requires the presence of a context free grammar into Chomsky Normal form to
operate. However, every context free grammar can be converted into CNF for keeping the sense
of grammar equivalent.
advertisement

8. The __________ running time of CYK is O(n3 .|G|)


where n is the length of the parse string and |G| is the size of the context free grammar G.
a) worst
b) best
c) average
d) none of the mentioned
View Answer

Answer: a
Explanation: This is the worst case running time of CYK and and this makes it one of the most
efficient algorithms for recognizing general context free languages in practice.

9. Which of the following is true for Valiants algorithm?


a) an extension of CYK
b) deals with efficient multiplication algorithms
c) matrices with 0-1 entries
d) all of the mentioned
View Answer

Answer: d
Explanation: Valiants algorithm is actually an extention of CYK which even computes the same
parsing table yet he showed another method can be utilized fro performing this operation.

10. Which among the following is a correct option in format for representing symbol and
expression in Backus normal form?
a) <symbol> ->expression
b) <symbol>::=_expression_
c) <symbol>=<expression>
d) all of the mentioned
View Answer

Answer: b
Explanation: <symbol>::=_expression_ is the correct representation where <symbol> is a non
terminal, and expression consist of one or more sequence of symbols, more sequence are
separated by |, indicating a choice.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – CFL- Closure Properties/Decision
Properties
» Next - Automata Theory Questions and Answers – Intersection with Regular Languages
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – CFL- Closure Properties/Decision Properties
Best Reference Books – M.Sc – Zoology
advertisement
advertisement

Recommended Posts:

1. Python Programming Examples on Graphs


2. C++ Algorithms, Problems & Programming Examples
3. Java Algorithms, Problems & Programming Examples
4. Cryptography and Network Security Questions and Answers
5. Java Programming Examples on Set & String Problems & Algorithms
6. Home
7. C Programming Examples on Set & String Problems & Algorithms
8. C++ Programming Examples on Set & String Problems & Algorithms
9. Theory of Machines Questions and Answers
10. Network Theory Questions and Answers
11. Electromagnetic Theory Questions and Answers
12. Compilers Questions and Answers
13. Automata Theory Questions and Answers
14. Automata Theory Questions and Answers – Pumping Lemma for Context Free Language
15. Automata Theory Questions and Answers – The Language of a Grammar, Inferences and
Ambiguity
16. Automata Theory Questions and Answers – From PDA to Grammars
17. Automata Theory Questions and Answers – CFG-Eliminating Useless Symbols
18. Automata Theory Questions and Answers – Construction and Yield of a Parse Tree
19. Automata Theory Questions and Answers – Regular Language & Expression – 2
20. Automata Theory Questions and Answers – Applications – Parsers
advertisement

Automata Theory Questions and Answers –


Intersection with Regular Languages
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Intersection with Regular Languages”.

1. Which of the following is not a negative property of Context free languages?


a) Intersection
b) Complement
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: Context free languages are not closed under complement and intersection. Thus,
are called Negative properties.
advertisement

2. The intersection of context free language and regular language is _________


a) regular language
b) context free language
c) context sensitive language
d) non of the mentioned
View Answer

Answer: b
Explanation: If a language L1 is regular and L2 is a context free language, then L1 intersection
L2 will result into a context free language.

3. Which of the following is regular?


a) a100b100
b) (a+b)*-{a100b100}
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: As the language seems to be finite, a dfa can be constructed for the same, thus is
regular.
4. Which of the following is not context free?
a) {w: nA=nB=nC}
b) {a*b*c*}
c) {a100b100}
d) All of the mentioned
View Answer

Answer: d
Explanation: {a*b*c*} and (c) are regular languages while option (a) is not context free
language.
advertisement

5. Which of the following can be used to prove a language is not context free?
a) Ardens theorem
b) Power Construction method
c) Regular Closure
d) None of the mentioned
View Answer

Answer: c
Explanation: We can use the properties of regular closure to prove that a language is not a
context free language. Example: Intersection of context free language and regular language is a
context free language. Proof by contradiction helps here.

6. Which of the following are valid membership algorithms?


a) CYK algorithm
b) Exhaustive search parser
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: CYK algorithm is a parsing algorithm for context free grammars, which employs
bottom up parsing and dynamic programming.

7. Which of the following belong to the steps to prove emptiness?


a) Remove useless variable
b) Check if a start variable S is useless
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: The empty-language question can be stated as: For context free grammar G find if
L(G) =f?
advertisement

8. Which of the following is true for CYK Algorithm?


a) Triangular Table
b) Circular Chart
c) Linked List
d) None of the mentioned
View Answer

Answer: a
Explanation: A triangular table is constructed to facilitate the solution of membership problem
using bottom up parsing and dynamic programming.

9. Which of the following steps are wrong with respect to infiniteness problem?
a) Remove useless variables
b) Remove unit and epsilon production
c) Create dependency graph for variables
d) If there is a loop in the dependency graph the the language is finite else infinite
View Answer

Answer: d
Explanation: If we are able to detect a loop in the formed dependency graph, then the language
in infinite.

10. State true or false:


Statement: Every context free language can be generated by a grammar which contains no
useless non terminals.
a) true
b) false
View Answer

Answer: a
Explanation: At first, we detect useless symbols and discard them. Inorder to find whether a
symbol is useless, just make it the starting symbol and check for emptiness.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – CFL- Other Normal Forms
» Next - Automata Theory Questions and Answers – Turing Machine-Notation and Transition
Diagrams
Categories Automata Theory MCQsPost navigation
Best Reference Books – M.Sc – Zoology
Foundation Engineering Questions and Answers – Geophysical Methods – 1
advertisement
advertisement

Recommended Posts:
1. Engineering Drawing Questions and Answers
2. Java Programming Examples on Computational Geometry Problems & Algorithms
3. Java Programming Examples on Set & String Problems & Algorithms
4. Cryptography and Network Security Questions and Answers
5. Java Programming Examples on Data-Structures
6. C Programming Examples on Stacks & Queues
7. Computer Science Questions and Answers
8. Python Programming Examples on Stacks & Queues
9. C++ Programming Examples on Set & String Problems & Algorithms
10. C Programming Examples on Set & String Problems & Algorithms
11. Information Science Questions and Answers
12. Home
13. Theory of Machines Questions and Answers
14. Network Theory Questions and Answers
15. C++ Programming Examples on STL
16. Java Algorithms, Problems & Programming Examples
17. C++ Algorithms, Problems & Programming Examples
18. Electromagnetic Theory Questions and Answers
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers – Turing


Machine-Notation and Transition Diagrams
« Prev
Next »

This set of Automata Theory Interview Questions and Answers for freshers focuses on “Turing
Machine – Notation and Transition Diagrams”.

1. A turing machine is a
a) real machine
b) abstract machine
c) hypothetical machine
d) more than one option is correct
View Answer

Answer: d
Explanation: A turing machine is abstract or hypothetical machine thought by mathematician
Alan Turing in 1936 capable of simulating any algorithm, however complicated it is.
advertisement

2. A turing machine operates over:


a) finite memory tape
b) infinite memory tape
c) depends on the algorithm
d) none of the mentioned
View Answer

Answer: b
Explanation: The turing machine operates on an infinite memory tape divided into cells. The
machine positions its head over the cell and reads the symbol.

3. Which of the functions are not performed by the turing machine after reading a symbol?
a) writes the symbol
b) moves the tape one cell left/right
c) proceeds with next instruction or halts
d) none of the mentioned
View Answer

Answer: d
Explanation: After the read head reads the symbol from the input tape, it performs the following
functions:
a) writes a symbol(some model allow symbol erasure/no writing)
b) moves the tape left or right (some models allows no motion)
c) proceeds with subsequent instruction or goes either into accepting halting state or rejecting
halting state.

4. ‘a’ in a-machine is :
a) Alan
b) arbitrary
c) automatic
d) None of the mentioned
View Answer

Answer: c
Explanation: The turing machine was invented by Alan turing in 1936. He named it as a-
machine(automatic machine).
advertisement

5. Which of the problems were not answered when the turing machine was invented?
a) Does a machine exists that can determine whether any arbitrary machine on its tape is
circular.
b) Does a machine exists that can determine whether any arbitrary machine on its tape is ever
prints a symbol
c) Hilbert Entscheidungs problem
d) None of the mentioned
View Answer

Answer: d
Explanation: Invention of turing machine answered a lot of questions which included problems
like decision problem, etc.) . Alan was able to prove the properties of computation using such
model.

6. The ability for a system of instructions to simulate a Turing Machine is called _________
a) Turing Completeness
b) Simulation
c) Turing Halting
d) None of the mentioned
View Answer

Answer: a
Explanation: Turing Completeness the ability for a system of instructions to simulate a Turing
machine. A programming language that is Turing complete is theoretically capable of
expressing all tasks accomplishable by computers; nearly all programming languages are Turing
complete.

7. Turing machine can be represented using the following tools:


a) Transition graph
b) Transition table
c) Queue and Input tape
d) All of the mentioned
View Answer

Answer: d
Explanation: We can represent a turing machine, graphically, tabularly and diagramatically.
advertisement

8. Which of the following is false for an abstract machine?


a) Turing machine
b) theoretical model of computer
c) assumes a discrete time paradigm
d) all of the mentioned
View Answer

Answer: d
Explanation: A n abstract machine also known as abstract computer, is a theoretical model of
computer or hardware system in automata theory. Abstraction in computing process usually
assumes a discrete time paradigm.

9. Fill in the blank with the most appropriate option.


Statement: In theory of computation, abstract machines are often used in ___________
regarding computability or to analyze the complexity of an algorithm.
a) thought experiments
b) principle
c) hypothesis
d) all of the mentioned
View Answer

Answer: d
Explanation: A thought experiment considers some hypothesis, theory or principle for the
purpose of thinking through its consequences.

10. State true or false:


Statement: RAM model allows random access to indexed memory locations.
a) true
b) false
View Answer

Answer: a
Explanation: In computer science, Random access machine is an abstract machine in the general
class of register machines. Random access machine should not be confused with Random access
memory.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory for Interviews, here is complete set of 1000+ Multiple
Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Intersection with Regular Languages
» Next - Automata Theory Questions and Answers – The Language of Turing Machine
Categories Automata Theory MCQsPost navigation
Foundation Engineering Questions and Answers – Geophysical Methods – 1
Best Reference Books – M.Sc. – Foods and Nutrition
advertisement
advertisement

Recommended Posts:

1. C++ Programming Examples on Set & String Problems & Algorithms


2. Java Programming Examples
3. Information Science Questions and Answers
4. Python Programming Examples on Stacks & Queues
5. Java Programming Examples on Data-Structures
6. Home
7. Computer Science Questions and Answers
8. Network Theory Questions and Answers
9. Computer Organization & Architecture Questions and Answers
10. Computer Fundamentals Questions and Answers
11. Electromagnetic Theory Questions and Answers
12. C Programming Examples on Stacks & Queues
13. Machine Kinematics Questions and Answers
14. Machine Design Questions and Answers
15. Machine Dynamics Questions and Answers
16. Machine Tools & Machining Questions and Answers
17. Theory of Machines Questions and Answers
18. Machine Drawing Questions and Answers
19. Compilers Questions and Answers
20. Automata Theory Questions and Answers
advertisement
Automata Theory Questions and Answers – The
Language of Turing Machine
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “The
Language of Turing Machine”.

1. A turing machine that is able to simulate other turing machines:


a) Nested Turing machines
b) Universal Turing machine
c) Counter machine
d) None of the mentioned
View Answer

Answer: b
Explanation: A more mathematically oriented definition with the same universal nature was
introduced by church and turing together called the Church-Turing thesis(formal theory of
computation).
advertisement

2. Which of the problems are unsolvable?


a) Halting problem
b) Boolean Satisfiability problem
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: Alan turing proved in 1936 that a general algorithm to solve the halting problem
for all possible program-input pairs cannot exist.

3. Which of the following a turing machine does not consist of?


a) input tape
b) head
c) state register
d) none of the mentioned
View Answer

Answer: d
Explanation: A state register is one which stores the state of the turing machine, one of the
finitely many. Among these is the special start state with which the state register is initialized.

4. The value of n if turing machine is defined using n-tuples:


a) 6
b) 7
c) 8
d) 5
View Answer

Answer: b
Explanation:
The 7-tuple definition of turing machine: (Q, S, G, d, q0, B, F)
where Q= The finite set of states of finite control
S= The finite set of input symbols
G= The complete set of tape symbols
d= The transition function
q0= The start state, a member of Q, in which the finite control is found initially.
B= The blank symbol
F= The set of final or accepting states, a subset of Q.

5. If d is not defined on the current state and the current tape symbol, then the machine ______
a) does not halts
b) halts
c) goes into loop forever
d) none of the mentioned
View Answer

Answer: b
Explanation: If we reach hA or hR, we say TM halts. Once it has halted, it cannot move further,
since d is not defined at any pair (hA,X) or (hR,X) where hA = accept halting state and hR = reject
halting state.
advertisement

6. Statement: Instantaneous descriptions can be designed for a Turing machine.


State true or false:
a) true
b) false
View Answer

Answer: a
Explanation: Inorder to describe formally what a Turing machine does, we need to develop a
notation for configurations or Instantaneous descriptions(ID).

7. Which of the following are the models equivalent to Turing machine?


a) Multi tape turing machine
b) Multi track turing machine
c) Register machine
d) All of the mentioned
View Answer

Answer: d
Explanation: Many machines that might be thought to have more computational capability than
a simple UTM can be shown to have no more power. They might compute faster or use less
memory but cannot compute more powerfully i.e. more mathematical questions.
8. Which among the following is incorrect for o-machines?
a) Oracle Turing machines
b) Can be used to study decision problems
c) Visualizes Turing machine with a black box which is able to decide cerain decion problems in
one operation
d) None of the mentioned
View Answer

Answer: d
Explanation: In automata theory, an o- machine or oracle machine is a abstract machine used to
study decision problems. The problem the oracle solves can be of any complexity class. Even
undecidable problems like halting problems can be used.

9. RASP stands for:


a) Random access storage program
b) Random access stored program
c) Randomly accessed stored program
d) Random access storage programming
View Answer

Answer: b
Explanation: RASP or Random access stored program is an abstract machine that has instances
like modern stored computers.
advertisement

10. Which of the following is not true about RASP?


a) Binary search can be performed more quickly using RASP than a turing machine
b) Stores its program in memory external to its state machines instructions
c) Has infinite number of distinguishable, unbounded registers
d) Binary search can be performed less quickly using RASP than a turing machine
e) More than two options are incorrect
View Answer

Answer: d
Explanation: In theoretical computer science, the random access stored program( RASP )
machine model is an abstract machine used for the purpose of algorithm development and
algorithm complexity theory.

11. State true or false:


Statement: RASP is to RAM like UTM is to turing machine.
a) true
b) false
View Answer

Answer: a
Explanation: The Rasp is a random access machine model that, unlike the RAM has its program
in its registers together with its input. The registers are unbounded(infinite in capacity); whether
the number of registers is finite is model-specific.
Sanfoundry Global Education & Learning Series – Automata Theory.
To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Turing Machine-Notation and Transition
Diagrams
» Next - Automata Theory Questions and Answers – The Language of Turing Machine-2
Categories Automata Theory MCQsPost navigation
Best Reference Books – M.Sc. – Foods and Nutrition
Foundation Engineering Questions and Answers – Geophysical Methods – 2
advertisement
advertisement

Recommended Posts:

1. Hydraulic Machines Questions and Answers


2. DC Machines Questions and Answers
3. C Programming Examples on Combinatorial Problems & Algorithms
4. Java Algorithms, Problems & Programming Examples
5. Electrical Machines Questions and Answers
6. Electromagnetic Theory Questions and Answers
7. VLSI Questions and Answers
8. Machine Drawing Questions and Answers
9. Machine Design Questions and Answers
10. Compilers Questions and Answers
11. Java Programming Examples on Set & String Problems & Algorithms
12. C Algorithms, Problems & Programming Examples
13. Network Theory Questions and Answers
14. Machine Kinematics Questions and Answers
15. Machine Dynamics Questions and Answers
16. Machine Tools & Machining Questions and Answers
17. Theory of Machines Questions and Answers
18. C++ Programming Examples on Set & String Problems & Algorithms
19. C Programming Examples on Set & String Problems & Algorithms
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers – The


Language of Turing Machine-2
« Prev
Next »
This set of Automata Theory Questions and Answers for Freshers focuses on ” The Language of
Turing Machine-2″.

1. The class of recursively ennumerable language is known as:


a) Turing Class
b) Recursive Languages
c) Universal Languages
d) RE
View Answer

Answer: d
Explanation: RE or recursively ennumerable is only called the class of recursively ennumerable
language.
advertisement

2. A language L is said to be Turing decidable if:


a) recursive
b) TM recognizes L
c) TM accepts L
d) None of the mentioned
View Answer

Answer: a,b
Explanation: A language L is recursively ennumerable if there is a turing machine that accepts
L, and recursive if there is a TM that recognizes L.(Sometimes these languages are alse called
Turing-acceptable and Turing-decidable respectively).

3. Which of the following statements are false?


a) Every recursive language is recursively ennumerable
b) Recursively ennumerable language may not be recursive
c) Recursive languages may not be recursively ennumerable
d) None of the mentioned
View Answer

Answer: c
Explanation: Every recursive language is recursively ennumerable but there exists recursively
ennumerable languages that are not recursive. If L is accepted by a Non deterministic TM T, and
every possible sequence of moves of T causes it to halt, then L is recursive.

4. Choose the correct option:


Statement: If L1 and L2 are recursively ennumerable languages over S, then the following is/are
recursively ennumerable.
a) L1 U L2
b) L2 ∩ L2
c) Both (a) and (b)
d) None of the mentioned
View Answer
Answer: c
Explanation: Both the union and intersection operations preserve the property of recursive
ennumerablity(Theorem).
advertisement

5. If L is a recursive language, L’ is:


a) Recursive
b) Recursively Ennumerable
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: If T is a turing machine recognizing L, we can make it recognize L’ by
interchanging the two outputs. And every recursive language is recursively ennumerable.

6. Choose the appropriate option:


Statement: If a language L is recursive, it is closed under the following operations:
a) Union
b) Intersection
c) Complement
d) All of the mentioned
View Answer

Answer: d
Explanation: The closure property of recursive languages include union, intersection and
complement operations.

7. A recursively ennumerable language L can be recursive if:


a) L’ is recursively ennumerable
b) Every possible sequence of moves of T, the TM which accept L, causes it to halt
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: Theorem- If L is a recursively ennumerable language whose complement is
recursively ennumerable, then L is recursive.
advertisement

8. A language L is recursively ennumerable if L=L(M) for some turing machine M.

Which among the following cannot be among A, B and C?


a) yes w ∈ L
b) no w ∉ L
c) M does not halt w ∉ L
d) None of the mentioned
View Answer

Answer: d
Explanation:

9. State true or false:


Statement: An ennumerator is a turing machine mwith extra output tape T, where symbols, once
written, are never changed.
a) true
b) false
View Answer

Answer: a
Explanation: To ennumerate a set means to list the elements once at a time, and to say that a set
is ennumerable should perhaps mean that there exists an algorithm for ennumerating it.

10. A Language L may not be accepted by a Turing Machine if:


a) It it is recursively ennumerable
b) It is recursive
c) L can be ennumerated by some turing machine
d) None of the mentioned
View Answer

Answer: b
Explanation: A language L is recursively ennumerable if and only if it can be ennumerated by
some turing machine. A recursive ennumerable language may or may not be recursive.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory for Freshers, here is complete set of 1000+ Multiple
Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – The Language of Turing Machine
» Next - Automata Theory Questions and Answers -Turing Machine and Halting
Categories Automata Theory MCQsPost navigation
Foundation Engineering Questions and Answers – Geophysical Methods – 2
Automata Theory Questions and Answers -Turing Machine and Halting
advertisement
advertisement

Recommended Posts:

1. Mechanical Engineering Questions and Answers


2. Computer Fundamentals Questions and Answers
3. Spring Questions and Answers
4. Java Programming Examples on Set & String Problems & Algorithms
5. Agricultural Engineering Questions and Answers
6. Artificial Intelligence Questions and Answers
7. Computer Science Questions and Answers
8. C++ Programming Examples on Set & String Problems & Algorithms
9. Information Science Questions and Answers
10. C Programming Examples on Set & String Problems & Algorithms
11. Compilers Questions and Answers
12. Network Theory Questions and Answers
13. Electromagnetic Theory Questions and Answers
14. Machine Dynamics Questions and Answers
15. Machine Design Questions and Answers
16. Machine Kinematics Questions and Answers
17. Theory of Machines Questions and Answers
18. Machine Drawing Questions and Answers
19. Machine Tools & Machining Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers -Turing


Machine and Halting
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Turing Machine and Halting”.
1. Which of the following regular expression resembles the given diagram?

a) {a}*{b}*{a,b}
b) {a,b}*{aba}
c) {a,b}*{bab}
d) {a,b}*{a}*{b}*
View Answer

Answer: b
Explanation: The given diagram is a transition graph for a turing machine which accepts the
language with the regular expression {a,b}*{aba}.
advertisement

2. Construct a turing machine which accepts a string with ‘aba’ as its substring.

a)
b)

c)

d)
View Answer

Answer: c
Explanation: The language consist of strings with a substring ‘aba’ as fixed at its end and the left
part can be anything including epsilon. Thus the turing machine uses five states to express the
language excluding the rejection halting state which if allowed can modify the graph as:

3. The number of states required to automate the last question i.e. {a,b}*{aba}{a,b}* using
finite automata:
a) 4
b) 3
c) 5
d) 6
View Answer

Answer: a
Explanation: The finite automata can be represented as:

4. The machine accept the string by entering into hA or it can:


a) explicitly reject x by entering into hR
b) enter into an infinte loop
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: Three things can occur when a string is tested over a turing machine:
a) enter into accept halting state
b) enter into reject halting state
c) goes into loop forever
advertisement

5. d(q,X)=(r,Y,D) where D cannot be:

a) L
b) R
c) S
d) None of the mentioned
View Answer

Answer: c
Explanation: D represents the direction in which automata moves forward as per the queue
which surely cannot be a starting variable.

6. Which of the following can accept even palindrome over {a,b}


a) Push down Automata
b) Turing machine
c) NDFA
d) All of the mentioned
View Answer

Answer: c
Explanation: A language generating strings which are palindrome is not regular, thus cannot b
represented using a finite automaton.

7. Which of the functions can a turing machine not perform?


a) Copying a string
b) Deleting a symbol
c) Accepting a pal
d) Inserting a symbol
View Answer

Answer: d
Explanation: Different turing machines exist for operations like copying a string, deleting a
symbol, inserting a symbol and accepting palindromes.
advertisement

8. If T1 and T2 are two turing machines. The composite can be represented using the
expression:
a) T1T2
b) T1 U T2
c) T1 X T2
d) None of the mentioned
View Answer
Answer: a
Explanation: If T1 and T2 are TMs, with disjoint sets of non halting states and transition
function d1 and d2, respectively, we write T1T2 to denote this composite TM.

9. The following turing machine acts like:

a) Copies a string
b) Delete a symbol
c) Insert a symbol
d) None of the mentioned
View Answer

Answer: b
Explanation: A turing machine does the deletion by changing the tape contents from yaz to yz,
where y belongs to (S U {#})*.
10. What does the following transition graph shows:

a) Copies a symbol
b) Reverses a string
c) Accepts a pal
d) None of the mentioned
View Answer

Answer: c
Explanation: The composite TM accepts the language of palindromes over {a, b} by comparing
the input string to its reverse and accepting if and only if the two are equal.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – The Language of Turing Machine-2
» Next - Automata Theory Questions and Answers – Programming Techniques-Storage and
Subroutines
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – The Language of Turing Machine-2
Automata Theory Questions and Answers – Programming Techniques-Storage and Subroutines
advertisement
advertisement

Recommended Posts:

1. Home
2. Java Algorithms, Problems & Programming Examples
3. C++ Algorithms, Problems & Programming Examples
4. C Algorithms, Problems & Programming Examples
5. Java Programming Examples on Set & String Problems & Algorithms
6. C Programming Examples on Set & String Problems & Algorithms
7. Network Theory Questions and Answers
8. C++ Programming Examples on STL
9. C Programming Examples on Stacks & Queues
10. Electromagnetic Theory Questions and Answers
11. C++ Programming Examples on Set & String Problems & Algorithms
12. Machine Dynamics Questions and Answers
13. Python Programming Examples on Stacks & Queues
14. Machine Design Questions and Answers
15. Machine Kinematics Questions and Answers
16. Theory of Machines Questions and Answers
17. Machine Drawing Questions and Answers
18. Compilers Questions and Answers
19. Machine Tools & Machining Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Programming Techniques-Storage and
Subroutines
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Programming Techniques-Storage and Subroutines”.

1. A turing machine has ____________ number of states in a CPU.


a) finite
b) infinte
c) May be finite
d) None of the mentioned
View Answer

Answer: a
Explanation: A turing machine has finite number of states in its CPU. However the states are not
small in number. Real computer consist of registers which can store values (fixed number of
bits).
advertisement

2. Suppose we have a simple computer with control unit holding a PC with a 32 bit address +
Arithmetic unit holding one double length 64 bit Arithmetic Register. The number of states the
finite machine will hold:
a) 2(32*64)
b) 296
c) 96
d) 32
View Answer

Answer: b
Explanation: According to the statistics of the question, we will have a finite machine with 2^96
states.

3. In one move a turing machine will:

a) Change a state
b) Write a tape symbol in the cell scanned
c) Move the tape head left or right
d) All of the mentioned
View Answer

Answer: d
Explanation: A move of a turing machine is the function of the state of finite control and the
tape symbol just scanned.

4. State true or false:


Statement: We can use the finite control of turing machine to hold a finite amount of data.
a) true
b) false
View Answer

Answer: a
Explanation:

The finite control not only contains state q but also three data, A, B, C. The following technique
requires no extension to the Turing Machine model. Shaping states this way allows to describe
transitions in more systematic way and often to simplify the strategy of the program.
advertisement

5. 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
b) Statement 1 is the reason and Statement 2 is the assertion
c) Statement 1 and Statement 2 are independent from each other
d) None of the mentioned
View Answer

Answer: a
Explanation: Cartesian product works like a struct in C/C++. For Example: Computer tape
storage is something like 8 or 9 bits in each cell. One can recognize a multi track tape machine
by looking at the transitions because each will have tuples as the read and write symbols.

6. A multi track turing machine can described as a 6-tuple (Q, X, S, d, q0, F) where X
represents:
a) input alphabet
b) tape alphabet
c) shift symbols
d) none of the mentioned
View Answer

Answer: b
Explanation: The 6-tuple (Q, X, S, d, q0, F) can be explained as:
Q represents finite set of states,
X represents the tape alphabet,
S represents the input alphabet
d represents the relation on states and the symbols
q0 represents the initial state
F represents the set of final states.

7. Which of the following statements are false?


a) A multi track turing machine is a special kind of multi tape turing machine
b) 4-heads move independently along 4-tracks in standard 4-tape turing machine
c) In a n-track turing machine, n head reads and writes on all the tracks simultaneously.
d) All of the mentioned
View Answer

Answer: c
Explanation: In a n-track turing machine, one head reads and writes on all the tracks
simultaneously.
advertisement

8. State true or false:


Statement: Two track turing machine is equivalent to a standard turing machine.
a) true
b) false
View Answer

Answer: a
Explanation: This can be generalized for n- tracks and can be proved equivalent using
ennumerable languages.
9. Which of the following is/are not true for recursively ennumerable language?
a) partially decidable
b) Turing acceptable
c) Turing Recognizable
d) None of the mentioned
View Answer

Answer: d
Explanation: In automata theory, a formal language is called recursively ennumerable language
or partially decidable or semi decidable or turing acceptable or turing recognizable if there exists
a turing machine which will ennumerate all valid strings of the language.

10. According to Chomsky hierarchy, which of the following is adopted by Recursively


Ennumerable language?
a) Type 0
b) Type 1
c) Type 2
d) Type 3
View Answer

Answer: a
Explanation: Recursively Ennumerable languages are type 0 languages in the Chomsky
hierarchy. All regular, context free, context sensitive languages are recursivelyennumerable
language.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers -Turing Machine and Halting
» Next - Automata Theory Questions and Answers – Multitape Turing Machines
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers -Turing Machine and Halting
Foundation Engineering Questions and Answers – Reinforced Earth
advertisement
advertisement

Recommended Posts:

1. Java Programming Examples on Exception Handling


2. C# Programming Examples on Data Structures
3. Java Programming Examples on Collections
4. C# Programming Examples
5. Java Programming Examples on Java.Lang
6. R Programming Questions and Answers
7. C# Programming Examples on Interfaces
8. C# Programming Examples on Networking
9. Electromagnetic Theory Questions and Answers
10. Network Theory Questions and Answers
11. SAN – Storage Area Networks Questions & Answers
12. C# Programming Examples on Functions
13. Theory of Machines Questions and Answers
14. Ruby Programming Questions and Answers
15. C Algorithms, Problems & Programming Examples
16. Compilers Questions and Answers
17. Java Programming Examples on Set & String Problems & Algorithms
18. C Programming Examples on Set & String Problems & Algorithms
19. C++ Programming Examples on Set & String Problems & Algorithms
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Multitape Turing Machines
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Multitape Turing Machines”.

1. A turing machine with several tapes in known as:


a) Multi-tape turing machine
b) Poly-tape turing maching
c) Universal turing machine
d) All of the mentioned
View Answer

Answer: a
Explanation: A multitape turing machine is an ordinary turing machine with multiple tapes.
Each tape has its own head to control the read and write.
advertisement

2. A multitape turing machine is ________ powerful than a single tape turing machine.
a) more
b) less
c) equal
d) none of the mentioned
View Answer

Answer: a
Explanation: The multitape turing machine model seems much powerful than the single tape
model, but any multi tape machine, no matter how many tapes, can be simulated by single taped
TM.
3. In what ratio, more computation time is needed to simulate multitape turing machines using
single tape turing machines?
a) doubly
b) triple
c) quadratically
d) none of the mentioned
View Answer

Answer: c
Explanation: Thus, multitape turing machines cannot calculate any more functions than single
tape machines.

4. Which of the following is true for two stack turing machines?


a) one read only input
b) two storage tapes
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: Two-stack Turing machines have a read-only input and two storage tapes. If a head
moves left on either tape a blank is printed on that tape, but one symbol from a “library” can be
printed.
advertisement

5. Which of the following is not a Non deterministic turing machine?


a) Alternating Turing machine
b) Probabalistic Turing machine
c) Read-only turing machine
d) None of the mentioned
View Answer

Answer: c
Explanation: A read only turing machine or 2 way deterministic finite automaton is a class of
model of computability that behaves like a turing machine, and can move in both directions
across input, except cannot write to its input tape.

6. Which of the turing machines have existential and universal states?


a) Alternating Turing machine
b) Probalistic Turing machine
c) Read-only turing machine
d) None of the mentioned
View Answer

Answer: a
Explanation: ATM is divide into two sets: an existential state is accepting if some transitions
leads to an accepting state; an universal state is accepting if every transition leads to an
accepting state.
7. Which of the following is false for Quantum Turing machine?
a) Abstract machine
b) Any quantum algorithm can be expressed formally as a particular quantum turing machine
c) Gives a solution to ‘Is a universal quantum computer sufficient’
d) None of the mentioned
View Answer

Answer: c
Explanation: ‘Is a universal quantum computer sufficient’ is one of the unsolved problem from
physics.
advertisement

8. A deterministic turing machine is:


a) ambiguous turing machine
b) unambiguous turing machine
c) non-deterministic
d) none of the mentioned
View Answer

Answer: b
Explanation: A deterministic turing machine is unambiguous and for every input, there is
exactly one operation possible. It is a subset of non-deterministic Turing machines.

9. Which of the following is true about Turing’s a-machine?


a) a stands for automatic
b) left ended, right end-infinite
c) finite number of tape symbols were allowed
d) all of the mentioned
View Answer

Answer: d
Explanation: Turings a- machine or automatic machine was left ended,right end infinite.Any of
finite number of tape symbols were allowed and the 5 tuples were not in order.

10. Which of the following is a multi tape turing machine?


a) Post turing Machine
b) Wang-B Machine
c) Oblivious turing Machine
d) All of the mentioned
View Answer

Answer: c
Explanation: An oblivious turing machine where movements of various heads are fixed
functions of time, independent of the input. Pippenger and Fischer showed that any computation
that can be performed by a multi-tape Turing machine in n steps can be performed by an
oblivious two-tape Turing machine in O(n log n) steps.
advertisement
Sanfoundry Global Education & Learning Series – Automata Theory.
To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Programming Techniques-Storage and
Subroutines
» Next - Automata Theory Questions and Answers – Equivalence of One-Tape and Multitape
TM’s
Categories Automata Theory MCQsPost navigation
Foundation Engineering Questions and Answers – Reinforced Earth
Automata Theory Questions and Answers – Equivalence of One-Tape and Multitape TM’s
advertisement
advertisement

Recommended Posts:

1. VLSI Questions and Answers


2. C# Programming Examples on Events
3. Machine Kinematics Questions and Answers
4. Mechatronics Engineering Questions and Answers
5. Mechanical Engineering Questions and Answers
6. Agricultural Engineering Questions and Answers
7. Machine Tools & Machining Questions and Answers
8. Engineering Metrology Questions and Answers
9. C++ Programming Examples on Set & String Problems & Algorithms
10. C Programming Examples on Set & String Problems & Algorithms
11. Network Theory Questions and Answers
12. Compilers Questions and Answers
13. Electromagnetic Theory Questions and Answers
14. Home
15. Hydraulic Machines Questions and Answers
16. DC Machines Questions and Answers
17. Electrical Machines Questions and Answers
18. Design of Electrical Machines Questions and Answers
19. Theory of Machines Questions and Answers
20. Automata Theory Questions and Answers – From PDA to Grammars
advertisement

Automata Theory Questions and Answers –


Equivalence of One-Tape and Multitape TM’s
« Prev
Next »
This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Equivalence of One-Tape and Multitape TM’s”.

1. Which of the following are related to construction of One Tape turing machines?
a) JFLAP
b) NFLAP
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: a
Explanation: JFLAP is educational software written in java to experiment with the topics in
automata theory and area of formal languages.
advertisement

2. Which of the following topics cannot be covered using JFLAPS?


a) L-System
b) Unrestricted Grammar
c) Regular Expression
d) None of the mentioned
View Answer

Answer: d
Explanation: Topics like regular expressions, context free languages and unrestricted grammar
including parsers like LL,SLR parsers can be covered using JFLAPS.

3. State true or false:


Statement: Multitape turing machine have multi tapes where each tape is accessed with one
head.
a) true
b) false
View Answer

Answer: b
Explanation: Multitape turing machines do have multiple tapes but they they are accessed by
separate heads.

4. Which of the following statements is/are true?


a) Every multitape turing machine has its equivalent single tape turing machine
b) Every multitape turing machine is an abstract machine
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: A multitape turing machine is an ordinary turing machine which is always
abstract.And they do have their equivalent single tape turing machines.
advertisement
5. Are Multitape and Multitrack turing machines same?
a) Yes
b) No
c) Somewhat yes
d) Cannot tell
View Answer

Answer: a
Explanation: Multitrack turing machines are special types of Multitape turing machines. In a
standard n-tape Turing machine, n heads move independently along n-tracks.

6. In a n-track turing machine, _________ head/heads read and write on all tracks
simultaneously.
a) one
b) two
c) n
d) infinite
View Answer

Answer: a
Explanation: In a n-track Turing machine, one head reads and writes on all tracks
simultaneously. A tape position in a n-track Turing Machine contains n symbols from the tape
alphabet.

7. Which of the following does not exists?


a) Turing Machine with Multiple heads
b) Turing Machine with infinite tapes
c) Turing machine with two dimensional tapes
d) None of the mentioned
View Answer

Answer: d
Explanation: All of the mentioned are one or the other kind of Turing machines in existence.
advertisement

8. Can a multitape turing machine have an infinte number of tapes?


a) Yes
b) No
View Answer

Answer: b
Explanation: One needs a finite number of tapes. The proofs that show the equivalence between
multi-tape TM and one-band TM rely on the fact that the number of tapes is bounded.

9. Every language accepted by a k-tape TM is _____ by a single-tape TM.


a) accepted
b) not accepted
c) generated
d) not generated
View Answer
Answer: a
Explanation: Its the theorem that states Every multitape turing machine can be simulated by a
single tape turing machine and the corresponding language can be accepted.

10. Which of the following is/are a basic TM equivalent to?


a) Multitrack TM
b) Multitape TM
c) Non-deterministic TM
d) All of the mentioned
View Answer

Answer: d
Explanation: Tms can be used as both: language recognizers/Computers. TMs are like universal
computing machines with universal storage.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Multitape Turing Machines
» Next - Automata Theory Questions and Answers – Non Deterministic Turing Machines
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Multitape Turing Machines
Foundation Engineering Questions and Answers – Geotextiles
advertisement
advertisement

Recommended Posts:

1. Electrical Engineering Questions and Answers


2. C Programming Examples on Set & String Problems & Algorithms
3. Aeronautical Engineering Questions and Answers
4. Machine Dynamics Questions and Answers
5. Home
6. VLSI Questions and Answers
7. Machine Kinematics Questions and Answers
8. Mechatronics Engineering Questions and Answers
9. Compilers Questions and Answers
10. Machine Tools & Machining Questions and Answers
11. Mechanical Engineering Questions and Answers
12. Agricultural Engineering Questions and Answers
13. Hydraulic Machines Questions and Answers
14. DC Machines Questions and Answers
15. Design of Electrical Machines Questions and Answers
16. Network Theory Questions and Answers
17. Electromagnetic Theory Questions and Answers
18. Electrical Machines Questions and Answers
19. Theory of Machines Questions and Answers
20. Automata Theory Questions and Answers – Deterministic Finite Automata-Introduction
and Definition
advertisement

Automata Theory Questions and Answers – Non


Deterministic Turing Machines
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “Non
Deterministic Turing Machines”.

1. X is a simple mathematical model of a computer. X has unrestricted and unlimited memory.


X is a FA with R/W head. X can have an infinite tape divided into cells, each cell holding one
symbol.
Name X?
a) Push Down Automata
b) Non deterministic Finite Automata
c) Turing machines
d) None of the mentioned
View Answer

Answer: c
Explanation: Turing machine is known as universal computer. It is denoted by M=(Q,Σ,Ґ ,δ ,q0,
B,F)
advertisement

2. Which of the following is/are not an application of turing machine?


a) Language Recognization
b) Computers of functions on non negative numbers
c) Generating devices
d) None of the mentioned
View Answer

Answer: d
Explanation: A turing machine can have many applications like : Enumerator (A turing machine
with an output printer), function computer, etc.

3. State true or false:


Statement: Turing Machine can change symbols on its tape, whereas the FA cannot change
symbols on tape.
a) true
b) false
View Answer
Answer: a
Explanation: The following mentioned is the difference between 2-way FA and TM. Another
instance is that TM has a read/write tape head while FA doesn’t.

4. Which of the following cannot be a possibility of a TM while it processes an input?


a) Enters accepting state
b) Enters non-accepting state
c) Enters infinite loop and never halts
d) None of the mentioned
View Answer

Answer: d
Explanation: The following mentioned are the only possibilities of operating a string through a
turing machine.

5. Pick the odd one out.


a) Subroutines
b) Multiple tracks
c) Shifting over
d) Recursion
View Answer

Answer: d
Explanation: Except Recursion, all the other options are techniques of Turing Machine
construction which further includes, Checking off symbols and Storage in finite control.
advertisement

6. Which among the following is not true for 2-way infinte TM?
a) tape in both directions
b) Leftmost square not distinguished
c) Any computation that can be performed by 2-way infinite tape can also be performed by
standard TM.
d) None of the mentioned
View Answer

Answer: d
Explanation: All of the mentioned are correct statements for a two way infinite tape turing
machine. Theorems say the power of such a machine is in no way superior than a standard
turing machine.

7. Can a turing machine act like a transducer?


a) yes
b) no
View Answer

Answer: a
Explanation: A turing machine can be used as a transducer. The most obvious way to do this is
to treat the entire non blank portion of the initial tape as input, and to treat the entire blank
portion of the tape when the machine halts as output.
8. Which of the following does not exists?
a) Mutitape TM
b) Multihead TM
c) Multidimentional TM
d) None of the mentioned
View Answer

Answer: d
Explanation: If the tape contains k-dimentional array of cells infinte in all 2k directions, for
some fixed k and has a finite control, the machine can be called Multidimentional TM.

9. Enumerator is a turing machine with __________


a) an output printer
b) 5 input tapes
c) a stack
d) none of the mentioned
View Answer

Answer: a
Explanation: Here, the turing machine can use the printer as an output device to print strings.
Note: There is no input to an enumerator. If it doesn’t halt, it may print an infinite set of strings.
advertisement

10. For the following language, an enumerator will print:


L={anbn|n>=0}
a) anbn
b) {ab, a2b2, a3b3, …}
c) {e, ab, a2b2, a3b3, …}
d) None of the mentioned
View Answer

Answer: b
Explanation: An enumerator is a turing machine with an output printer. It can use an printer as
an output device to print output strings. As n also holds the value , epsilon will also be a part of
the output set.

11. Complete the following statement:


Statement : A language is turing recognizable if an only if ___________
a) an enumerator enumerates it
b) it is finite
c) both (a) and (b)
d) none of the mentioned
View Answer

Answer: a
Explanation: If an Enumerator E enumerates a language L, there is a turing machine M that
recognizes language L. Also, If a turing machine M recognizes a language L, there is an
enumerator for L.
Sanfoundry Global Education & Learning Series – Automata Theory.
To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Equivalence of One-Tape and Multitape
TM’s
» Next - Automata Theory Questions and Answers – Multistack Machines, Counter Machines
Categories Automata Theory MCQsPost navigation
Foundation Engineering Questions and Answers – Geotextiles
Automata Theory Questions and Answers – Multistack Machines, Counter Machines
advertisement
advertisement

Recommended Posts:

1. Computer Science Questions and Answers


2. Machine Tools & Machining Questions and Answers
3. C# Programming Examples on Interfaces
4. Home
5. R Programming Questions and Answers
6. C++ Questions and Answers
7. Artificial Intelligence Questions and Answers
8. Java Programming Examples on Set & String Problems & Algorithms
9. C Questions and Answers
10. C++ Programming Examples on Set & String Problems & Algorithms
11. C Programming Examples on Set & String Problems & Algorithms
12. Hydraulic Machines Questions and Answers
13. Compilers Questions and Answers
14. DC Machines Questions and Answers
15. Design of Electrical Machines Questions and Answers
16. Network Theory Questions and Answers
17. Electrical Machines Questions and Answers
18. Electromagnetic Theory Questions and Answers
19. Theory of Machines Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Multistack Machines, Counter Machines
« Prev
Next »
This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Multistack Machines, Counter Machines”.

1. Can a single tape turing machine be simulated using deterministic 2-stack turing machine?
a) Yes
b) No
c) Cannot be said
d) none of the mentioned
View Answer

Answer: a
Explanation: The symbols to left of the head of turing macine being simulated can be stored on
the stack while the symbols on the right of the head can be placed on another stack. On each
stack, symbols closer to the TM’s head are placed closer to the top of the stack than symbols
farther from the TM’s head.
advertisement

2. A ___________ is a multi tape turing machine whose input tape is read only.
a) Counter Machine
b) Multi-stack
c) Alternating Turing machine
d) None of the mentioned
View Answer

Answer: a
Explanation: Counter machines are offline(a multitape turing machine whose input is read only)
whose storage tapes are semi-infinite and whose tape symbols contains only two symbols Z and
a blank symbol B.

3. Instantaneous description of a counter machine can be described using:


a) the input tape contents
b) position of the input head
c) distance of storage heads from symbol Z
d) all of the mentioned
View Answer

Answer: d
Explanation: Instantaneous description of a counter machine can be described by the state, the
input tape contents, the position of input head, and the distance of storage heads from the
symbol Z. The counter machine can really store a count on each tape and tell if the count is zero.

4. Which of the following parameters cannot be used to restrict a turing machine?


a) tape alphabets
b) number of tapes
c) number of states
d) none of these
View Answer

Answer: d
Explanation: Another procedure to restrict a turing machine is to limit the size of tape alphabet
or reduce the number of states. If the tape alphabets, number of tapes or number of states are
limited, then there is only a finite number of different turing machine, so the restricted model is
more powerful than the original one.
advertisement

5. Linear Bounded Automaton is a:


a) Finite Automaton
b) Turing Machine
c) Push down Automaton
d) None of the mentioned
View Answer

Answer: b
Explanation: Linear Bounded Automaton is a type of Turing Machine where tape is not allowed
to move off the portion of the tape containing the input. It is a Turing machine with limited
amount of memory.

6. State true or false:


Statement: Using a two track tape, we can use a semi infinite tape to simulate an infinte tape.
a) true
b) false
View Answer

Answer: true
Explanation: A TM with a semi-infinite tape means that there are no cells to the left of the initial
head position. A TM with a semi infinite tape simulates a TM with an infinite tape by using a
two-track tape.

7. Which of the following is true with reference to semi-infinite tape using a two track tape?
a) Can simulate a two way tape
b) Upper track represents the head-right cells
c) Lower track represents the head-left cells
d) All of the mentioned
View Answer

Answer: d
Explanation: The upper track represents the cells of the original TM that are at the right of the
initial head position. The lower track represents the cells to the left of the initial head position,
but in reverse order.
advertisement

8. Which among the following options are correct?


Statement 1: TMs can accept languages that are not accepted by any PDA with one stack.
Statement 2: But PDA with two stacks can accept any language that a TM can accept.
a) Statement 1 and 2, both are correct
b) Statement 1 is correct but Statement 2 is false
c) Statement 2 is correct while Statement 1 is false
d) Statement 1 and 2, both are false
View Answer
Answer: a
Explanation: Both the statements are true. Both the statements are properties of Multistack
machines.

9. A two-way infinite tape turing machine is ________ superior than the basic model of the
turing machine in terms of power.
a) more
b) less
c) no way
d) none of the mentioned
View Answer

Answer: c
Explanation: A two way infinite tape turing machine is a turing machine with its input tape
infinte in both directions, the other component being the same as the basic model.

10. For a basic turing machine, there exists an equivalent :


a) 2-counter machine
b) 3-counter machine
c) 4-counter machine
d) All of the mentioned
View Answer

Answer: d
Explanation: For a basic TM, there exists a 2-counter, 3-counter and 4-counter machines
We can prove them using Deterministic two stack turing machine.
Counter machine:

advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Non Deterministic Turing Machines
» Next - Automata Theory Questions and Answers – Simulation of Turing Machine
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Non Deterministic Turing Machines
Automata Theory Questions and Answers – Simulation of Turing Machine
advertisement
advertisement

Recommended Posts:

1. Java Programming Examples on Exception Handling


2. Python Programming Examples on Linked Lists
3. C Programming Examples on Data-Structures
4. Network Theory Questions and Answers
5. C Programming Examples on Linked List
6. Machine Tools & Machining Questions and Answers
7. Machine Drawing Questions and Answers
8. Ruby Programming Questions and Answers
9. Electromagnetic Theory Questions and Answers
10. Cloud Computing Questions and Answers
11. C Programming Examples on Stacks & Queues
12. Python Programming Examples on Stacks & Queues
13. Home
14. C# Programming Examples on Data Structures
15. Design of Electrical Machines Questions and Answers
16. Hydraulic Machines Questions and Answers
17. Electrical Machines Questions and Answers
18. DC Machines Questions and Answers
19. Theory of Machines Questions and Answers
20. Automata Theory Questions and Answers – Finite Automata-Introduction
advertisement

Automata Theory Questions and Answers –


Simulation of Turing Machine
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Simulation of Turing Machine”.

1. Fill in the blank with an appropriate option.


In automata theory, ___________ is said to be Computationally Universal if can be used to
simulate any single taped Turing Machine.
a) Computer’s instruction set
b) A programming language
c) Cellular Automaton
d) All of the mentioned
View Answer

Answer: d
Explanation: Computationally Universal or Turing Complete is a set of data manipulation rules
if it can be used to simulate a single-taped turing machine.
advertisement
2. Give a classic example of the concept of turing complete.
a) lambda calculus
b) C++
c) Lisp
d) All of the mentioned
View Answer

Answer: d
Explanation: Most of the programming languages, conventional or unconventional are turing
complete. Functional languages like Lisp and Haskell are also turing complete.

3. Let two machines be P and Q. The state in which P can simulate Q and Q can simulate P is
called:
a) Turing Equivalence
b) State Equivalence
c) Universal Turing Machine
d) None of the mentioned
View Answer

Answer: a
Explanation: It is a closely related concept with Turing complete. It says, two computers P and
Q are called equivalent if P can simulate Q and Q can simulate P.

4. Which of the following remarks the given statement?


Statement: Any function whose values can be computed by an algorithm, can be computed by a
Turing machine.
a) Smn theorem
b) Structured Program theorem
c) Church-Turing thesis
d) None of the mentioned
View Answer

Answer: c
Explanation: The following conclusion is laid down from the Church-Turing thesis:
Any function whose values can be computed by an algorithm, can be computed by a Turing
machine. If any real world computer can be simulated by a turing machine, it is Turing
equivalent to a Turing Machine.
advertisement

5. Which of the following can be used to simulate any turing machine?


a) Finite State Automaton
b) Universal Turing Machine
c) Counter machines
d) All of the mentioned
View Answer

Answer: b
Explanation: The computational aspect of any possible real world computer can be simulated
using an Universal Turing Machine so can be any turing machine.
6. State true or false:
Statement: Inorder to show something is Turing complete, it is enough to demonstrate that it can
be used to simulate some Turing complete system.
a) true
b) false
View Answer

Answer: a
Explanation: Yes it is. For instance, an imperative language is called Turing complete if it tends
to have conditional branching and an ability to maintain an arbitrary number of symbols.

7. Which of the following can lack in a Universal computer?


a) Turing Complete Instruction set
b) Infinite memory
c) Infinite time
d) None of the mentioned
View Answer

Answer: d
Explanation: Real computers which are manufactured till date, all are similar to single taped
turing machine. However, they have limited physical resources so they are linearly bounded
complete on the contrary.
advertisement

8. Which among are not the results of computational theory?


a) In general, it is impossible to predict that what a Turing-complete program will do over an
arbitrarily long time.
b) It is impossible to determine for every input, whether the program will eventually stop or
continue forever.
c) It is not possible to determine whether a program will return true or false.
d) None of the mentioned
View Answer

Answer: d
Explanation: All of the following mentioned are the conclusions of automata theory or
computability theory.

9. Which of the games fill under the category of Turing-complete?


a) Minecraft
b) Minesweeper
c) Dwarf Fortress
d) All of the mentioned
View Answer

Answer: d
Explanation: Many games fall under the category og turing complete:
a) Minecraft
b) Minesweeper
c) Dwarf Fortress
d) Conway’s Game of Life
e) Pokemon Yellow, etc.

10. Which of the following a Non-turing Complete language?


a) Regular Language
b) Context free grammars
c) Epigram
d) All of the mentioned
View Answer

Answer: There exists some computational languages which are not turing complete. Regular
language which is accepted by finite automata tops the list. Other examples are pixel shader
languages embedded in Direct3D and OpenGL extensions.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Multistack Machines, Counter Machines
» Next - Automata Theory Questions and Answers – The Diagonalization Languages
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Multistack Machines, Counter Machines
Automata Theory Questions and Answers – The Diagonalization Languages
advertisement
advertisement

Recommended Posts:

1. Java Programming Examples on Set & String Problems & Algorithms


2. Computer Science Questions and Answers
3. C++ Programming Examples on Set & String Problems & Algorithms
4. C# Programming Examples on Functions
5. C Programming Examples on Mathematical Functions
6. Information Science Questions and Answers
7. C# Programming Examples on Networking
8. C Programming Examples on Set & String Problems & Algorithms
9. Computer Fundamentals Questions and Answers
10. C# Programming Examples on Events
11. Compilers Questions and Answers
12. Electromagnetic Theory Questions and Answers
13. Machine Design Questions and Answers
14. Machine Kinematics Questions and Answers
15. Network Theory Questions and Answers
16. Machine Drawing Questions and Answers
17. Machine Dynamics Questions and Answers
18. Machine Tools & Machining Questions and Answers
19. Theory of Machines Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers – The


Diagonalization Languages
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “The
Diagonalization Languages”

1. Which of the following technique is used to find whether a natural language isnt recursive
ennumerable?
a) Diagonalization
b) Recursive Induction
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: a
Explanation: To find a non recursively ennumerable language, we use the technique of
diagonalization.
advertisement

2. Diagonalization can be useful in:


a) To find a non recursively ennumerable language
b) To prove undecidablility of haltig problem
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: Diagonalization is a technique we use for the following operations:
a) To find a non recursively ennumerable language.
b) To prove undecidablility of halting problem.

3. Which of the following are undecidable problems?


a) Determining whether two grammars generate the same language
b) Determining whether a grammar is ambiguous
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: In contrast we can put up an algorithm for checking whether two FA’s are
equivalent and this program can be implemented as a program.
4. Which of the following are incorrect options?
a) Informally, problem is a yes/no question about an infinite set of possible instances
b) Formally, a problem is a language
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: d
Explanation: Example: Does a graph G has a Hamilton cycle?
=>Each undirected graph is an instance of Hamilton cycle problem.

5. If a problem has an algorithm to answer it, we call it _________


a) decidable
b) solved
c) recognizable
d) none of the mentioned
View Answer

Answer: a
Explanation: An algorithm is a TM that halts on all inputs,accepted or not. Putting other way,
decidable problems are recursive languages.
advertisement

6. Which of the following are decidable problems?


a) Can a particular line of code in a program ever be executed?
b) Do two given CFG’s generate the same language
c) Is a given CFG ambiguous?
d) None of the mentioned
View Answer

Answer: d
Explanation: All of the mentioned problems are undecidable.

7.Which one of the following is true for the given?


A={(M,w)|M is a turing machine that accepts string w}
a) A concrete undecidable problem
b) A is recognizable but not decidable
c) -A is not recognizable
d) All of the mentioned
View Answer

Answer: d
Explanation: We can proof A to be undecidable using the contradiction method.

8. Which of the following are correct statements?


a) TMs that always halt are known as Decidable problems
b) TMs that are guaranteed to halt only on acceptance are recursive ennumerable.
c) Both (a) and (b)
d) None of the mentioned
View Answer
Answer: c
Explanation: There are two types of TMs on the basis of halting: Recursive and Recursively
Ennumerable(TM may or may not halt,could loop forever).

9. Statement: If L id R.E., Lc needs to be R.E. Is it correct?


a) Yes
b) No
c) Maybe
d) Cannot predict
View Answer

Answer: b
Explanation: Any recursive ennumerable language is not closed under complementation.
advertisement

10. Which of the following is true for The Halting problem?


a) It is recursively ennumerable
b) It is undecidable
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: Halting problem: Does a given Turing machine M halt on a given input w?

11. With reference to binary strings, state true or false:


Statement: For any turing machine, the input alphabet is restricted to {0,1}.
a) true
b) false
View Answer

Answer: a
Explanation: When turing machines are coded as Binary strings, we are restricted to take any
input alphabet except {0,1}.

12. With reference ti enumeration of binary strings, the conversion of binary strings to integer is
possible by treating the resulting string as a base ____ integer.
a) 2
b) 8
c) 16
d) All of the mentioned
View Answer

Answer: a
Explanation: It makes sense to talk about the i-th binary string” and about “the i-th Turing
machine. If i makes no sense as a TM, assume the i-th TM accepts nothing.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.
advertisement

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Simulation of Turing Machine
» Next - Automata Theory Questions and Answers – The Universal Language-Undecidability
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Simulation of Turing Machine
Automata Theory Questions and Answers – The Universal Language-Undecidability
advertisement
advertisement

Recommended Posts:

1. C++ Programming Examples on Graph Problems & Algorithms


2. Java Programming Examples on Graph Problems & Algorithms
3. C Programming Examples without using Recursion
4. Dynamic Programming Problems and Solutions
5. C Programming Examples on Graph Problems & Algorithms
6. Artificial Intelligence Questions and Answers
7. C Programming Examples using Recursion
8. Simple C Programs
9. C++ Algorithms, Problems & Programming Examples
10. Java Algorithms, Problems & Programming Examples
11. C Algorithms, Problems & Programming Examples
12. C++ Programming Examples on Set & String Problems & Algorithms
13. Python Programming Examples on Trees
14. Compilers Questions and Answers
15. C Programming Examples on Trees
16. C Programming Examples on Set & String Problems & Algorithms
17. Electromagnetic Theory Questions and Answers
18. Theory of Machines Questions and Answers
19. Network Theory Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers – The


Universal Language-Undecidability
« Prev
Next »

This set of Automata Theory Questions and Answers for Experienced people focuses on “The
Universal Language-Undecidability”.
1. The decision problem is the function from string to ______________
a) char
b) int
c) boolean
d) none of the mentioned
View Answer

Answer: c
Explanation: The decision problem requires checking of input (string) has some property or not.
That is a string to boolean transaction.
advertisement

2. 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
b) decidable
c) undecidable
d) none of the mentioned
View Answer

Answer: b
Explanation: Decidability refers to the decision problem and existence of a effective method for
determining membership, and return true and false accordingly rather that going into a loop
forever.

3. Which aong the following are undecidable theories?


a) The first order theory of boolean algebra
b) The first order theory of Euclidean geomentry
c) The first order theory of hyperbolic geometry
d) The first order theory of the natural number with addition, multiplication, and equality
View Answer

Answer: d
Explanation: Tarski and Mostowski in 1949, established that the first order theory of natural
numbers with addition, multiplication, and equality is an undecidable theory. Others mentioned
are decidable theories.

4. Rec-DFA = { | M is a DFA and M recognizes input w}.


Fill in the blank:
Rec-DFA is ___________
a) Undecidable
b) Decidable
c) Non finite
d) None of the mentioned
View Answer

Answer: b
Explanation: Under decidablity of regular language properties we have the following lemma
which states that A DFA which recognizes an input w is decidable.
5. Which among the following are semi decidable?
a) Empty-DFA
b) Rec-NFA
c) Infinite-DFA
d) All of the mentioned
View Answer

Answer: d
Explanation: All are the properties of regular languages and all are decidable languages.
advertisement

6. The language accepted by a turing machine is called ____________


a) Recursive Ennumerable
b) Recursive
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: The language accepted by Turing machines are called recursively ennumerable
(RE), and the subset of RE languages that are accepted by a turing machine that always halts are
called recursive.

7. Decidable can be taken as a synonym to:


a) recursive
b) non recursive
c) recognizable
d) none of the mentioned
View Answer

Answer: a
Explanation: We can refer to languages as ‘recursive’ and problems as ‘decidable’. If a language
is not recursive , then we call the problem expressed by that language undecidable.

8. The problems which have no algorithm, regardless of whether or not they are accepted by a
turing machine that fails to halts on some input are referred as:
a) Decidable
b) Undecidable
c) Computable
d) None of the mentioned
View Answer

Answer: b
Explanation: The problems that can be solved by a turing machine can divided into two classes:
a) Those that have an algorithm
b) Intractable problems: Those that are only solved by a turing machine that may run forever on
inputs they do not accept.

9. An algorithm is called efficient if it runs in ____________ time on a serial computer.


a) polynomial
b) non polynomial
c) logarithmic
d) none of the mentioned
View Answer

Answer: a
Explanation: Example: Runtimes of efficient algorithms
O(n), O(nlogn), O(n3log2n)
Runtimes of inefficient algorithms
O(2n), O(n!)
advertisement

10. A problem is called __________ if its has an efficient algorithm for itself.
a) tractable
b) intractable
c) computational
d) none of the mentioned
View Answer

Answer: a
Explanation: A problem is called intractable iff there is an efficient (i.e. polynomial time)
algorithm that solves it. A problem is called intractable iff there exists no efficient algorithm that
solves it.

11. A formal language is recursive if :


a) a total turing machine exists
b) a turing machine that halts for every input
c) turing machine rejects if the input does not belong to the language
d) all of the mentioned
View Answer

Answer: d
Explanation: A formal language is called recursive if it is a recursive subset of the set of all
possible finite sequences over the alphabet of the language.

12. Recursive languages are also known as:


a) decidable
b) undecidable
c) sometimes decidable
d) none of the mentioned
View Answer

Answer: a
Explanation: A language is recursive if there exists a turing machine such that it halts i.e.
accepts if the input belongs to the language else rejects. It is better called Turing decidable
language.

13. The class of recursive language is known as:


a) R
b) RC
c) RL
d) All of the mentioned
View Answer

Answer: a
Explanation: R is the set of all recursive languages, a class of decision problems solvable by
turing machines. Although, R is also used for the class RP.
advertisement

14. Which of the following was not a part of Chomsky hierarchy ?


a) Context sensitive grammar
b) Unrestricted grammar
c) Recursive grammar
d) None of the mentioned
View Answer

Answer: c
Explanation: All recursive languages are recursively enumerable. All regular, context free and
context sensitive languages are recursive.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory for Experienced people, here is complete set of 1000+
Multiple Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – The Diagonalization Languages
» Next - Automata Theory Questions and Answers – Rice’s Theorem, Properties and PCP
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – The Diagonalization Languages
Automata Theory Questions and Answers – Rice’s Theorem, Properties and PCP
advertisement
advertisement

Recommended Posts:

1. Data Structures & Algorithms II – Questions and Answers


2. Cryptography and Network Security Questions and Answers
3. C Programming Examples on Numerical Problems & Algorithms
4. Dynamic Programming Problems and Solutions
5. Java Programming Examples on Numerical Problems & Algorithms
6. C Algorithms, Problems & Programming Examples
7. Computer Fundamentals Questions and Answers
8. Java Programming Examples on Graph Problems & Algorithms
9. Artificial Intelligence Questions and Answers
10. C Programming Examples on Graph Problems & Algorithms
11. C++ Programming Examples on Graph Problems & Algorithms
12. Java Algorithms, Problems & Programming Examples
13. C++ Algorithms, Problems & Programming Examples
14. Theory of Machines Questions and Answers
15. Java Programming Examples on Set & String Problems & Algorithms
16. Electromagnetic Theory Questions and Answers
17. Network Theory Questions and Answers
18. C Programming Examples on Set & String Problems & Algorithms
19. C++ Programming Examples on Set & String Problems & Algorithms
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers – Rice’s


Theorem, Properties and PCP
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “Rice’s
Theorem, Properties and PCP”.

1. According to the rice’s theorem, If P is a non trivial property, Lp is :


a) infinite
b) decidable
c) undecidable
d) none of the mentioned
View Answer

Answer: c
Explanation: Rice’s theorem states that ‘Any non trivial property about the language recognized
by a turing machine is undecidable’.
advertisement

2. Fill in the blank with reference to Rice’s theorem.


For any non-trivial property of __________ no general or effective method can decide whether
an algorithm computes it with that property.
a) partial functions
b) piecewise functions
c) both (a) and (b)
d) none of the mentioned
View Answer

Answer: a
Explanation: A property of partial functions is called trivial if it holds for all partial computable
functions or for none, and an effective decision method is called general if it decides correctly
for every algorithm.

3. Which of the following is incorrect according to rice theorem?


Let S be a set of language hat is non trivial:
a) there exists a TM that recognizes the language in S
b) there exists a TM that recognizes the language not in S
c) both (a) and (b)
d) none of the mentioned
View Answer

Answer: c
Explanation: According to rice theorem, it is undecidable to determine whether the language
recognized by an arbitrary turing machine lies in S.

4. Which of the following set of computable functions are decidable?


a) The class of computable functions that are constant, and its complement
b) The class of indices for computable functions that are total
c) The class of indices for recursively enumerable sets that are cofinite
d) All of the mentioned
View Answer

Answer: d
Explanation: According to Rice’s theorem, if there exists atleast one computable function in a
particular class C of computable functions and another computable function not in C then the
problem deciding whether a particular program computes a function in C is undecidable.
advertisement

5. Which of the following statements are undecidable?


For a given Turing Machine M,
a) does M halt on an empty input tape
b) does M halt for anly inputs at all?
c) is L(M) regular? Context free? Turing decidable?
d) all of the mentioned
View Answer

Answer: d
Explanation: All of the following mentioned are immediate results of Rice’s theorem and thus,
undecidable.

6. Post Correspondence problem is


a) decidable decision problem
b) undecidable decision problem
c) not a decision problem
d) none of the mentioned
View Answer

Answer: b
Explanation: Post Correspondence problem is an undecidable decision problem that was
introduced by Emil Post in 1946. Being simpler than halting problem, it can be used in proofs of
undecidability.

7. State true or false:


Statement: The difference between PCP and MPCP is that in MPCP, a solution is required to
start with the first string on each list.
a) true
b) false
View Answer

Answer: a
Explanation: The MPCP is : Given lists A and B of K strings ,say A = w1 ,w2, …wk and B= x1,
x2,…..xk does there exists a sequence of integers i1,i2,…ir such that w1wi1wi2…..wir =
x1xi1xi2…xir?
advertisement

8. PCP stands for?


a) Post Correspondence Problem
b) Post Corresponding Problem
c) Pre Correspondence problem
d) None of the mentioned
View Answer

Answer: a
Explanation: PCP or Post Correspondence problem is an undecidable decision problem.

9. Can a Modified PCP problem be reduced to PCP?


a) yes
b) no
View Answer

Answer: a
Explanation: Yes, it can be. There exists a theorem and as well as its proof which supports the
assertion.

10. Consider three decision problem A, B, C. A is decidable and B is not. Which of the
following is a correct option?
a) C is undecidable if C is reducible to B
b) C is undecidable if B is reducible to C
c) C is decidable if A is reducible to C
d) C is decidable if C is reducible to B’s complement.
View Answer

Answer: b
Explanation: As B is undecidable and it can be reduced to C, C is also an undecidable problem.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – The Universal Language-Undecidability
» Next - Automata Theory Questions and Answers – Problem Solvable in Polynomial Time
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – The Universal Language-Undecidability
Best Reference Books – B.Sc. – Agriculture
advertisement
advertisement

Recommended Posts:

1. Object Oriented Programming Questions and Answers


2. Ruby Programming Questions and Answers
3. Spring Questions and Answers
4. Thermodynamics Questions and Answers
5. C++ Questions and Answers
6. C Questions and Answers
7. PHP Questions and Answers
8. Signals & Systems Questions and Answers
9. Engineering Mathematics Questions and Answers
10. Java Programming Examples on Hard Graph Problems & Algorithms
11. Discrete Mathematics Questions and Answers
12. C Programming Examples on Hard Graph Problems & Algorithms
13. C++ Programming Examples on Hard Graph Problems & Algorithms
14. R Programming Questions and Answers
15. Probability and Statistics Questions and Answers
16. Electromagnetic Theory Questions and Answers
17. Theory of Machines Questions and Answers
18. C# Programming Examples on Functions
19. Network Theory Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Problem Solvable in Polynomial Time
« Prev
Next »

This set of Automata Theory Interview Questions and Answers for Experienced people focuses
on “Problem Solvable in Polynomial Time”.

1. If the number of steps required to solve a problem is O(nk), then the problem is said to be
solved in:
a) non-polynomial time
b) polynomial time
c) infinite time
d) none of the mentioned
View Answer

Answer: b
Explanation: Most of the operations like addition, subtraction, etc as well as computing
functions including powers, square roots and logarithms can be performed in polynomial time.
In the given question, n is the complexity of the input and k is some non negative integer.
advertisement

2. The value of constants like p and e can be calculated in:


a) polynomial time
b) non-polynomial time
c) cannot be calculated
d) none of the mentioned
View Answer

Answer: a
Explanation: The value of such constants can be calculated using algorithms which have time
complexity in terms if O(nk) i.e polynomial time.

3. Which of the following cannot be solved using polynomial time?


a) Linear Programming
b) Greatest common divisor
c) Maximum matching
d) None of the mentioned
View Answer

Answer: d
Explanation: In graph theory, a matching or independent edge set in a graph G is a set of edges
without common vertices. Given a graph (V, E), a matching M in G is a set of pairwise non
adjacent edges i.e. no two edges share a common vertex.

4. The complexity class P consist of all the decision problems that can be solved by
___________using polynomial amount of computation time.

a) Push Down automata


b) DFA
c) NDFA
d) Deterministic Turing machine
View Answer

Answer: d
Explanation: All the decision problems that can be solved using a Deterministic turing machine
using polynomial time to compute, all belong to the complexity class P.
advertisement

5. A generalization of P class can be:


a) PTIME
b) DTIME
c) NP
d) None of the mentioned
View Answer
Answer: c
Explanation: P is a specific case of NP class, which is the class of decidable problems decidable
by a non deterministic turing machine that runs in polynomial time.

6. Which of the following options are correct with reference to P-complete problems?
a) used for the problems which are difficult to solve in limited space
b) every problem in P can be reduced to it using proper reductions
c) complete problem for complexity class P
d) all of the mentioned
View Answer

Answer: d
Explanation:
The notion of P-complete decision problems is useful in the analysis of:
a) which problems are tough to parallelize effectively
b) which problems are difficult to solve in limited space

7. A problem X belongs to P complexity class if there exist ________ algorithm to solve that
problem, such that the number of steps of the algorithms bounded by a polynomial in n, where n
is the length of the input.
a) 1
b) 2
c) 3
d) all of the mentioned
View Answer

Answer: d
Explanation: A problem X belongs to P complexity class if there exist atleast 1 algorithm to
solve that problem, such that the number of steps of the algorithms bounded by a polynomial in
n, where n is the length of the input. Thus, all the options are correct.

8. Which of the following is a P-complete type of problem?


a) Circuit Value problem
b) Linear programming
c) Context free grammar membership
d) All of the mentioned
View Answer

Answer: d
Explanation: Given a context free grammar and a string, can the string be generated by the
grammar? Such problems fall in the category of P-complete.
advertisement

9. State true or false?


Statement: Given a turing machine, an input for the machine, and a number T(unary), does that
machine halt on that input within the first T-steps?
The given problem is P-complete.
a) true
b) false
View Answer
Answer: a
Explanation: If we can parallelize a general simulation of a sequential computer, then we will be
able to parallelize any program that runs on that computer. If this problem is in NC, then so
every other problem in P.

10. In the above problem, if the input is binary, the class the problem belongs?
a) EXPSPACE
b) DLOGTIME
c) EXPTIME-complete
d) All of the mentioned
View Answer

Answer: c
Explanation: It is the set of all decision problems that have exponential run time i.e. solvable by
deterministic turing machine in O(2p(n)) time, where p(n) is a polynomial function of n.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory for Interviews, here is complete set of 1000+ Multiple
Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Rice’s Theorem, Properties and PCP
» Next - Automata Theory Questions and Answers – Non Deterministic Polynomial Time
Categories Automata Theory MCQsPost navigation
Best Reference Books – B.Sc. – Agriculture
Automata Theory Questions and Answers – Non Deterministic Polynomial Time
advertisement
advertisement

Recommended Posts:

1. C++ Algorithms, Problems & Programming Examples


2. Information Science Questions and Answers
3. Agricultural Engineering Questions and Answers
4. Computer Science Questions and Answers
5. C++ Programming Examples on Combinatorial Problems & Algorithms
6. Machine Tools & Machining Questions and Answers
7. C Algorithms, Problems & Programming Examples
8. C++ Programming Examples on Hard Graph Problems & Algorithms
9. Cryptography and Network Security Questions and Answers
10. Artificial Intelligence Questions and Answers
11. Java Programming Examples on Hard Graph Problems & Algorithms
12. C Programming Examples on Hard Graph Problems & Algorithms
13. Theory of Machines Questions and Answers
14. Compilers Questions and Answers
15. Electromagnetic Theory Questions and Answers
16. Network Theory Questions and Answers
17. Java Programming Examples on Set & String Problems & Algorithms
18. C++ Programming Examples on Set & String Problems & Algorithms
19. C Programming Examples on Set & String Problems & Algorithms
20. Automata Theory Questions and Answers – From PDA to Grammars
advertisement

Automata Theory Questions and Answers – Non


Deterministic Polynomial Time
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on “Non
Deterministic Polynomial Time”.

1. What does NP stands for in complexity classes theory?


a) Non polynomial
b) Non-deterministic polynomial
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: b
Explanation: NP is said to be one of the most fundamental complexity classes. NP is an acronym
for Non deterministic polynomial time.
advertisement

2. The hardest of NP problems can be:


a) NP-complete
b) NP-hard
c) P
d) None of the mentioned
View Answer

Answer: a
Explanation: NP class contains many important problems, the hardest of which is NP-complete,
whose solution is sufficient to deal with any other NP problem in polynomial time.

3. Which of the following contains NP?


a) PSPACE
b) EXPSPACE
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: It is sufficient to construct a PSPACE machine that loops over all proof strings and
feeds each one to a polynomial time verifier. It is also contained in EXPTIME, since the same
algorithm operates in exponential time.

4. Travelling sales man problem belongs to which of the class?


a) P
b) NP
c) Linear
d) None of the mentioned
View Answer

Answer: b
Explanation: Travelling Salesman Problem: Given an input matrix of distances between n cities,
this problem is to determine if there is a route visiting all cities with total distance less than k.

5. State true or false?


Statement: If a problem X is in NP and a polynomial time algorithm for X could also be used to
solve problem Y in polynomial time, then Y is also in NP.
a) true
b) false
View Answer

Answer: a
Explanation: This is just a commutative property of NP complexity class where a problem is
said to be in NP if it can be solved using an algorithm which was used to solve another NP
problem in polynomial amount of time.
advertisement

6. A problem which is both _______ and _________ is said to be NP complete.


a) NP, P
b) NP, NP hard
c) P, P complete
d) None of the mentioned
View Answer

Answer: a
Explanation: A problem is said to be NP Hard if an algorithm for solving the problem can be
translated from for solving any other problem. It is easier to show a problem NP than showing it
Np Hard.

7. Which of the following is incorrect for the given phrase


Phrase :’solvable by non deterministic algorithms in polynomial time’
a) NP Problems
b) During control flow, non deterministic algorithm may have more than one choice
c) If the choices that non deterministic algorithm makes are correct, the amount of time it takes
is bounded by polynomial time.
d) None of the mentioned
View Answer

Answer: d
Explanation: Primality testing is a simple example. To decide whether a number is prime or not,
one simply selects non deterministically a number checks whether factors exist for the number
or not.

8. In terms of NTIME, NP problems are the set of decision problems which can be solved using
a non deterministic machine in _______ time.
a) O(n)
b) O(n1/2)
c) O(nk), k∈N
d) None of the mentioned
View Answer

Answer: c
Explanation: The complexity class NP can be defined in terms of NTIME as:
NP=O(nk) for k ∈N.

9. Which of the following can be used to define NP complexity class?


a) Verifier
b) Polynomial time
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: NP can be defined using deterministic turing machines as verifiers.
advertisement

10. Which of the following are not in NP?


a) All problems in P
b) Boolean Satisfiability problems
c) Integer factorization problem
d) None of the mentioned
View Answer

Answer: d
Explanation: This is a list of some problems which are in NP:
a) All problems in P
b) Decision version of Integer factorization method
c) Graph Isomorphism Problem
d) All NP complete problems, etc.

11. Which of the following does not belong to the closure properties of NP class?
a) Union
b) Concatenation
c) Reversal
d) Complement
View Answer

Answer: d
Explanation: It is unknown about the closure property-complement for the complexity class NP.
The question is so called NP versus co-NP problem.
Sanfoundry Global Education & Learning Series – Automata Theory.
To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Problem Solvable in Polynomial Time
» Next - Automata Theory Questions and Answers – Node-Cover Problem, Hamilton Circuit
Problem
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Problem Solvable in Polynomial Time
Best Reference Books – B.Sc. – Aquaculture
advertisement
advertisement

Recommended Posts:

1. C Programming Examples on Computational Geometry Problems & Algorithms


2. Information Science Questions and Answers
3. Python Programming Examples on Graphs
4. C Algorithms, Problems & Programming Examples
5. C++ Programming Examples on Combinatorial Problems & Algorithms
6. Data Structures & Algorithms II – Questions and Answers
7. Computer Science Questions and Answers
8. Java Programming Examples on Combinatorial Problems & Algorithms
9. C Programming Examples on Combinatorial Problems & Algorithms
10. Compilers Questions and Answers
11. Java Algorithms, Problems & Programming Examples
12. Java Programming Examples on Set & String Problems & Algorithms
13. Theory of Machines Questions and Answers
14. C++ Algorithms, Problems & Programming Examples
15. Electromagnetic Theory Questions and Answers
16. Cryptography and Network Security Questions and Answers
17. C++ Programming Examples on Set & String Problems & Algorithms
18. Network Theory Questions and Answers
19. C Programming Examples on Set & String Problems & Algorithms
20. Automata Theory Questions and Answers – PDA-Acceptance by Final State
advertisement

Automata Theory Questions and Answers – Node-


Cover Problem, Hamilton Circuit Problem
« Prev
Next »
This set of Automata Theory Questions and Answers for Aptitude test focuses on “Node-Cover
Problem, Hamilton Circuit Problem”.

1. Which of the given problems are NP-complete?


a) Node cover problems
b) Directed Hamilton Circuit Problem
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: Vertex cover or Node cover problem, and Hamilton Circuit problem, both are NP
complete type of problems.
advertisement

2. Which of the following problems do not belong to Karp’s 21 NP-complete problems?


a) Vertex Cover problems
b) Knapsack
c) 0-1 integer programming
d) None of the mentioned
View Answer

Answer: d
Explanation: There exists a set of 21 problems that are NP-complete and the set is called Karp’s
21 NP-complete problems.

3. Which of the following problems were reduced to Knapsack?


a) Exact Cover
b) Max Cut
c) 0-1 integer programming
d) None of the mentioned
View Answer

Answer: a
Explanation: Exact cover is a decision problem in computer science to determine if an exact
cover exists.

4. An exact cover problem can be represented using:


a) incidence matrix
b) bipartite graph
c) both (a) and (b)
d) none of the mentioned
View Answer

Answer: c
Explanation: The relation ‘contains’ can be represented using a bipartite graph. The vertices of
the graph can be divided into two disjoint sets, one representing the subset S and the other
representing the elements of P and one edge for each subset in S;each node is included in
exactly one of the edges forming the cover.
advertisement
5. For which of the following, greedy algorithm finds a minimal vertex cover in polynomial
time?
a) tree graphs
b) bipartite graphs
c) both (a) and (b)
d) none of the mentioned
View Answer

Answer: a
Explanation: For bipartite graphs, Konigs theorem allows the bipartite vertex problem to be
solved in polynomial time.

6. Hamilton circuit problem can have the following version/s as per the input graph:
a) directed
b) undirected
c) both (a) and (b)
d) none of the mentioned
View Answer

Answer: c
Explanation: Hamilton circuit problem is a problem determining whether a Hamiltonian path(a
path in an undirected or directed graph that visits each vertex exactly once) exists in a
graph(directed or undirected).

7. Hamilton Circuit problem is a special case of ____________


a) travelling salesman problem
b) halting problem
c) hitting set
d) none of the mentioned
View Answer

Answer: a
Explanation: Hamilton circuit problem is a special case of travelling salesman problem, obtained
by setting the distance between two cities to one if they are adjacent and two otherwise, and
verifying that the total distance travelled is equal to n (if so, the route is a Hamiltonian circuit; if
there is no Hamiltonian circuit then the shortest route will be longer).
advertisement

8. Which of the following cannot solve Hamilton Circuit problem?


a) DNA Computer
b) Monte Carlo algorithm
c) Dynamic programming
d) None of the mentioned
View Answer

Answer: d
Explanation: Using Inclusion-exclusion principle, Andreas showed how to solve Hamilton
Circuit problem in arbitrary n-vertex graphs by a Monte Carlo algorithm in time O(1.657n).
9. State true or false:
Statement: Hamiltonian cycles through any fixed edge is always even, so if one such cycle is
given, the second one must also exists.
a) true
b) false
View Answer

Answer: a
Explanation: Handshaking lemma states that ‘Every finite undirected graph has an even number
of vertices with odd degree.

10. Fibonacci number falls in the category of _________ combinatorics.


a) Algebric
b) Enumerative
c) Analytic
d) Extremal
View Answer

Answer: b
Explanation: Enumerative combinatorics is the most classical area of combinatorics and
concentrates on counting the number of certain combinatorial objects. Fibonacci series is a basic
example of Enumerative Combinatorics.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory for Aptitude test, here is complete set of 1000+
Multiple Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Non Deterministic Polynomial Time
» Next - Automata Theory Questions and Answers – PSPACE
Categories Automata Theory MCQsPost navigation
Best Reference Books – B.Sc. – Aquaculture
Automata Theory Questions and Answers – PSPACE
advertisement
advertisement

Recommended Posts:

1. Theory of Machines Questions and Answers


2. Java Programming Examples on Combinatorial Problems & Algorithms
3. C Programming Examples on Set & String Problems & Algorithms
4. C++ Programming Examples on Combinatorial Problems & Algorithms
5. C Programming Examples on Combinatorial Problems & Algorithms
6. Data Structures & Algorithms II – Questions and Answers
7. Discrete Mathematics Questions and Answers
8. Electromagnetic Theory Questions and Answers
9. Java Algorithms, Problems & Programming Examples
10. Network Theory Questions and Answers
11. C Algorithms, Problems & Programming Examples
12. Java Programming Examples on Graph Problems & Algorithms
13. C++ Programming Examples on Graph Problems & Algorithms
14. C Programming Examples on Graph Problems & Algorithms
15. C++ Algorithms, Problems & Programming Examples
16. Java Programming Examples on Hard Graph Problems & Algorithms
17. Python Programming Examples on Graphs
18. C++ Programming Examples on Hard Graph Problems & Algorithms
19. C Programming Examples on Hard Graph Problems & Algorithms
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


PSPACE
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“PSPACE”.

1. All set of polynomial questions which can be solved by a turing machine using a polynomial
amount of space:
a) PSPACE
b) NPSPACE
c) EXPSPACE
d) None of the mentioned
View Answer

Answer: a
Explanation: PSPACE is the problem class which contains all set of decision problems which
can be solved using a turing machine taking polynomial amount of space.
advertisement

2. PSPACE is strictly the super set of:


a) Regular language
b) Context free language
c) Context Sensitive Language
d) None of the mentioned
View Answer

Answer: c
Explanation: Membership of a string in a language defined by an arbitrary context sensitive
grammar, or by an arbitrary determinisic context sensitive grammar, is a PSPACE -complete
problem.
3. Savitch theorem relates to which of the following:
a) PSPACE=NPSPACE
b) Alternating Turing Machine
c) Time complexity
d) None of the mentioned
View Answer

Answer: a
Explanation: Some important conclusions of Savitch theorem includes:
a) PSPACE=NPSPACE: square of a polynomial function is still a polynomial function.
b) NL∈L2

4. The class PSPACE is closed under the following operations:


a) Union
b) Concatenation
c) Kleene
d) All of the mentioned
View Answer

Answer: d
Explanation: The closure property of PSPACE class includes :- Union, Concatenation and
Kleene operation.
advertisement

5. Correct the given order:


NL∈ P∈ NP∈ PH∈ PSPACE
a) NP∈ P∈ NL∈ PH∈ PSPACE
b) NL∈ PH∈ NP∈ P∈ PSPACE
c) NL∈ P∈ NP∈ PH∈ PSPACE
d) None of the mentioned
View Answer

Answer: c
Explanation: The given order is the only correct order and further PSPACE belongs to
EXPTIME class and subsequently occurs EXPSPACE class.

6. NL ∈ PSPACE ∈ EXPSPACE
The given relation involves which of the following theorems?
a) Space hierarchy theorem
b) Savitch’s theorem
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: c
Explanation: From space hierarchy theorem: NL ∈ NPSPACE, from Savitch’s theorem:
NPSPACE= PSPACE.

7. Statement : All PSPACE problems can be reduced to PSPACE-complete problems.


State true or false:
a) true
b) false
View Answer

Answer: a
Explanation: PSPACE-complete problems are the most difficut problems is PSPACE. Finding a
simple solution to PSPACE-complete means simple solution to all other problems in PSPACE
because all PSPACE problems can be reduced to PSPACE-complete problems.
advertisement

8. Without needing extra __________ we can simulate non deterministic turing machine using
deterministic turing machine.
a) time
b) space
c) both time and space
d) none of the mentioned
View Answer

Answer: b
Explanation: Though it may use extra time, but as PSPACE=NPSPACE from savitch’s theorem,
we can say that space taken is same for both the machins, deterministic as well as non-
deterministic.

9. Complement of all the problems in PSPACE is ________


a) PSPACE
b) NL
c) P
d) All of the mentioned
View Answer

Answer: a
Explanation: The complement of all the problems in PSPACE are also in PSPACE, meaning co-
PSPACE= PSPACE.

10. Which of the following PSPACE can be characterized into?


a) APTIME
b) AP
c) Quantom complexity class
d) None of the mentioned
View Answer

Answer: d
Explanation: An alternative characterization of PSPACE is a set of problems decidable by a
turing machine in polynomial time, sometimes called, APTIME or AP.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.
Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Node-Cover Problem, Hamilton Circuit
Problem
» Next - Automata Theory Questions and Answers – Randomized Algorithm
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Node-Cover Problem, Hamilton Circuit Problem
Automata Theory Questions and Answers – Randomized Algorithm
advertisement
advertisement

Recommended Posts:

1. Engineering Mechanics Questions and Answers


2. Machine Tools & Machining Questions and Answers
3. Signals & Systems Questions and Answers
4. Structural Analysis Questions and Answers
5. Engineering Mathematics Questions and Answers
6. C++ Programming Examples on Set & String Problems & Algorithms
7. Java Algorithms, Problems & Programming Examples
8. Aerodynamics Questions and Answers
9. Discrete Mathematics Questions and Answers
10. C++ Algorithms, Problems & Programming Examples
11. C Algorithms, Problems & Programming Examples
12. C Programming Examples on Set & String Problems & Algorithms
13. Artificial Intelligence Questions and Answers
14. Compilers Questions and Answers
15. Cryptography and Network Security Questions and Answers
16. Probability and Statistics Questions and Answers
17. Theory of Machines Questions and Answers
18. Electromagnetic Theory Questions and Answers
19. Network Theory Questions and Answers
20. Automata Theory Questions and Answers – Mealy Machine
advertisement

Automata Theory Questions and Answers –


Randomized Algorithm
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Randomized Algorithm”

1. A randomized algorithm uses random bits as input inorder to achieve a _____________ good
performance over all possible choice of random bits.
a) worst case
b) best case
c) average case
d) none of the mentioned
View Answer

Answer: c
Explanation: A randomized algorithm is an algorithm that employs a degree of randomness as a
part of its logic using random bits as inputs and in hope of producing average case good
performace.
advertisement

2. Which of the following options match the given statement:


Statement: The algorithms that use the random input to reduce the expected running time or
memory usage, but always terminate with a correct result in a bounded amount of time.
a) Las Vegas Algorithm
b) Monte Carlo Algorithm
c) Atlantic City Algorithm
d) None of the mentioned
View Answer

Answer: a
Explanation: The other type of algorithms are probabalistic algorithms, which depending upon
the random input, have a chance of producing incorrect results or fail to produce a result.

3. Which of the following are probalistic algorithms?


a) Las Vegas Algorithm
b) Monte Carlo Algorithm
c) Atlantic City Algorithm
d) All of the mentioned
View Answer

Answer: d
Explanation: Monte Carlo algorithms are very vast, but only probably correct. On thr other side,
Las Vegas algorithms are always correct, but probably fast.

4. Which of the following algorithms are probably correct as well as fast?


a) Las Vegas Algorithm
b) Monte Carlo Algorithm
c) Atlantic City Algorithm
d) All of the mentioned
View Answer

Answer: c
Explanation: The atlantic city algorithms which are bounded polynomial time algorithms are
probably correct and probably fast. It is correct more than 75% of the times.

5. Prisonner’s dilemma can be related to the following:


a) cooperative behaviour
b) graph theory
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: a
Explanation: Prisonner’s dilemma is a standard example of a game analysed in game theory
where rational cooperative behaviour is judged on the basis of rewards and punishment.
advertisement

6. Unix sort command uses _________ as its sorting technique.


a) Quick Sort
b) Bucket Sort
c) Radix Sort
d) Merge Sort
View Answer

Answer: a
Explanation: Quicksort is the method of choice in many applications( Unix sort command) with
O(nlogn) in worst case.

7. State true or false:


Statement: A turing machine has the capability of using randomly ‘generated’ numbers.
a) true
b) false
View Answer

Answer: a
Explanation: Complexity theories models randomized algorithms as probalistic turing machines.
A probalistic turing machine is a non deterministic turing machine which randomly chooses
between the available transitions at each point according to some probalistic distribution.

8. For the given algorithm, find the probability of finding after k iterations:
find_a(array A, n, k)
begin
i=0
repeat
Randomly select one element out of n elements
i=i+1
until i=k or a is found
end

a) (1/2)k
b) (1-(1/3))k
c) 1-(1/2)k
d) None of the mentioned
View Answer

Answer: c
Explanation: The given is known as Monte Carlo Algorithm. If a is fount, the algorithm
succeeds, else the algorith fails. The algorithm doesn not guarantee success but the run time is
bounded.
advertisement
9. Which of the following can be solved in computer science?
a) P=BPP problem
b) NP=co-NP problem
c) Do one way problems exist?
d) All of the mentioned
View Answer

Answer: d
Explanation: There exists a list of unsolved problems in computational theory which includes
many problems including the ones given.

10. Which of the following can be referred to as applications of Randomized algorithm?


a) Quicksort
b) Min Cut
c) Verifying Matrix Multiplication
d) All of the mentioned
View Answer

Answer: d
Explanation: Freivalds algorithm is a probabalistic randomized algorithm we use to verify
matrix multiplication. On the other hand, Randomness can be useful in quicksort. If the
algorithm selects pivot element uniformaly at random, it has a probably high probabilty of
finishing the work in O(nlogn) time regardless of the input.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.
advertisement

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – PSPACE
» Next - Automata Theory Questions and Answers – Class RP and ZPP,Complexity
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – PSPACE
Automata Theory Questions and Answers – Class RP and ZPP,Complexity
advertisement
advertisement

Recommended Posts:

1. Network Theory Questions and Answers


2. Electromagnetic Theory Questions and Answers
3. Data Structures & Algorithms II – Questions and Answers
4. C++ Programming Examples on Numerical Problems & Algorithms
5. C++ Programming Examples on Graph Problems & Algorithms
6. C++ Programming Examples on Set & String Problems & Algorithms
7. Java Programming Examples on Numerical Problems & Algorithms
8. C Programming Examples on Graph Problems & Algorithms
9. C Programming Examples on Numerical Problems & Algorithms
10. Java Programming Examples on Graph Problems & Algorithms
11. C Programming Examples on Set & String Problems & Algorithms
12. C# Programming Examples on Sorting
13. C++ Programming Examples on Combinatorial Problems & Algorithms
14. C++ Algorithms, Problems & Programming Examples
15. Java Programming Examples on Combinatorial Problems & Algorithms
16. C Programming Examples on Searching and Sorting
17. C Programming Examples on Combinatorial Problems & Algorithms
18. Java Algorithms, Problems & Programming Examples
19. Python Programming Examples on Searching and Sorting
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers – Class


RP and ZPP,Complexity
« Prev
Next »

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Complexity Classes,Class RP and ZPP”.

1. Which among the following is smallest for n=50


a) 2n2
b) n2+3n+7
c) n3
d) 2n
View Answer

Answer: b
Explanation:
2n2=5000
n2+3n+7=2567
n3=125000
2n=1.13*1015
advertisement

2. The space complexity of a turing machine is undefined if:


a) It is a multitape turing machine
b) If no string of length n causes T to use infinite number of tape squares
c) If some input of length n causes T to loop forever
d) None of the mentioned
View Answer
Answer: c
Explanation: If there exists an input string of length n that causes T to use an infinite number of
tape squares, the space complexity of the turing machine is undefined.

3. In order to reduce the run time of a turing machine:


a) we can reduce the number of tapes
b) we can increase the number of tapes
c) use infinite tapes
d) none of the mentioned
View Answer

Answer: One way to reduce the run time can be to increase the number of tapes. Sometimes,
using two tapes can be used to avoid back and forth motions altogether.

4. Which of the following are basic complexity classes for a function f:N->N?
a) Ntime(f)
b) Nspace(f)
c) Space(f)
d) All of the mentioned
View Answer

Answer: d
Explanation: Ntime(f): is a set of languages that can be accepted by a NTM T with non
deterministic time complexity function t <=f. In all four cases, the machines are allowed to be
multitape TM’s.

5. A function f is called __________ if there exists a TM T so that for any n and any input string
of length n, T halts in exactly f(n) moves.
a) Step function
b) Step counting function
c) Inplace functions
d) None of the mentioned
View Answer

Answer: b
Explanation: If f is a step counting function, T is a TM halting in f(n) moves where n is the
length of input string.
advertisement

6. Let f: N->N be a step counting function. Then for some constant C, Time(f) is a proper subset
of Time(_______)
a) O(nf)
b) O(n+f)
c) O(n2f2)
d) None of the mentioned
View Answer

Answer: c
Explanation: Using the encoding function, it is possible to show that if the function f is a step
counting function, then the function Cn2(f(n))2 is the total number of moves required.
7. Which among the following is false?
If f=O(h) and g=O(k) for f,g,h,k:N->N, then
a) f+g = O(h+k)
b) fg = O(hk)
c) fg=O(hk)
d) None of the mentioned
View Answer

Answer: c
Explanation: f,g,h,k are partial functions and each is defined at all but a finite number of points.

8. Which of the following is not correct for ZPP?


a) zero error probabalistic polynomial time
b) it runs in non-polynomial time
c) it returns an answer yes, no or do not know
d) none of the mentioned
View Answer

Answer: b
Explanation: ZPP is zero error probabalistic polynomial time complexity class which run in
polynomial time, returns an answer: yes, no or do not know.

9. ZPP is based on ________


a) Probabalistic turing machine
b) Alternative turing machine
c) Quantum turing machine
d) None of the mentioned
View Answer

Answer: a
Explanation: A probabalistic turing machine is a non deterministic turing machine which
randomly chooses between the available transitions at each point according to some probability
distribution.
advertisement

10. ZPP is exactly equal to the ____________of the classes RP and co-RP.
a) Union
b) Intersection
c) Concatenation
d) Difference
View Answer

Answer: b
Explanation: To prove the following statement, we need to take in note that every problem in RP
and co-RP has a Las-Vegas algorithm.

11. Suppose we have a las vegas algorithm C to prove ZPP is contained in RP and co-RP. Run C
for double its expected running time.
By Markov’s inequality, the chance that it will answer before we stop is:
a) 1/2
b) 1/4
c) 1/3
d) none of the mentioned
View Answer

Answer: a
Explanation: This means the chance we’ll give the wrong answer on a YES instance, by
stopping and yielding NO, is only 1/2, fitting the definition of an RP algorithm.

12. State true or false:


Statement: ZPP is closed under complement function.
a) true
b) false
View Answer

Answer: a
Explanation: ZPP is said to be closed under complement function i.e. ZPP=co-ZPP.

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.
advertisement

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Randomized Algorithm
» Next - Automata Theory Questions and Answers – Applications of NFA
Categories Automata Theory MCQsPost navigation
Automata Theory Questions and Answers – Randomized Algorithm
Best Reference Books – B.Sc. – Aviation
advertisement
advertisement

Recommended Posts:

1. Agricultural Engineering Questions and Answers


2. Machine Kinematics Questions and Answers
3. Python Programming Examples on Linked Lists
4. Computer Science Questions and Answers
5. C++ Programming Examples on Combinatorial Problems & Algorithms
6. Machine Tools & Machining Questions and Answers
7. Data Structures & Algorithms II – Questions and Answers
8. C Programming Examples on Bitwise Operations
9. C Programming Examples on Combinatorial Problems & Algorithms
10. Java Programming Examples on Combinatorial Problems & Algorithms
11. C++ Programming Examples on Set & String Problems & Algorithms
12. Probability and Statistics Questions and Answers
13. Java Programming Examples on Set & String Problems & Algorithms
14. Compilers Questions and Answers
15. C Programming Examples on Set & String Problems & Algorithms
16. Discrete Mathematics Questions and Answers
17. Electromagnetic Theory Questions and Answers
18. Theory of Machines Questions and Answers
19. Network Theory Questions and Answers
20. Automata Theory Questions and Answers
advertisement

Automata Theory Questions and Answers –


Applications of NFA
« Prev

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on
“Applications of NFA”.

1. Under which of the following operation, NFA is not closed?


a) Negation
b) Kleene
c) Concatenation
d) None of the mentioned
View Answer

Answer: d
Explanation: NFA is said to be closed under the following operations:
a) Union
b) Intersection
c) Concatenation
d) Kleene
e) Negation.
advertisement

2. It is less complex to prove the closure properties over regular languages using:
a) NFA
b) DFA
c) PDA
d) Can’t be said
View Answer

Answer: a
Explanation: None.

3. Which of the following is an application of Finite Automaton?


a) Compiler Design
b) Grammar Parsers
c) Text Search
d) All of the mentioned
View Answer

Answer: d
Explanation: There are many applications of finite automata, mainly in the field of Compiler
Design and Parsers and Search Engines.

4. John is asked to make an automaton which accepts a given string for all the occurrence of
‘1001’ in it. How many number of transitions would John use such that, the string processing
application works?
a) 9
b) 11
c) 12
d) 15
View Answer

Answer: a
Explanation: None.
advertisement

5. Which of the following do we use to form an NFA from a regular expression?


a) Subset Construction Method
b) Power Set Construction Method
c) Thompson Construction Method
d) Scott Construction Method
View Answer

Answer: c
Explanation: Thompson Construction method is used to turn a regular expression in an NFA by
fragmenting the given regular expression through the operations performed on the input
alphabets.

6. Which among the following can be an example of application of finite state machine(FSM)?
a) Communication Link
b) Adder
c) Stack
d) None of the mentioned
View Answer

Answer: a
Explanation: Idle is the state when data in form of packets is send and returns if NAK is
received else waits for the NAK to be received.

7. Which among the following is not an application of FSM?


a) Lexical Analyser
b) BOT
c) State charts
d) None of the mentioned
View Answer
Answer: d
Explanation: Finite state automation is used in Lexical Analyser, Computer BOT (used in
games), State charts, etc.
advertisement

8. L1= {w | w does not contain the string tr }


L2= {w | w does contain the string tr}
Given ∑= {t, r}, The difference of the minimum number of states required to form L1 and L2?
a) 0
b) 1
c) 2
d) Cannot be said
View Answer

Answer: a
Explanation: None.

9. Predict the number of transitions required to automate the following language using only 3
states:
L= {w | w ends with 00}
a) 3
b) 2
c) 4
d) Cannot be said
View Answer

Answer: a
Explanation: None.

10. The total number of states to build the given language using DFA:
L= {w | w has exactly 2 a’s and at least 2 b’s}
a) 10
b) 11
c) 12
d) 13
View Answer

Answer: a
Explanation: We need to make the number of a as fixed i.e. 2 and b can be 2 or more. Thus,
using this condition a finite automata can be created using 1 states.
advertisement

Sanfoundry Global Education & Learning Series – Automata Theory.


To practice all areas of Automata Theory, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Automata Theory Questions and Answers – Class RP and ZPP,Complexity
Categories Automata Theory MCQsPost navigation
Power Plant Questions and Answers – Combined Cycle Plants, Nuclear and Thermionic Power
Generation
Power Plant Questions and Answers – Gas Turbine-Steam Power Plant – I
advertisement
advertisement

Recommended Posts:

1. Numerical Methods Questions and Answers


2. C++ Algorithms, Problems & Programming Examples
3. Java Algorithms, Problems & Programming Examples
4. Java Programming Examples on Utility Classes
5. C# Programming Examples on Functions
6. Geotechnical Engineering I Questions and Answers
7. C Algorithms, Problems & Programming Examples
8. C++ Programming Examples on STL
9. Theory of Machines Questions and Answers
10. Master of Computer Applications Questions and Answers
11. Electromagnetic Theory Questions and Answers
12. C Programming Examples on Stacks & Queues
13. Bachelor of Computer Applications Questions and Answers
14. Python Programming Examples on Stacks & Queues
15. Network Theory Questions and Answers
16. Compilers Questions and Answers
17. Java Programming Examples on Set & String Problems & Algorithms
18. C Programming Examples on Set & String Problems & Algorithms
19. C++ Programming Examples on Set & String Problems & Algorithms
20. Automata Theory Questions and Answers
advertisement

Power Plant Questions and Answers – Gas


Turbine-Steam Power Plant – I
« Prev
Next »

This set of Power Plant Engineering Multiple Choice Questions & Answers (MCQs) focuses on
“Gas Turbine-Steam Power Plant – I”.

1. What is the air standard cycle for a Gas-Turbine called?


a) Reheat cycle
b) Rankine cycle
c) Brayton cycle
d) Diesel cycle
View Answer
Answer: c
Explanation: Brayton cycle is an ideal air standard cycle for a Gas turbine, which, like the
Rankine cycle, also comprises of two reversible adiabatic & two reversible isobars.
advertisement

2. What is the difference between a Rankine cycle & a Brayton cycle?


a) working fluid in a Brayton cycle undergoes phase change while it doesn’t in Rankine cycle
b) working fluid in a Brayton cycle doesn’t undergo phase change while it does in Rankine
cycle
c) both are same
d) none of the mentioned
View Answer

Answer: b
Explanation: The difference between a Rankine cycle & a Brayton cycle is that the working
fluid in a Brayton cycle doesn’t undergo phase change while it does in Rankine cycle.

3. Which of the following is a type of Gas Turbine Plant?


a) Single Acting
b) Double Acting
c) Open
d) None of the mentioned
View Answer

Answer: c
Explanation: Open & Closed Gas Turbine plants are the two types.

4. Power is produced when the working fluid does some work on the?
a) Shaft
b) Fins
c) Blades
d) None of the mentioned
View Answer

Answer: c
Explanation: For the production of power, the working fluid does some work on the blades of
the turbine, thereby producing Power.
advertisement

5. A Gas Turbine is which type of combustion plant?


a) external
b) open
c) internal
d) cannot say
View Answer

Answer: c
Explanation: Since for the production of power, the working fluid does some work on the blades
of the turbine, thereby producing Power. Hence, it is called an internal combustion plant.
6. Which among these is the main component of a gas turbine plant?
a) Condenser
b) Compressor
c) Boiler
d) Both Compressor & Boiler
View Answer

Answer: b
Explanation: The main component of a Gas turbine plant is Compressor.

7. Which type of compressor is used in a gas turbine plant?


a) Reciprocating compressor
b) Screw compressor
c) Multistage axial flow compressor
d) Either Reciprocating compressor & Screw compressor
View Answer

Answer: c
Explanation: Multistage axial flow compressor is the compressor in practical usage in a gas
turbine plant.
advertisement

8. What part or % of power developed is utilised for driving the compressor?


a) 65 %
b) 70 %
c) 55 %
d) 80 %
View Answer

Answer: a
Explanation: A total of 65 % of power developed in the gas turbine is used for driving the
compressor.

9. The gas turbine power plant mainly uses which among the following fuels?
a) Coal and Peat
b) Kerosene oil and diesel oil and residual oil
c) Gas oil
d) Natural gas and liquid petroleum fuel
View Answer

Answer: d
Explanation: Natural gas and liquid petroleum fuel are among the two fuels used in a gas
turbine.

Sanfoundry Global Education & Learning Series – Power Plant Engineering.


advertisement

To practice all areas of Power Plant Engineering, here is complete set of 1000+ Multiple Choice
Questions and Answers.
Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Power Plant Questions and Answers – Combined Cycle Plants, Nuclear and Thermionic
Power Generation
» Next - Power Plant Questions and Answers – Gas Turbine-Steam Power Plant – II
Categories Power Plant MCQsPost navigation
Automata Theory Questions and Answers – Applications of NFA
Power Plant Questions and Answers – Gas Turbine-Steam Power Plant – II
advertisement
advertisement

Recommended Posts:

1. Mechanical Engineering Questions and Answers


2. Mechanical Operations Questions and Answers
3. Marine Engineering Questions and Answers
4. Hydraulic Machines Questions and Answers
5. Energy Engineering Questions and Answers
6. Power Electronics Questions and Answers
7. Home
8. Power Systems Questions and Answers
9. Thermodynamics Questions and Answers
10. Steam and Gas Turbines Questions and Answers
11. Power Plant Questions and Answers
12. Power Plant Questions and Answers – Turbine Efficiency and Flow Through Nozzles – II
13. Power Plant Questions and Answers – Binary Vapour Cycle
14. Power Plant Questions and Answers – Reheating of Steam – 1
15. Power Systems Questions and Answers – Gas Turbine Power Plants & Types of Tariffs
16. Power Plant Questions and Answers – Regeneration – 2
17. Power Plant Questions and Answers – Carnotinization of Rankine Cycle
18. Power Plant Questions and Answers – Flaws of Steam as a Working Fluid and Vapor
Cycle Characteristics
19. Power Plant Questions and Answers – Rankine Cycle and Carnot Cycle
20. Steam and Gas turbines Questions – Fundamentals of Thermodynamics
advertisement

Power Plant Questions and Answers – Gas


Turbine-Steam Power Plant – II
« Prev
Next »

This set of Power Plant Interview Questions and Answers for freshers focuses on “Gas Turbine-
Steam Power Plant – II”.
1. The heating value of gaseous fuels is about _____________
a) 500 kJ/litre
b) 30 kJ/litre
c) 100 kJ/litre
d) 10 kJ/litre
View Answer

Answer: b
Explanation: 30 kJ/litre is the heating value of gaseous fuels.
advertisement

2. The compressor has to be started _____________


a) Before starting the gas turbine
b) After starting the gas turbine
c) Simultaneously with starting of gas turbine
d) At any time during the operation
View Answer

Answer: a
Explanation: Compressor has to be started before starting the gas turbine as the turbine work is
used by compressor.

3. Which of these is not a part of a Gas Turbine Plant?


a) Compressor
b) Gas Turbine
c) Combustion chamber
d) Boiler
View Answer

Answer: d
Explanation: A Gas Turbine Plant has the following parts:
Compressor, Gas Turbine, Combustion chamber.

4. What are the major field(s) of application of gas turbine?


a) Aviation
b) Oil and gas industry
c) Marine propulsion
d) All of the mentioned
View Answer

Answer: d
Explanation: A Gas Turbine has applications in nearly all fields, the major ones being in the
fields of Aviation, Oil & Gas industry, Marine propulsion.

5. Which of the following is (are) the limitation(s) of gas turbines?


a) They are not self-starting
b) Higher rotor speeds
c) Low efficiencies at part loads
d) All of the mentioned
View Answer
Answer: d
Explanation: The limitations in the functioning of a Gas Turbines are inability of self-starting,
excess rotor speeds and inability to adjust to varying loads.
advertisement

6. The ratio of heat actually released by 1kg of fuel to heat that would be released by complete
perfect combustion is called ___________
a) Thermal efficiency
b) Combustion efficiency
c) Engine efficiency
d) Compression efficiency
View Answer

Answer: b
Explanation: Combustion efficiency is defined as,” The ratio of heat actually released by 1kg of
fuel to heat that would be released by complete perfect combustion”.

7. What is the percentage of total energy input appearing as network output of the cycle?
a) Thermal efficiency
b) Combustion efficiency
c) Engine efficiency
d) Compression efficiency
View Answer

Answer: a
Explanation: Thermal Efficiency is, “The percentage of total energy input appearing as network
output of the cycle”.

8. Which of the following method(s) can be used to improve the thermal efficiency of open
cycle gas turbine plant?
a) Inter-cooling
b) Reheating
c) Regeneration
d) All of the mentioned
View Answer

Answer: d
Explanation: The various methods to improve the efficiency of open cycles include intercooling
the feed water from the compressor to the turbine and then employing regeneration & reheat to
just use the power of the reheated water in order to maximize the power output.

9. Which of the following is (are) used as starter for a gas turbine?


a) An Internal combustion engine
b) A steam turbine
c) An auxiliary electric motor
d) All of the mentioned
View Answer
Answer: d
Explanation: There are various methods by which a Gas Turbine can be started, they are by the
use of an Internal Combustion engine, a steam turbine, an auxiliary electric motor, etc.
advertisement

10. Gas turbine is shut down by ____________


a) Turning off starter
b) Stopping the compressor
c) Fuel is cut off from the combustor
d) All of the mentioned
View Answer

Answer: c
Explanation: The only way to stop a running Gas turbine is by cutting off the fuel supply so that
the various processes in the cycle are stopped.

Sanfoundry Global Education & Learning Series – Power Plant Engineering.

To practice all areas of Power Plant for Interviews, here is complete set of 1000+ Multiple
Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Power Plant Questions and Answers – Gas Turbine-Steam Power Plant – I
» Next - Power Plant Questions and Answers – Gas Turbine-Steam Power Plant – III
Categories Power Plant MCQsPost navigation
Power Plant Questions and Answers – Gas Turbine-Steam Power Plant – I
Power Plant Questions and Answers – Gas Turbine-Steam Power Plant – III
advertisement
advertisement

Recommended Posts:

1. Machine Dynamics Questions and Answers


2. Machine Design Questions and Answers
3. Chemical Engineering Questions and Answers
4. Applied Chemistry Questions and Answers
5. Mechanical Operations Questions and Answers
6. Mechanical Engineering Questions and Answers
7. DC Machines Questions and Answers
8. Electrical Machines Questions and Answers
9. Fluidization Engineering Questions and Answers
10. Engineering Chemistry II Questions and Answers
11. Rocket Propulsion Questions and Answers
12. Hydraulic Machines Questions and Answers
13. Power Electronics Questions and Answers
14. Thermodynamics Questions and Answers
15. Automobile Engineering Questions and Answers
16. IC Engine Questions and Answers
17. Power Systems Questions and Answers
18. Energy Engineering Questions and Answers
19. Steam and Gas Turbines Questions and Answers
20. Power Plant Questions and Answers
advertisement

Power Plant Questions and Answers – Gas


Turbine-Steam Power Plant – III
« Prev
Next »

This set of Power Plant Questions and Answers for Experienced people focuses on “Gas
Turbine-Steam Power Plant – III”.

1. In gas turbine, intercooler is placed _____________


a) before low pressure compressor
b) in between low pressure compressor and high pressure compressor
c) in between high pressure compressor and turbine
d) none of the mentioned
View Answer

Answer: b
Explanation: The various methods to improve the efficiency of open cycles include intercooling
the feed water from the compressor to the turbine and then employing regeneration & reheat to
just use the power of the reheated water in order to maximize the power output. Here, this is
done by placing the intercooler before any of the above processes.
advertisement

2. In gas turbine, what is the function of Re-heater?


a) Heat inlet air
b) Heat exhaust gases
c) Heat air coming out of compressor
d) Heat gases coming out of high pressure turbine
View Answer

Answer: d
Explanation: In order to make a thermodynamic process of larger efficiency, it is shifted towards
isothermal behavior. For this, the output from re-generator, which is at a higher temperature is
cooled to the temperature which is mid-way between the two temperature ranges. Then, it is
again heated to the final temperature thereby increasing the efficiency of the cycle.

3. The ‘work ratio’ increases with _____________


a) increase in turbine inlet pressure
b) decrease in compressor inlet temperature
c) decrease in pressure ratio of the cycle
d) all of the mentioned
View Answer

Answer: d
Explanation: The ‘work ratio’ increases when the turbine inlet pressure increases, the
compressor inlet temperature decreases, the pressure ratio of the cycle decreases.

4. In the centrifugal compressor, total pressure varies _____________


a) directly as the speed ratio
b) square of speed ratio
c) cube of the speed ratio
d) all of the mentioned
View Answer

Answer: b
Explanation: The total pressure in a centrifugal compressor is a function of speed ratio. It varies
square of the speed ratio.
advertisement

5. The efficiency of multistage compressor is _____ than a single stage.


a) lower
b) higher
c) equal to
d) all of the mentioned
View Answer

Answer: a
Explanation: The efficiency of multistage compressor is lower than a single stage.

6. In centrifugal compressor, power input varies as _________


a) directly as the speed ratio
b) the square of speed ratio
c) the cube of the speed ratio
d) all of the mentioned
View Answer

Answer: c
Explanation: Power output in a centrifugal compressor varies as the cube of the speed ratio.

7. In the ____________ heat transfer takes place between the exhaust gases and cool air.
a) Intercooler
b) Re-heater
c) Regenerator
d) Compressor
View Answer

Answer: c
Explanation: The process of heat transfer between the exhaust gases and cool air takes place in
Regenerator.
advertisement
8. In centrifugal compressor, the diffuser converts _________
a) Kinetic energy into pressure energy
b) Pressure energy into Kinetic energy
c) Kinetic energy into Mechanical energy
d) Mechanical energy into Kinetic energy
View Answer

Answer: a
Explanation: The diffuser of a centrifugal compressor converts Kinetic Energy into Pressure
energy.

Sanfoundry Global Education & Learning Series – Power Plant Engineering.

To practice all areas of Power Plant for Experienced people, here is complete set of 1000+
Multiple Choice Questions and Answers.
advertisement

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Power Plant Questions and Answers – Gas Turbine-Steam Power Plant – II
» Next - Power Plant Questions and Answers – Fuel Oil
Categories Power Plant MCQsPost navigation
Power Plant Questions and Answers – Gas Turbine-Steam Power Plant – II
Power Plant Questions and Answers – Fuel Oil
advertisement
advertisement

Recommended Posts:

1. Machine Design Questions and Answers


2. DC Machines Questions and Answers
3. Electrical Machines Questions and Answers
4. Chemical Process Calculation Questions and Answers
5. Mechanical Engineering Questions and Answers
6. Fluidization Engineering Questions and Answers
7. Heat Transfer Operations Questions and Answers
8. Refrigeration and Air Conditioning Questions and Answers
9. Home
10. Renewable Energy Questions and Answers
11. Chemical Engineering Questions and Answers
12. Mechanical Operations Questions and Answers
13. Power Electronics Questions and Answers
14. Energy Engineering Questions and Answers
15. Thermodynamics Questions and Answers
16. Power Systems Questions and Answers
17. Thermal Engineering Questions and Answers
18. Hydraulic Machines Questions and Answers
19. Steam and Gas Turbines Questions and Answers
20. Power Plant Questions and Answers
advertisement

Power Plant Questions and Answers – Fuel Oil


« Prev
Next »

This set of Power Plant Engineering Multiple Choice Questions & Answers (MCQs) focuses on
“Fuel Oil”.

1. The bulk of hydrocarbon belongs to which group?


a) paraffin
b) isoparaffin
c) cycloparaffin
d) aromatic
View Answer

Answer: a
Explanation: A bulk of hydrocarbons in fuel oils belongs to paraffin series like methane, ethane.
advertisement

2. Which of these is not a lighter fraction of fuel oil?


a) gasoline
b) aviation fuel
c) heavy diesel oil
d) boiler fuel
View Answer

Answer: d
Explanation: Boiler fuel is one of the heavier fraction in the refining process of fuel oil.

3. Which of these properties specifies the minimum temperature at which fuel oil can be
ignited?
a) pour point
b) flash point
c) heating value
d) viscosity
View Answer

Answer: b
Explanation: The flash point is the minimum temperature at which fuel may be ignited.

4. Which of the following type of fuel does not contain ash?


a) coal
b) fuel oil
c) natural gas
d) synthetic fuels
View Answer

Answer: c
Explanation: Because of its gaseous nature, natural gas is the cleanest of all fuel types as it does
contain ash and also produces no smoke on combustion.
advertisement

5. Which of these gases is the reason for the maintenance of natural gas at cryogenic
temperatures?
a) methane
b) ethane
c) propane
d) benzene
View Answer

Answer: a
Explanation: The major component of natural gas is methane, whose critical temperature is -83C
. So cryogenic temperatures are needed to maintain them it in liquid state at moderate pressure.

6. The gas which contributes maximum to heating value of natural gas is?
a) CO
b) CO2
c) H2
d) CH4
View Answer

Answer: d
Explanation: CH4 gas contributes maximum to the heating value of natural gas.

7. A coal containing high percentage of durian is called _________


a) splint
b) bright
c) boghead
d) non-banded
View Answer

Answer: a
Explanation: Coal containing high percentage of durian is called splint.
advertisement

8. Low temperature carbonisation _________


a) produces less quantity of tar than high temperature carbonisation
b) is mainly producing smokeless domestic coke
c) is meant for production of ‘metallurgical coke’
d) produces higher temperature gas than high temperature carbonisation
View Answer
Answer: b
Explanation: During this process, the fuel is broken down into solid residue called semicoke, a
primary gas and a watery condensate.

Sanfoundry Global Education & Learning Series – Power Plant Engineering.

To practice all areas of Power Plant Engineering, here is complete set of 1000+ Multiple Choice
Questions and Answers.
advertisement

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Power Plant Questions and Answers – Gas Turbine-Steam Power Plant – III
» Next - Power Plant Questions and Answers – Coal-Oil & Coal-Water Mixtures – I
Categories Power Plant MCQsPost navigation
Power Plant Questions and Answers – Gas Turbine-Steam Power Plant – III
Power Plant Questions and Answers – Coal-Oil & Coal-Water Mixtures – I
advertisement
advertisement

Recommended Posts:

1. C Programming Examples on Mathematical Functions


2. Waste Water Engineering Questions and Answers
3. Mechanical Engineering Questions and Answers
4. Polymer Engineering Questions and Answers
5. Electric Circuits Questions and Answers
6. IC Engine Questions and Answers
7. Fluidization Engineering Questions and Answers
8. Marine Engineering Questions and Answers
9. Automobile Engineering Questions and Answers
10. Steam and Gas Turbines Questions and Answers
11. Applied Chemistry Questions and Answers
12. Power Electronics Questions and Answers
13. Engineering Chemistry II Questions and Answers
14. Power Systems Questions and Answers
15. Energy Engineering Questions and Answers
16. Power Plant Questions and Answers
17. Power Plant Questions and Answers – Efficiencies in a Steam Power Plant – 2
18. Power Plant Questions and Answers – Gas Turbine-Steam Power Plant – II
19. Power Plant Questions and Answers – Advantages of Combined Cycle Power Generation
20. Power Plant Questions and Answers – Coal-Oil & Coal-Water Mixtures – II
advertisement
Power Plant Questions and Answers – Coal-Oil &
Coal-Water Mixtures – I
« Prev
Next »

This set of Power Plant Engineering Multiple Choice Questions & Answers (MCQs) focuses on
“Coal-Oil & Coal-Water Mixtures – I”.

1. Which of the following is not considered a type of coal according to ASTM?


a) anthracite
b) bituminous
c) peat
d) lignite
View Answer

Answer: c
Explanation: Because peat contains 90% of moisture and hence is not suitable as utility fuel.
advertisement

2. Which of the following is not directly determined in the Proximate Analysis of coal?
a) Volatile Matter
b) Fixed Carbon
c) Moisture
d) Ash
View Answer

Answer: b
Explanation: Fixed carbon is the difference between 100% and sum of the percentages of
volatile matter, moisture and ash.

3. Which of these is not a component of coal in Ultimate Analysis?


a) carbon
b) sulphur
c) ash
d) phosphor
View Answer

Answer: d
Explanation: This component is not determined in Ultimate Analysis.

4. If M and A represent the percentages of moisture and ash respectively, the dry and ash free
analysis in Ultimate Analysis is obtained on dividing other components by the fraction of?
a) {1-(M+A)}/100
b) {1-(M-A)}/100
c) {1-(A-M)}/100
d) 1-{(M+A)/100}
View Answer
Answer: d
Explanation: The fraction of ash and moisture is given by (M+A)/100. So the dry and ash free
part is 1-{(M+A)/100}.
advertisement

5. The extent of caking in coal is determined using __________


a) swelling index
b) grindability
c) weatherability
d) heating value
View Answer

Answer: a
Explanation: Swelling index is the quantitative evaluation method devised to determine the
extent of calling in coal.

6. Coke devoid of volatile matter is called __________


a) caking coal
b) free-burning coal
c) agglomerate
d) coke
View Answer

Answer: d
Explanation: Coke is the type of coal devoid of volatile matter.

7. Which of the following property is the inverse of the power required to grind coal to a
particular size for burning?
a) heating value
b) weatherabillity
c) grindability
d) sulphur content
View Answer

Answer: c
Explanation: This property of coal is measured by the standard Grindability Index.
advertisement

8. The design of steam generator greatly depends on __________


a) spontaneous combustion
b) sulphur content
c) ash softening temperature
d) heating value
View Answer

Answer: c
Explanation: The ash softening temperature is the temperature at which ash becomes plastic. If
the furnace temperature is higher, ash forms molten slag and causes trouble in discharge.

Sanfoundry Global Education & Learning Series – Power Plant Engineering.


To practice all areas of Power Plant Engineering, here is complete set of 1000+ Multiple Choice
Questions and Answers.
advertisement

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Power Plant Questions and Answers – Fuel Oil
» Next - Power Plant Questions and Answers – Coal-Oil & Coal-Water Mixtures – II
Categories Power Plant MCQsPost navigation
Power Plant Questions and Answers – Fuel Oil
Power Plant Questions and Answers – Coal-Oil & Coal-Water Mixtures – II
advertisement
advertisement

Recommended Posts:

1. Manufacturing Engineering / Processes I Questions and Answers


2. Engineering Materials and Metallurgy Questions and Answers
3. Microwave Engineering Questions and Answers
4. Basic Electrical Engineering Questions and Answers
5. Pulp & Paper Questions and Answers
6. Fluidization Engineering Questions and Answers
7. Engineering Physics II Questions and Answers
8. Energy Engineering Questions and Answers
9. Applied Chemistry Questions and Answers
10. Power Systems Questions and Answers
11. Power Electronics Questions and Answers
12. Waste Water Engineering Questions and Answers
13. Engineering Chemistry II Questions and Answers
14. Power Plant Questions and Answers
15. Engineering Chemistry Questions and Answers – Pulverised Coal
16. Power Plant Questions and Answers – Energy Analysis of Combined Cycles and Choice
of a Gas Turbine
17. Power Plant Questions and Answers – Fuel Oil
18. Energy Engineering Questions and Answers – Feed Water and Steam Generation System,
Working of Thermal Power Plant
19. Power Plant Questions and Answers – Synthetic Fuels, Biomass and Thermodynamic
View
20. Power Plant Questions and Answers – Mean Temperature of Heat Addition – 1
advertisement

Power Plant Questions and Answers – Coal-Oil &


Coal-Water Mixtures – II
« Prev
Next »

This set of Power Plant Interview Questions and Answers for Experienced people focuses on
“Coal-Oil & Coal-Water Mixtures – II”.

1. Presence of ______________ in dry gaseous fuel does not contribute its calorific value.
a) hydrogen
b) sulphur
c) oxygen
d) carbon
View Answer

Answer: c
Explanation: Oxygen does not contribute to the calorific value of dry gaseous fuels.
advertisement

2. Improper storage condition results weathering of coal and spontaneous combustion, which
increases its?
a) caking index
b) yield of carbonised products
c) calorific value
d) friability and oxygen content
View Answer

Answer: d
Explanation: Improper storage of coal causes loss of oxygen content, resulting in loss of heat
value.

3. Laboratory gas is obtained by cracking of __________


a) fuel oil
b) gasoline
c) kerosene
d) diesel
View Answer

Answer: c
Explanation: Kerosene on cracking gives laboratory gas.

4. Higher percentage of ash in coal meant for the production of metallurgical grade coke
__________
a) causes brittleness in coke
b) increases abrasion resistance of coke
c) decreases hardness of coke
d) causes high toughness
View Answer

Answer: b
Explanation: A high percentage of ash in coal meant for production of metallurgical grade coke
causes an increase in abrasion resistance in coke.
5. Carbon content by weight in air dried wood may be about _____________ %.
a) 25
b) 50
c) 10
d) 80
View Answer

Answer: b
Explanation: Air dried wood has carbon content of about 50%.
advertisement

6. Softening temperature of coal is a measure of which tendency of coal?


a) clinkering tendency
b) coking tendency
c) caking tendency
d) size tendency
View Answer

Answer: a
Explanation: Clinkering tendency is responsible for the softening of coal.

7. Combustion of pulverised coal as compared to lump coal __________


a) can be done with less excess air
b) develops a low temperature flame
c) develops a non-luminous flames
d) provides a lower rate of heat release
View Answer

Answer: a
Explanation: Pulverisation leads to less use of air.

8. Dry air required to burn 1kg of carbon completely may be around ________________ kg.
a) 11
b) 38
c) 2
d) 20
View Answer

Answer: a
Explanation: 11kg of dry air is required to burn 1kg of carbon.

9. ‘Fat coal’ means a coal having __________


a) high volatile matter
b) low ash content
c) low calorific value
d) non-smoking tendency
View Answer

Answer: a
Explanation: Coal having high volatile matter is called ‘fat coal’.
advertisement

10. A good quality coal should have __________


a) high ash content
b) high sulphur
c) low fusion point of ash
d) none of the mentioned
View Answer

Answer: d
Explanation: A good quality coal should have high carbon content.

11. Grindability of coal is 100. It implies that __________


a) it can’t be pulverised
b) it is easily pulverised
c) can be pulverised with difficulty
d) power consumption is high in pulverisation
View Answer

Answer: b
Explanation: High grindability of coal implies easy pulverisation.

12. The difference in total carbon and fixed carbon of coal will be minimum in case of
__________
a) lignite
b) bituminous coal
c) high temperature coke
d) anthracite
View Answer

Answer: c
Explanation: Out of these options, high temperature coke has minimum difference.

13. Fuel gases containing hydrocarbons are not preheated before burning, because __________
a) they crack, thereby choking and fouling heat transfer surface
b) it reduces calorific value tremendously
c) it reduces flame temperature tremendously
d) there are chances of explosion during preheating
View Answer

Answer: a
Explanation: Hydrocarbons crack easily, hence they are not preheated.
advertisement

Sanfoundry Global Education & Learning Series – Power Plant Engineering.

To practice all areas of Power Plant for Interviews, here is complete set of 1000+ Multiple
Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!
Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Power Plant Questions and Answers – Coal-Oil & Coal-Water Mixtures – I
» Next - Power Plant Questions and Answers – Synthetic Fuels, Biomass and Thermodynamic
View
Categories Power Plant MCQsPost navigation
Power Plant Questions and Answers – Coal-Oil & Coal-Water Mixtures – I
Power Plant Questions and Answers – Synthetic Fuels, Biomass and Thermodynamic View
advertisement
advertisement

Recommended Posts:

1. Fluidization Engineering Questions and Answers


2. Power Systems Questions and Answers
3. Applied Chemistry Questions and Answers
4. Power Electronics Questions and Answers
5. Waste Water Engineering Questions and Answers
6. Engineering Chemistry II Questions and Answers
7. Energy Engineering Questions and Answers
8. Power Plant Questions and Answers
9. Power Plant Questions and Answers – Mean Temperature of Heat Addition – 1
10. Power Plant Questions and Answers – Fuel Oil
11. Energy Engineering Questions and Answers – Feed Water and Steam Generation System,
Working of Thermal Power Plant
12. Applied Chemistry Questions and Answers – Analysis of Coal and Selection
13. Engineering Chemistry Questions and Answers – Carbonization of Coal
14. Engineering Chemistry Questions and Answers – Characteristics of Coal
15. Engineering Chemistry Questions and Answers – Coal – 1
16. Engineering Chemistry Questions and Answers – Analysis of Coal
17. Power Plant Questions and Answers – Combined Cycle Plants, Nuclear and Thermionic
Power Generation
18. Engineering Chemistry Questions and Answers – Coal – 2
19. Power Plant Questions and Answers – Synthetic Fuels, Biomass and Thermodynamic
View
20. Engineering Chemistry Questions and Answers – Pulverised Coal
advertisement

Power Plant Questions and Answers – Synthetic


Fuels, Biomass and Thermodynamic View
« Prev
Next »

This set of Power Plant Engineering Multiple Choice Questions & Answers (MCQs) focuses on
“ASynthetic Fuels, Biomass and Thermodynamic View”.

1. Production of producer gas from coke requires _____________ moles of nitrogen.


a) 3.76
b) 4.51
c) 2.23
d) 3.49
View Answer

Answer: a
Explanation: None.
advertisement

2. Which of the following mode is not used to liquefy coal?


a) hydrogenation
b) catalytic conversion
c) hydro pyrolysis
d) coal gasification
View Answer

Answer: d
Explanation: In coal gasification, coal is gasified in a situ and the gas is conveyed to the surface.
The other processes are methods of coal liquefaction.

3. What are the first products in Fischer-Tropsch process?


a) CO+H2
b) CO2 +H2
c) Coke + H2O
d) Coke
View Answer

Answer: a
Explanation: The first products in Fischer-Tropsch process are carbon monoxide and hydrogen.

4. ____________ prohibits the use of alcohols directly in petrol engines.


a) high cost and availability
b) low octane number
c) low flash point
d) low calorific value
View Answer

Answer: a
Explanation: High cost is the reason for no use of alcohols in petrol engines.
advertisement

5. Which of these is not a form of bioconversion route?


a) direct combustion
b) fermentation
c) thermochemical conversion
d) biochemical conversion
View Answer
Answer: b
Explanation: Fermentation is a breakdown of complex molecules in organic compounds. It is a
type of biochemical conversion.

6. Which of these is a product of pyrolysis process in dry thermochemical conversion?


a) methane
b) methanol
c) ammonia
d) pyrolytic oils
View Answer

Answer: d
Explanation: Pyrolytic oils, gas and char are the products of pyrolysis process.

7. Which of these is an important measure of performance in for a power plant?


a) NPHR
b) AP
c) NTO
d) HHV
View Answer

Answer: a
Explanation: NPHR- net plant heat rate is the most important measure of performance for power
plant. AP-auxillary power NTO-net turbine output NTHR-net turbine heat rate.
advertisement

8. The overall efficiency of a power plant is given by __________


a) 3600/NTO
b) 3600/AP
c) 3600/HHV
d) 3600/NPHR
View Answer

Answer: d
Explanation: The overall efficiency of a power plant is given by ɳ = 3600/NPHR.

Sanfoundry Global Education & Learning Series – Power Plant Engineering.

To practice all areas of Power Plant Engineering, here is complete set of 1000+ Multiple Choice
Questions and Answers.
advertisement

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Power Plant Questions and Answers – Coal-Oil & Coal-Water Mixtures – II
» Next - Power Plant Questions and Answers – Draught System
Categories Power Plant MCQsPost navigation
Power Plant Questions and Answers – Coal-Oil & Coal-Water Mixtures – II
Power Plant Questions and Answers – Draught System
advertisement
advertisement

Recommended Posts:

1. Mechanical Engineering Questions and Answers


2. Bioprocess Engineering Questions and Answers
3. Engineering Materials and Metallurgy Questions and Answers
4. Dairy Engineering Questions and Answers
5. PLC Programming Examples
6. Marine Engineering Questions and Answers
7. Applied Chemistry Questions and Answers
8. Engineering Chemistry II Questions and Answers
9. Power Electronics Questions and Answers
10. Power Systems Questions and Answers
11. Fluidization Engineering Questions and Answers
12. Energy Engineering Questions and Answers
13. Power Plant Questions and Answers
14. Power Plant Questions and Answers – Efficiencies in a Steam Power Plant – 2
15. Power Plant Questions and Answers – Advantages of Combined Cycle Power Generation
16. Energy Engineering Questions and Answers – Gaseous Fuels & Nuclear Fuels
17. Power Plant Questions and Answers – Coal Firing Systems – I
18. Power Plant Questions and Answers – Efficiencies in a Steam Power Plant – 1
19. Power Plant Questions and Answers – Magnetohydrodynamic Power Generation
20. Power Plant Questions and Answers – Pulverisation and Gasifiers
advertisement

Power Plant Questions and Answers – Draught


System
« Prev
Next »

This set of Power Plant Engineering Multiple Choice Questions & Answers (MCQs) focuses on
“Draught System”.

1. Which of these terms defines the pressure difference in the furnace?


a) draught
b) duct
c) stack
d) chimney
View Answer

Answer: a
Explanation: The term ‘draught’ is used to define the static pressure in the furnace, in the
various ducts and the stack.
advertisement
2. The draught or pressure difference for a chimney of height of H metres is given by?
a) Δp = gH(ρa-ρg)
b) Δp = gH(ρg-ρa)
c) Δp = gHρg
d) Δp = gH(ρa+ρg)
View Answer

Answer: a
Explanation: The draught produced is given by Δp = gH(ρa-ρg).

3. Which of these is not a type of mechanical draft system for a furnace?


a) balanced draft
b) induced draft
c) forced draft
d) actuated draft
View Answer

Answer: d
Explanation: The three types of mechanical drafts are balanced, induced and forced drafts.

4. Stack heat losses can be minimised by __________


a) using low c.v. fuels
b) controlling the excess air
c) oxygen enrichment of combustion air
d) maintaining proper draft in the furnace
View Answer

Answer: b
Explanation: Excess amount of air leads to significant losses in energy due to heat loss through
flue gases.
advertisement

5. Which of these accentuates clinkering trouble on furnace grate burning coal?


a) low reactivity of carbonised residue containing high proportions of iron and sulphur
b) low forced draught and low fuel bed temperature
c) thick fire bed and preheated primary air
d) all of the mentioned
View Answer

Answer: d
Explanation: All these reasons lead to clinkering.

6. Natural draught produced by a chimney depends upon __________


a) density of chimney gases
b) height of chimney
c) both ‘density of chimney gases’ and ‘height of chimney’
d) none of the mentioned
View Answer
Answer: c
Explanation: Natural draught depends on density of gases in chimney and its height.

7. In a furnace employing forced draught compared to induced draught __________


a) the fan operates hot and hence blades are liable to corrosion and erosion
b) positive pressure exists in the furnace
c) air is sucked in, so air leaks are more and hence furnace efficiency is reduced
d) none of the mentioned
View Answer

Answer: c
Explanation: A positive pressure exists in the furnace employing forced draught.
advertisement

8. Which of the following types of the fans has the highest cost?
a) centrifugal fans
b) axial fans
c) primary fans
d) gas recirculation fans
View Answer

Answer: b
Explanation: Axial fans have the highest cost.

9. Which of these is not a type of drive of variable speed control?


a) variable speed turbine
b) hydraulic coupling
c) multiple speed ac motor
d) electronically adjustable turbine drive
View Answer

Answer: d
Explanation: Except ‘electronically adjustable turbine drive’, all other are a type of drive in
variable speed control.

Sanfoundry Global Education & Learning Series – Power Plant Engineering.


advertisement

To practice all areas of Power Plant Engineering, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Power Plant Questions and Answers – Synthetic Fuels, Biomass and Thermodynamic
View
» Next - Power Plant Questions and Answers – Heat of Combustion-I
Categories Power Plant MCQsPost navigation
Power Plant Questions and Answers – Synthetic Fuels, Biomass and Thermodynamic View
Power Plant Questions and Answers – Heat of Combustion-I
advertisement
advertisement

Recommended Posts:

1. Fluidization Engineering Questions and Answers


2. Hydraulic Machines Questions and Answers
3. Farm Machinery Questions and Answers
4. C# Programming Examples on Data Structures
5. Steam and Gas Turbines Questions and Answers
6. Home
7. Thermal Engineering Questions and Answers
8. Energy Engineering Questions and Answers
9. Power Electronics Questions and Answers
10. Power Systems Questions and Answers
11. Power Plant Questions and Answers
12. Power Plant Questions and Answers – Thermodynamics of Brayton-Rankine Combined
Plant – I
13. Power Plant Questions and Answers – Steam Power Plant Appraisal
14. Power Plant Questions and Answers – Combined Cycle Plants, Nuclear and Thermionic
Power Generation
15. Power Plant Questions and Answers – Pulverisation and Gasifiers
16. Power Plant Questions and Answers – Supercritical Pressure Cycle and Layout of a Stem
Power Plant
17. Power Plant Questions and Answers – Gas Turbine-Steam Power Plant – III
18. Power Plant Questions and Answers – Fire Tube Boilers – II
19. Power Plant Questions and Answers – Turbine Blading – II
20. Power Plant Questions and Answers – Steam Power Plant
advertisement

Power Plant Questions and Answers – Heat of


Combustion-I
« Prev
Next »

This set of Power Plant Engineering Multiple Choice Questions & Answers (MCQs) focuses on
“Heat of Combustion-I”.

1. Internal energy of combustion products is ______________ than that of reactants.


a) less
b) more or less (depends on state of fuel)
c) same
d) more
View Answer
Answer: a
Explanation: The internal energy of combustion is given by uRP=UP-UR which gives a negative
value.
advertisement

2. Higher efficiency in combustion of solid fuel cannot be achieved by ___________


a) keeping flue gas temperature very high
b) proper fuel preparation
c) supplying correct quantity of combustion air
d) adopting efficient fuel-firing technique and equipment
View Answer

Answer: a
Explanation: Keeping flue gas temperature very high does not result in increased efficiency of
solid fuel.

3. Bomb calorimeter is used determine the calorific value of ___________


a) solid fuels
b) liquid fuels
c) both solid and liquid fuels
d) none of the mentioned
View Answer

Answer: c
Explanation: Bomb calorimeter can be used to determine the calorific value of both solid and
liquid fuels.

4. Which of these is not a reason for reduction in maximum flame temperature in actuality?
a) incomplete combustion
b) heat loss to exhaust gases
c) excess air requirements
d) heat loss to surroundings
View Answer

Answer: b
Explanation: Maximum flame temperature is defined on the temperature of products; hence it
cannot be a reason for reduction in flame temperature.

5. Grindability index of a coal is 100. It implies that the __________


a) coal can be easily pulverised
b) coal can be pulverised with great difficulty
c) coal can’t be pulverised
d) power consumption in grinding the coal will be very high
View Answer

Answer: a
Explanation: Grindability of an object is the ease with which the object can be reduced into
powdered form. A measure of the same is the Grindability index of coal.
advertisement
6. Tar yield in the low temperature and high temperature carbonisation of dry coal may be
respectively __________ percent.
a) 10 & 3
b) 3 & 10
c) 15 & 8
d) 10 & 20
View Answer

Answer: a
Explanation: Tar yield in the low temperature and high temperature carbonisation of dry coal
may be respectively 10 & 3 percent.

7. High amount of sulphur and phosphorous in coke causes __________


a) decrease in its calorific value
b) increase in its strength
c) brittleness of steel made by using it
d) none of the mentioned
View Answer

Answer: d
Explanation: None of the effects are caused by the increased strength of sulphur & phosphorus
in coke.

8. The difference between the enthalpy of products & the enthalpy of reactants when complete
combustion occurs at specific temperature & pressure is called?
a) Enthalpy of burning
b) Enthalpy of Combustion
c) Enthalpy of complete combustion
d) None of the mentioned
View Answer

Answer: b
Explanation: Enthalpy of Combustion is defined as, “The difference between the enthalpy of
products & the enthalpy of reactants when complete combustion occurs at specific temperature
& pressure”.

9. The internal energy of products minus the internal energy of reactants for complete
combustion at specific temperature & pressure gives the internal energy of?
a) combustion
b) partial combustion
c) complete combustion
d) none of the mentioned
View Answer

Answer: a
Explanation: The internal energy of products minus the internal energy of reactants is called the
internal energy of combustion.
advertisement
10. HCV stands for?
a) Higher Combustion Value
b) Higher Convection Value
c) Higher Calorific Value
d) Higher Calorific Value
View Answer

Answer: d
Explanation: HCV is an acronym for High Calorific Value.

Sanfoundry Global Education & Learning Series – Power Plant Engineering.

To practice all areas of Power Plant Engineering, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Power Plant Questions and Answers – Draught System
» Next - Power Plant Questions and Answers – Heat of Combustion – II
Categories Power Plant MCQsPost navigation
Power Plant Questions and Answers – Draught System
Power Plant Questions and Answers – Heat of Combustion – II
advertisement
advertisement

Recommended Posts:

1. Thermodynamics Questions and Answers


2. Engineering Chemistry I Questions and Answers
3. Power Electronics Questions and Answers
4. Heat Transfer Questions and Answers
5. Steam and Gas Turbines Questions and Answers
6. Bioprocess Engineering Questions and Answers
7. Rocket Propulsion Questions and Answers
8. Chemical Engineering Questions and Answers
9. Chemical Process Calculation Questions and Answers
10. IC Engine Questions and Answers
11. Automobile Engineering Questions and Answers
12. Power Systems Questions and Answers
13. Heat Transfer Operations Questions and Answers
14. Applied Chemistry Questions and Answers
15. Energy Engineering Questions and Answers
16. Engineering Chemistry II Questions and Answers
17. Power Plant Questions and Answers
18. Power Plant Questions and Answers – Combined Cycle Plants, Nuclear and Thermionic
Power Generation
19. Power Plant Questions and Answers – Gas Turbine-Steam Power Plant – I
20. Power Plant Questions and Answers – Mean Temperature of Heat Addition – 1
advertisement

Power Plant Questions and Answers – Heat of


Combustion – II
« Prev
Next »

This set of Power Plant test focuses on “Heat of Combustion-II”.

1. The heat transferred when the H2O in the products is in the liquid state is called?
a) HCV
b) LCV
c) LHV
d) None of the mentioned
View Answer

Answer: a
Explanation: The heat transferred when the H2O in the products is in the liquid state is called
HCV [Higher Calorific Value].
advertisement

2. The heat transferred when the H2O in the products is in the vapour state is called?
a) HCV
b) LCV
c) HHV
d) None of the mentioned
View Answer

Answer: b
Explanation: The heat transferred when the H2O in the products is in the vapour state is called
LCV [Lower Calorific Value].

3. The maximum temperature achieved for given reactants is called?


a) Practical Flame Temperature
b) Critical Temperature
c) Theoretical Flame Temperature
d) None of the mentioned
View Answer

Answer: c
Explanation: Theoretical Flame Temperature is the maximum temperature achieved for given
reactants.

4. Maximum Theoretical Flame Temperature corresponds to _____________


a) Partial Combustion
b) Incomplete Combustion
c) Complete combustion
d) None of the mentioned
View Answer

Answer: c
Explanation: Maximum Theoretical Flame Temperature corresponds to Complete Combustion.
advertisement

5. In pure oxygen, the maximum flame temperature is _____________


a) higher than the theoretical flame temperature
b) lower than the theoretical flame temperature
c) equal to the theoretical flame temperature
d) none of the mentioned
View Answer

Answer: a
Explanation: In pure oxygen, the maximum flame temperature is higher than the theoretical
flame temperature because of dilution effect of Nitrogen.

6. Maximum permissible temperature in a gas turbine is?


a) Fixed
b) Variable
c) Linearly increasing
d) Linearly decreasing
View Answer

Answer: a
Explanation: Maximum permissible temperature in a gas turbine is Fixed from metallurgical
considerations.

7. Dissociation is directly proportional to temperature.


a) True
b) False
View Answer

Answer: a
Explanation: Dissociation is directly proportional to temperature as when the temperature
increases, the amount of dissociation also increases & vice-versa.
advertisement

8. Spontaneity of a chemical reaction depends on?


a) Enthalpy of reaction
b) Energy of reaction
c) Gibbs Free Energy
d) None of the mentioned
View Answer

Answer: c
Explanation: Gibbs free energy is the parameter which determines the spontaneity of the
reaction after determining its randomness.
9. For exothermic reactions, free energy change is?
a) positive
b) negative
c) zero
d) none of the mentioned
View Answer

Answer: b
Explanation: Gibbs free energy is the parameter which determines the spontaneity of the
reaction after determining its randomness. For exothermic reactions, this energy difference has
to be negative.

Sanfoundry Global Education & Learning Series – Power Plant Engineering.


advertisement

To practice all areas of Power Plant for tests, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest


Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
« Prev - Power Plant Questions and Answers – Heat of Combustion-I
» Next - Power Plant Questions and Answers – Heat of Combustion-III
Categories Power Plant MCQsPost navigation
Power Plant Questions and Answers – Heat of Combustion-I
Power Plant Questions and Answers – Heat of Combustion-III
advertisement
advertisement

Recommended Posts:

1. Basic Electrical Engineering Questions and Answers


2. Electric Circuits Questions and Answers
3. Biotechnology Questions and Answers
4. Mechanical Engineering Questions and Answers
5. Engineering Physics I Questions and Answers
6. Rocket Propulsion Questions and Answers
7. Engineering Chemistry II Questions and Answers
8. Automobile Engineering Questions and Answers
9. IC Engine Questions and Answers
10. Energy Engineering Questions and Answers
11. Thermodynamics Questions and Answers
12. Bioprocess Engineering Questions and Answers
13. Power Electronics Questions and Answers
14. Chemical Process Calculation Questions and Answers
15. Heat Transfer Operations Questions and Answers
16. Steam and Gas Turbines Questions and Answers
17. Power Systems Questions and Answers
18. Chemical Engineering Questions and Answers
19. Heat Transfer Questions and Answers
20. Power Plant Questions and Answers
advertisement
Seat No -
Total number of questions : 60

10270_THEORY OF COMPUTATION
Time : 1hr
Max Marks : 50
N.B

1) All questions are Multiple Choice Questions having single correct option.

2) Attempt any 50 questions out of 60.

3) Use of calculator is allowed.

4) Each question carries 1 Mark.

5) Specially abled students are allowed 20 minutes extra for examination.

6) Do not use pencils to darken answer.

7) Use only black/blue ball point pen to darken the appropriate circle.

8) No change will be allowed once the answer is marked on OMR Sheet.

9) Rough work shall not be done on OMR sheet or on question paper.

10) Darken ONLY ONE CIRCLE for each answer.

Q.no 1. Which of the following does not belong to the language if input alphabet set is
a,b

A:a

B:b

C : epsilon

D:c

Q.no 2. Which of the following regular expressions represents the set of strings which
do not contain a substring ‘rt’ if alphabet = {r, t}

A : (rt)*

B : (tr)*

C : (r*t*)
D : (t*r*)

Q.no 3. If there exists a language L, for which there exists a TM, T, that accepts every
word in L and either rejects or loops for every word that is not in L, is called

A : Recursive

B : Recursively Enumerable

C : NP-HARD

D : NP Complete

Q.no 4. Recursive languages are also known as:

A : decidable

B : Undecidable

C : sometimes decidable

D : infinite

Q.no 5. Which of the production rule can be accepted by Chomsky grammar. (i) A->BC,
(ii) A->a

A : only i

B : only ii

C : both i and ii

D : neither i nor ii

Q.no 6. Which of the following is true?

A : Every subset of a regular set is regular

B : Every finite subset of non-regular set is regular

C : The union of two non regular set is not regular

D : Infinite union of finite set is regular

Q.no 7. A push down automata is different than finite automata by

A : Its memory

B : number of states
C : start state

D : input symbols

Q.no 8. Turing machine is more powerful than (a) Finite automata, (b) Push down
automata

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Neither (a) nor (b)

Q.no 9. Turing machine was invented by

A : Alan Turing

B : Turing man

C : Turing taring

D : Turling Bake

Q.no 10. Construct a regular expression for the language that contains strings having at
least one pair of consecutive zeros over {0, 1}.

A : (100)*

B : 1* (00)* 1*

C : [ (1 + 0 )* (00) (1 + 0 )*] +

D : ((0+1)(0+1))*

Q.no 11. Why Palindromes cannot be recognized by any FSM ?

A : an FSM cannot deterministically fix the mid-point

B : an FSM can remember arbitrarily large amount of information

C : FSM has finite memory

D : FSM has only 5 tuples

Q.no 12. _________ is the class of decision problems that can be solved by non-
deterministic polynomial algorithms?
A : NP

B:P

C : Hard

D : Complete

Q.no 13. NPDA stands for

A : non deterministic pushup automata

B : null pushdown automata

C : nested pushdown automata

D : non deterministic pushdown automata

Q.no 14. A Turing machine with several tapes in known as

A : Multi-tape Turing machine

B : Poly-tape Turing maching

C : Universal Turing machine

D : Complete Turing machine

Q.no 15. 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*

B : R = P*Q

C : R = RP

D : R = QP

Q.no 16. Which among the following are incorrect regular identities?

A:

B:
C:

D:

Q.no 17. Which of the following are the actions that operates on stack top?

A : only push

B : only pop

C : only push and pop

D : push, pop and replace

Q.no 18. A deterministic Turing machine is

A : Ambiguous Turing Machine

B : Unambiguous Turing Machine

C : Non-Deterministic Finite Automata

D : Deterministic Finite Automata

Q.no 19. Bottom-up parsers use

A : leftmost derivation

B : rightmost derivation

C : rightmost derivation in reverse order

D : leftmost derivation in reverse order

Q.no 20. 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

B : Decidable

C : Undecidable

D : NP-HARD

Q.no 21. Which of the given problems are NP-complete?


A : (a) Traveling Salesman Problem

B : (b) Satisfiability Problem

C : Both (a) and (b)

D : Turing Machine

Q.no 22. The production of the form A->B , where A and B are non terminals is called

A : Null production

B : Greibach Normal Form

C : Unit production

D : Chomsky Normal Form

Q.no 23. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which the total number of a’s is divisible by 2.

A : ((a+b)(a+b))*

B : (a + ab)*

C : ( b* a b*ab*)* + b*

D : a* b (aa)*b a*

Q.no 24. Which of the following statement(s) are correct? (a) All languages can be
generated by CFG, (b) Any regular language has an equivalent CFG, (c) Some non
regular languages cannot be generated by CFG.

A : only (a)

B : Only (b)

C : Only (c)

D : Both (b) and (c)

Q.no 25. A grammar G=(V,T,P,S) in which V represents

A : Set of Nonterminals

B : Start symbol

C : Set of terminals
D : Production

Q.no 26. A PDA chooses the next move based on

A : current State and input

B : current state, stack and input

C : current state and stack

D : current state

Q.no 27. In multi head Turing machine there are

A : More than one heads of the Turing machine

B : More than one input tapes of Turing machine

C : Similar to the basic model of Turing machine

D : More than one input symbols of Turing machine

Q.no 28. Construct a regular expression for the language that contains strings having
no pair of consecutive zeros over {0, 1}.

A : (1+0)*

B:

C : ((0+1)(0+1))*

D : (01 + 10)*

Q.no 29. The difference between number of states in FA for regular expression (a + b)
and (a + b) * is:

A:1

B:2

C:3

D:0

Q.no 30. Which of the following statement is false?

A : Context free language is the subset of context sensitive language


B : Regular language is the subset of context sensitive language

C : Recursively ennumerable language is the super set of regular language

D : Context sensitive language is a subset of context free language

Q.no 31. Which among the following is the LEAF of the parse tree?

A : Production P

B : Nonterminal V

C : Terminal T

D : Starting symbol S

Q.no 32. The ability for a system of instructions to simulate a Turing Machine is called
_________

A : Turing Completeness

B : Simulation

C : Turing Halting

D : Computability

Q.no 33. Which of the following statement is false?

A : Every language that is defined by regular expression can also be defined by finite
automata

B : Every language defined by finite automata can also be defined by regular expression

C : We can convert regular expressions into finite automata

D : There exists a unique DFA for every regular language

Q.no 34. Which of the following statements is false?

A : For every non-deterministic Turing machine, there exists an equivalent deterministic


Turing machine.

B : Turing recognizable languages are closed under union and complement.

C : Turing decidable languages are closed under intersection


and complement.

D : Turing recognizable languages are closed under union and intersection.


Q.no 35. How many strings of length less than 4 contain the language described by the
regular expression (x+y)*y(a+ab)*

A:7

B : 10

C : 12

D : 11

Q.no 36. An instantaneous description of Turing machine consists of

A : Present state and input to be processed

B : Present state and entire input to be processed

C : Present input only

D : Present state only

Q.no 37. According to the given language, which among the following expressions does
it corresponds to Language L={xϵ{0,1}|x is of length 4 or less}

A : (0+1+0+1+0+1+0+1)^4

B : (0+1)^4

C : (01)^4

D : (0+1+ε)^4

Q.no 38. Identify the following problem: If G=(V, E) and V' is subset of V, then V' is an
independent set iff no two nodes in V' are connected by an edge in E.

A : Satisfiability

B : Independent set

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 39. Which of the following is analogous to the NFA and NPDA ?

A : Regular language and Context Free language

B : Regular language and Context Sensitive language


C : Context free language and Context Sensitive language

D : Unrestricted language

Q.no 40. Given grammar G:


(1)S->AS (2)S->AAS (3)A->SA (4)A->aa
Which of the following productions denies the format of Chomsky Normal Form?

A : 2,4

B : 1,3

C : 1, 2, 3, 4

D : 2, 3, 4

Q.no 41.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 42.

A:A
B:B

C:C

D:D

Q.no 43. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 44. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 45. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's


Q.no 46. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 47. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 48. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 49. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS
B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 50. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 51. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 52. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?
A:

B:

C:

D:

Q.no 53. Which of the following statement is false.


A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 54. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 55. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.

A:
B:

C:

D:

Q.no 56. For two regular languages


L1 = (a + b)* a
and
L2 = b (a + b ) *
the intersection of L1 and L2 is given by

A : (a + b ) * ab
B : ab (a + b ) *

C:a(a+b)*b

D : b (a + b ) * a

Q.no 57. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II

B : Only III

C : Only I and II

D : Only I and III

Q.no 58. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".

A:

B:

C:
D:

Q.no 59.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 60. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2

Q.no 1. If the PDA does not stop on an accepting state and the stack is not empty, the
string is

A : rejected

B : goes into loop forever

C : rejected and goes into loop forever

D : accepted

Q.no 2. Number of states required to accept strings ending with 101


A:3

B:4

C:2

D : cannot be represented.

Q.no 3. What is the Regular Expression Matching Zero or More Specific Characters

A:x

B:#

C:*

D:&

Q.no 4. What is the value of n if Turing machine is defined using n-tuples?

A:6

B:7

C:8

D:5

Q.no 5. Which one of the following languages over the alphabet {0, 1} is described by
the regular expression: (0+1)*0(0+1)*0(0+1)*

A : The set of all strings containing the substring 00

B : The set of all strings containing at most two 0’s

C : The set of all strings containing at least two 0’s

D : The set of all strings that begin and end with either 0 or 1

Q.no 6. Which of the following is not a part of 5-tuple finite automata?

A : Input alphabet

B : Transition function

C : Initial State

D : Output alphabet
Q.no 7. Pushdown automata accepts

A : regular language

B : context free language

C : context sensitive language

D : unrestricted language

Q.no 8. What is the pumping length of string of length x?

A : x+1

B:x

C : x-1

D : x2

Q.no 9. In CFG, notation of VARIABLE representation is

A : Captal Letters

B : Small Letters

C : Italic Letters

D : Roman Letters

Q.no 10. PDA is more powerful than

A : Turing Machine

B : Finite Automata

C : Linear Bounded Automata

D : Non Deterministic Turing Machine

Q.no 11. Turing Machine can update symbols on its tape, whereas the FA cannot update
symbols on tape.

A : true

B : false

C : Cannot say
D : May be

Q.no 12. An algorithm is called efficient if it runs in ____________ time on a serial


computer.

A : Polynomial

B : Non polynomial

C : Logarithmic

D : Non Logarithmic

Q.no 13. Which of the following is false for a grammar G in Chomsky Normal Form:

A : G has no useless symbols

B : G has no unit productions

C : G has no epsilon productions

D : G must have useless symbols

Q.no 14. Top-down parsers use the grammar

A : LL(K)

B : LR(K)

C : SLR(K)

D : CLR(K)

Q.no 15. A Turing machine operates over

A : Finite memory tape

B : Infinite memory tape

C : Depends on the algorithm

D : Depends on the input

Q.no 16. PDA accepts languages generated by which grammar

A : type 0

B : type 1
C : type 2

D : type 3

Q.no 17. If T1 and T2 are two Turing machines, the composite can be represented using
the expression

A : T1 T2

B : T2 T1

C : T1 X T2

D : T2 X T1

Q.no 18. Which of the following are not quantifiers?

A : Kleene plus +

B : Kleene star *

C : Question mark ?

D : Union

Q.no 19. Transition function of DFA machine maps.

A:

B:

C:

D:

Q.no 20. Which of these does not belong to CFG?

A : Terminal Symbol

B : Non Terminal Symbol

C : Start symbol

D : End symbol
Q.no 21.

A : {w | w is a string of odd length}

B : {w | w is a string of length multiple of 3}

C : {w | w is a string of length 3}

D : {w | w is an empty string}

Q.no 22. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which any occurrence of the symbol b, is in
groups of odd numbers.

A : (abbb)*

B : a* b (bb)* a*

C : ((a+b)(a+b)(a+b))*

D : a* b* (bb)* a*

Q.no 23. The worst-case efficiency of solving a problem in polynomial time is?

A : O(p(n))

B : O(p( n log n))

C:

D : O(p(m log n))

Q.no 24. According to Chomsky hierarchy, which of the following is recognized by


Recursively Enumerable language?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 25. Every CFG can be transformed into equivalent NPDA.


A : false

B : true

C : may be

D : cannot say

Q.no 26. Which of the following is a regular language?

A : String whose length is a sequence of prime numbers

B : String with substring wwr in between

C : Palindrome string

D : String with even number of Zeroes

Q.no 27. Which of the following statements is incorrect?

A : A Turing Machine cannot solve Halting problem

B : Set of recursively enumerated languages is closed under union

C : A FSM with 3 stacks is more powerful than FSM with 2 stacks

D : Context sensitive grammar can be recognized by a linearly bounded memory machine.

Q.no 28. The instantaneous description is PDA shows

A : present state, string to be processed and stack symbol

B : present state and stack symbol

C : present state and string to be processed

D : stack symbol and string to be processed

Q.no 29. It is less complex to prove the closure properties over regular languages using

A : NFA

B : DFA

C : PDA

D : Canot be said
Q.no 30. Which of the following represents a language which has no pair of consecutive
1’s if alphabet = {0,1}?

A:

B:

C:

D:

Q.no 31. The minimum number of productions required to produce a language


consisting of palindrome strings over T={a,b} is

A:3

B:7

C:5

D:6

Q.no 32. A PDA machine configuration (p, w, y) can be correctly represented as

A : unprocessed input, stack content, current state

B : current state, unprocessed input, stack content

C : current state, stack content, unprocessed input

D : stack content, current state, unprocessed input

Q.no 33. Which among the following is not true for 2-way infinte TM?

A : Tape in both directions

B : Leftmost square not distinguished

C : Any computation that can be performed by 2-way infinite tape can also be performed by
standard TM.

D : Tape is only in one direction.


Q.no 34. Which of the following statement is false?

A : For non deterministic PDA, equivalence is undecidable.

B : For deterministic PDA, equivalence is decidable.

C : For deterministic PDA, equivalence is undecidable.

D : For non deterministic PDA, equivalence is decidable.

Q.no 35. CFGs are more powerful than (a) DFA, (b) NDFA, (c) Mealy Machine

A : Only (a)

B : Only (b) and (c)

C : Only (a) and (c)

D : (a), (b) and (c)

Q.no 36. Number of external states of a UTM should be atleast

A:1

B:2

C:3

D:4

Q.no 37. The complexity class P consist of all the decision problems that can be solved
by ___________using polynomial amount of computation time.

A : Push Down automata

B : DFA

C : NDFA

D : Deterministic Turing machine

Q.no 38. The automaton which allows transformation to a new state without consuming
any input symbols:

A : NFA

B : DFA

C : Epsilon NFA
D : PDA

Q.no 39. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings without double a?

A:

B : ((a+b)(a+b))*

C : (a + bb)*

D:

Q.no 40.

A:

B:

C:

D : {0, 1}

Q.no 41. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 42. The CFG "S-> aS | bS |a|b " is equivalent to regular expression

A : (a + b)

B : (a + b) (a + b)*
C : (a + b) (a + b)

D : (a . b) (a . b)

Q.no 43. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 44. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 45. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 46. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011
Q.no 47. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 48. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 49. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:
Q.no 50. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 51. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab

A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 52. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 53. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal


Q.no 54. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 55. Which of the following are decidable?


I. Whether the intersection of two regular languages is infinite
II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 56. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 57. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted


Q.no 58.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable

Q.no 59. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 60. CFG is not closed under

A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 1. The symbol Z0 in formal definition of PDA is used for

A : input symbol

B : stack symbol
C : output symbol

D : tape symbol

Q.no 2. Kruskal's algorithm is used to find

A : whether there is cycle in the graph

B : spanning tree of the graph

C : minimum spanning tree in the graph

D : whether there is spanning tree in the graph

Q.no 3. Which of the following is true?

A : (01)*0 = 0(10)0*

B : (0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*

C : (0+1)*01(0+1)*+1*0* = (0+1)*0

D : (01)*01 = 0(10)0*1

Q.no 4. Which of the following are the actions that operates on stack top?

A : only push

B : only pop

C : only push and pop

D : push, pop and replace

Q.no 5. Finite state machine is ___________tuple machine.

A:4

B:5

C:6

D : unlimitted

Q.no 6.
A:R

B:

C : R*

D:

Q.no 7.

A:

B:

C:L

D : L*

Q.no 8. Bottom-up parsing is also known as

A : shift reduce parsing

B : predictive descent parsing

C : operator precedence parsing

D : LL1 Parsing

Q.no 9.

A:

B:

C:0

D:1

Q.no 10. Precedence of regular expression in decreasing order is

A:*,.,+
B:.,*,+

C:.,+,*

D:+,.,*

Q.no 11. Those problems that are solvable in polynomial time belong to __

A : NP

B:P

C : Hard

D : Complete

Q.no 12. Halting states are of two types. They are:

A : accept and reject

B : reject and allow

C : start and reject

D : start and accept

Q.no 13. Which among the following is the format of unit production?

A : A->B

B : A->b

C : B->Aa

D : B->aA

Q.no 14. Which operation can be applied on stack

A : Push

B : Pop

C : Push and Pop

D : Read

Q.no 15.
A : Always starts with b

B : Can have any number of ba and ab

C : Can not have 2 b's together.

D : Starts and end with same symbol

Q.no 16. To simplify a grammar we can eliminate

A : Useful symbols

B : epsilon productions

C : Reachable symbols

D : Non Unit productions

Q.no 17. Halting problem is an example for

A : decidable problem

B : undecidable problem

C : complete problem

D : trackable problem

Q.no 18. The language accepted by a Turing machine is called ………. language.

A : Regular

B : Recursively Enumerable

C : Context free

D : Context sensitive

Q.no 19. Which among the following are incorrect regular identities?

A:

B:

C:
D:

Q.no 20. How many states a Turing machine has?

A : Finite

B : Infinite

C : May be finite

D : One

Q.no 21. If r1 = (aa + bb) and r2 = (a + b) then the language (aa + bb)(a + b) will be
generated by

A : (r1)(r2)

B : (r1 + r2)

C : (r2)(r1)

D : (r1)

Q.no 22. The variable which produces


epsilon is called

A : Empty variable

B : Nullable variable

C : Non-empty variable

D : Non-nullable variable

Q.no 23. Which of the following is in 2-CNF?

A : (e1 Ʌ e2) Ʌ (e1 Ʌ ~e2)

B : (e1 Ʌ e2) Ʌ (e1 V ~e2)

C : (e1 V e2) Ʌ (e1 V ~e2)

D : (e1 V e2) Ʌ (e1 Ʌ ~e2)

Q.no 24. Which of the following pairs have different expressive power

A : Deterministic Finite Automata (DFA) and Non-deterministic Finite Automata (NFA)


B : Deterministic Push Down Automata (DPDA) and Non-deterministic Push Down Automata
(NPDA)

C : single tape turing machine and multi tape turing machine

D : deterministic single tape and nondeterministic single tape turing machine

Q.no 25. Language is accepted by PDA if it is

A : regular language

B : context free language

C : unrestricted

D : regular and context free

Q.no 26. Which of the following is a false statement?

A : Moore machine has no accepting states

B : Mealy machine has no accepting states

C : We can convert Mealy to Moore and vice versa

D : We can convert Mealy to Moore but not vice versa

Q.no 27. A non-deterministic pushdown automaton can be converted into an equivalent


deterministic pushdown automaton.

A : never

B : not always

C : always

D : maybe

Q.no 28. The power of non-deterministic pushdown automata and deterministic


pushdown automata is not same.

A : true

B : false

C : maybe

D : cannot say
Q.no 29. The travelling salesman problem can be solved using _________

A : A spanning tree

B : A minimum spanning tree

C : Bellman – Ford algorithm

D : DFS traversal

Q.no 30. The minimum number of 1’s to be used in a regular expression of the given
language of all strings containing exactly 2 zeroes.

A:2

B:3

C:0

D:1

Q.no 31. An Epsilon-NFA is ___________ in representation.

A : Quadruple

B : Quintuple

C : Triple

D : None of the mentioned

Q.no 32. In multi head Turing machine there are

A : More than one heads of the Turing machine

B : More than one input tapes of Turing machine

C : Similar to the basic model of Turing machine

D : More than one input symbols of Turing machine

Q.no 33. Choose the incorrect statement.

A : Moore and Mealy machines are FSM with output capabilities

B : Any given Moore machine has an equivalent Mealy machine

C : Any given Mealy machine has an equivalent Moore machine


D : Moore machine is not an FSM

Q.no 34. The difference between Turing Machine and Two Way FA is in:

A : Input Tape

B : Read Write Head

C : Finite Control

D : All of these

Q.no 35. The worst case complexity of a deterministic problem to find the satisfiability
of a given formula of n variables is

A : O(n)

B : O(n^2)

C : O(n^3)

D : O(2^n)

Q.no 36. The basic limitation of finite automata is that

A : It cannot remember arbitrary large amount of information.

B : It sometimes recognize grammar that are not regular.

C : It sometimes fails to recognize regular grammar.

D : It sometimes fails to recognize regular laguage

Q.no 37. Let the class of language accepted by finite state machine be L1 and the class
of languages represented by regular expressions be L2 then

A : L1<L2

B : L1>=L2

C : L1!=L2

D : L1=L2

Q.no 38. The regular expression with all strings of 0′s and 1′s with at least two
consecutive 0′s is:

A : 1 + (10)*
B : (0+1)*00(0+1)*

C : (0+1)*011

D : 0*1*2*

Q.no 39. The difference between number of states in FA for regular expression (a + b)
and (a + b) * is:

A:1

B:2

C:3

D:0

Q.no 40. Which of the following pairs have DIFFERENT expressive power?

A : Deterministic finite automata (DFA) and Non-Deterministic finite automata(NFA)

B : Deterministic push down automata (DPDA) and Non-deterministic pushdown automata


(NPDA)

C : Deterministic single-tape Turing machine and Non-deterministic single-tape Turing


Machine

D : Single-tape Turing machine and multi-tape Turing machine

Q.no 41. The following Turing machine acts like


A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 42. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 43. Construct a Turing machine which accepts a string with ‘aba’ as its substring.

A:

B:
C:

D:

Q.no 44. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 45. For two regular languages


L1 = (a + b)* a
and
L2 = b (a + b ) *
the intersection of L1 and L2 is given by

A : (a + b ) * ab

B : ab (a + b ) *

C:a(a+b)*b
D : b (a + b ) * a

Q.no 46. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD

D:DA

Q.no 47.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 48. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard
Q.no 49. The minimum number of productions required to produce a language
consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2

Q.no 50.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 51. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.

A:
B:

C:

D:

Q.no 52. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a
D : (a+b)(a+b)*

Q.no 53. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 54. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".

A:

B:

C:

D:
Q.no 55. Context free grammar having the following production
X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar

Q.no 56. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 57. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar

Q.no 58. Which of the following grammars are in Chomsky Normal Form:

A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 59. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's

D : has atleast two a's

Q.no 60. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable

Q.no 1. Consider following regular expression


i) (a|b)* ii) (a*|b*)* iii) ((a)*b*)* Which of the following statements is correct?
A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : all are equal

Q.no 2. Regular expression x + y denotes the set

A : {x,y}

B : {xy}

C : {x}

D : {y}

Q.no 3. Universal TM influenced the concept of

A : Stored program computers

B : Interpretive implementation of programming languages

C : Computability

D : All of these

Q.no 4. Can we convert PDA to equivalent CFG?

A : yes

B : no

C : maybe

D : never

Q.no 5. The minimum number of states required to recognize an octal number divisible
by 3 is

A:1

B:3

C:5

D:7
Q.no 6. Identify the problem: Given a graph G = <V, E>, and a starting node a, does it
have a tour cost less than k?

A : Satisfiability

B : Independent set

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 7. Turing Machine also behaves like General purpose computer and that TM is
known as _______

A : Multi-tape Turing Machine

B : Poly-tape Turing Machine

C : Universal Turing Machine

D : Deterministic Finite Automata

Q.no 8. Which of the following pair of regular expressions are not equivalent?

A : 1(01)* and (10)*1

B : x(xx)* and (xx)*x

C : (ab)* and a*b*

D : x+ and x*x+

Q.no 9. Turing Machine can update symbols on its tape, whereas the FA cannot update
symbols on tape.

A : true

B : false

C : Cannot say

D : May be

Q.no 10. Epsilon-closure of a state is a combination of self state and ----

A : Epsilon-reachable states

B : initial state
C : Final state

D : Non-final states

Q.no 11. Top-down parsers use

A : leftmost derivation

B : rightmost derivation

C : rightmost derivation in reverse order

D : leftmost derivation in reverse order

Q.no 12. Decidable can be taken as a synonym to:

A : Recursive

B : Non Recursive

C : Recognizable

D : Non Recognizable

Q.no 13. A two-way infinite tape Turing machine is ________ superior than the basic
model of the Turing machine in terms of power.

A : More

B : Less

C : No way

D : Very Much

Q.no 14. _________ is the class of decision problems that can be solved by non-
deterministic polynomial algorithms?

A : NP

B:P

C : Hard

D : Complete

Q.no 15. In Moore machine, if input is of length n, then length of output string will be

A:n
B : n+1

C : n+n

D : n-1

Q.no 16. Finite automata needs minimum _______ number of stacks

A:0

B:1

C:2

D:3

Q.no 17. Which of the following a Turing machine does not consist of?

A : Input tape

B : Head

C : State register

D : Stack

Q.no 18. A Language for which no DFA exist is a________

A : Regular Language

B : Non-Regular Language

C : May be Regular

D : Cannot be said

Q.no 19. The push down automata indicate the acceptance of input string in terms of

A : final state

B : empty stack

C : final state and empty stack

D : start state

Q.no 20. NFA, in its name has Non-deterministic words because

A : The result is undetermined


B : The choice of path is non-deterministic

C : The state to be transited next is non-deterministic

D : More number of final states

Q.no 21. Which of the following is not a regular expression?

A : [(a+b)*(aa+bb)]*

B : [(0+1)-(0b+a1)*(a+]*

C : (01+11+10)*

D : (1+2+0)*(1+2)*

Q.no 22. Which of the following statements is false ?

A : Halting problem of Turing machines is undecidable

B : Determining whether a context-free grammar is ambiguous is undecidable

C : Given two arbitrary context-free grammars G1 G2 and it is undecidable whether L (G1) =


L (G2).

D : Given two regular grammars G1 G2 and it is undecidable whether L (G1) = L (G2)

Q.no 23. Which one of the following is FALSE?

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to an equivalent DFA.

C : Every Epsilon NFA can be converted to an equivalent DFA.

D : Every Mealy can be converted to an equivalent Moore machine.

Q.no 24. The RE in which any number of 0′s is followed by any number of 1′s followed
by any number of 2′s is

A : (0+1+2)*

B : 0*1*2*

C : 0* + 1 + 2

D : (0+1)*2*

Q.no 25. 3-SAT and 2-SAT problems are


A : NP-complete and in P respectively

B : Undecidable and NP-complete

C : Both NP-complete

D : Both in P

Q.no 26. Which regular language corresponds to 1+(1+0)*0+(0+1)*11

A : The language of all strings that end with 11 or 00

B : The language of all strings that end with 0 or 1

C : The language of all strings which does not end with 01

D : The language of all strings which does not end with 10

Q.no 27. Given a Grammar G:


S->aA
A->a | A
B->B
The number of productions to be removed immediately as Unit productions are

A:0

B:1

C:2

D:3

Q.no 28. Which of the following is true for the language?

A : It is not accepted by a Turing Machine

B : It is regular but not context-free

C : It is context-free but not regular

D : It is neither regular nor context-free, but accepted by a Turing machine

Q.no 29.

A:
B:

C:

D:

Q.no 30. For every CFL, G, there exists a PDA M such that L(G) = L(M) and vice versa.

A : true

B : false

C : maybe

D : probably

Q.no 31. Which productions will generate odd length palindromes for terminals 'a' and
'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb

D : S-> aSb|bSa|a|b

Q.no 32. Which of the following is the restricted model of Turing machines (a) Turing
machine with semi-infinite tape, (b) Multi stack machine, (c) Offline Turing machine

A : Only (a)

B : Only (b)

C : Only (c)

D : Both (a) and (b)

Q.no 33. Which of the following statement is not true?

A : Type 0 grammar is called unrestricted grammar

B : Chomsky hierarchy define only one type of grammar

C : Type 3 grammar is recognized by FA

D : Type 2 grammar is CFG


Q.no 34. Every grammar in Chomsky Normal Form is:

A : Regular

B : Context free

C : Context sensitive

D :  Unrestricted

Q.no 35. Limitation of PDA can be overcome by

A : Mealy machine

B : Moore machine

C : Turing machine

D : Finite state machine

Q.no 36. What does it mean when we say that an algorithm X is asymptotically more
efficient than Y?

A : X will always be a better choice for small inputs

B : X will always be a better choice for large inputs

C : Y will always be a better choice for small inputs

D : X will always be a better choice for all inputs

Q.no 37. Construct a regular expression for the language that contains strings having
even number of 0’s followed by odd number of 1’s over {0, 1}.

A : (00)* 1 (11)*

B : ((0+1)(0+1))*

C : (0+1)*

D : (001)*

Q.no 38. Unrestricted grammar is also called_______ Grammar

A : Type 3

B : Type 2

C : Type 1
D : Type 0

Q.no 39. The subset construction shows that every NFA accepts a ……..

A : String

B : Function

C : Regular language

D : Context-free language

Q.no 40. Which of the following is true?

A : The complement of a recursive language is recursive.

B : The complement of a recursively enumerable language is recursively enumerable.

C : The complement of a recursive language is either recursive or recursively enumerable.

D : The complement of a context-free language is context-free.

Q.no 41. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 42. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 43. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?
A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 44. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 45. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:

Q.no 46. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 47. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?
A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 48. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 49. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 50. The language A-> tB|t generated by which of the following grammar?

A : Type 3
B : Type 2

C : Type 1

D : Type 0

Q.no 51.

A:A

B:B

C:C

D:D

Q.no 52. The CFG "S-> aS | bS |a|b " is equivalent to regular expression

A : (a + b)

B : (a + b) (a + b)*

C : (a + b) (a + b)

D : (a . b) (a . b)

Q.no 53. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.


Q.no 54. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 55. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II

B : Only III

C : Only I and II

D : Only I and III

Q.no 56. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 57. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?
A:

B:

C:

D:

Q.no 58. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab
A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 59. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 60. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 1. Minimal finite automata need _____________ no. of final states

A:1

B:2

C:3

D : Depends on problem

Q.no 2. Language of finite automata is generated by

A : Type 0 grammar

B : Type 1 grammar

C : Type 2 grammar
D : Type 3 grammar

Q.no 3. A problem which is both _______ and _________ is said to be NP complete.

A : P, NP

B : NP, NP hard

C : P, P complete

D : NP Hard,P

Q.no 4. The format: A->aB refers to which of the following?

A : Chomsky Normal Form

B : Greibach Normal Form

C : Backus Naur Form

D : Sentential form

Q.no 5. Which one of the following is the most powerful method?

A : LL(1)

B : SLR

C : CLR

D : LALR

Q.no 6. Linear Bounded Automaton is a

A : Finite Automaton

B : Turing Machine

C : Push down Automaton

D : Deterministic Finite Automata

Q.no 7. Which of the following statement is true?

A : Mealy machine has no terminating state

B : A Moore machine has terminating state

C : Converting from Mealy into Moore machine and vice versa is not possible
D : More machine is Moore powerful than Mealy machine

Q.no 8. Are the given two patterns equivalent?


(1) gray | grey (2) gr(a|e)y

A : yes

B : no

C : may be

D : cannot say

Q.no 9. Given the expression, is there some assignment of true and false values to the
variables that will make the entire expression true? This is termed as

A : Satisfiability problem

B : Independent set problem

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 10. Those problems that require large amount of computational resources that
are practically not feasible to solve, these problems are known as _________

A : Decidable

B : Undecidable

C : Tractable

D : Intractable

Q.no 11. In one move the Turing machine___

A : May change its state

B : Write a symbol on the cell being scanned.

C : Move the head one position left or right

D : All of the above

Q.no 12.
A : L*

B:

C:L

D:

Q.no 13. (a+b)* is equivalent to

A : b*a*

B : (a*b*)*

C : a*b*

D:

Q.no 14. Those problems that are solvable in polynomial time belong to __

A : NP

B:P

C : Hard

D : Complete

Q.no 15. Top-down parsers use the grammar

A : LL(K)

B : LR(K)

C : SLR(K)

D : CLR(K)

Q.no 16. Finite state machine can recognize

A : any grammar

B : only context-free grammar

C : context free grammar and regualr grammar


D : only regular grammar

Q.no 17. A formal language is recursive if :

A : A turing machine exists

B : A turing machine that halts for every input

C : Turing machine rejects if the input does not belong to the language

D : All of the mentioned

Q.no 18. If T1 and T2 are two Turing machines, the composite can be represented using
the expression

A : T1 T2

B : T2 T1

C : T1 X T2

D : T2 X T1

Q.no 19. RR* can be expressed in which of the forms:

A : R+

B : R-

C : R+ U R-

D:R

Q.no 20. In given Transition function of TM which head movement of tape is shown
(q0,a)->(q1,X,L)

A : Left Movement

B : Right Movement

C : Top Movement

D : Bottom Movement
Q.no 21.

A : Perform the transition from q0 to q1 by changing "a" symbol to "X" and perform the right
movement.

B : Perform the transition from q0 to q1 by changing "X" symbol to "a" and perform the right
movement.

C : Perform the transition from q0 to q1 by changing "a" symbol to "X" and perform the Left
movement.

D : Perform the transition from q0 to q1 by changing "q0" symbol to "q1" and perform the
right movement.

Q.no 22. Which of the following represents a language which has no pair of consecutive
1’s if alphabet = {0,1}?

A:

B:

C:

D:

Q.no 23. Which of the following does not obey pumping lemma for context free
languages ?

A : Finite languages

B : Context free Languages

C : Unrestricted languages

D : Restricted languages

Q.no 24. The problem of finding a path in a graph that visits every vertex exactly once
is called
A : Hamiltonian path problem

B : Hamiltonian cycle problem

C : Subset sum problem

D : Turnpike reconstruction problem

Q.no 25. How many strings of length less than 4 contain the language described by the
regular expression (x+y)*y(a+ab)*

A:7

B : 10

C : 12

D : 11

Q.no 26. Is the language preserved in all the steps while eliminating epsilon transitions
from a NFA?

A : yes

B : no

C : may be

D : cannot say

Q.no 27. Turing machine (TM) is more powerful than FSM (Finite State Machine)
because

A : Tape movement is confined to one direction

B : It has no finite state

C : It has the capability to remember arbitrarily long sequences of input symbols

D : It has tape symbols

Q.no 28. Can a DFA recognize a palindrome number?

A : Yes

B : No

C : May be
D : Cannot be determined

Q.no 29. For a give Moore Machine,


Statement 1: Null string is processed in Moore Machine.
Statement 2: There are more than 5-Tuples in the definition of Moore Machine.
Choose the correct option.

A : Statement 1 is true and Statement 2 is true

B : Statement 1 is true while Statement 2 is false

C : Statement 1 is false while Statement 2 is true

D : Statement 1 is false and Statement 2 is false

Q.no 30. Production Rule: aAb->agb belongs to which of the following category?

A : Regular Language

B : Context free Language

C : Context Sensitive Language

D : Recursively Ennumerable Language

Q.no 31. PDA works as Finite Automata when the number of auxiliary memory it has is

A:3

B:2

C:1

D:0

Q.no 32. The worst case complexity of a deterministic problem to find the satisfiability
of a given formula of n variables is

A : O(n)

B : O(n^2)

C : O(n^3)

D : O(2^n)

Q.no 33. Which of the following statements is false?


A : For every non-deterministic Turing machine, there exists an equivalent deterministic
Turing machine.

B : Turing recognizable languages are closed under union and complement.

C : Turing decidable languages are closed under intersection


and complement.

D : Turing recognizable languages are closed under union and intersection.

Q.no 34. Out of the three decision problems P1, P2 and P3, P1 is decidable and P2 is
undecidable. The statement that holds true is

A : P3 is decidable if P3 is reducible to compliment of P2

B : P3 is decidable if P1 is reducible to P3

C : P3 is undecidable if P1 is reducible to P3

D : P3 is undecidable if P2 is reducible to P3

Q.no 35. The set of all strings over {a,b} in which strings consisting a’s and b’s and
ending with bb is

A : ab

B : a*bbb

C : (a+b)* bb

D : (a+b)+ bb

Q.no 36. Which of the following statement is false?

A : Every language that is defined by regular expression can also be defined by finite
automata

B : Every language defined by finite automata can also be defined by regular expression

C : We can convert regular expressions into finite automata

D : There exists a unique DFA for every regular language

Q.no 37. The total number of states and transitions required to form a Moore machine
that processes a binary input string and will produce residue mod 3.

A : 3 and 6

B : 3 and 5
C : 2 and 4

D : 2 and 5

Q.no 38. The operations of PDA never work on elements other than top of the stack.

A : false

B : true

C : may be

D : cannot say

Q.no 39. For a DFA accepting binary numbers whose decimal equivalent is divisible by
4, what are all the possible remainders?

A:0

B:2

C : 0,2,4

D : 0,1,2,3

Q.no 40. Number of external states of a UTM should be atleast

A:1

B:2

C:3

D:4

Q.no 41. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD
C:CD

D:DA

Q.no 42. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal

Q.no 43. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 44. For two regular languages


L1 = (a + b)* a
and
L2 = b (a + b ) *
the intersection of L1 and L2 is given by

A : (a + b ) * ab

B : ab (a + b ) *

C:a(a+b)*b
D : b (a + b ) * a

Q.no 45. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011

Q.no 46. CFG is not closed under

A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 47. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's

D : has atleast two a's

Q.no 48. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.
A:

B:

C:
D:

Q.no 49. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 50. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 51. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard
Q.no 52. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar

Q.no 53. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 54.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 55. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular


B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 56. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 57.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 58. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 59. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is
A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

Q.no 60. Construct a Turing machine which accepts a string with ‘aba’ as its substring.

A:

B:
C:

D:

Q.no 1. Which of the following can be used to simulate any Turing machine?

A : Finite State Automaton

B : Universal Turing Machine

C : Counter machines

D : Deterministic Finite Automata

Q.no 2. If the PDA does not stop on an accepting state and the stack is not empty, the
string is

A : rejected

B : goes into loop forever

C : rejected and goes into loop forever

D : accepted
Q.no 3. A boolean formula is said to be in Conjuctive Normal Form (CNF) if it can
represented as

A : e1 V e2 V e3

B : e1 Ʌ e2 V e3

C : e1 V e2 Ʌ e3

D : e1 Ʌ e2 Ʌ e3

Q.no 4. Transition function of Turing Machine is

A:

B:

C:

D:

Q.no 5. Which of the following correctly recognize the symbol ‘|-‘ in context to PDA?

A : moves

B : transition function

C : or symbol

D : not symbol

Q.no 6. Choose the correct option for the statement: Unambiguity is the ideal structure
of a language.

A : true

B : Partially True

C : false

D : Cannot be said

Q.no 7. What is the value of n if Turing machine is defined using n-tuples?

A:6
B:7

C:8

D:5

Q.no 8. Which of the following are the actions that operates on stack top?

A : only push

B : only pop

C : only push and pop

D : push, pop and replace

Q.no 9. The major difference between a moore and mealy machine is that

A : Output of the former depends on the present state and present input

B : output of the former depends only on the present state

C : output of the former depends only on the present input

D : output of the former depends on the present input and next state

Q.no 10. Turing machine was invented by

A : Alan Turing

B : Turing man

C : Turing taring

D : Turling Bake

Q.no 11. Bottom-up parsing is also known as

A : shift reduce parsing

B : predictive descent parsing

C : operator precedence parsing

D : LL1 Parsing

Q.no 12. In Moore machine the output depends on

A : Only present state


B : Present state and present input

C : Nothing

D : Type of input

Q.no 13. Transition function of DFA machine maps.

A:

B:

C:

D:

Q.no 14. Which of the following case does not exist in complexity theory?

A : Best case

B : Worst case

C : Average case

D : Null case

Q.no 15. PDA always works on top element of stack

A : true

B : false

C : maybe

D : cannot say

Q.no 16. A grammar that produces more than one parse tree for some sentence is
called

A : ambiguous

B : unambiguous

C : regular

D : context free grammar


Q.no 17. If two finite state machines are equivalent,

A : they should have the same number of states

B : they should have the same number of edges

C : they should have the same number of states and edges

D : they can have different number of states and edges

Q.no 18. There is a linear grammar that generates a context free grammar

A : Always

B : Never

C : Sometimes

D : Everytime

Q.no 19. In Parse Tree, Root represents

A : Terminals

B : Variables

C : Start Symbol

D : Productions

Q.no 20. A Turing machine with several tapes in known as

A : Multi-tape Turing machine

B : Poly-tape Turing maching

C : Universal Turing machine

D : Complete Turing machine

Q.no 21.

A:
B:

C:

D : {0, 1}

Q.no 22. Number of states required to accept strings ending with 10 are

A:3

B:2

C:1

D : can’t be represented.

Q.no 23. The complexity class P consist of all the decision problems that can be solved
by ___________using polynomial amount of computation time.

A : Push Down automata

B : DFA

C : NDFA

D : Deterministic Turing machine

Q.no 24. Given a Grammar G:


S->aA
A->a | A
B->B
The number of productions to be removed immediately as Unit productions are

A:0

B:1

C:2

D:3

Q.no 25. The shown language is recognized by (a) Turing machine, (b) Pushdown

automata, (c) Finite automata

A : Only (a)
B : Only (b)

C : Only (c)

D : Only (a) and (b)

Q.no 26. The power of non-deterministic pushdown automata and deterministic


pushdown automata is not same.

A : true

B : false

C : maybe

D : cannot say

Q.no 27. Which of the functions are not performed by the Turing machine after reading
a symbol?

A : Writes the symbol

B : Moves the tape one cell left/right

C : Proceeds with next instruction or halts

D : Push the input in stack

Q.no 28. The set of all strings over alphabet = {a,b} in which all strings having bbbb as
substring is

A : (a+b)* bbbb (a+b)*

B : (a+b)* bb (a+b)*bb

C : bbb(a+b)*

D : bb (a+b)*

Q.no 29. Which of the following is not a Non deterministic Turing machine?

A : Alternating Turing Machine

B : Probabalistic Turing Machine

C : Read-only Turing Machine

D : Unsolvable
Q.no 30. If there exists a TM which when applied to any problem in the class,
terminates, if correct answer is yes and may or may not terminate otherwise is called

A : Stable

B : Unsolvable

C : Partially solvable

D : Unstable

Q.no 31. A context free language is called ambiguous if (a) It has two or more leftmost
derivations for the same string. (b) It has two or more rightmost derivations for the
same string. (c) It has Only single derivation tree.

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Only (c)

Q.no 32. Which of the following statements is incorrect?

A : A Turing Machine cannot solve Halting problem

B : Set of recursively enumerated languages is closed under union

C : A FSM with 3 stacks is more powerful than FSM with 2 stacks

D : Context sensitive grammar can be recognized by a linearly bounded memory machine.

Q.no 33. PDA is useful in

A : lexical analysis

B : syntax analysis

C : semantic analysis

D : code generation

Q.no 34. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings without double a?

A:
B : ((a+b)(a+b))*

C : (a + bb)*

D:

Q.no 35. The RE that gives none or many instances of an x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 36. The automaton which allows transformation to a new state without consuming
any input symbols:

A : NFA

B : DFA

C : Epsilon NFA

D : PDA

Q.no 37. A string derived by a grammar is graphically represented using ……...

A : Binary tree

B : Sparse tree

C : Parse tree

D : Forest

Q.no 38. In given Transition function of TM


(q1,b)->(q2,Y,R)
Which one is the correct statement?

A : "q1" symbol is changed to "q2"

B : "b" symbol is changed to "q2"

C : "Y" symbol is changed to "b"


D : "b" symbol is changed to "Y"

Q.no 39. An NFA’s transition function returns

A : Boolean value

B : A state

C : A set of states

D : An edge

Q.no 40. Let the class of language accepted by finite state machine be L1 and the class
of languages represented by regular expressions be L2 then

A : L1<L2

B : L1>=L2

C : L1!=L2

D : L1=L2

Q.no 41. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?

A:

B:
C:

D:

Q.no 42.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable

Q.no 43. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:

Q.no 44. Which of the following grammars are in Chomsky Normal Form:
A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 45. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar

Q.no 46. The CFG "S-> aS | bS |a|b " is equivalent to regular expression

A : (a + b)

B : (a + b) (a + b)*

C : (a + b) (a + b)

D : (a . b) (a . b)

Q.no 47. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7
D:2

Q.no 48. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 49. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 50. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 51. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 52. The context free grammar


S->SS|0S1 |1S0|Є
generates :
A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 53. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 54. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 55. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 56. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12
D : 15

Q.no 57.

A:A

B:B

C:C

D:D

Q.no 58. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*
Q.no 59. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 60. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 1. A problem which is both _______ and _________ is said to be NP complete.

A : P, NP

B : NP, NP hard

C : P, P complete
D : NP Hard,P

Q.no 2. Turing machine is more powerful than (a) Finite automata, (b) Push down
automata

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Neither (a) nor (b)

Q.no 3. The push down automata indicate the acceptance of input string in terms of

A : final state

B : empty stack

C : final state and empty stack

D : start state

Q.no 4. Which among the following cannot be accepted by a regular grammar?

A : L is a set of numbers divisible by 2

B : L is a set of binary complement

C : L is a set of strings with odd number of 0s

D : L is a set of 0^n1^n

Q.no 5. Every grammar in Chomsky Normal Form is:

A : regular

B : context sensitive

C : context free

D : Unrestricted

Q.no 6. A deterministic Turing machine is

A : Ambiguous Turing Machine

B : Unambiguous Turing Machine


C : Non-Deterministic Finite Automata

D : Deterministic Finite Automata

Q.no 7. To which of the following class does a CNF-satisfiability problem belong?

A : NP class

B : P class

C : NP complete

D : NP hard

Q.no 8. 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*

B : R = P*Q

C : R = RP

D : R = QP

Q.no 9. Halting states are of two types. They are:

A : accept and reject

B : reject and allow

C : start and reject

D : start and accept

Q.no 10. A grammar G=(V, T, P, S) is __________ if every production taken one of the two
forms: B->aC , B->a

A : Ambiguous

B : Regular

C : Non Regular

D : Context sensitive

Q.no 11. In regular expressions, the operator ‘*’ stands for

A : Concatenation
B : Selection

C : Iteration

D : Addition

Q.no 12. Construct a regular expression for the language that contains strings having at
least one pair of consecutive zeros over {0, 1}.

A : (100)*

B : 1* (00)* 1*

C : [ (1 + 0 )* (00) (1 + 0 )*] +

D : ((0+1)(0+1))*

Q.no 13.

A:

B:

C:0

D:1

Q.no 14. Epsilon-closure of a state is a combination of self state and ----

A : Epsilon-reachable states

B : initial state

C : Final state

D : Non-final states

Q.no 15. The recognizing capability of NDFAand DFA

A : must be the same

B : may be different

C : must be different

D : cannot say
Q.no 16. A problem is called __________ if it has an efficient algorithm for itself.

A : Tractable

B : Intractable

C : Computational

D : Computable

Q.no 17. PDA accepts languages generated by which grammar

A : type 0

B : type 1

C : type 2

D : type 3

Q.no 18. Why Palindromes cannot be recognized by any FSM ?

A : an FSM cannot deterministically fix the mid-point

B : an FSM can remember arbitrarily large amount of information

C : FSM has finite memory

D : FSM has only 5 tuples

Q.no 19. Halting problem is an example for

A : decidable problem

B : undecidable problem

C : complete problem

D : trackable problem

Q.no 20. A language is regular if and only if

A : accepted by DFA

B : accepted by PDA

C : accepted by LBA

D : accepted by Turing machine


Q.no 21. According to the given language, which among the following expressions does
it corresponds to Language L={xϵ{0,1}|x is of length 4 or less}

A : (0+1+0+1+0+1+0+1)^4

B : (0+1)^4

C : (01)^4

D : (0+1+ε)^4

Q.no 22. Recursively enumerable languages are …….. , whereas recursive languages are
…....

A : completely-solvable, semi solvable

B : semi-solvable, completely solvable

C : not solvable, completely solvable

D : semi-solvable, not solvable

Q.no 23. How many strings of length less than 4 contain the language described by the
regular expression (x+y)*y(a+ab)*

A:7

B : 10

C : 12

D : 11

Q.no 24. Which of the following is the restricted model of Turing machines (a) Turing
machine with semi-infinite tape, (b) Multi stack machine, (c) Offline Turing machine

A : Only (a)

B : Only (b)

C : Only (c)

D : Both (a) and (b)

Q.no 25. Complement of a DFA can be obtained by

A : making starting state as final state.


B : no trival method.

C : making final states non-final and non-final to final.

D : make final as a starting state.

Q.no 26. Which productions will generate even length palindromes for terminals 'a'
and 'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb

D : S-> aSb|bSa|a|b

Q.no 27. X is a simple mathematical model of a computer. X has unrestricted and


unlimited memory. X is a FA with R/W head. X can have an infinite tape divided into
cells, each cell holding one symbol.
Name X?

A : Push Down Automata

B : Non deterministic Finite Automata

C : Turing machines

D : Deterministic Finite Automata

Q.no 28. The worst-case efficiency of solving a problem in polynomial time is?

A : O(p(n))

B : O(p( n log n))

C:

D : O(p(m log n))

Q.no 29. The difference between number of states in FA for regular expression (a + b)
and (a + b) * is:

A:1

B:2
C:3

D:0

Q.no 30. Which of the following pairs have DIFFERENT expressive power?

A : Deterministic finite automata (DFA) and Non-Deterministic finite automata(NFA)

B : Deterministic push down automata (DPDA) and Non-deterministic pushdown automata


(NPDA)

C : Deterministic single-tape Turing machine and Non-deterministic single-tape Turing


Machine

D : Single-tape Turing machine and multi-tape Turing machine

Q.no 31. Which of the following is true?

A : The complement of a recursive language is recursive.

B : The complement of a recursively enumerable language is recursively enumerable.

C : The complement of a recursive language is either recursive or recursively enumerable.

D : The complement of a context-free language is context-free.

Q.no 32. 3-SAT and 2-SAT problems are

A : NP-complete and in P respectively

B : Undecidable and NP-complete

C : Both NP-complete

D : Both in P

Q.no 33. The minimum number of productions required to produce a language


consisting of palindrome strings over T={a,b} is

A:3

B:7

C:5

D:6

Q.no 34. Regular expression (x|y)(x|y) denotes the set


A : {xy,xy}

B : {xx,xy,yx,yy}

C : {x,y}

D : {x,y,xy}

Q.no 35. Which of the following problems is solvable ?

A : Writing a universal Turing machine

B : Determining of an arbitrary Turing machine is an universal Turing machine

C : Determining of a universal Turing machine can be written for fewer than k instructions
for some k

D : Determining of a universal Turing machine and some input will halt

Q.no 36. Which of the following statement is false?

A : Every language that is defined by regular expression can also be defined by finite
automata

B : Every language defined by finite automata can also be defined by regular expression

C : We can convert regular expressions into finite automata

D : There exists a unique DFA for every regular language

Q.no 37. Which among the following is equivalent to the given regular expression 01*+1

A : (01)*+1

B : 0((1)*+1)

C : (0(1)*)+1

D : ((0*1)1*)*

Q.no 38. Which of the following is not an application of Finite Automaton?

A : Compiler Design

B : Grammar Parsers

C : Text Search

D : Image processing
Q.no 39. Which of the regular expressions correspond to the given problem statement:
Express the identifiers in C Programming language where l=letters d=digits

A : (l+_)(d+_)*

B : (l+d+_)*

C : (l+_)(l+d+_)*

D : (_+d)(l+d+_)*

Q.no 40. PDA can be represented with the help of

A : Instantaneous description

B : input symbols

C : start state

D : final state

Q.no 41. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".

A:

B:

C:
D:

Q.no 42. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 43. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 44. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 45. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II
B : Only III

C : Only I and II

D : Only I and III

Q.no 46. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 47. Which of the following are decidable?


I. Whether the intersection of two regular languages is infinite
II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 48. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal

Q.no 49. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?
A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 50. CFG is not closed under

A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 51. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011

Q.no 52. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 53. Construct a Turing machine which accepts a string with ‘aba’ as its substring.
A:

B:

C:
D:

Q.no 54. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 55. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

Q.no 56. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab

A : ababbbbab
B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 57.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 58. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 59. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable
D : X1 – X3 is recursively enumerable

Q.no 60. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 1. Transition function of DFA machine maps.

A:

B:

C:

D:

Q.no 2. A Language for which no DFA exist is a________

A : Regular Language

B : Non-Regular Language

C : May be Regular

D : Cannot be said

Q.no 3. Bottom-up parsers use

A : leftmost derivation

B : rightmost derivation

C : rightmost derivation in reverse order

D : leftmost derivation in reverse order

Q.no 4. Finite state machine is ___________tuple machine.

A:4
B:5

C:6

D : unlimitted

Q.no 5. NPDA stands for

A : non deterministic pushup automata

B : null pushdown automata

C : nested pushdown automata

D : non deterministic pushdown automata

Q.no 6. Minimal finite automata need _____________ no. of final states

A:1

B:2

C:3

D : Depends on problem

Q.no 7. Which of these does not belong to CFG?

A : Terminal Symbol

B : Non Terminal Symbol

C : Start symbol

D : End symbol

Q.no 8. Language of finite automata is generated by

A : Type 0 grammar

B : Type 1 grammar

C : Type 2 grammar

D : Type 3 grammar

Q.no 9. 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

C : At least one state has more than one transitions

D : At most one state has more than one transitions

Q.no 10. RR* can be expressed in which of the forms:

A : R+

B : R-

C : R+ U R-

D:R

Q.no 11. Which operation can be applied on stack

A : Push

B : Pop

C : Push and Pop

D : Read

Q.no 12. Problems that can be solved in polynomial time are known as

A : intractable

B : tractable

C : decision

D : complete

Q.no 13. In given Transition function of TM which head movement of tape is shown
(q0,a)->(q1,X,L)

A : Left Movement

B : Right Movement

C : Top Movement

D : Bottom Movement

Q.no 14. For alphabet = {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

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

Q.no 15. Which of the following are not quantifiers?

A : Kleene plus +

B : Kleene star *

C : Question mark ?

D : Union

Q.no 16. Which of the following are the examples of finite state machine system? (a)
Control Mechanism of an elevator (b) Traffic Lights (c) Combinational Locks

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 17. The Grammar can be defined as: G= (V, T, P, S) In the given definition, what
does S represents?

A : Accepting State

B : Starting Variable

C : Sensitive Grammar

D : Final state

Q.no 18. A formal language is recursive if :

A : A turing machine exists

B : A turing machine that halts for every input

C : Turing machine rejects if the input does not belong to the language

D : All of the mentioned


Q.no 19. Identify the problem: Given a graph G = <V, E>, and a starting node a, does it
have a tour cost less than k?

A : Satisfiability

B : Independent set

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 20. Which of the following regular expressions represents the set of strings which
do not contain a substring ‘rt’ if alphabet = {r, t}

A : (rt)*

B : (tr)*

C : (r*t*)

D : (t*r*)

Q.no 21. The travelling salesman problem can be solved using _________

A : A spanning tree

B : A minimum spanning tree

C : Bellman – Ford algorithm

D : DFS traversal

Q.no 22. The ability for a system of instructions to simulate a Turing Machine is called
_________

A : Turing Completeness

B : Simulation

C : Turing Halting

D : Computability

Q.no 23.
A : Perform the transition from q0 to q1 by changing "a" symbol to "X" and perform the right
movement.

B : Perform the transition from q0 to q1 by changing "X" symbol to "a" and perform the right
movement.

C : Perform the transition from q0 to q1 by changing "a" symbol to "X" and perform the Left
movement.

D : Perform the transition from q0 to q1 by changing "q0" symbol to "q1" and perform the
right movement.

Q.no 24. Number of external states of a UTM should be atleast

A:1

B:2

C:3

D:4

Q.no 25. If there exists a TM which when applied to any problem in the class,
terminates, if correct answer is yes and may or may not terminate otherwise is called

A : Stable

B : Unsolvable

C : Partially solvable

D : Unstable

Q.no 26. Pushdown automata behaves like Turing machine when it has the number of
auxiliary memory

A : one or more

B : two or more

C : zero

D : one

Q.no 27. Which of the following statement is correct?

A : All Regular grammars are context free but not vice versa

B : All context free grammars are regular grammars but not vice versa
C : Regular grammar and context free grammar are the same entity

D : All context sensitive grammar are regular grammar but not vice versa

Q.no 28. Which language is represented by the following grammar G:


G={{S},{0,1},P,S}
where elements of P are:
S --> SS
S--> 0S1
S--> 1S0
S--> Є

A : Regular language

B : Context-free language

C : Context-sensitive language

D : Recursively enumerable language

Q.no 29. Which among the following is the LEAF of the parse tree?

A : Production P

B : Nonterminal V

C : Terminal T

D : Starting symbol S

Q.no 30. Which among the following is not true for 2-way infinte TM?

A : Tape in both directions

B : Leftmost square not distinguished

C : Any computation that can be performed by 2-way infinite tape can also be performed by
standard TM.

D : Tape is only in one direction.

Q.no 31. The production of the form A->B , where A and B are non terminals is called

A : Null production

B : Greibach Normal Form

C : Unit production
D : Chomsky Normal Form

Q.no 32. Every grammar in Chomsky Normal Form is:

A : Regular

B : Context free

C : Context sensitive

D :  Unrestricted

Q.no 33. A PDA machine configuration (p, w, y) can be correctly represented as

A : unprocessed input, stack content, current state

B : current state, unprocessed input, stack content

C : current state, stack content, unprocessed input

D : stack content, current state, unprocessed input

Q.no 34. The complement of a language will only be defined when and only when the
__________ over the language is defined.

A : String

B : Word

C : Alphabet

D : Grammar

Q.no 35. Out of the three decision problems P1, P2 and P3, P1 is decidable and P2 is
undecidable. The statement that holds true is

A : P3 is decidable if P3 is reducible to compliment of P2

B : P3 is decidable if P1 is reducible to P3

C : P3 is undecidable if P1 is reducible to P3

D : P3 is undecidable if P2 is reducible to P3

Q.no 36. Which is a wrong satatement?

A : A regular language is produced by union of two regular languages

B : The concatenation of two regular languages is regular


C : The Kleene closure of a regular language is regular

D : The complement of a regular language is also a regular language

Q.no 37. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which any occurrence of the symbol b, is in
groups of odd numbers.

A : (abbb)*

B : a* b (bb)* a*

C : ((a+b)(a+b)(a+b))*

D : a* b* (bb)* a*

Q.no 38. If r1 = (aa + bb) and r2 = (a + b) then the language (aa + bb)(a + b) will be
generated by

A : (r1)(r2)

B : (r1 + r2)

C : (r2)(r1)

D : (r1)

Q.no 39. The instantaneous description is PDA shows

A : present state, string to be processed and stack symbol

B : present state and stack symbol

C : present state and string to be processed

D : stack symbol and string to be processed

Q.no 40. Limitation of PDA can be overcome by

A : Mealy machine

B : Moore machine

C : Turing machine

D : Finite state machine


Q.no 41.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable

Q.no 42. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 43. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD

D:DA

Q.no 44. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b
C : S->aS | bS |S

D : S->aS | bS |a

Q.no 45. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:

Q.no 46. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2

Q.no 47. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's


Q.no 48. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 49. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar

Q.no 50. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.
A:

B:

C:
D:

Q.no 51.

A:A

B:B

C:C

D:D

Q.no 52. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine
Q.no 53. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 54. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 55. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 56.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 57. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 58. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's


D : has atleast two a's

Q.no 59. The CFG "S-> aS | bS |a|b " is equivalent to regular expression

A : (a + b)

B : (a + b) (a + b)*

C : (a + b) (a + b)

D : (a . b) (a . b)

Q.no 60. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 1. Which of the following is true?

A : (01)*0 = 0(10)0*

B : (0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*

C : (0+1)*01(0+1)*+1*0* = (0+1)*0

D : (01)*01 = 0(10)0*1

Q.no 2. 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*

B : R = P*Q

C : R = RP

D : R = QP

Q.no 3.

A : L*
B:

C:L

D:

Q.no 4. Which of the following pair of regular expressions are not equivalent?

A : 1(01)* and (10)*1

B : x(xx)* and (xx)*x

C : (ab)* and a*b*

D : x+ and x*x+

Q.no 5. In Moore machine, if input is of length n, then length of output string will be

A:n

B : n+1

C : n+n

D : n-1

Q.no 6. In Parse Tree, Intermediate Node represents

A : Terminals

B : Variables

C : Start Symbol

D : Productions

Q.no 7. Are the given two patterns equivalent?


(1) gray | grey (2) gr(a|e)y

A : yes

B : no

C : may be

D : cannot say
Q.no 8. Finite automata needs minimum _______ number of stacks

A:0

B:1

C:2

D:3

Q.no 9. Those problems that require large amount of computational resources that are
practically not feasible to solve, these problems are known as _________

A : Decidable

B : Undecidable

C : Tractable

D : Intractable

Q.no 10. Which among the following is the format of unit production?

A : A->B

B : A->b

C : B->Aa

D : B->aA

Q.no 11. Can we convert PDA to equivalent CFG?

A : yes

B : no

C : maybe

D : never

Q.no 12. NFA, in its name has Non-deterministic words because

A : The result is undetermined

B : The choice of path is non-deterministic

C : The state to be transited next is non-deterministic


D : More number of final states

Q.no 13. Recursive languages are also known as:

A : decidable

B : Undecidable

C : sometimes decidable

D : infinite

Q.no 14. The decision problem is the function from string to ______________

A : char

B :  int

C :  boolean

D : float

Q.no 15.

A : Always starts with b

B : Can have any number of ba and ab

C : Can not have 2 b's together.

D : Starts and end with same symbol

Q.no 16. Turing Machine can update symbols on its tape, whereas the FA cannot update
symbols on tape.

A : true

B : false

C : Cannot say

D : May be

Q.no 17. Those problems that are solvable in polynomial time belong to __

A : NP
B:P

C : Hard

D : Complete

Q.no 18. Which of the following statement is true? (a) Turing machine was developed
by Alan Turing, (b) PDA is less powerful than Turing machine, (c) FA is more powerful
than TM

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Only (c)

Q.no 19. A->aA| a| b


The number of steps to generate aab are

A:2

B:3

C:4

D:5

Q.no 20. In CFG, notation of VARIABLE representation is

A : Captal Letters

B : Small Letters

C : Italic Letters

D : Roman Letters

Q.no 21. Which of the following does not obey pumping lemma for context free
languages ?

A : Finite languages

B : Context free Languages

C : Unrestricted languages

D : Restricted languages
Q.no 22. Which of the regular expressions correspond to the given problem statement:
Express the identifiers in C Programming language where l=letters d=digits

A : (l+_)(d+_)*

B : (l+d+_)*

C : (l+_)(l+d+_)*

D : (_+d)(l+d+_)*

Q.no 23. Which of the following automata takes stack as auxiliary storage

A : finite automata

B : pushdown automata

C : Turing machine

D : finite state machine

Q.no 24. The string (a)|((b)*(c)) is equivalent to

A : Empty

B : abcabc

C : b*c|a

D : abc

Q.no 25. Which of the following statement is false?

A : Context free language is the subset of context sensitive language

B : Regular language is the subset of context sensitive language

C : Recursively ennumerable language is the super set of regular language

D : Context sensitive language is a subset of context free language

Q.no 26. Choose the incorrect statement.

A : Moore and Mealy machines are FSM with output capabilities

B : Any given Moore machine has an equivalent Mealy machine

C : Any given Mealy machine has an equivalent Moore machine


D : Moore machine is not an FSM

Q.no 27. A string derived by a grammar is graphically represented using ……...

A : Binary tree

B : Sparse tree

C : Parse tree

D : Forest

Q.no 28. Recursive languages are ………… of recursively enumerable languages.

A : subset

B : proper subset

C : not subset

D : not proper subset

Q.no 29. Construct a regular expression for the language that contains strings having
even number of 0’s followed by odd number of 1’s over {0, 1}.

A : (00)* 1 (11)*

B : ((0+1)(0+1))*

C : (0+1)*

D : (001)*

Q.no 30. Which of the following statements is false ?

A : Halting problem of Turing machines is undecidable

B : Determining whether a context-free grammar is ambiguous is undecidable

C : Given two arbitrary context-free grammars G1 G2 and it is undecidable whether L (G1) =


L (G2).

D : Given two regular grammars G1 G2 and it is undecidable whether L (G1) = L (G2)

Q.no 31.

A:
B:

C:

D:

Q.no 32. Which of the following pairs have different expressive power

A : Deterministic Finite Automata (DFA) and Non-deterministic Finite Automata (NFA)

B : Deterministic Push Down Automata (DPDA) and Non-deterministic Push Down Automata
(NPDA)

C : single tape turing machine and multi tape turing machine

D : deterministic single tape and nondeterministic single tape turing machine

Q.no 33. Which of the following statement is false?

A : For non deterministic PDA, equivalence is undecidable.

B : For deterministic PDA, equivalence is decidable.

C : For deterministic PDA, equivalence is undecidable.

D : For non deterministic PDA, equivalence is decidable.

Q.no 34. Turing machine (TM) is more powerful than FSM (Finite State Machine)
because

A : Tape movement is confined to one direction

B : It has no finite state

C : It has the capability to remember arbitrarily long sequences of input symbols

D : It has tape symbols

Q.no 35. Is the language preserved in all the steps while eliminating epsilon transitions
from a NFA?

A : yes

B : no

C : may be
D : cannot say

Q.no 36. A grammar G=(V,T,P,S) in which V represents

A : Set of Nonterminals

B : Start symbol

C : Set of terminals

D : Production

Q.no 37. Which of the following is in 2-CNF?

A : (e1 Ʌ e2) Ʌ (e1 Ʌ ~e2)

B : (e1 Ʌ e2) Ʌ (e1 V ~e2)

C : (e1 V e2) Ʌ (e1 V ~e2)

D : (e1 V e2) Ʌ (e1 Ʌ ~e2)

Q.no 38. Can a DFA recognize a palindrome number?

A : Yes

B : No

C : May be

D : Cannot be determined

Q.no 39. The shown language is recognized by (a) Turing machine, (b) Pushdown

automata, (c) Finite automata

A : Only (a)

B : Only (b)

C : Only (c)

D : Only (a) and (b)

Q.no 40. What does it mean when we say that an algorithm X is asymptotically more
efficient than Y?

A : X will always be a better choice for small inputs


B : X will always be a better choice for large inputs

C : Y will always be a better choice for small inputs

D : X will always be a better choice for all inputs

Q.no 41.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 42. Which of the following are decidable?


I. Whether the intersection of two regular languages is infinite
II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 43. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.


Q.no 44. For two regular languages
L1 = (a + b)* a
and
L2 = b (a + b ) *
the intersection of L1 and L2 is given by

A : (a + b ) * ab

B : ab (a + b ) *

C:a(a+b)*b

D : b (a + b ) * a

Q.no 45. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 46. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 47. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011
Q.no 48. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 49. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 50. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?

A:

B:
C:

D:

Q.no 51. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 52. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 53. Construct a Turing machine which accepts a string with ‘aba’ as its substring.
A:

B:

C:
D:

Q.no 54. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar

Q.no 55. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

Q.no 56. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard
Q.no 57. Which of the following is NOT generated by regular expression
R = (ab + abb)* bbab

A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 58. Which of the following grammars are in Chomsky Normal Form:

A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 59. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 60. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II
B : Only III

C : Only I and II

D : Only I and III

Q.no 1. Which operation can be applied on stack

A : Push

B : Pop

C : Push and Pop

D : Read

Q.no 2. An algorithm is called efficient if it runs in ____________ time on a serial


computer.

A : Polynomial

B : Non polynomial

C : Logarithmic

D : Non Logarithmic

Q.no 3. Choose the correct option for the statement: Unambiguity is the ideal structure
of a language.

A : true

B : Partially True

C : false

D : Cannot be said

Q.no 4. Pushdown automata accepts

A : regular language

B : context free language

C : context sensitive language

D : unrestricted language

Q.no 5. 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

C : At least one state has more than one transitions

D : At most one state has more than one transitions

Q.no 6. Regular expression x + y denotes the set

A : {x,y}

B : {xy}

C : {x}

D : {y}

Q.no 7. Given the expression, is there some assignment of true and false values to the
variables that will make the entire expression true? This is termed as

A : Satisfiability problem

B : Independent set problem

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 8. What is the Regular Expression Matching Zero or More Specific Characters

A:x

B:#

C:*

D:&

Q.no 9. Transition function of Turing Machine is

A:

B:

C:
D:

Q.no 10. The regular expression to denote zero or more instances of x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 11.

A:

B:

C:L

D : L*

Q.no 12. A push down automata is different than finite automata by

A : Its memory

B : number of states

C : start state

D : input symbols

Q.no 13. Consider following regular expression


i) (a|b)* ii) (a*|b*)* iii) ((a)*b*)* Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : all are equal

Q.no 14. Linear Bounded Automaton is a


A : Finite Automaton

B : Turing Machine

C : Push down Automaton

D : Deterministic Finite Automata

Q.no 15. Which of the following statement is true?

A : Mealy machine has no terminating state

B : A Moore machine has terminating state

C : Converting from Mealy into Moore machine and vice versa is not possible

D : More machine is Moore powerful than Mealy machine

Q.no 16. Which of the production rule can be accepted by Chomsky grammar. (i) A->BC,
(ii) A->a

A : only i

B : only ii

C : both i and ii

D : neither i nor ii

Q.no 17. A two-way infinite tape Turing machine is ________ superior than the basic
model of the Turing machine in terms of power.

A : More

B : Less

C : No way

D : Very Much

Q.no 18. The language accepted by a Turing machine is called ………. language.

A : Regular

B : Recursively Enumerable

C : Context free

D : Context sensitive
Q.no 19. Which of the following does not belong to the language if input alphabet set is
a,b

A:a

B:b

C : epsilon

D:c

Q.no 20. In one move the Turing machine___

A : May change its state

B : Write a symbol on the cell being scanned.

C : Move the head one position left or right

D : All of the above

Q.no 21. Which of the following statement is correct?

A : All Regular grammars are context free but not vice versa

B : All context free grammars are regular grammars but not vice versa

C : Regular grammar and context free grammar are the same entity

D : All context sensitive grammar are regular grammar but not vice versa

Q.no 22. Which of the given problems are NP-complete?

A : (a) Traveling Salesman Problem

B : (b) Satisfiability Problem

C : Both (a) and (b)

D : Turing Machine

Q.no 23. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings without double a?

A:

B : ((a+b)(a+b))*
C : (a + bb)*

D:

Q.no 24.

A : {w | w is a string of odd length}

B : {w | w is a string of length multiple of 3}

C : {w | w is a string of length 3}

D : {w | w is an empty string}

Q.no 25. Which of the following statement is false?

A : Every language that is defined by regular expression can also be defined by finite
automata

B : Every language defined by finite automata can also be defined by regular expression

C : We can convert regular expressions into finite automata

D : There exists a unique DFA for every regular language

Q.no 26. An Epsilon-NFA is ___________ in representation.

A : Quadruple

B : Quintuple

C : Triple

D : None of the mentioned

Q.no 27.

A:

B:
C:

D : {0, 1}

Q.no 28. Which of the following statements is false?

A : For every non-deterministic Turing machine, there exists an equivalent deterministic


Turing machine.

B : Turing recognizable languages are closed under union and complement.

C : Turing decidable languages are closed under intersection


and complement.

D : Turing recognizable languages are closed under union and intersection.

Q.no 29. The worst-case efficiency of solving a problem in polynomial time is?

A : O(p(n))

B : O(p( n log n))

C:

D : O(p(m log n))

Q.no 30. It is less complex to prove the closure properties over regular languages using

A : NFA

B : DFA

C : PDA

D : Canot be said

Q.no 31. Which of the following is a regular language?

A : String whose length is a sequence of prime numbers

B : String with substring wwr in between

C : Palindrome string

D : String with even number of Zeroes


Q.no 32. In definition of PDA M=(Q, Σ,Γ, q0,Z0,A,δ) what Γ represents

A : initial stack symbol

B : stack alphabet

C : finite set of states

D : transition function

Q.no 33. The total number of states and transitions required to form a Moore machine
that processes a binary input string and will produce residue mod 3.

A : 3 and 6

B : 3 and 5

C : 2 and 4

D : 2 and 5

Q.no 34. Which of the following problems is solvable ?

A : Writing a universal Turing machine

B : Determining of an arbitrary Turing machine is an universal Turing machine

C : Determining of a universal Turing machine can be written for fewer than k instructions
for some k

D : Determining of a universal Turing machine and some input will halt

Q.no 35. Which of the following is true for the language?

A : It is not accepted by a Turing Machine

B : It is regular but not context-free

C : It is context-free but not regular

D : It is neither regular nor context-free, but accepted by a Turing machine

Q.no 36. A PDA chooses the next move based on

A : current State and input

B : current state, stack and input


C : current state and stack

D : current state

Q.no 37. Which of the following is not a Non deterministic Turing machine?

A : Alternating Turing Machine

B : Probabalistic Turing Machine

C : Read-only Turing Machine

D : Unsolvable

Q.no 38. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which any occurrence of the symbol b, is in
groups of odd numbers.

A : (abbb)*

B : a* b (bb)* a*

C : ((a+b)(a+b)(a+b))*

D : a* b* (bb)* a*

Q.no 39. PDA is useful in

A : lexical analysis

B : syntax analysis

C : semantic analysis

D : code generation

Q.no 40. Every CFG can be transformed into equivalent NPDA.

A : false

B : true

C : may be

D : cannot say

Q.no 41. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.

A:

B:

C:
D:

Q.no 42. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 43. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's

D : has atleast two a's

Q.no 44. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:
Q.no 45. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 46. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 47. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".
A:

B:

C:

D:

Q.no 48.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable

Q.no 49. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?
A : 10

B : 11

C : 12

D : 15

Q.no 50. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 51. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 52. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable
Q.no 53. The minimum number of productions required to produce a language
consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2

Q.no 54. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal

Q.no 55.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 56. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar
Q.no 57. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 58. The CFG "S-> aS | bS |a|b " is equivalent to regular expression

A : (a + b)

B : (a + b) (a + b)*

C : (a + b) (a + b)

D : (a . b) (a . b)

Q.no 59. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD

D:DA

Q.no 60. CFG is not closed under

A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 1. PDA accepts languages generated by which grammar


A : type 0

B : type 1

C : type 2

D : type 3

Q.no 2. A Turing machine with several tapes in known as

A : Multi-tape Turing machine

B : Poly-tape Turing maching

C : Universal Turing machine

D : Complete Turing machine

Q.no 3. The push down automata indicate the acceptance of input string in terms of

A : final state

B : empty stack

C : final state and empty stack

D : start state

Q.no 4. The major difference between Mealy and Moore machine is about:

A : Output Variations

B : Input Variations

C : Both

D : Transitions

Q.no 5. Which of the following are the examples of finite state machine system? (a)
Control Mechanism of an elevator (b) Traffic Lights (c) Combinational Locks

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)


Q.no 6. The format: A->aB refers to which of the following?

A : Chomsky Normal Form

B : Greibach Normal Form

C : Backus Naur Form

D : Sentential form

Q.no 7. In Mealy machine the output depends on

A : Only present state

B : Present state and present input

C : Nothing

D : Type of input

Q.no 8. If two finite state machines are equivalent,

A : they should have the same number of states

B : they should have the same number of edges

C : they should have the same number of states and edges

D : they can have different number of states and edges

Q.no 9. Bottom-up parsers use

A : leftmost derivation

B : rightmost derivation

C : rightmost derivation in reverse order

D : leftmost derivation in reverse order

Q.no 10. A push down automaton employs which data structure?

A : queue

B : linked list

C : hash table

D : stack
Q.no 11. Construct a regular expression for the language that contains strings having at
least one pair of consecutive zeros over {0, 1}.

A : (100)*

B : 1* (00)* 1*

C : [ (1 + 0 )* (00) (1 + 0 )*] +

D : ((0+1)(0+1))*

Q.no 12. Halting states are of two types. They are:

A : accept and reject

B : reject and allow

C : start and reject

D : start and accept

Q.no 13. Universal TM influenced the concept of

A : Stored program computers

B : Interpretive implementation of programming languages

C : Computability

D : All of these

Q.no 14. If T1 and T2 are two Turing machines, the composite can be represented using
the expression

A : T1 T2

B : T2 T1

C : T1 X T2

D : T2 X T1

Q.no 15. Which of the following are the actions that operates on stack top?

A : only push

B : only pop

C : only push and pop


D : push, pop and replace

Q.no 16. Epsilon-closure of a state is a combination of self state and ----

A : Epsilon-reachable states

B : initial state

C : Final state

D : Non-final states

Q.no 17. Which one of the following is the most powerful method?

A : LL(1)

B : SLR

C : CLR

D : LALR

Q.no 18. There is a linear grammar that generates a context free grammar

A : Always

B : Never

C : Sometimes

D : Everytime

Q.no 19. The finite automata  is called NFA when there exists____________ for a specific
input from current state to next state

A : Single path

B : Multiple paths

C : Only two paths

D : Three paths

Q.no 20. If there exists a language L, for which there exists a TM, T, that accepts every
word in L and either rejects or loops for every word that is not in L, is called

A : Recursive

B : Recursively Enumerable
C : NP-HARD

D : NP Complete

Q.no 21. The RE in which any number of 0′s is followed by any number of 1′s followed
by any number of 2′s is

A : (0+1+2)*

B : 0*1*2*

C : 0* + 1 + 2

D : (0+1)*2*

Q.no 22. Which of the following statement is false?

A : For non deterministic PDA, equivalence is undecidable.

B : For deterministic PDA, equivalence is decidable.

C : For deterministic PDA, equivalence is undecidable.

D : For non deterministic PDA, equivalence is decidable.

Q.no 23. Which of the following does not obey pumping lemma for context free
languages ?

A : Finite languages

B : Context free Languages

C : Unrestricted languages

D : Restricted languages

Q.no 24. Is the language preserved in all the steps while eliminating epsilon transitions
from a NFA?

A : yes

B : no

C : may be

D : cannot say

Q.no 25. Which one of the following is FALSE?


A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to an equivalent DFA.

C : Every Epsilon NFA can be converted to an equivalent DFA.

D : Every Mealy can be converted to an equivalent Moore machine.

Q.no 26. The difference between Turing Machine and Two Way FA is in:

A : Input Tape

B : Read Write Head

C : Finite Control

D : All of these

Q.no 27. The regular expression with all strings of 0′s and 1′s with at least two
consecutive 0′s is:

A : 1 + (10)*

B : (0+1)*00(0+1)*

C : (0+1)*011

D : 0*1*2*

Q.no 28. Under which of the following operation, NFA is not closed?

A : Negation

B : Kleene

C : Concatenation

D : complement

Q.no 29. The minimum number of productions required to produce a language


consisting of palindrome strings over T={a,b} is

A:3

B:7

C:5

D:6
Q.no 30. The operations of PDA never work on elements other than top of the stack.

A : false

B : true

C : may be

D : cannot say

Q.no 31. Which regular language corresponds to 1+(1+0)*0+(0+1)*11

A : The language of all strings that end with 11 or 00

B : The language of all strings that end with 0 or 1

C : The language of all strings which does not end with 01

D : The language of all strings which does not end with 10

Q.no 32. The minimum number of 1’s to be used in a regular expression of the given
language of all strings containing exactly 2 zeroes.

A:2

B:3

C:0

D:1

Q.no 33. The production of the form A->B , where A and B are non terminals is called

A : Null production

B : Greibach Normal Form

C : Unit production

D : Chomsky Normal Form

Q.no 34. For a DFA accepting binary numbers whose decimal equivalent is divisible by
4, what are all the possible remainders?

A:0

B:2

C : 0,2,4
D : 0,1,2,3

Q.no 35. Which among the following is equivalent to the given regular expression 01*+1

A : (01)*+1

B : 0((1)*+1)

C : (0(1)*)+1

D : ((0*1)1*)*

Q.no 36. Complement of a DFA can be obtained by

A : making starting state as final state.

B : no trival method.

C : making final states non-final and non-final to final.

D : make final as a starting state.

Q.no 37. The RE that gives none or many instances of an x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 38. Language is accepted by PDA if it is

A : regular language

B : context free language

C : unrestricted

D : regular and context free

Q.no 39. The complexity class P consist of all the decision problems that can be solved
by ___________using polynomial amount of computation time.

A : Push Down automata

B : DFA
C : NDFA

D : Deterministic Turing machine

Q.no 40. According to Chomsky hierarchy, which of the following is recognized by


Recursively Enumerable language?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 41. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 42. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome


B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 43. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 44. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 45. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab

A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 46. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)


Q.no 47. Which of the following grammars are in Chomsky Normal Form:

A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 48. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II

B : Only III

C : Only I and II

D : Only I and III

Q.no 49. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 50. For two regular languages


L1 = (a + b)* a
and
L2 = b (a + b ) *
the intersection of L1 and L2 is given by

A : (a + b ) * ab

B : ab (a + b ) *

C:a(a+b)*b

D : b (a + b ) * a

Q.no 51. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 52.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 53. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete
C : Q is NP-hard

D : R is NP-hard

Q.no 54. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 55. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 56.

A:A

B:B
C:C

D:D

Q.no 57. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 58. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

Q.no 59. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*
B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 60. Construct a Turing machine which accepts a string with ‘aba’ as its substring.

A:

B:

C:
D:

Q.no 1. Decidable can be taken as a synonym to:

A : Recursive

B : Non Recursive

C : Recognizable

D : Non Recognizable

Q.no 2. Precedence of regular expression in decreasing order is

A:*,.,+

B:.,*,+

C:.,+,*

D:+,.,*

Q.no 3. A formal language is recursive if :

A : A turing machine exists

B : A turing machine that halts for every input

C : Turing machine rejects if the input does not belong to the language

D : All of the mentioned

Q.no 4. The recognizing capability of NDFAand DFA

A : must be the same

B : may be different
C : must be different

D : cannot say

Q.no 5. In Moore machine the output depends on

A : Only present state

B : Present state and present input

C : Nothing

D : Type of input

Q.no 6. Language of finite automata is generated by

A : Type 0 grammar

B : Type 1 grammar

C : Type 2 grammar

D : Type 3 grammar

Q.no 7. Kruskal's algorithm is used to find

A : whether there is cycle in the graph

B : spanning tree of the graph

C : minimum spanning tree in the graph

D : whether there is spanning tree in the graph

Q.no 8. The symbol Z0 in formal definition of PDA is used for

A : input symbol

B : stack symbol

C : output symbol

D : tape symbol

Q.no 9. If the PDA does not stop on an accepting state and the stack is not empty, the
string is

A : rejected
B : goes into loop forever

C : rejected and goes into loop forever

D : accepted

Q.no 10. Which of the following regular expressions represents the set of strings which
do not contain a substring ‘rt’ if alphabet = {r, t}

A : (rt)*

B : (tr)*

C : (r*t*)

D : (t*r*)

Q.no 11. A grammar G=(V, T, P, S) is __________ if every production taken one of the two
forms: B->aC , B->a

A : Ambiguous

B : Regular

C : Non Regular

D : Context sensitive

Q.no 12. (a+b)* is equivalent to

A : b*a*

B : (a*b*)*

C : a*b*

D:

Q.no 13. Which one of the following languages over the alphabet {0, 1} is described by
the regular expression: (0+1)*0(0+1)*0(0+1)*

A : The set of all strings containing the substring 00

B : The set of all strings containing at most two 0’s

C : The set of all strings containing at least two 0’s

D : The set of all strings that begin and end with either 0 or 1
Q.no 14.

A:R

B:

C : R*

D:

Q.no 15. Are the given two patterns equivalent?


(1) gray | grey (2) gr(a|e)y

A : yes

B : no

C : may be

D : cannot say

Q.no 16. What is the pumping length of string of length x?

A : x+1

B:x

C : x-1

D : x2

Q.no 17. The Grammar can be defined as: G= (V, T, P, S) In the given definition, what
does S represents?

A : Accepting State

B : Starting Variable

C : Sensitive Grammar

D : Final state

Q.no 18. Which of the following is not a part of 5-tuple finite automata?
A : Input alphabet

B : Transition function

C : Initial State

D : Output alphabet

Q.no 19. In Moore machine, if input is of length n, then length of output string will be

A:n

B : n+1

C : n+n

D : n-1

Q.no 20. Which of the following correctly recognize the symbol ‘|-‘ in context to PDA?

A : moves

B : transition function

C : or symbol

D : not symbol

Q.no 21. Which is a wrong satatement?

A : A regular language is produced by union of two regular languages

B : The concatenation of two regular languages is regular

C : The Kleene closure of a regular language is regular

D : The complement of a regular language is also a regular language

Q.no 22. The basic limitation of finite automata is that

A : It cannot remember arbitrary large amount of information.

B : It sometimes recognize grammar that are not regular.

C : It sometimes fails to recognize regular grammar.

D : It sometimes fails to recognize regular laguage


Q.no 23. Given grammar G:
(1)S->AS (2)S->AAS (3)A->SA (4)A->aa
Which of the following productions denies the format of Chomsky Normal Form?

A : 2,4

B : 1,3

C : 1, 2, 3, 4

D : 2, 3, 4

Q.no 24. The difference between number of states in FA for regular expression (a + b)
and (a + b) * is:

A:1

B:2

C:3

D:0

Q.no 25. Which of the following represents a language which has no pair of consecutive
1’s if alphabet = {0,1}?

A:

B:

C:

D:

Q.no 26. In definition of PDA M=(Q, Σ,Γ, q0,Z0,A,δ) what Γ represents

A : initial stack symbol

B : stack alphabet

C : finite set of states


D : transition function

Q.no 27. A grammar G=(V,T,P,S) in which V represents

A : Set of Nonterminals

B : Start symbol

C : Set of terminals

D : Production

Q.no 28. Given a Grammar G:


S->aA
A->a | A
B->B
The number of productions to be removed immediately as Unit productions are

A:0

B:1

C:2

D:3

Q.no 29. A non-deterministic pushdown automaton can be converted into an equivalent


deterministic pushdown automaton.

A : never

B : not always

C : always

D : maybe

Q.no 30. Which productions will generate odd length palindromes for terminals 'a' and
'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb

D : S-> aSb|bSa|a|b

Q.no 31. Which of the following statement is not true?


A : Type 0 grammar is called unrestricted grammar

B : Chomsky hierarchy define only one type of grammar

C : Type 3 grammar is recognized by FA

D : Type 2 grammar is CFG

Q.no 32. Which of the following automata takes stack as auxiliary storage

A : finite automata

B : pushdown automata

C : Turing machine

D : finite state machine

Q.no 33. 3-SAT and 2-SAT problems are

A : NP-complete and in P respectively

B : Undecidable and NP-complete

C : Both NP-complete

D : Both in P

Q.no 34. Which of the following statements is false ?

A : Halting problem of Turing machines is undecidable

B : Determining whether a context-free grammar is ambiguous is undecidable

C : Given two arbitrary context-free grammars G1 G2 and it is undecidable whether L (G1) =


L (G2).

D : Given two regular grammars G1 G2 and it is undecidable whether L (G1) = L (G2)

Q.no 35. Which of the following is not a regular expression?

A : [(a+b)*(aa+bb)]*

B : [(0+1)-(0b+a1)*(a+]*

C : (01+11+10)*

D : (1+2+0)*(1+2)*
Q.no 36. PDA works as Finite Automata when the number of auxiliary memory it has is

A:3

B:2

C:1

D:0

Q.no 37. Which of the following problems is solvable ?

A : Writing a universal Turing machine

B : Determining of an arbitrary Turing machine is an universal Turing machine

C : Determining of a universal Turing machine can be written for fewer than k instructions
for some k

D : Determining of a universal Turing machine and some input will halt

Q.no 38. A context free language is called ambiguous if (a) It has two or more leftmost
derivations for the same string. (b) It has two or more rightmost derivations for the
same string. (c) It has Only single derivation tree.

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Only (c)

Q.no 39. Regular expression (x|y)(x|y) denotes the set

A : {xy,xy}

B : {xx,xy,yx,yy}

C : {x,y}

D : {x,y,xy}

Q.no 40. Which of the following statement is correct?

A : All Regular grammars are context free but not vice versa

B : All context free grammars are regular grammars but not vice versa
C : Regular grammar and context free grammar are the same entity

D : All context sensitive grammar are regular grammar but not vice versa

Q.no 41. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable

Q.no 42. The CFG "S-> aS | bS |a|b " is equivalent to regular expression

A : (a + b)

B : (a + b) (a + b)*

C : (a + b) (a + b)

D : (a . b) (a . b)

Q.no 43. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 44. CFG is not closed under

A : Kleene closure

B : Concatenation
C : Complement

D : Union

Q.no 45. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard

Q.no 46.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 47. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 48. Which of the following are decidable?


I. Whether the intersection of two regular languages is infinite
II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free

A : I and II
B : I and IV

C : II and III

D : II and IV

Q.no 49. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 50. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 51. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 52. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted


Q.no 53. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 54. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2
Q.no 55. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 56. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 57. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 58. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.

A:

B:

C:
D:

Q.no 59. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 60. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011

Q.no 1. RR* can be expressed in which of the forms:

A : R+

B : R-

C : R+ U R-

D:R

Q.no 2. In Parse Tree, Root represents


A : Terminals

B : Variables

C : Start Symbol

D : Productions

Q.no 3. Transition function of Turing Machine is

A:

B:

C:

D:

Q.no 4. To which of the following class does a CNF-satisfiability problem belong?

A : NP class

B : P class

C : NP complete

D : NP hard

Q.no 5.

A:

B:

C:0

D:1

Q.no 6. Why Palindromes cannot be recognized by any FSM ?

A : an FSM cannot deterministically fix the mid-point


B : an FSM can remember arbitrarily large amount of information

C : FSM has finite memory

D : FSM has only 5 tuples

Q.no 7. Which of the following are the actions that operates on stack top?

A : only push

B : only pop

C : only push and pop

D : push, pop and replace

Q.no 8. Halting states are of two types. They are:

A : accept and reject

B : reject and allow

C : start and reject

D : start and accept

Q.no 9. Top-down parsers use

A : leftmost derivation

B : rightmost derivation

C : rightmost derivation in reverse order

D : leftmost derivation in reverse order

Q.no 10. A Turing machine operates over

A : Finite memory tape

B : Infinite memory tape

C : Depends on the algorithm

D : Depends on the input

Q.no 11. 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*

B : R = P*Q

C : R = RP

D : R = QP

Q.no 12. The major difference between Mealy and Moore machine is about:

A : Output Variations

B : Input Variations

C : Both

D : Transitions

Q.no 13. Which among the following are incorrect regular identities?

A:

B:

C:

D:

Q.no 14. Which of the following pair of regular expressions are not equivalent?

A : 1(01)* and (10)*1

B : x(xx)* and (xx)*x

C : (ab)* and a*b*

D : x+ and x*x+

Q.no 15. A boolean formula is said to be in Conjuctive Normal Form (CNF) if it can
represented as

A : e1 V e2 V e3

B : e1 Ʌ e2 V e3
C : e1 V e2 Ʌ e3

D : e1 Ʌ e2 Ʌ e3

Q.no 16. Which of the following is false for a grammar G in Chomsky Normal Form:

A : G has no useless symbols

B : G has no unit productions

C : G has no epsilon productions

D : G must have useless symbols

Q.no 17. A Language for which no DFA exist is a________

A : Regular Language

B : Non-Regular Language

C : May be Regular

D : Cannot be said

Q.no 18. PDA is more powerful than

A : Turing Machine

B : Finite Automata

C : Linear Bounded Automata

D : Non Deterministic Turing Machine

Q.no 19. Which of the following case does not exist in complexity theory?

A : Best case

B : Worst case

C : Average case

D : Null case

Q.no 20. Which of the production rule can be accepted by Chomsky grammar. (i) A->BC,
(ii) A->a

A : only i
B : only ii

C : both i and ii

D : neither i nor ii

Q.no 21. The production of the form A->B , where A and B are non terminals is called

A : Null production

B : Greibach Normal Form

C : Unit production

D : Chomsky Normal Form

Q.no 22.

A:

B:

C:

D:

Q.no 23. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which the total number of a’s is divisible by 2.

A : ((a+b)(a+b))*

B : (a + ab)*

C : ( b* a b*ab*)* + b*

D : a* b (aa)*b a*

Q.no 24. Which of the following is in 2-CNF?

A : (e1 Ʌ e2) Ʌ (e1 Ʌ ~e2)

B : (e1 Ʌ e2) Ʌ (e1 V ~e2)

C : (e1 V e2) Ʌ (e1 V ~e2)


D : (e1 V e2) Ʌ (e1 Ʌ ~e2)

Q.no 25. The power of non-deterministic pushdown automata and deterministic


pushdown automata is not same.

A : true

B : false

C : maybe

D : cannot say

Q.no 26. A string derived by a grammar is graphically represented using ……...

A : Binary tree

B : Sparse tree

C : Parse tree

D : Forest

Q.no 27. For every CFL, G, there exists a PDA M such that L(G) = L(M) and vice versa.

A : true

B : false

C : maybe

D : probably

Q.no 28. Which of the following statements is incorrect?

A : A Turing Machine cannot solve Halting problem

B : Set of recursively enumerated languages is closed under union

C : A FSM with 3 stacks is more powerful than FSM with 2 stacks

D : Context sensitive grammar can be recognized by a linearly bounded memory machine.

Q.no 29. Which of the following is a false statement?

A : Moore machine has no accepting states

B : Mealy machine has no accepting states


C : We can convert Mealy to Moore and vice versa

D : We can convert Mealy to Moore but not vice versa

Q.no 30. If r1 = (aa + bb) and r2 = (a + b) then the language (aa + bb)(a + b) will be
generated by

A : (r1)(r2)

B : (r1 + r2)

C : (r2)(r1)

D : (r1)

Q.no 31. Which of the following statement(s) are correct? (a) All languages can be
generated by CFG, (b) Any regular language has an equivalent CFG, (c) Some non
regular languages cannot be generated by CFG.

A : only (a)

B : Only (b)

C : Only (c)

D : Both (b) and (c)

Q.no 32. Limitation of PDA can be overcome by

A : Mealy machine

B : Moore machine

C : Turing machine

D : Finite state machine

Q.no 33. The problem of finding a path in a graph that visits every vertex exactly once
is called

A : Hamiltonian path problem

B : Hamiltonian cycle problem

C : Subset sum problem

D : Turnpike reconstruction problem

Q.no 34. The subset construction shows that every NFA accepts a ……..
A : String

B : Function

C : Regular language

D : Context-free language

Q.no 35. Construct a regular expression for the language that contains strings having
no pair of consecutive zeros over {0, 1}.

A : (1+0)*

B:

C : ((0+1)(0+1))*

D : (01 + 10)*

Q.no 36. Production Rule: aAb->agb belongs to which of the following category?

A : Regular Language

B : Context free Language

C : Context Sensitive Language

D : Recursively Ennumerable Language

Q.no 37. Which of the following pairs have DIFFERENT expressive power?

A : Deterministic finite automata (DFA) and Non-Deterministic finite automata(NFA)

B : Deterministic push down automata (DPDA) and Non-deterministic pushdown automata


(NPDA)

C : Deterministic single-tape Turing machine and Non-deterministic single-tape Turing


Machine

D : Single-tape Turing machine and multi-tape Turing machine

Q.no 38. Construct a regular expression for the language that contains strings that
start with either ‘01’ or ‘10’ over {0, 1}.

A : (01 + 10)*

B : (1+0)* (01 + 10) (1+0)*


C : (01 + 10) (1+0)*

D : (1+0)*

Q.no 39. Number of external states of a UTM should be atleast

A:1

B:2

C:3

D:4

Q.no 40. Pushdown automata behaves like Turing machine when it has the number of
auxiliary memory

A : one or more

B : two or more

C : zero

D : one

Q.no 41.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 42. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".
A:

B:

C:

D:

Q.no 43.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable

Q.no 44. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab

A : ababbbbab
B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 45. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD

D:DA

Q.no 46. For two regular languages


L1 = (a + b)* a
and
L2 = b (a + b ) *
the intersection of L1 and L2 is given by

A : (a + b ) * ab

B : ab (a + b ) *

C:a(a+b)*b

D : b (a + b ) * a

Q.no 47. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar
Q.no 48. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 49.

A:A

B:B

C:C

D:D

Q.no 50. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*
C : (0+010)*

D : (0+1)*

Q.no 51. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 52. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 53. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 54. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a
D : (a+b)(a+b)*

Q.no 55. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 56. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II

B : Only III

C : Only I and II

D : Only I and III

Q.no 57. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?

A:
B:

C:

D:

Q.no 58. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 59. Which of the following grammars are in Chomsky Normal Form:
A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 60. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar

Q.no 1. 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

C : At least one state has more than one transitions

D : At most one state has more than one transitions

Q.no 2. In Mealy machine the output depends on

A : Only present state

B : Present state and present input

C : Nothing

D : Type of input
Q.no 3. Problems that can be solved in polynomial time are known as

A : intractable

B : tractable

C : decision

D : complete

Q.no 4. If T1 and T2 are two Turing machines, the composite can be represented using
the expression

A : T1 T2

B : T2 T1

C : T1 X T2

D : T2 X T1

Q.no 5. Which of the following can be used to simulate any Turing machine?

A : Finite State Automaton

B : Universal Turing Machine

C : Counter machines

D : Deterministic Finite Automata

Q.no 6. For alphabet = {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

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

Q.no 7. Which among the following cannot be accepted by a regular grammar?

A : L is a set of numbers divisible by 2

B : L is a set of binary complement

C : L is a set of strings with odd number of 0s


D : L is a set of 0^n1^n

Q.no 8. The transition a Push down automaton makes is additionally dependent upon
the:

A : Current State

B : input tape

C : stack

D : terminals

Q.no 9. If there exists a language L, for which there exists a TM, T, that accepts every
word in L and either rejects or loops for every word that is not in L, is called

A : Recursive

B : Recursively Enumerable

C : NP-HARD

D : NP Complete

Q.no 10. How many states a Turing machine has?

A : Finite

B : Infinite

C : May be finite

D : One

Q.no 11. Given the expression, is there some assignment of true and false values to the
variables that will make the entire expression true? This is termed as

A : Satisfiability problem

B : Independent set problem

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 12. In CFG, notation of VARIABLE representation is

A : Captal Letters
B : Small Letters

C : Italic Letters

D : Roman Letters

Q.no 13. Those problems that are solvable in polynomial time belong to __

A : NP

B:P

C : Hard

D : Complete

Q.no 14. Finite state machine is ___________tuple machine.

A:4

B:5

C:6

D : unlimitted

Q.no 15. 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

B : 2, 3 and 4

C : 1, 2 and 4

D : 1, 3 and 4

Q.no 16. Those problems that require large amount of computational resources that
are practically not feasible to solve, these problems are known as _________

A : Decidable

B : Undecidable

C : Tractable

D : Intractable
Q.no 17. Regular expression x + y denotes the set

A : {x,y}

B : {xy}

C : {x}

D : {y}

Q.no 18. A->aA| a| b


The number of steps to generate aab are

A:2

B:3

C:4

D:5

Q.no 19. A deterministic Turing machine is

A : Ambiguous Turing Machine

B : Unambiguous Turing Machine

C : Non-Deterministic Finite Automata

D : Deterministic Finite Automata

Q.no 20. Which of these does not belong to CFG?

A : Terminal Symbol

B : Non Terminal Symbol

C : Start symbol

D : End symbol

Q.no 21. The ability for a system of instructions to simulate a Turing Machine is called
_________

A : Turing Completeness

B : Simulation

C : Turing Halting
D : Computability

Q.no 22. For a give Moore Machine,


Statement 1: Null string is processed in Moore Machine.
Statement 2: There are more than 5-Tuples in the definition of Moore Machine.
Choose the correct option.

A : Statement 1 is true and Statement 2 is true

B : Statement 1 is true while Statement 2 is false

C : Statement 1 is false while Statement 2 is true

D : Statement 1 is false and Statement 2 is false

Q.no 23. CFGs are more powerful than (a) DFA, (b) NDFA, (c) Mealy Machine

A : Only (a)

B : Only (b) and (c)

C : Only (a) and (c)

D : (a), (b) and (c)

Q.no 24. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which any occurrence of the symbol b, is in
groups of odd numbers.

A : (abbb)*

B : a* b (bb)* a*

C : ((a+b)(a+b)(a+b))*

D : a* b* (bb)* a*

Q.no 25. Let the class of language accepted by finite state machine be L1 and the class
of languages represented by regular expressions be L2 then

A : L1<L2

B : L1>=L2

C : L1!=L2

D : L1=L2

Q.no 26. Which of the following pairs have different expressive power
A : Deterministic Finite Automata (DFA) and Non-deterministic Finite Automata (NFA)

B : Deterministic Push Down Automata (DPDA) and Non-deterministic Push Down Automata
(NPDA)

C : single tape turing machine and multi tape turing machine

D : deterministic single tape and nondeterministic single tape turing machine

Q.no 27. PDA can be represented with the help of

A : Instantaneous description

B : input symbols

C : start state

D : final state

Q.no 28. PDA works as Finite Automata when the number of auxiliary memory it has is

A:3

B:2

C:1

D:0

Q.no 29. The set of all strings over alphabet = {a,b} in which all strings having bbbb as
substring is

A : (a+b)* bbbb (a+b)*

B : (a+b)* bb (a+b)*bb

C : bbb(a+b)*

D : bb (a+b)*

Q.no 30. Which of the following represents a language which has no pair of consecutive
1’s if alphabet = {0,1}?

A:
B:

C:

D:

Q.no 31. The variable which produces


epsilon is called

A : Empty variable

B : Nullable variable

C : Non-empty variable

D : Non-nullable variable

Q.no 32. According to Chomsky hierarchy, which of the following is recognized by


Recursively Enumerable language?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 33. Which of the following is a regular language?

A : String whose length is a sequence of prime numbers

B : String with substring wwr in between

C : Palindrome string

D : String with even number of Zeroes

Q.no 34. Which of the following is not a regular expression?

A : [(a+b)*(aa+bb)]*

B : [(0+1)-(0b+a1)*(a+]*
C : (01+11+10)*

D : (1+2+0)*(1+2)*

Q.no 35.

A:

B:

C:

D : {0, 1}

Q.no 36. Which of the following statement is correct?

A : All Regular grammars are context free but not vice versa

B : All context free grammars are regular grammars but not vice versa

C : Regular grammar and context free grammar are the same entity

D : All context sensitive grammar are regular grammar but not vice versa

Q.no 37. Construct a regular expression for the language that contains strings having
even number of 0’s followed by odd number of 1’s over {0, 1}.

A : (00)* 1 (11)*

B : ((0+1)(0+1))*

C : (0+1)*

D : (001)*

Q.no 38. If there exists a TM which when applied to any problem in the class,
terminates, if correct answer is yes and may or may not terminate otherwise is called

A : Stable

B : Unsolvable

C : Partially solvable
D : Unstable

Q.no 39. Number of states required to accept strings ending with 10 are

A:3

B:2

C:1

D : can’t be represented.

Q.no 40. Which of the following statements is false ?

A : Halting problem of Turing machines is undecidable

B : Determining whether a context-free grammar is ambiguous is undecidable

C : Given two arbitrary context-free grammars G1 G2 and it is undecidable whether L (G1) =


L (G2).

D : Given two regular grammars G1 G2 and it is undecidable whether L (G1) = L (G2)

Q.no 41. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 42. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 43. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3
B:5

C:7

D:2

Q.no 44. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal

Q.no 45. The CFG "S-> aS | bS |a|b " is equivalent to regular expression

A : (a + b)

B : (a + b) (a + b)*

C : (a + b) (a + b)

D : (a . b) (a . b)

Q.no 46. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa
Q.no 47. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 48. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's

D : has atleast two a's

Q.no 49. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character


Q.no 50. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 51. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 52. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable
Q.no 53. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 54. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 55.

A : X is decidable
B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 56. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 57. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard

Q.no 58. Which of the following are decidable?


I. Whether the intersection of two regular languages is infinite
II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 59. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.
A:

B:

C:
D:

Q.no 60. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 1. Turing machine was invented by

A : Alan Turing

B : Turing man

C : Turing taring

D : Turling Bake

Q.no 2. What is the value of n if Turing machine is defined using n-tuples?

A:6

B:7

C:8

D:5

Q.no 3. Which one of the following languages over the alphabet {0, 1} is described by
the regular expression: (0+1)*0(0+1)*0(0+1)*
A : The set of all strings containing the substring 00

B : The set of all strings containing at most two 0’s

C : The set of all strings containing at least two 0’s

D : The set of all strings that begin and end with either 0 or 1

Q.no 4. Turing machine is more powerful than (a) Finite automata, (b) Push down
automata

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Neither (a) nor (b)

Q.no 5. Which of the following does not belong to the language if input alphabet set is
a,b

A:a

B:b

C : epsilon

D:c

Q.no 6. Which operation can be applied on stack

A : Push

B : Pop

C : Push and Pop

D : Read

Q.no 7. In regular expressions, the operator ‘*’ stands for

A : Concatenation

B : Selection

C : Iteration

D : Addition
Q.no 8. Construct a regular expression for the language that contains strings having at
least one pair of consecutive zeros over {0, 1}.

A : (100)*

B : 1* (00)* 1*

C : [ (1 + 0 )* (00) (1 + 0 )*] +

D : ((0+1)(0+1))*

Q.no 9. Identify the problem: Given a graph G = <V, E>, and a starting node a, does it
have a tour cost less than k?

A : Satisfiability

B : Independent set

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 10. In Parse Tree, Root represents

A : Terminals

B : Variables

C : Start Symbol

D : Productions

Q.no 11. A language is regular if and only if

A : accepted by DFA

B : accepted by PDA

C : accepted by LBA

D : accepted by Turing machine

Q.no 12. In Parse Tree, Intermediate Node represents

A : Terminals

B : Variables

C : Start Symbol
D : Productions

Q.no 13. Finite automata needs minimum _______ number of stacks

A:0

B:1

C:2

D:3

Q.no 14. The Grammar can be defined as: G= (V, T, P, S) In the given definition, what
does S represents?

A : Accepting State

B : Starting Variable

C : Sensitive Grammar

D : Final state

Q.no 15. Recursive languages are also known as:

A : decidable

B : Undecidable

C : sometimes decidable

D : infinite

Q.no 16.

A:

B:

C:L

D : L*

Q.no 17. _________ is the class of decision problems that can be solved by non-
deterministic polynomial algorithms?
A : NP

B:P

C : Hard

D : Complete

Q.no 18. The recognizing capability of NDFAand DFA

A : must be the same

B : may be different

C : must be different

D : cannot say

Q.no 19. Regular expressions are used to represent which language?

A : Recursive language

B : Context free language

C : Regular language

D : Context Sensitive language

Q.no 20. The major difference between a moore and mealy machine is that

A : Output of the former depends on the present state and present input

B : output of the former depends only on the present state

C : output of the former depends only on the present input

D : output of the former depends on the present input and next state

Q.no 21. Which among the following is not true for 2-way infinte TM?

A : Tape in both directions

B : Leftmost square not distinguished

C : Any computation that can be performed by 2-way infinite tape can also be performed by
standard TM.

D : Tape is only in one direction.


Q.no 22. An Epsilon-NFA is ___________ in representation.

A : Quadruple

B : Quintuple

C : Triple

D : None of the mentioned

Q.no 23. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which the total number of a’s is divisible by 2.

A : ((a+b)(a+b))*

B : (a + ab)*

C : ( b* a b*ab*)* + b*

D : a* b (aa)*b a*

Q.no 24. A context free language is called ambiguous if (a) It has two or more leftmost
derivations for the same string. (b) It has two or more rightmost derivations for the
same string. (c) It has Only single derivation tree.

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Only (c)

Q.no 25. Which of the functions are not performed by the Turing machine after reading
a symbol?

A : Writes the symbol

B : Moves the tape one cell left/right

C : Proceeds with next instruction or halts

D : Push the input in stack

Q.no 26. Which of the regular expressions correspond to the given problem statement:
Express the identifiers in C Programming language where l=letters d=digits

A : (l+_)(d+_)*
B : (l+d+_)*

C : (l+_)(l+d+_)*

D : (_+d)(l+d+_)*

Q.no 27. The difference between Turing Machine and Two Way FA is in:

A : Input Tape

B : Read Write Head

C : Finite Control

D : All of these

Q.no 28. Language is accepted by PDA if it is

A : regular language

B : context free language

C : unrestricted

D : regular and context free

Q.no 29.

A : Perform the transition from q0 to q1 by changing "a" symbol to "X" and perform the right
movement.

B : Perform the transition from q0 to q1 by changing "X" symbol to "a" and perform the right
movement.

C : Perform the transition from q0 to q1 by changing "a" symbol to "X" and perform the Left
movement.

D : Perform the transition from q0 to q1 by changing "q0" symbol to "q1" and perform the
right movement.

Q.no 30.
A:

B:

C:

D:

Q.no 31. Unrestricted grammar is also called_______ Grammar

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 32. A PDA machine configuration (p, w, y) can be correctly represented as

A : unprocessed input, stack content, current state

B : current state, unprocessed input, stack content

C : current state, stack content, unprocessed input

D : stack content, current state, unprocessed input

Q.no 33. A string derived by a grammar is graphically represented using ……...

A : Binary tree

B : Sparse tree

C : Parse tree

D : Forest

Q.no 34. Which productions will generate even length palindromes for terminals 'a'
and 'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb
D : S-> aSb|bSa|a|b

Q.no 35. The complexity class P consist of all the decision problems that can be solved
by ___________using polynomial amount of computation time.

A : Push Down automata

B : DFA

C : NDFA

D : Deterministic Turing machine

Q.no 36. The production of the form A->B , where A and B are non terminals is called

A : Null production

B : Greibach Normal Form

C : Unit production

D : Chomsky Normal Form

Q.no 37. X is a simple mathematical model of a computer. X has unrestricted and


unlimited memory. X is a FA with R/W head. X can have an infinite tape divided into
cells, each cell holding one symbol.
Name X?

A : Push Down Automata

B : Non deterministic Finite Automata

C : Turing machines

D : Deterministic Finite Automata

Q.no 38. Can a DFA recognize a palindrome number?

A : Yes

B : No

C : May be

D : Cannot be determined

Q.no 39. A grammar G=(V,T,P,S) in which V represents

A : Set of Nonterminals
B : Start symbol

C : Set of terminals

D : Production

Q.no 40. A PDA chooses the next move based on

A : current State and input

B : current state, stack and input

C : current state and stack

D : current state

Q.no 41. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".

A:

B:

C:

D:
Q.no 42. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 43. For two regular languages


L1 = (a + b)* a
and
L2 = b (a + b ) *
the intersection of L1 and L2 is given by

A : (a + b ) * ab

B : ab (a + b ) *

C:a(a+b)*b

D : b (a + b ) * a

Q.no 44. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 45. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab

A : ababbbbab
B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 46. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 47. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011

Q.no 48. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 49. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*


D : (111*)* and (111+11*)*

Q.no 50. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 51. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 52. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:

Q.no 53. Construct a Turing machine which accepts a string with ‘aba’ as its substring.
A:

B:

C:
D:

Q.no 54. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 55.

A:A

B:B

C:C

D:D
Q.no 56. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 57. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 58. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 59. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar


Q.no 60. CFG is not closed under

A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 1. A push down automaton employs which data structure?

A : queue

B : linked list

C : hash table

D : stack

Q.no 2. A grammar that produces more than one parse tree for some sentence is called

A : ambiguous

B : unambiguous

C : regular

D : context free grammar

Q.no 3. Bottom-up parsing is also known as

A : shift reduce parsing

B : predictive descent parsing

C : operator precedence parsing

D : LL1 Parsing

Q.no 4. Pushdown automata accepts

A : regular language

B : context free language

C : context sensitive language

D : unrestricted language
Q.no 5. Number of states required to accept strings ending with 101

A:3

B:4

C:2

D : cannot be represented.

Q.no 6. Top-down parsers use

A : leftmost derivation

B : rightmost derivation

C : rightmost derivation in reverse order

D : leftmost derivation in reverse order

Q.no 7. Every grammar in Chomsky Normal Form is:

A : regular

B : context sensitive

C : context free

D : Unrestricted

Q.no 8. For alphabet = {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

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

Q.no 9. Halting problem is an example for

A : decidable problem

B : undecidable problem

C : complete problem

D : trackable problem
Q.no 10. NFA, in its name has Non-deterministic words because

A : The result is undetermined

B : The choice of path is non-deterministic

C : The state to be transited next is non-deterministic

D : More number of final states

Q.no 11. Can we convert PDA to equivalent CFG?

A : yes

B : no

C : maybe

D : never

Q.no 12. To simplify a grammar we can eliminate

A : Useful symbols

B : epsilon productions

C : Reachable symbols

D : Non Unit productions

Q.no 13. A two-way infinite tape Turing machine is ________ superior than the basic
model of the Turing machine in terms of power.

A : More

B : Less

C : No way

D : Very Much

Q.no 14. Which of the following statement is true? (a) Turing machine was developed
by Alan Turing, (b) PDA is less powerful than Turing machine, (c) FA is more powerful
than TM

A : Only (a)

B : Only (b)
C : Both (a) and (b)

D : Only (c)

Q.no 15. The format: A->aB refers to which of the following?

A : Chomsky Normal Form

B : Greibach Normal Form

C : Backus Naur Form

D : Sentential form

Q.no 16. A push down automata is different than finite automata by

A : Its memory

B : number of states

C : start state

D : input symbols

Q.no 17. Language of finite automata is generated by

A : Type 0 grammar

B : Type 1 grammar

C : Type 2 grammar

D : Type 3 grammar

Q.no 18. (a+b)* is equivalent to

A : b*a*

B : (a*b*)*

C : a*b*

D:

Q.no 19. Which among the following are incorrect regular identities?

A:
B:

C:

D:

Q.no 20. Choose the correct option for the statement: Unambiguity is the ideal
structure of a language.

A : true

B : Partially True

C : false

D : Cannot be said

Q.no 21. The RE that gives none or many instances of an x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 22. The minimum number of productions required to produce a language


consisting of palindrome strings over T={a,b} is

A:3

B:7

C:5

D:6

Q.no 23. Which of the given problems are NP-complete?

A : (a) Traveling Salesman Problem

B : (b) Satisfiability Problem

C : Both (a) and (b)


D : Turing Machine

Q.no 24. The operations of PDA never work on elements other than top of the stack.

A : false

B : true

C : may be

D : cannot say

Q.no 25. Number of states required to accept strings ending with 10 are

A:3

B:2

C:1

D : can’t be represented.

Q.no 26. Which one of the following is FALSE?

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to an equivalent DFA.

C : Every Epsilon NFA can be converted to an equivalent DFA.

D : Every Mealy can be converted to an equivalent Moore machine.

Q.no 27. A non-deterministic pushdown automaton can be converted into an equivalent


deterministic pushdown automaton.

A : never

B : not always

C : always

D : maybe

Q.no 28. What does it mean when we say that an algorithm X is asymptotically more
efficient than Y?

A : X will always be a better choice for small inputs

B : X will always be a better choice for large inputs


C : Y will always be a better choice for small inputs

D : X will always be a better choice for all inputs

Q.no 29. Limitation of PDA can be overcome by

A : Mealy machine

B : Moore machine

C : Turing machine

D : Finite state machine

Q.no 30. The worst case complexity of a deterministic problem to find the satisfiability
of a given formula of n variables is

A : O(n)

B : O(n^2)

C : O(n^3)

D : O(2^n)

Q.no 31. In definition of PDA M=(Q, Σ,Γ, q0,Z0,A,δ) what Γ represents

A : initial stack symbol

B : stack alphabet

C : finite set of states

D : transition function

Q.no 32. Which of the following statement(s) are correct? (a) All languages can be
generated by CFG, (b) Any regular language has an equivalent CFG, (c) Some non
regular languages cannot be generated by CFG.

A : only (a)

B : Only (b)

C : Only (c)

D : Both (b) and (c)


Q.no 33.

A : {w | w is a string of odd length}

B : {w | w is a string of length multiple of 3}

C : {w | w is a string of length 3}

D : {w | w is an empty string}

Q.no 34. The automaton which allows transformation to a new state without consuming
any input symbols:

A : NFA

B : DFA

C : Epsilon NFA

D : PDA

Q.no 35. Which of the following statement is false?

A : Context free language is the subset of context sensitive language

B : Regular language is the subset of context sensitive language

C : Recursively ennumerable language is the super set of regular language

D : Context sensitive language is a subset of context free language

Q.no 36. Recursively enumerable languages are …….. , whereas recursive languages are
…....

A : completely-solvable, semi solvable

B : semi-solvable, completely solvable

C : not solvable, completely solvable

D : semi-solvable, not solvable

Q.no 37. Which of the following statement is false?

A : For non deterministic PDA, equivalence is undecidable.

B : For deterministic PDA, equivalence is decidable.


C : For deterministic PDA, equivalence is undecidable.

D : For non deterministic PDA, equivalence is decidable.

Q.no 38. Choose the incorrect statement.

A : Moore and Mealy machines are FSM with output capabilities

B : Any given Moore machine has an equivalent Mealy machine

C : Any given Mealy machine has an equivalent Moore machine

D : Moore machine is not an FSM

Q.no 39. Given grammar G:


(1)S->AS (2)S->AAS (3)A->SA (4)A->aa
Which of the following productions denies the format of Chomsky Normal Form?

A : 2,4

B : 1,3

C : 1, 2, 3, 4

D : 2, 3, 4

Q.no 40. In given Transition function of TM


(q1,b)->(q2,Y,R)
Which one is the correct statement?

A : "q1" symbol is changed to "q2"

B : "b" symbol is changed to "q2"

C : "Y" symbol is changed to "b"

D : "b" symbol is changed to "Y"

Q.no 41. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*
Q.no 42. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 43. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 44. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 45. The language A-> tB|t generated by which of the following grammar?
A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 46. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable

Q.no 47. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 48. Which of the following grammars are in Chomsky Normal Form:

A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 49. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 50. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 51. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD

D:DA
Q.no 52.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 53. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol


Q.no 54. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 55. Which of the following are decidable?


I. Whether the intersection of two regular languages is infinite
II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 56.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable


Q.no 57. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 58. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 59. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II

B : Only III

C : Only I and II

D : Only I and III

Q.no 60. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal


Q.no 1. Decidable can be taken as a synonym to:

A : Recursive

B : Non Recursive

C : Recognizable

D : Non Recognizable

Q.no 2. An algorithm is called efficient if it runs in ____________ time on a serial


computer.

A : Polynomial

B : Non polynomial

C : Logarithmic

D : Non Logarithmic

Q.no 3. The minimum number of states required to recognize an octal number divisible
by 3 is

A:1

B:3

C:5

D:7

Q.no 4. In one move the Turing machine___

A : May change its state

B : Write a symbol on the cell being scanned.

C : Move the head one position left or right

D : All of the above

Q.no 5. Which of the following correctly recognize the symbol ‘|-‘ in context to PDA?

A : moves

B : transition function

C : or symbol
D : not symbol

Q.no 6. A Turing machine operates over

A : Finite memory tape

B : Infinite memory tape

C : Depends on the algorithm

D : Depends on the input

Q.no 7. A problem which is both _______ and _________ is said to be NP complete.

A : P, NP

B : NP, NP hard

C : P, P complete

D : NP Hard,P

Q.no 8. In Mealy machine the output depends on

A : Only present state

B : Present state and present input

C : Nothing

D : Type of input

Q.no 9. Transition function of Turing Machine is

A:

B:

C:

D:

Q.no 10. Construct a regular expression for the language that contains strings having at
least one pair of consecutive zeros over {0, 1}.
A : (100)*

B : 1* (00)* 1*

C : [ (1 + 0 )* (00) (1 + 0 )*] +

D : ((0+1)(0+1))*

Q.no 11.

A:R

B:

C : R*

D:

Q.no 12. The push down automata indicate the acceptance of input string in terms of

A : final state

B : empty stack

C : final state and empty stack

D : start state

Q.no 13. A Language for which no DFA exist is a________

A : Regular Language

B : Non-Regular Language

C : May be Regular

D : Cannot be said

Q.no 14. Which of the following pair of regular expressions are not equivalent?

A : 1(01)* and (10)*1

B : x(xx)* and (xx)*x


C : (ab)* and a*b*

D : x+ and x*x+

Q.no 15. Transition function of DFA machine maps.

A:

B:

C:

D:

Q.no 16. In given Transition function of TM which head movement of tape is shown
(q0,a)->(q1,X,L)

A : Left Movement

B : Right Movement

C : Top Movement

D : Bottom Movement

Q.no 17. PDA accepts languages generated by which grammar

A : type 0

B : type 1

C : type 2

D : type 3

Q.no 18. Which of the following is true?

A : (01)*0 = 0(10)0*

B : (0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*

C : (0+1)*01(0+1)*+1*0* = (0+1)*0

D : (01)*01 = 0(10)0*1

Q.no 19. Which of the following are the examples of finite state machine system? (a)
Control Mechanism of an elevator (b) Traffic Lights (c) Combinational Locks
A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 20. What is the Regular Expression Matching Zero or More Specific Characters

A:x

B:#

C:*

D:&

Q.no 21. A PDA chooses the next move based on

A : current State and input

B : current state, stack and input

C : current state and stack

D : current state

Q.no 22. Every CFG can be transformed into equivalent NPDA.

A : false

B : true

C : may be

D : cannot say

Q.no 23. Which language is represented by the following grammar G:


G={{S},{0,1},P,S}
where elements of P are:
S --> SS
S--> 0S1
S--> 1S0
S--> Є

A : Regular language

B : Context-free language
C : Context-sensitive language

D : Recursively enumerable language

Q.no 24. Let the class of language accepted by finite state machine be L1 and the class
of languages represented by regular expressions be L2 then

A : L1<L2

B : L1>=L2

C : L1!=L2

D : L1=L2

Q.no 25. Which productions will generate even length palindromes for terminals 'a'
and 'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb

D : S-> aSb|bSa|a|b

Q.no 26. The instantaneous description is PDA shows

A : present state, string to be processed and stack symbol

B : present state and stack symbol

C : present state and string to be processed

D : stack symbol and string to be processed

Q.no 27. The total number of states and transitions required to form a Moore machine
that processes a binary input string and will produce residue mod 3.

A : 3 and 6

B : 3 and 5

C : 2 and 4

D : 2 and 5

Q.no 28. Which of the following is not an application of Finite Automaton?


A : Compiler Design

B : Grammar Parsers

C : Text Search

D : Image processing

Q.no 29. Identify the following problem: If G=(V, E) and V' is subset of V, then V' is an
independent set iff no two nodes in V' are connected by an edge in E.

A : Satisfiability

B : Independent set

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 30. Every grammar in Chomsky Normal Form is:

A : Regular

B : Context free

C : Context sensitive

D :  Unrestricted

Q.no 31. Pushdown automata behaves like Turing machine when it has the number of
auxiliary memory

A : one or more

B : two or more

C : zero

D : one

Q.no 32. For a DFA accepting binary numbers whose decimal equivalent is divisible by
4, what are all the possible remainders?

A:0

B:2

C : 0,2,4
D : 0,1,2,3

Q.no 33. Turing machine (TM) is more powerful than FSM (Finite State Machine)
because

A : Tape movement is confined to one direction

B : It has no finite state

C : It has the capability to remember arbitrarily long sequences of input symbols

D : It has tape symbols

Q.no 34. Language is accepted by PDA if it is

A : regular language

B : context free language

C : unrestricted

D : regular and context free

Q.no 35. Which of the following statements is false?

A : For every non-deterministic Turing machine, there exists an equivalent deterministic


Turing machine.

B : Turing recognizable languages are closed under union and complement.

C : Turing decidable languages are closed under intersection


and complement.

D : Turing recognizable languages are closed under union and intersection.

Q.no 36. Given a Grammar G:


S->aA
A->a | A
B->B
The number of productions to be removed immediately as Unit productions are

A:0

B:1

C:2

D:3
Q.no 37. The shown language is recognized by (a) Turing machine, (b) Pushdown

automata, (c) Finite automata

A : Only (a)

B : Only (b)

C : Only (c)

D : Only (a) and (b)

Q.no 38. Which of the following is not a Non deterministic Turing machine?

A : Alternating Turing Machine

B : Probabalistic Turing Machine

C : Read-only Turing Machine

D : Unsolvable

Q.no 39. A string derived by a grammar is graphically represented using ……...

A : Binary tree

B : Sparse tree

C : Parse tree

D : Forest

Q.no 40. An NFA’s transition function returns

A : Boolean value

B : A state

C : A set of states

D : An edge

Q.no 41. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.
A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 42. The CFG "S-> aS | bS |a|b " is equivalent to regular expression

A : (a + b)

B : (a + b) (a + b)*

C : (a + b) (a + b)

D : (a . b) (a . b)

Q.no 43.

A:A

B:B

C:C

D:D

Q.no 44. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11
C : 12

D : 15

Q.no 45.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 46. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar

Q.no 47. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2

Q.no 48. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.
C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 49. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 50. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 51. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?

A:
B:

C:

D:

Q.no 52. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.
A:

B:

C:
D:

Q.no 53. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 54. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 55. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable
C : Computable

D : Recognizable

Q.no 56. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar

Q.no 57. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard

Q.no 58. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011

Q.no 59. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular


D : CFL < CSL < Regular < Unrestricted

Q.no 60. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".

A:

B:

C:

D:

Q.no 1.

A:

B:

C:L

D : L*
Q.no 2. Finite automata needs minimum _______ number of stacks

A:0

B:1

C:2

D:3

Q.no 3. _________ is the class of decision problems that can be solved by non-
deterministic polynomial algorithms?

A : NP

B:P

C : Hard

D : Complete

Q.no 4. 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

B : Decidable

C : Undecidable

D : NP-HARD

Q.no 5. The finite automata  is called NFA when there exists____________ for a specific
input from current state to next state

A : Single path

B : Multiple paths

C : Only two paths

D : Three paths

Q.no 6.

A:
B:

C:0

D:1

Q.no 7. Turing Machine also behaves like General purpose computer and that TM is
known as _______

A : Multi-tape Turing Machine

B : Poly-tape Turing Machine

C : Universal Turing Machine

D : Deterministic Finite Automata

Q.no 8. Which among the following is the format of unit production?

A : A->B

B : A->b

C : B->Aa

D : B->aA

Q.no 9.

A : L*

B:

C:L

D:

Q.no 10. A Turing machine with several tapes in known as

A : Multi-tape Turing machine

B : Poly-tape Turing maching

C : Universal Turing machine


D : Complete Turing machine

Q.no 11. The decision problem is the function from string to ______________

A : char

B :  int

C :  boolean

D : float

Q.no 12. Bottom-up parsers use

A : leftmost derivation

B : rightmost derivation

C : rightmost derivation in reverse order

D : leftmost derivation in reverse order

Q.no 13.

A : Always starts with b

B : Can have any number of ba and ab

C : Can not have 2 b's together.

D : Starts and end with same symbol

Q.no 14. To simplify a grammar we can eliminate

A : Useful symbols

B : epsilon productions

C : Reachable symbols

D : Non Unit productions

Q.no 15. A formal language is recursive if :

A : A turing machine exists

B : A turing machine that halts for every input


C : Turing machine rejects if the input does not belong to the language

D : All of the mentioned

Q.no 16. 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

B : 2, 3 and 4

C : 1, 2 and 4

D : 1, 3 and 4

Q.no 17. Given the expression, is there some assignment of true and false values to the
variables that will make the entire expression true? This is termed as

A : Satisfiability problem

B : Independent set problem

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 18. Turing machine was invented by

A : Alan Turing

B : Turing man

C : Turing taring

D : Turling Bake

Q.no 19. Which of the following statement is true?

A : Mealy machine has no terminating state

B : A Moore machine has terminating state

C : Converting from Mealy into Moore machine and vice versa is not possible

D : More machine is Moore powerful than Mealy machine

Q.no 20. Top-down parsing is also known as


A : shift reduce parsing

B : predictive descent parsing

C : LR parsing

D : SLR parsing

Q.no 21. Which of the following automata takes stack as auxiliary storage

A : finite automata

B : pushdown automata

C : Turing machine

D : finite state machine

Q.no 22. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings without double a?

A:

B : ((a+b)(a+b))*

C : (a + bb)*

D:

Q.no 23. The power of non-deterministic pushdown automata and deterministic


pushdown automata is not same.

A : true

B : false

C : maybe

D : cannot say

Q.no 24. The automaton which allows transformation to a new state without consuming
any input symbols:

A : NFA
B : DFA

C : Epsilon NFA

D : PDA

Q.no 25. Which of the regular expressions correspond to the given problem statement:
Express the identifiers in C Programming language where l=letters d=digits

A : (l+_)(d+_)*

B : (l+d+_)*

C : (l+_)(l+d+_)*

D : (_+d)(l+d+_)*

Q.no 26. The complement of a language will only be defined when and only when the
__________ over the language is defined.

A : String

B : Word

C : Alphabet

D : Grammar

Q.no 27. The ability for a system of instructions to simulate a Turing Machine is called
_________

A : Turing Completeness

B : Simulation

C : Turing Halting

D : Computability

Q.no 28. Which of the following statements is false ?

A : Halting problem of Turing machines is undecidable

B : Determining whether a context-free grammar is ambiguous is undecidable

C : Given two arbitrary context-free grammars G1 G2 and it is undecidable whether L (G1) =


L (G2).

D : Given two regular grammars G1 G2 and it is undecidable whether L (G1) = L (G2)


Q.no 29. PDA works as Finite Automata when the number of auxiliary memory it has is

A:3

B:2

C:1

D:0

Q.no 30. The regular expression with all strings of 0′s and 1′s with at least two
consecutive 0′s is:

A : 1 + (10)*

B : (0+1)*00(0+1)*

C : (0+1)*011

D : 0*1*2*

Q.no 31. For every CFL, G, there exists a PDA M such that L(G) = L(M) and vice versa.

A : true

B : false

C : maybe

D : probably

Q.no 32. An instantaneous description of Turing machine consists of

A : Present state and input to be processed

B : Present state and entire input to be processed

C : Present input only

D : Present state only

Q.no 33. The maximum number of transitions which can be performed over a state in a
DFA having alphabet set a,b,c are

A:1

B:2

C:3
D:4

Q.no 34. The production of the form A->B , where A and B are non terminals is called

A : Null production

B : Greibach Normal Form

C : Unit production

D : Chomsky Normal Form

Q.no 35. Under which of the following operation, NFA is not closed?

A : Negation

B : Kleene

C : Concatenation

D : complement

Q.no 36. A non-deterministic pushdown automaton can be converted into an equivalent


deterministic pushdown automaton.

A : never

B : not always

C : always

D : maybe

Q.no 37. Unrestricted grammar is also called_______ Grammar

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 38. The difference between number of states in FA for regular expression (a + b)
and (a + b) * is:

A:1

B:2
C:3

D:0

Q.no 39. Which of the following statement is false?

A : Every language that is defined by regular expression can also be defined by finite
automata

B : Every language defined by finite automata can also be defined by regular expression

C : We can convert regular expressions into finite automata

D : There exists a unique DFA for every regular language

Q.no 40. Which of the following is analogous to the NFA and NPDA ?

A : Regular language and Context Free language

B : Regular language and Context Sensitive language

C : Context free language and Context Sensitive language

D : Unrestricted language

Q.no 41. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 42. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's

D : has atleast two a's

Q.no 43. Which grammar accepts the language of {a, b} having strings ending with 'a'.
A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 44. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab

A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 45. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 46. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal


Q.no 47. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 48. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 49. For two regular languages


L1 = (a + b)* a
and
L2 = b (a + b ) *
the intersection of L1 and L2 is given by

A : (a + b ) * ab

B : ab (a + b ) *
C:a(a+b)*b

D : b (a + b ) * a

Q.no 50. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable

Q.no 51. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 52. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD
D:DA

Q.no 53. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 54. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

Q.no 55. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:
Q.no 56. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 57. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 58.

A : X is undecidable but partially decidable

B : X is decidable
C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 59. CFG is not closed under

A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 60. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 1. Linear Bounded Automaton is a

A : Finite Automaton

B : Turing Machine

C : Push down Automaton

D : Deterministic Finite Automata

Q.no 2. The format: A->aB refers to which of the following?

A : Chomsky Normal Form

B : Greibach Normal Form

C : Backus Naur Form

D : Sentential form

Q.no 3. Finite state machine is ___________tuple machine.

A:4
B:5

C:6

D : unlimitted

Q.no 4. What is the value of n if Turing machine is defined using n-tuples?

A:6

B:7

C:8

D:5

Q.no 5. NPDA stands for

A : non deterministic pushup automata

B : null pushdown automata

C : nested pushdown automata

D : non deterministic pushdown automata

Q.no 6. Recursive languages are also known as:

A : decidable

B : Undecidable

C : sometimes decidable

D : infinite

Q.no 7. Which of the following is true?

A : Every subset of a regular set is regular

B : Every finite subset of non-regular set is regular

C : The union of two non regular set is not regular

D : Infinite union of finite set is regular

Q.no 8. A deterministic Turing machine is

A : Ambiguous Turing Machine


B : Unambiguous Turing Machine

C : Non-Deterministic Finite Automata

D : Deterministic Finite Automata

Q.no 9. RR* can be expressed in which of the forms:

A : R+

B : R-

C : R+ U R-

D:R

Q.no 10. Number of states required to accept strings ending with 101

A:3

B:4

C:2

D : cannot be represented.

Q.no 11. Minimal finite automata need _____________ no. of final states

A:1

B:2

C:3

D : Depends on problem

Q.no 12. Choose the correct option for the statement: Unambiguity is the ideal
structure of a language.

A : true

B : Partially True

C : false

D : Cannot be said

Q.no 13. 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

C : At least one state has more than one transitions

D : At most one state has more than one transitions

Q.no 14. The regular expression to denote zero or more instances of x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 15. Regular expressions are used to represent which language?

A : Recursive language

B : Context free language

C : Regular language

D : Context Sensitive language

Q.no 16. Turing Machine can update symbols on its tape, whereas the FA cannot update
symbols on tape.

A : true

B : false

C : Cannot say

D : May be

Q.no 17. (a+b)* is equivalent to

A : b*a*

B : (a*b*)*

C : a*b*

D:
Q.no 18. Are the given two patterns equivalent?
(1) gray | grey (2) gr(a|e)y

A : yes

B : no

C : may be

D : cannot say

Q.no 19. In Mealy machine the output depends on

A : Only present state

B : Present state and present input

C : Nothing

D : Type of input

Q.no 20. In regular expressions, the operator ‘*’ stands for

A : Concatenation

B : Selection

C : Iteration

D : Addition

Q.no 21. Which of the following statement is not true?

A : Type 0 grammar is called unrestricted grammar

B : Chomsky hierarchy define only one type of grammar

C : Type 3 grammar is recognized by FA

D : Type 2 grammar is CFG

Q.no 22. What does it mean when we say that an algorithm X is asymptotically more
efficient than Y?

A : X will always be a better choice for small inputs

B : X will always be a better choice for large inputs

C : Y will always be a better choice for small inputs


D : X will always be a better choice for all inputs

Q.no 23. X is a simple mathematical model of a computer. X has unrestricted and


unlimited memory. X is a FA with R/W head. X can have an infinite tape divided into
cells, each cell holding one symbol.
Name X?

A : Push Down Automata

B : Non deterministic Finite Automata

C : Turing machines

D : Deterministic Finite Automata

Q.no 24. Which productions will generate odd length palindromes for terminals 'a' and
'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb

D : S-> aSb|bSa|a|b

Q.no 25. How many strings of length less than 4 contain the language described by the
regular expression (x+y)*y(a+ab)*

A:7

B : 10

C : 12

D : 11

Q.no 26. Construct a regular expression for the language that contains strings that
start with either ‘01’ or ‘10’ over {0, 1}.

A : (01 + 10)*

B : (1+0)* (01 + 10) (1+0)*

C : (01 + 10) (1+0)*

D : (1+0)*

Q.no 27. Which of the following is not a regular expression?


A : [(a+b)*(aa+bb)]*

B : [(0+1)-(0b+a1)*(a+]*

C : (01+11+10)*

D : (1+2+0)*(1+2)*

Q.no 28. In definition of PDA M=(Q, Σ,Γ, q0,Z0,A,δ) what Γ represents

A : initial stack symbol

B : stack alphabet

C : finite set of states

D : transition function

Q.no 29. Which of the following pairs have different expressive power

A : Deterministic Finite Automata (DFA) and Non-deterministic Finite Automata (NFA)

B : Deterministic Push Down Automata (DPDA) and Non-deterministic Push Down Automata
(NPDA)

C : single tape turing machine and multi tape turing machine

D : deterministic single tape and nondeterministic single tape turing machine

Q.no 30. PDA is useful in

A : lexical analysis

B : syntax analysis

C : semantic analysis

D : code generation

Q.no 31. The set of all strings over {a,b} in which strings consisting a’s and b’s and
ending with bb is

A : ab

B : a*bbb

C : (a+b)* bb

D : (a+b)+ bb
Q.no 32. Let the class of language accepted by finite state machine be L1 and the class
of languages represented by regular expressions be L2 then

A : L1<L2

B : L1>=L2

C : L1!=L2

D : L1=L2

Q.no 33. Recursive languages are ………… of recursively enumerable languages.

A : subset

B : proper subset

C : not subset

D : not proper subset

Q.no 34. Pushdown automata behaves like Turing machine when it has the number of
auxiliary memory

A : one or more

B : two or more

C : zero

D : one

Q.no 35. Which of the following problems is solvable ?

A : Writing a universal Turing machine

B : Determining of an arbitrary Turing machine is an universal Turing machine

C : Determining of a universal Turing machine can be written for fewer than k instructions
for some k

D : Determining of a universal Turing machine and some input will halt

Q.no 36.

A : {w | w is a string of odd length}


B : {w | w is a string of length multiple of 3}

C : {w | w is a string of length 3}

D : {w | w is an empty string}

Q.no 37. Number of external states of a UTM should be atleast

A:1

B:2

C:3

D:4

Q.no 38. The minimum number of 1’s to be used in a regular expression of the given
language of all strings containing exactly 2 zeroes.

A:2

B:3

C:0

D:1

Q.no 39. According to Chomsky hierarchy, which of the following is recognized by


Recursively Enumerable language?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 40. The RE in which any number of 0′s is followed by any number of 1′s followed
by any number of 2′s is

A : (0+1+2)*

B : 0*1*2*

C : 0* + 1 + 2

D : (0+1)*2*
Q.no 41. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 42. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 43. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 44. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3
B:5

C:7

D:2

Q.no 45. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar

Q.no 46. Which of the following are decidable?


I. Whether the intersection of two regular languages is infinite
II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 47. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".

A:

B:
C:

D:

Q.no 48. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.

A:

B:
C:

D:

Q.no 49. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011

Q.no 50. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*


Q.no 51. Which of the following grammars are in Chomsky Normal Form:

A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 52.

A:A

B:B

C:C

D:D

Q.no 53. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?
A : Only II

B : Only III

C : Only I and II

D : Only I and III

Q.no 54. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 55. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 56. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 57. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 58. Construct a Turing machine which accepts a string with ‘aba’ as its substring.

A:

B:
C:

D:

Q.no 59.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable

Q.no 60. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard
C : Q is NP-complete

D : Q is NP-hard

Q.no 1. Transition function of DFA machine maps.

A:

B:

C:

D:

Q.no 2. Transition function of Turing Machine is

A:

B:

C:

D:

Q.no 3. Which of the following regular expressions represents the set of strings which
do not contain a substring ‘rt’ if alphabet = {r, t}

A : (rt)*

B : (tr)*

C : (r*t*)

D : (t*r*)

Q.no 4. A push down automata is different than finite automata by

A : Its memory

B : number of states

C : start state
D : input symbols

Q.no 5. To which of the following class does a CNF-satisfiability problem belong?

A : NP class

B : P class

C : NP complete

D : NP hard

Q.no 6. Kruskal's algorithm is used to find

A : whether there is cycle in the graph

B : spanning tree of the graph

C : minimum spanning tree in the graph

D : whether there is spanning tree in the graph

Q.no 7. Which of the following are not quantifiers?

A : Kleene plus +

B : Kleene star *

C : Question mark ?

D : Union

Q.no 8. Halting states are of two types. They are:

A : accept and reject

B : reject and allow

C : start and reject

D : start and accept

Q.no 9. The major difference between Mealy and Moore machine is about:

A : Output Variations

B : Input Variations

C : Both
D : Transitions

Q.no 10.

A:

B:

C:0

D:1

Q.no 11. In given Transition function of TM which head movement of tape is shown
(q0,a)->(q1,X,L)

A : Left Movement

B : Right Movement

C : Top Movement

D : Bottom Movement

Q.no 12. A Language for which no DFA exist is a________

A : Regular Language

B : Non-Regular Language

C : May be Regular

D : Cannot be said

Q.no 13. If two finite state machines are equivalent,

A : they should have the same number of states

B : they should have the same number of edges

C : they should have the same number of states and edges

D : they can have different number of states and edges


Q.no 14.

A:R

B:

C : R*

D:

Q.no 15. For alphabet = {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

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

Q.no 16. Bottom-up parsing is also known as

A : shift reduce parsing

B : predictive descent parsing

C : operator precedence parsing

D : LL1 Parsing

Q.no 17. An algorithm is called efficient if it runs in ____________ time on a serial


computer.

A : Polynomial

B : Non polynomial

C : Logarithmic

D : Non Logarithmic

Q.no 18. In CFG, notation of VARIABLE representation is

A : Captal Letters
B : Small Letters

C : Italic Letters

D : Roman Letters

Q.no 19. Which of the following a Turing machine does not consist of?

A : Input tape

B : Head

C : State register

D : Stack

Q.no 20. NFA, in its name has Non-deterministic words because

A : The result is undetermined

B : The choice of path is non-deterministic

C : The state to be transited next is non-deterministic

D : More number of final states

Q.no 21.

A:

B:

C:

D:

Q.no 22. Which among the following is the LEAF of the parse tree?

A : Production P

B : Nonterminal V

C : Terminal T

D : Starting symbol S
Q.no 23. Identify the following problem: If G=(V, E) and V' is subset of V, then V' is an
independent set iff no two nodes in V' are connected by an edge in E.

A : Satisfiability

B : Independent set

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 24. The ability for a system of instructions to simulate a Turing Machine is called
_________

A : Turing Completeness

B : Simulation

C : Turing Halting

D : Computability

Q.no 25. A PDA chooses the next move based on

A : current State and input

B : current state, stack and input

C : current state and stack

D : current state

Q.no 26. The complement of a language will only be defined when and only when the
__________ over the language is defined.

A : String

B : Word

C : Alphabet

D : Grammar

Q.no 27. For a give Moore Machine,


Statement 1: Null string is processed in Moore Machine.
Statement 2: There are more than 5-Tuples in the definition of Moore Machine.
Choose the correct option.

A : Statement 1 is true and Statement 2 is true


B : Statement 1 is true while Statement 2 is false

C : Statement 1 is false while Statement 2 is true

D : Statement 1 is false and Statement 2 is false

Q.no 28. The difference between number of states in FA for regular expression (a + b)
and (a + b) * is:

A:1

B:2

C:3

D:0

Q.no 29. Which of the following does not obey pumping lemma for context free
languages ?

A : Finite languages

B : Context free Languages

C : Unrestricted languages

D : Restricted languages

Q.no 30. An instantaneous description of Turing machine consists of

A : Present state and input to be processed

B : Present state and entire input to be processed

C : Present input only

D : Present state only

Q.no 31. The minimum number of productions required to produce a language


consisting of palindrome strings over T={a,b} is

A:3

B:7

C:5

D:6
Q.no 32. Number of states required to accept strings ending with 10 are

A:3

B:2

C:1

D : can’t be represented.

Q.no 33. The difference between Turing Machine and Two Way FA is in:

A : Input Tape

B : Read Write Head

C : Finite Control

D : All of these

Q.no 34. The string (a)|((b)*(c)) is equivalent to

A : Empty

B : abcabc

C : b*c|a

D : abc

Q.no 35. Regular expression (x|y)(x|y) denotes the set

A : {xy,xy}

B : {xx,xy,yx,yy}

C : {x,y}

D : {x,y,xy}

Q.no 36. A context free language is called ambiguous if (a) It has two or more leftmost
derivations for the same string. (b) It has two or more rightmost derivations for the
same string. (c) It has Only single derivation tree.

A : Only (a)

B : Only (b)

C : Both (a) and (b)


D : Only (c)

Q.no 37. If there exists a TM which when applied to any problem in the class,
terminates, if correct answer is yes and may or may not terminate otherwise is called

A : Stable

B : Unsolvable

C : Partially solvable

D : Unstable

Q.no 38. Which of the following is not a Non deterministic Turing machine?

A : Alternating Turing Machine

B : Probabalistic Turing Machine

C : Read-only Turing Machine

D : Unsolvable

Q.no 39. Which is a wrong satatement?

A : A regular language is produced by union of two regular languages

B : The concatenation of two regular languages is regular

C : The Kleene closure of a regular language is regular

D : The complement of a regular language is also a regular language

Q.no 40. In multi head Turing machine there are

A : More than one heads of the Turing machine

B : More than one input tapes of Turing machine

C : Similar to the basic model of Turing machine

D : More than one input symbols of Turing machine

Q.no 41. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted


C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 42. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 43. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 44. The CFG "S-> aS | bS |a|b " is equivalent to regular expression

A : (a + b)

B : (a + b) (a + b)*

C : (a + b) (a + b)

D : (a . b) (a . b)

Q.no 45. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 46. CFG is not closed under


A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 47. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal

Q.no 48. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 49. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 50. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3
C:4

D:5

Q.no 51. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 52. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 53. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 54. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*
B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 55. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab

A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 56. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

Q.no 57. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:

Q.no 58. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar


D : Center Recursive Grammar

Q.no 59. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD

D:DA

Q.no 60. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's

D : has atleast two a's

Q.no 1.

A : L*

B:

C:L

D:

Q.no 2. In Moore machine, if input is of length n, then length of output string will be

A:n
B : n+1

C : n+n

D : n-1

Q.no 3. Those problems that are solvable in polynomial time belong to __

A : NP

B:P

C : Hard

D : Complete

Q.no 4. The push down automata indicate the acceptance of input string in terms of

A : final state

B : empty stack

C : final state and empty stack

D : start state

Q.no 5. Recursive languages are also known as:

A : decidable

B : Undecidable

C : sometimes decidable

D : infinite

Q.no 6. A problem is called __________ if it has an efficient algorithm for itself.

A : Tractable

B : Intractable

C : Computational

D : Computable

Q.no 7. If T1 and T2 are two Turing machines, the composite can be represented using
the expression
A : T1 T2

B : T2 T1

C : T1 X T2

D : T2 X T1

Q.no 8. The transition a Push down automaton makes is additionally dependent upon
the:

A : Current State

B : input tape

C : stack

D : terminals

Q.no 9. Turing Machine also behaves like General purpose computer and that TM is
known as _______

A : Multi-tape Turing Machine

B : Poly-tape Turing Machine

C : Universal Turing Machine

D : Deterministic Finite Automata

Q.no 10. Which of the following can be used to simulate any Turing machine?

A : Finite State Automaton

B : Universal Turing Machine

C : Counter machines

D : Deterministic Finite Automata

Q.no 11.

A:

B:
C:L

D : L*

Q.no 12. Which of the following are the actions that operates on stack top?

A : only push

B : only pop

C : only push and pop

D : push, pop and replace

Q.no 13. A->aA| a| b


The number of steps to generate aab are

A:2

B:3

C:4

D:5

Q.no 14. Top-down parsers use the grammar

A : LL(K)

B : LR(K)

C : SLR(K)

D : CLR(K)

Q.no 15. Which operation can be applied on stack

A : Push

B : Pop

C : Push and Pop

D : Read

Q.no 16. In Moore machine the output depends on

A : Only present state


B : Present state and present input

C : Nothing

D : Type of input

Q.no 17. The regular expression to denote zero or more instances of x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 18. Consider following regular expression


i) (a|b)* ii) (a*|b*)* iii) ((a)*b*)* Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : all are equal

Q.no 19. Precedence of regular expression in decreasing order is

A:*,.,+

B:.,*,+

C:.,+,*

D:+,.,*

Q.no 20. In Parse Tree, Root represents

A : Terminals

B : Variables

C : Start Symbol

D : Productions

Q.no 21. Which of the following statement is false?


A : Context free language is the subset of context sensitive language

B : Regular language is the subset of context sensitive language

C : Recursively ennumerable language is the super set of regular language

D : Context sensitive language is a subset of context free language

Q.no 22. Choose the incorrect statement.

A : Moore and Mealy machines are FSM with output capabilities

B : Any given Moore machine has an equivalent Mealy machine

C : Any given Mealy machine has an equivalent Moore machine

D : Moore machine is not an FSM

Q.no 23. 3-SAT and 2-SAT problems are

A : NP-complete and in P respectively

B : Undecidable and NP-complete

C : Both NP-complete

D : Both in P

Q.no 24. Which of the following automata takes stack as auxiliary storage

A : finite automata

B : pushdown automata

C : Turing machine

D : finite state machine

Q.no 25. The total number of states and transitions required to form a Moore machine
that processes a binary input string and will produce residue mod 3.

A : 3 and 6

B : 3 and 5

C : 2 and 4

D : 2 and 5
Q.no 26. Which among the following is equivalent to the given regular expression 01*+1

A : (01)*+1

B : 0((1)*+1)

C : (0(1)*)+1

D : ((0*1)1*)*

Q.no 27. If r1 = (aa + bb) and r2 = (a + b) then the language (aa + bb)(a + b) will be
generated by

A : (r1)(r2)

B : (r1 + r2)

C : (r2)(r1)

D : (r1)

Q.no 28. The instantaneous description is PDA shows

A : present state, string to be processed and stack symbol

B : present state and stack symbol

C : present state and string to be processed

D : stack symbol and string to be processed

Q.no 29. Recursively enumerable languages are …….. , whereas recursive languages are
…....

A : completely-solvable, semi solvable

B : semi-solvable, completely solvable

C : not solvable, completely solvable

D : semi-solvable, not solvable

Q.no 30. Which of the following statement(s) are correct? (a) All languages can be
generated by CFG, (b) Any regular language has an equivalent CFG, (c) Some non
regular languages cannot be generated by CFG.

A : only (a)

B : Only (b)
C : Only (c)

D : Both (b) and (c)

Q.no 31. X is a simple mathematical model of a computer. X has unrestricted and


unlimited memory. X is a FA with R/W head. X can have an infinite tape divided into
cells, each cell holding one symbol.
Name X?

A : Push Down Automata

B : Non deterministic Finite Automata

C : Turing machines

D : Deterministic Finite Automata

Q.no 32. Construct a regular expression for the language that contains strings having
even number of 0’s followed by odd number of 1’s over {0, 1}.

A : (00)* 1 (11)*

B : ((0+1)(0+1))*

C : (0+1)*

D : (001)*

Q.no 33. Which one of the following is FALSE?

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to an equivalent DFA.

C : Every Epsilon NFA can be converted to an equivalent DFA.

D : Every Mealy can be converted to an equivalent Moore machine.

Q.no 34. Which of the following pairs have DIFFERENT expressive power?

A : Deterministic finite automata (DFA) and Non-Deterministic finite automata(NFA)

B : Deterministic push down automata (DPDA) and Non-deterministic pushdown automata


(NPDA)

C : Deterministic single-tape Turing machine and Non-deterministic single-tape Turing


Machine

D : Single-tape Turing machine and multi-tape Turing machine


Q.no 35. The RE that gives none or many instances of an x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 36. Which of the following is in 2-CNF?

A : (e1 Ʌ e2) Ʌ (e1 Ʌ ~e2)

B : (e1 Ʌ e2) Ʌ (e1 V ~e2)

C : (e1 V e2) Ʌ (e1 V ~e2)

D : (e1 V e2) Ʌ (e1 Ʌ ~e2)

Q.no 37. Number of external states of a UTM should be atleast

A:1

B:2

C:3

D:4

Q.no 38. The travelling salesman problem can be solved using _________

A : A spanning tree

B : A minimum spanning tree

C : Bellman – Ford algorithm

D : DFS traversal

Q.no 39. In definition of PDA M=(Q, Σ,Γ, q0,Z0,A,δ) what Γ represents

A : initial stack symbol

B : stack alphabet

C : finite set of states

D : transition function
Q.no 40. A grammar G=(V,T,P,S) in which V represents

A : Set of Nonterminals

B : Start symbol

C : Set of terminals

D : Production

Q.no 41. Which of the following grammars are in Chomsky Normal Form:

A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 42. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?

A:
B:

C:

D:

Q.no 43. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 44. Which of the following are decidable?


I. Whether the intersection of two regular languages is infinite
II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 45. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 46. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard
Q.no 47. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 48. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable

Q.no 49. Which one of following is false.


A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 50. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar

Q.no 51. Construct a Turing machine which accepts a string with ‘aba’ as its substring.

A:

B:
C:

D:

Q.no 52. For two regular languages


L1 = (a + b)* a
and
L2 = b (a + b ) *
the intersection of L1 and L2 is given by

A : (a + b ) * ab

B : ab (a + b ) *

C:a(a+b)*b

D : b (a + b ) * a

Q.no 53. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.
A:

B:

C:
D:

Q.no 54. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 55.

A:A

B:B

C:C

D:D
Q.no 56. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 57. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 58.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable


Q.no 59. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 60. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 1. Which of the following does not belong to the language if input alphabet set is
a,b

A:a

B:b

C : epsilon

D:c

Q.no 2. In regular expressions, the operator ‘*’ stands for


A : Concatenation

B : Selection

C : Iteration

D : Addition

Q.no 3. Which of the following are the examples of finite state machine system? (a)
Control Mechanism of an elevator (b) Traffic Lights (c) Combinational Locks

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 4. Turing machine is more powerful than (a) Finite automata, (b) Push down
automata

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Neither (a) nor (b)

Q.no 5. _________ is the class of decision problems that can be solved by non-
deterministic polynomial algorithms?

A : NP

B:P

C : Hard

D : Complete

Q.no 6. Identify the problem: Given a graph G = <V, E>, and a starting node a, does it
have a tour cost less than k?

A : Satisfiability

B : Independent set

C : Node-Cover Problem
D : Traveling Salesman Problem

Q.no 7. Epsilon-closure of a state is a combination of self state and ----

A : Epsilon-reachable states

B : initial state

C : Final state

D : Non-final states

Q.no 8. Universal TM influenced the concept of

A : Stored program computers

B : Interpretive implementation of programming languages

C : Computability

D : All of these

Q.no 9. Which among the following cannot be accepted by a regular grammar?

A : L is a set of numbers divisible by 2

B : L is a set of binary complement

C : L is a set of strings with odd number of 0s

D : L is a set of 0^n1^n

Q.no 10. Choose the correct option for the statement: Unambiguity is the ideal
structure of a language.

A : true

B : Partially True

C : false

D : Cannot be said

Q.no 11. Language of finite automata is generated by

A : Type 0 grammar

B : Type 1 grammar
C : Type 2 grammar

D : Type 3 grammar

Q.no 12. Finite state machine can recognize

A : any grammar

B : only context-free grammar

C : context free grammar and regualr grammar

D : only regular grammar

Q.no 13. Which of the production rule can be accepted by Chomsky grammar. (i) A->BC,
(ii) A->a

A : only i

B : only ii

C : both i and ii

D : neither i nor ii

Q.no 14. There is a linear grammar that generates a context free grammar

A : Always

B : Never

C : Sometimes

D : Everytime

Q.no 15. Are the given two patterns equivalent?


(1) gray | grey (2) gr(a|e)y

A : yes

B : no

C : may be

D : cannot say

Q.no 16. A push down automaton employs which data structure?

A : queue
B : linked list

C : hash table

D : stack

Q.no 17. Construct a regular expression for the language that contains strings having at
least one pair of consecutive zeros over {0, 1}.

A : (100)*

B : 1* (00)* 1*

C : [ (1 + 0 )* (00) (1 + 0 )*] +

D : ((0+1)(0+1))*

Q.no 18. If the PDA does not stop on an accepting state and the stack is not empty, the
string is

A : rejected

B : goes into loop forever

C : rejected and goes into loop forever

D : accepted

Q.no 19. The recognizing capability of NDFAand DFA

A : must be the same

B : may be different

C : must be different

D : cannot say

Q.no 20. Transition function of DFA machine maps.

A:

B:

C:

D:
Q.no 21. CFGs are more powerful than (a) DFA, (b) NDFA, (c) Mealy Machine

A : Only (a)

B : Only (b) and (c)

C : Only (a) and (c)

D : (a), (b) and (c)

Q.no 22. The RE in which any number of 0′s is followed by any number of 1′s followed
by any number of 2′s is

A : (0+1+2)*

B : 0*1*2*

C : 0* + 1 + 2

D : (0+1)*2*

Q.no 23. The minimum number of 1’s to be used in a regular expression of the given
language of all strings containing exactly 2 zeroes.

A:2

B:3

C:0

D:1

Q.no 24. Which of the following problems is solvable ?

A : Writing a universal Turing machine

B : Determining of an arbitrary Turing machine is an universal Turing machine

C : Determining of a universal Turing machine can be written for fewer than k instructions
for some k

D : Determining of a universal Turing machine and some input will halt

Q.no 25. Which of the following is not an application of Finite Automaton?

A : Compiler Design

B : Grammar Parsers
C : Text Search

D : Image processing

Q.no 26. Which of the following is the restricted model of Turing machines (a) Turing
machine with semi-infinite tape, (b) Multi stack machine, (c) Offline Turing machine

A : Only (a)

B : Only (b)

C : Only (c)

D : Both (a) and (b)

Q.no 27. The problem of finding a path in a graph that visits every vertex exactly once
is called

A : Hamiltonian path problem

B : Hamiltonian cycle problem

C : Subset sum problem

D : Turnpike reconstruction problem

Q.no 28. In given Transition function of TM


(q1,b)->(q2,Y,R)
Which one is the correct statement?

A : "q1" symbol is changed to "q2"

B : "b" symbol is changed to "q2"

C : "Y" symbol is changed to "b"

D : "b" symbol is changed to "Y"

Q.no 29. Let the class of language accepted by finite state machine be L1 and the class
of languages represented by regular expressions be L2 then

A : L1<L2

B : L1>=L2

C : L1!=L2

D : L1=L2
Q.no 30. Which of the following statements is false ?

A : Halting problem of Turing machines is undecidable

B : Determining whether a context-free grammar is ambiguous is undecidable

C : Given two arbitrary context-free grammars G1 G2 and it is undecidable whether L (G1) =


L (G2).

D : Given two regular grammars G1 G2 and it is undecidable whether L (G1) = L (G2)

Q.no 31. The basic limitation of finite automata is that

A : It cannot remember arbitrary large amount of information.

B : It sometimes recognize grammar that are not regular.

C : It sometimes fails to recognize regular grammar.

D : It sometimes fails to recognize regular laguage

Q.no 32. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which the total number of a’s is divisible by 2.

A : ((a+b)(a+b))*

B : (a + ab)*

C : ( b* a b*ab*)* + b*

D : a* b (aa)*b a*

Q.no 33. For a DFA accepting binary numbers whose decimal equivalent is divisible by
4, what are all the possible remainders?

A:0

B:2

C : 0,2,4

D : 0,1,2,3

Q.no 34. Given grammar G:


(1)S->AS (2)S->AAS (3)A->SA (4)A->aa
Which of the following productions denies the format of Chomsky Normal Form?

A : 2,4
B : 1,3

C : 1, 2, 3, 4

D : 2, 3, 4

Q.no 35. The variable which produces


epsilon is called

A : Empty variable

B : Nullable variable

C : Non-empty variable

D : Non-nullable variable

Q.no 36. Pushdown automata behaves like Turing machine when it has the number of
auxiliary memory

A : one or more

B : two or more

C : zero

D : one

Q.no 37. Which of the following does not obey pumping lemma for context free
languages ?

A : Finite languages

B : Context free Languages

C : Unrestricted languages

D : Restricted languages

Q.no 38. Is the language preserved in all the steps while eliminating epsilon transitions
from a NFA?

A : yes

B : no

C : may be

D : cannot say
Q.no 39. The minimum number of productions required to produce a language
consisting of palindrome strings over T={a,b} is

A:3

B:7

C:5

D:6

Q.no 40. PDA is useful in

A : lexical analysis

B : syntax analysis

C : semantic analysis

D : code generation

Q.no 41.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 42. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2
Q.no 43. Which of the following is NOT generated by regular expression
R = (ab + abb)* bbab

A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 44. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".

A:

B:

C:

D:

Q.no 45. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not


B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal

Q.no 46. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 47. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 48. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 49. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)
C : Only (c)

D : (a), (b) and (c)

Q.no 50. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 51.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 52. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*
C:

D : (0+1)* 011

Q.no 53. The CFG "S-> aS | bS |a|b " is equivalent to regular expression

A : (a + b)

B : (a + b) (a + b)*

C : (a + b) (a + b)

D : (a . b) (a . b)

Q.no 54. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 55. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:

Q.no 56. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s


D : 0's followed by 1's

Q.no 57. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 58. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 59. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 60. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 1. Can we convert PDA to equivalent CFG?

A : yes
B : no

C : maybe

D : never

Q.no 2. A grammar that produces more than one parse tree for some sentence is called

A : ambiguous

B : unambiguous

C : regular

D : context free grammar

Q.no 3. In one move the Turing machine___

A : May change its state

B : Write a symbol on the cell being scanned.

C : Move the head one position left or right

D : All of the above

Q.no 4. Halting problem is an example for

A : decidable problem

B : undecidable problem

C : complete problem

D : trackable problem

Q.no 5. If there exists a language L, for which there exists a TM, T, that accepts every
word in L and either rejects or loops for every word that is not in L, is called

A : Recursive

B : Recursively Enumerable

C : NP-HARD

D : NP Complete
Q.no 6.

A : Always starts with b

B : Can have any number of ba and ab

C : Can not have 2 b's together.

D : Starts and end with same symbol

Q.no 7. 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

B : Decidable

C : Undecidable

D : NP-HARD

Q.no 8. Which of the following case does not exist in complexity theory?

A : Best case

B : Worst case

C : Average case

D : Null case

Q.no 9. In Parse Tree, Intermediate Node represents

A : Terminals

B : Variables

C : Start Symbol

D : Productions

Q.no 10. Why Palindromes cannot be recognized by any FSM ?

A : an FSM cannot deterministically fix the mid-point

B : an FSM can remember arbitrarily large amount of information


C : FSM has finite memory

D : FSM has only 5 tuples

Q.no 11. Number of states required to accept strings ending with 101

A:3

B:4

C:2

D : cannot be represented.

Q.no 12. Turing machine was invented by

A : Alan Turing

B : Turing man

C : Turing taring

D : Turling Bake

Q.no 13. Which one of the following languages over the alphabet {0, 1} is described by
the regular expression: (0+1)*0(0+1)*0(0+1)*

A : The set of all strings containing the substring 00

B : The set of all strings containing at most two 0’s

C : The set of all strings containing at least two 0’s

D : The set of all strings that begin and end with either 0 or 1

Q.no 14. Which of the following is false for a grammar G in Chomsky Normal Form:

A : G has no useless symbols

B : G has no unit productions

C : G has no epsilon productions

D : G must have useless symbols

Q.no 15. Which of the following is not a part of 5-tuple finite automata?

A : Input alphabet
B : Transition function

C : Initial State

D : Output alphabet

Q.no 16. PDA accepts languages generated by which grammar

A : type 0

B : type 1

C : type 2

D : type 3

Q.no 17. A language is regular if and only if

A : accepted by DFA

B : accepted by PDA

C : accepted by LBA

D : accepted by Turing machine

Q.no 18. Which of the following are not quantifiers?

A : Kleene plus +

B : Kleene star *

C : Question mark ?

D : Union

Q.no 19. Recursive languages are also known as:

A : decidable

B : Undecidable

C : sometimes decidable

D : infinite

Q.no 20. Which among the following are incorrect regular identities?
A:

B:

C:

D:

Q.no 21. Which of the following is not a regular expression?

A : [(a+b)*(aa+bb)]*

B : [(0+1)-(0b+a1)*(a+]*

C : (01+11+10)*

D : (1+2+0)*(1+2)*

Q.no 22. Which of the following is a false statement?

A : Moore machine has no accepting states

B : Mealy machine has no accepting states

C : We can convert Mealy to Moore and vice versa

D : We can convert Mealy to Moore but not vice versa

Q.no 23. Which of the following statement is not true?

A : Type 0 grammar is called unrestricted grammar

B : Chomsky hierarchy define only one type of grammar

C : Type 3 grammar is recognized by FA

D : Type 2 grammar is CFG

Q.no 24. Which among the following is not true for 2-way infinte TM?

A : Tape in both directions

B : Leftmost square not distinguished


C : Any computation that can be performed by 2-way infinite tape can also be performed by
standard TM.

D : Tape is only in one direction.

Q.no 25. The maximum number of transitions which can be performed over a state in a
DFA having alphabet set a,b,c are

A:1

B:2

C:3

D:4

Q.no 26. An instantaneous description of Turing machine consists of

A : Present state and input to be processed

B : Present state and entire input to be processed

C : Present input only

D : Present state only

Q.no 27. It is less complex to prove the closure properties over regular languages using

A : NFA

B : DFA

C : PDA

D : Canot be said

Q.no 28. Production Rule: aAb->agb belongs to which of the following category?

A : Regular Language

B : Context free Language

C : Context Sensitive Language

D : Recursively Ennumerable Language

Q.no 29. If r1 = (aa + bb) and r2 = (a + b) then the language (aa + bb)(a + b) will be
generated by
A : (r1)(r2)

B : (r1 + r2)

C : (r2)(r1)

D : (r1)

Q.no 30. For every CFL, G, there exists a PDA M such that L(G) = L(M) and vice versa.

A : true

B : false

C : maybe

D : probably

Q.no 31. Given a Grammar G:


S->aA
A->a | A
B->B
The number of productions to be removed immediately as Unit productions are

A:0

B:1

C:2

D:3

Q.no 32. The subset construction shows that every NFA accepts a ……..

A : String

B : Function

C : Regular language

D : Context-free language

Q.no 33. Which of the following is true for the language?

A : It is not accepted by a Turing Machine

B : It is regular but not context-free


C : It is context-free but not regular

D : It is neither regular nor context-free, but accepted by a Turing machine

Q.no 34.

A:

B:

C:

D:

Q.no 35. Which productions will generate even length palindromes for terminals 'a'
and 'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb

D : S-> aSb|bSa|a|b

Q.no 36. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which any occurrence of the symbol b, is in
groups of odd numbers.

A : (abbb)*

B : a* b (bb)* a*

C : ((a+b)(a+b)(a+b))*

D : a* b* (bb)* a*

Q.no 37. The shown language is recognized by (a) Turing machine, (b) Pushdown

automata, (c) Finite automata

A : Only (a)

B : Only (b)
C : Only (c)

D : Only (a) and (b)

Q.no 38. Which of the regular expressions correspond to the given problem statement:
Express the identifiers in C Programming language where l=letters d=digits

A : (l+_)(d+_)*

B : (l+d+_)*

C : (l+_)(l+d+_)*

D : (_+d)(l+d+_)*

Q.no 39. PDA can be represented with the help of

A : Instantaneous description

B : input symbols

C : start state

D : final state

Q.no 40. Which of the following is a regular language?

A : String whose length is a sequence of prime numbers

B : String with substring wwr in between

C : Palindrome string

D : String with even number of Zeroes

Q.no 41. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.
A:

B:

C:
D:

Q.no 42. CFG is not closed under

A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 43. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 44.
A:A

B:B

C:C

D:D

Q.no 45. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD

D:DA

Q.no 46. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

Q.no 47. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard
Q.no 48. Consider the following statements.
I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II

B : Only III

C : Only I and II

D : Only I and III

Q.no 49. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 50. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 51. Transition function of NFA machine is given by

A:

B:
C:

D:

Q.no 52. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 53. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 54. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar
D : Phrase grammar

Q.no 55. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 56. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 57. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 58. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3
D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 59. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar

Q.no 60. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 1. Those problems that are solvable in polynomial time belong to __

A : NP

B:P
C : Hard

D : Complete

Q.no 2. What is the Regular Expression Matching Zero or More Specific Characters

A:x

B:#

C:*

D:&

Q.no 3. The minimum number of states required to recognize an octal number divisible
by 3 is

A:1

B:3

C:5

D:7

Q.no 4. Bottom-up parsing is also known as

A : shift reduce parsing

B : predictive descent parsing

C : operator precedence parsing

D : LL1 Parsing

Q.no 5. In CFG, notation of VARIABLE representation is

A : Captal Letters

B : Small Letters

C : Italic Letters

D : Roman Letters

Q.no 6. A push down automaton employs which data structure?

A : queue
B : linked list

C : hash table

D : stack

Q.no 7.

A:

B:

C:L

D : L*

Q.no 8. Which of the following pair of regular expressions are not equivalent?

A : 1(01)* and (10)*1

B : x(xx)* and (xx)*x

C : (ab)* and a*b*

D : x+ and x*x+

Q.no 9. Which of the following correctly recognize the symbol ‘|-‘ in context to PDA?

A : moves

B : transition function

C : or symbol

D : not symbol

Q.no 10. The major difference between a moore and mealy machine is that

A : Output of the former depends on the present state and present input

B : output of the former depends only on the present state

C : output of the former depends only on the present input

D : output of the former depends on the present input and next state


Q.no 11. A Language for which no DFA exist is a________

A : Regular Language

B : Non-Regular Language

C : May be Regular

D : Cannot be said

Q.no 12. Which of the following does not belong to the language if input alphabet set is
a,b

A:a

B:b

C : epsilon

D:c

Q.no 13. To which of the following class does a CNF-satisfiability problem belong?

A : NP class

B : P class

C : NP complete

D : NP hard

Q.no 14. The format: A->aB refers to which of the following?

A : Chomsky Normal Form

B : Greibach Normal Form

C : Backus Naur Form

D : Sentential form

Q.no 15. Which of the following is true?

A : (01)*0 = 0(10)0*

B : (0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*

C : (0+1)*01(0+1)*+1*0* = (0+1)*0
D : (01)*01 = 0(10)0*1

Q.no 16. A formal language is recursive if :

A : A turing machine exists

B : A turing machine that halts for every input

C : Turing machine rejects if the input does not belong to the language

D : All of the mentioned

Q.no 17. RR* can be expressed in which of the forms:

A : R+

B : R-

C : R+ U R-

D:R

Q.no 18. PDA is more powerful than

A : Turing Machine

B : Finite Automata

C : Linear Bounded Automata

D : Non Deterministic Turing Machine

Q.no 19. Minimal finite automata need _____________ no. of final states

A:1

B:2

C:3

D : Depends on problem

Q.no 20. In regular expressions, the operator ‘*’ stands for

A : Concatenation

B : Selection

C : Iteration
D : Addition

Q.no 21. Every grammar in Chomsky Normal Form is:

A : Regular

B : Context free

C : Context sensitive

D :  Unrestricted

Q.no 22. The operations of PDA never work on elements other than top of the stack.

A : false

B : true

C : may be

D : cannot say

Q.no 23. A PDA chooses the next move based on

A : current State and input

B : current state, stack and input

C : current state and stack

D : current state

Q.no 24. In definition of PDA M=(Q, Σ,Γ, q0,Z0,A,δ) what Γ represents

A : initial stack symbol

B : stack alphabet

C : finite set of states

D : transition function

Q.no 25. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings without double a?

A:
B : ((a+b)(a+b))*

C : (a + bb)*

D:

Q.no 26. Number of external states of a UTM should be atleast

A:1

B:2

C:3

D:4

Q.no 27. Which of the following statement is correct?

A : All Regular grammars are context free but not vice versa

B : All context free grammars are regular grammars but not vice versa

C : Regular grammar and context free grammar are the same entity

D : All context sensitive grammar are regular grammar but not vice versa

Q.no 28. X is a simple mathematical model of a computer. X has unrestricted and


unlimited memory. X is a FA with R/W head. X can have an infinite tape divided into
cells, each cell holding one symbol.
Name X?

A : Push Down Automata

B : Non deterministic Finite Automata

C : Turing machines

D : Deterministic Finite Automata

Q.no 29. The complement of a language will only be defined when and only when the
__________ over the language is defined.

A : String

B : Word

C : Alphabet
D : Grammar

Q.no 30. Which one of the following is FALSE?

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to an equivalent DFA.

C : Every Epsilon NFA can be converted to an equivalent DFA.

D : Every Mealy can be converted to an equivalent Moore machine.

Q.no 31. An NFA’s transition function returns

A : Boolean value

B : A state

C : A set of states

D : An edge

Q.no 32. Which of the following statement is false?

A : For non deterministic PDA, equivalence is undecidable.

B : For deterministic PDA, equivalence is decidable.

C : For deterministic PDA, equivalence is undecidable.

D : For non deterministic PDA, equivalence is decidable.

Q.no 33. Which of the following statements is false ?

A : Halting problem of Turing machines is undecidable

B : Determining whether a context-free grammar is ambiguous is undecidable

C : Given two arbitrary context-free grammars G1 G2 and it is undecidable whether L (G1) =


L (G2).

D : Given two regular grammars G1 G2 and it is undecidable whether L (G1) = L (G2)

Q.no 34. Language is accepted by PDA if it is

A : regular language

B : context free language


C : unrestricted

D : regular and context free

Q.no 35. 3-SAT and 2-SAT problems are

A : NP-complete and in P respectively

B : Undecidable and NP-complete

C : Both NP-complete

D : Both in P

Q.no 36. Which productions will generate odd length palindromes for terminals 'a' and
'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb

D : S-> aSb|bSa|a|b

Q.no 37. Which is a wrong satatement?

A : A regular language is produced by union of two regular languages

B : The concatenation of two regular languages is regular

C : The Kleene closure of a regular language is regular

D : The complement of a regular language is also a regular language

Q.no 38. Number of states required to accept strings ending with 10 are

A:3

B:2

C:1

D : can’t be represented.

Q.no 39. Complement of a DFA can be obtained by

A : making starting state as final state.


B : no trival method.

C : making final states non-final and non-final to final.

D : make final as a starting state.

Q.no 40. Which language is represented by the following grammar G:


G={{S},{0,1},P,S}
where elements of P are:
S --> SS
S--> 0S1
S--> 1S0
S--> Є

A : Regular language

B : Context-free language

C : Context-sensitive language

D : Recursively enumerable language

Q.no 41. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 42.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable


Q.no 43. The minimum number of productions required to produce a language
consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2

Q.no 44. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 45. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 46. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 47. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is
A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011

Q.no 48. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 49. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 50. Construct a Turing machine which accepts a string with ‘aba’ as its substring.

A:
B:

C:

D:

Q.no 51. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?
A:

B:

C:

D:

Q.no 52. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:
A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 53. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 54. Which of the following are decidable?


I. Whether the intersection of two regular languages is infinite
II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 55. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable
Q.no 56. The context free grammar
S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 57. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 58.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem


Q.no 59. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 60. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal

Q.no 1. Which of the following statement is true? (a) Turing machine was developed by
Alan Turing, (b) PDA is less powerful than Turing machine, (c) FA is more powerful
than TM

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Only (c)

Q.no 2. Every grammar in Chomsky Normal Form is:

A : regular
B : context sensitive

C : context free

D : Unrestricted

Q.no 3. Regular expression x + y denotes the set

A : {x,y}

B : {xy}

C : {x}

D : {y}

Q.no 4. Transition function of DFA machine maps.

A:

B:

C:

D:

Q.no 5. To simplify a grammar we can eliminate

A : Useful symbols

B : epsilon productions

C : Reachable symbols

D : Non Unit productions

Q.no 6. Precedence of regular expression in decreasing order is

A:*,.,+

B:.,*,+

C:.,+,*

D:+,.,*

Q.no 7. Finite automata needs minimum _______ number of stacks


A:0

B:1

C:2

D:3

Q.no 8. 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

C : At least one state has more than one transitions

D : At most one state has more than one transitions

Q.no 9. How many states a Turing machine has?

A : Finite

B : Infinite

C : May be finite

D : One

Q.no 10. A boolean formula is said to be in Conjuctive Normal Form (CNF) if it can
represented as

A : e1 V e2 V e3

B : e1 Ʌ e2 V e3

C : e1 V e2 Ʌ e3

D : e1 Ʌ e2 Ʌ e3

Q.no 11. 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*

B : R = P*Q

C : R = RP

D : R = QP
Q.no 12. What is the pumping length of string of length x?

A : x+1

B:x

C : x-1

D : x2

Q.no 13. The language accepted by a Turing machine is called ………. language.

A : Regular

B : Recursively Enumerable

C : Context free

D : Context sensitive

Q.no 14. 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

B : Decidable

C : Undecidable

D : NP-HARD

Q.no 15. The push down automata indicate the acceptance of input string in terms of

A : final state

B : empty stack

C : final state and empty stack

D : start state

Q.no 16. Halting states are of two types. They are:

A : accept and reject

B : reject and allow

C : start and reject


D : start and accept

Q.no 17. A Turing machine operates over

A : Finite memory tape

B : Infinite memory tape

C : Depends on the algorithm

D : Depends on the input

Q.no 18. The transition a Push down automaton makes is additionally dependent upon
the:

A : Current State

B : input tape

C : stack

D : terminals

Q.no 19. (a+b)* is equivalent to

A : b*a*

B : (a*b*)*

C : a*b*

D:

Q.no 20. Which of the following a Turing machine does not consist of?

A : Input tape

B : Head

C : State register

D : Stack

Q.no 21. Can a DFA recognize a palindrome number?

A : Yes

B : No
C : May be

D : Cannot be determined

Q.no 22. The travelling salesman problem can be solved using _________

A : A spanning tree

B : A minimum spanning tree

C : Bellman – Ford algorithm

D : DFS traversal

Q.no 23. Which of the following pairs have DIFFERENT expressive power?

A : Deterministic finite automata (DFA) and Non-Deterministic finite automata(NFA)

B : Deterministic push down automata (DPDA) and Non-deterministic pushdown automata


(NPDA)

C : Deterministic single-tape Turing machine and Non-deterministic single-tape Turing


Machine

D : Single-tape Turing machine and multi-tape Turing machine

Q.no 24. A string derived by a grammar is graphically represented using ……...

A : Binary tree

B : Sparse tree

C : Parse tree

D : Forest

Q.no 25. The RE that gives none or many instances of an x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 26. Which of the following is a false statement?

A : Moore machine has no accepting states


B : Mealy machine has no accepting states

C : We can convert Mealy to Moore and vice versa

D : We can convert Mealy to Moore but not vice versa

Q.no 27. Pushdown automata behaves like Turing machine when it has the number of
auxiliary memory

A : one or more

B : two or more

C : zero

D : one

Q.no 28. The production of the form A->B , where A and B are non terminals is called

A : Null production

B : Greibach Normal Form

C : Unit production

D : Chomsky Normal Form

Q.no 29. Which of the following statements is incorrect?

A : A Turing Machine cannot solve Halting problem

B : Set of recursively enumerated languages is closed under union

C : A FSM with 3 stacks is more powerful than FSM with 2 stacks

D : Context sensitive grammar can be recognized by a linearly bounded memory machine.

Q.no 30. The total number of states and transitions required to form a Moore machine
that processes a binary input string and will produce residue mod 3.

A : 3 and 6

B : 3 and 5

C : 2 and 4

D : 2 and 5

Q.no 31. Which of the following is not an application of Finite Automaton?


A : Compiler Design

B : Grammar Parsers

C : Text Search

D : Image processing

Q.no 32. Is the language preserved in all the steps while eliminating epsilon transitions
from a NFA?

A : yes

B : no

C : may be

D : cannot say

Q.no 33. The worst-case efficiency of solving a problem in polynomial time is?

A : O(p(n))

B : O(p( n log n))

C:

D : O(p(m log n))

Q.no 34. CFGs are more powerful than (a) DFA, (b) NDFA, (c) Mealy Machine

A : Only (a)

B : Only (b) and (c)

C : Only (a) and (c)

D : (a), (b) and (c)

Q.no 35. An Epsilon-NFA is ___________ in representation.

A : Quadruple

B : Quintuple

C : Triple
D : None of the mentioned

Q.no 36. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which the total number of a’s is divisible by 2.

A : ((a+b)(a+b))*

B : (a + ab)*

C : ( b* a b*ab*)* + b*

D : a* b (aa)*b a*

Q.no 37. Which of the following is analogous to the NFA and NPDA ?

A : Regular language and Context Free language

B : Regular language and Context Sensitive language

C : Context free language and Context Sensitive language

D : Unrestricted language

Q.no 38. Which of the given problems are NP-complete?

A : (a) Traveling Salesman Problem

B : (b) Satisfiability Problem

C : Both (a) and (b)

D : Turing Machine

Q.no 39. Which of the following is in 2-CNF?

A : (e1 Ʌ e2) Ʌ (e1 Ʌ ~e2)

B : (e1 Ʌ e2) Ʌ (e1 V ~e2)

C : (e1 V e2) Ʌ (e1 V ~e2)

D : (e1 V e2) Ʌ (e1 Ʌ ~e2)

Q.no 40. A context free language is called ambiguous if (a) It has two or more leftmost
derivations for the same string. (b) It has two or more rightmost derivations for the
same string. (c) It has Only single derivation tree.

A : Only (a)
B : Only (b)

C : Both (a) and (b)

D : Only (c)

Q.no 41. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 42. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard

Q.no 43. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 44. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab
A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 45. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 46. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 47.

A:A

B:B

C:C
D:D

Q.no 48. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar

Q.no 49. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:

Q.no 50. For two regular languages


L1 = (a + b)* a
and
L2 = b (a + b ) *
the intersection of L1 and L2 is given by

A : (a + b ) * ab

B : ab (a + b ) *

C:a(a+b)*b

D : b (a + b ) * a
Q.no 51. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 52. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's

D : has atleast two a's

Q.no 53. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.
A:

B:

C:
D:

Q.no 54. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 55. The CFG "S-> aS | bS |a|b " is equivalent to regular expression

A : (a + b)

B : (a + b) (a + b)*

C : (a + b) (a + b)

D : (a . b) (a . b)

Q.no 56. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 57. Which of the following grammars are in Chomsky Normal Form:
A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 58. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 59. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 60. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

You might also like