You are on page 1of 22

Multiple Choice Questions (Set I)

In each of the following questions, choose the correct answer from the four choi
ces provided.
1.
The following grammar
G = (N, T, P, S)
N = {S, A, B}
T = {a, b, c}
P : S ? aSa
S ? aAa
A ? bB
B ? bB
B ? c is
a. is type 3
b. is type 2 but not type 3
c. is type 1 but not type 2
d. is type 0 but not type 1
2.
The following grammar
G = (N, T, P, S)
N = {S, A, B, C, D, E}
T = {a, b, c}
P : S ? aAB
AB ? CD
CD ? CE
C ? aC
C ? b
bE ? bc is
a. is type 3
b. is type 2 but not type
c. is type 1 but not type
d. is type 0 but not type
3.
The following grammar
G = (N, T, P, S)
N = {S, A, B, C}
T = {a, b, c}
P : S ? aS
A ? bB
B ? cC
C ? a is
a. is type 3
b. is type 2 but not type
c. is type 1 but not type
d. is type 0 but not type
4.
The following grammar
G = (N, T, P, S)
N = {S, A, B, C, D, E}
T = (a, b, c}
P : S ? ABCD
BCD ? DE
D ? aD
D ? a
E ? bE
E ? c is

3
2
1

3
2
1

a. is type 3
b. is type 2 but not type 3

c. is type 1 but not type 2


d. is type 0 but not type 1
5.
Consider the following CFG
S ? aB S ? bA
B ? b A ? a
B ? bS A ? aS
B ? aBB A ? bAA
Consider the following derivation
S ? aB
? aaBB
? aaBb
? aabSb
? aabbAb
? aabbab
This derivation is
a. a leftmost derivation
b. a rightmost derivation
c. both leftmost and rightmost derivation
d. neither leftmost nor rightmost derivation
6.
Consider the following language
L = {anbncndn|n = 1}
L is
a. CFL but not regular
b. CSL but not CFL
c. regular
d. type 0 language but not type 1
7.
Consider the following language
L = {anbn|n = 1}
L is
a. CFL but not regular
b. CSL but not CFL
c. regular
d. type 0 language but not type 1
8.
Consider the following language
L = {anbmcpdq|n, m, p, q = 1}
L is
a. CFL but not regular
b. CSL but not CFL
c. regular
d. type 0 language but not type 1
9.
The following CFG is in
S ? AB
B ? CD
B ? AD
B ? b
D ? AD
D ? d
A ? a
C ? a
a. Chomsky normal form but not strong Chomsky normal form
b. Weak Chomsky normal form but not Chomsky normal form
c. Strong Chomsky normal form
d. Greibach normal form

10.
The following CFG is in
S ? aBB
B ? bAA
A ? a
B ? b
a. Chomsky normal form but not strong Chomsky normal form
b. Weak Chomsky normal form but not Chomsky normal form
c. Strong Chomsky normal form
d. Greibach normal form
11.
Which of the following CF language is inherently ambiguous?
a. {anbncmdm|n, m = 1}
b. {anbmcpdq|n = p or m = q, n, m, p, q = 1}
c. {anbmcpdq|n ? m ? p ? q}
d. {anbmcpdq|n ? m ? p ? q}
14.
Can a DFSA simulate a NFSA
a. No
b. Yes
c. sometimes
d. depends on NFA
16.
The concept of FSA is much used in this part of the compiler
a. lexical analysis
b. parser
c. code generation
d. code optimization
17.
The concept of grammar is much used in this part of the compiler
a. lexical analysis
b. parser
c. code generation
d. code optimization
18.
(a + b)(cd)*(a + b) denotes the following set
a. {a(cd)nb|n = 1}
b. {a(cd)na|n = 1} ? {b(cd)nb/n = 1}
c. {a(cd)na|n = 0} ? {a(cd)nb/n = 0} ? {b(cd)na/n = 0} ? {b(cd)nb/n = 0}
d. {acndnb|n = 1}
19.
baa*c denotes the set
a. {bnamcp|n, m, p = 1}
b. {banc|n = 0}
c. {banc|n = 1}
d. {w|w is a string of a, b, c}
20.
The set of all strings over the alphabet S = {a, b} (including e) is denoted by
a. (a + b)*
b. (a + b)+
c. a+b+
d. a*b*
21.
Palindromes cant be recognized by any FSA because
a. FSA cannot remember arbitrarily large amount of information
b. FSA cannot deterministically fix the midpoint
c. Even if the mid point is known an FSA cannot find whether the second half of
the string matches the first half

d. all of the above


22.
Let S = {a, b, c, d, e}. The number of strings in S* of length 4 such that no sy
mbol is used more than once in a string is
a. 360
b. 120
c. 35d. 36
23.
Which of the following denotes Chomskian hiearchy?
a. REG ? CFL ? CSL ? type0
b. CFL ? REG ? type0 ? CSL
c. CSL ? type0 ? REG ? CFL
d. CSL ? CFL ? REG ? type0
24.
A language L is accepted by a FSA iff it is
a. CFL
b. CSL
c. recursive
d. regular
25.
Which of the following regular expressions denotes a language comprising of all
possible strings over S = {a, b} of length n where n is a multiple of 3.
a. (a + b + aa + bb + aba + bba)*
b. (aaa + bbb)*
c. ((a + b)(a + b)(a + b))*
d. (aaa + ab + a) + (bbb + bb + a)
26.
A language is represented by a regular expression (a)*(a + ba). Which of the fol
lowing string does not belong to the regular set represented by the above expres
sion.
a. aaa
b. aba
c. ababad. aa
27.
Which of the following is not primitive recursive but partially recursive?
a. McCarthys function
b. Riemann function
c. Ackermanns function
d. Bounded function
28.
Consider the following right-linear grammar G = (N, T, P, S) N = {S}
P : S ? aS|aA T = {a, b}
A ? bA|b
Which of the following regular expression denotes L(G)?
a. (a + b)*
b. a(ab)*b
c. aa*bb*
d. a*b*
29.
Which of the following strings is not generated by the following grammar? S ? Sa
SbS|e
a. aabb
b. abab
c. aababb
d. aaabb
31.
Consider a language L for which there exists a Turing machine , T, that accepts e
very word in L and either rejects or loops for every word that is not in L. The

language L is
a. NP hard
b. NP complete
c. recursive
d. recursively enumerable
32.
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 statement are TRUE?
a. I only
b. I and II
c. I and III
d. II and III
33.
Which of the following statement is wrong?
a. Any regular language can be generated by a context-free grammar
b. Some non-regular languages cannot be generated by any CFG
c. the intersection of a CFL and regular set is a CFL
d. All non-regular languages can be generated by CFGs.
34.
Recursively enumerable languages are not closed under
a. union
b. homomorphism
c. complementation
d. concatenation
35.
Which of the following problem is undecidable?
a. membership problem for CFL
b. membership problem for regular sets
c. membership problem for CSL
d. membership problem for type 0 languages
36.
Recursive languages are
a. a proper superset of CFL
b. always recognized by PDA
c. are also called type 0 languages
d. always recognized by FSA
37.
R1 and R2 are regular sets. Which of the following is not true?
a. R1 n R2 neet not be regular
b. S* - R1 is regular
c. R1 ? R2 is regular
d. is regular
38.
Which of the following regular expression identity is true?
a. r(*) = r*
b. (r*s*)* = (r + s)*
c. (r + s)* = r* + s*
d. r*s* = r* + s*
39.
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
40.
Which of the following conversion is not possible (algorithmically)?

a. regular grammar to context-free grammar


b. nondeterministic FSA to deterministic FSA
c. nondeterministic PDA to deterministic PDA
d. nondeterministic TM to deterministic TM
Answers
1.b2.c3.a4.d5.d6.b7.a8.c9.c10.d11.b12.a13.b14.b15.b16.a17.b18.c19.c20.a21.d22.b2
?3.a24.d25.c26.c27.c28.c29.d30.c31.d32.b33.d34.c35.d36.a37.a38.b39.c40.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 Auto
mata (NPDA)
(B) Deterministic Finite Automata (DFA) and Non-deterministic Finite Automata(NF
A)
(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)


(B)
(C)
(D)

Finiteness problem for FSAs


Membership problem for CFGs
Equivalence problem for FSAs
Ambiguity problem for CFGs

View Answer / Hide Answer


ANSWER: Ambiguity problem for CFGs

(3) The language which is generated by the grammar S-> aSa I bSb I a I b over th
e alphabet {a, b} is the set of
(A)
(B)
(C)
(D)

Strings that begin and end with the same symbol


All odd and even length palindromes
All odd length palindromes
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-c
omplete. X shows a polynomial time reduction from the 3-SAT problem to p and Y s
hows a polynomial time reduction from p to 3-SAT. From these reduction it can be
inferred that

(A)
(B)
(C)
(D)

is
is
is
is

NP-com lete
NP-hard but not NP-com lete
in NP but not NP-com lete
neither NP-hard nor in NP

View Answer / Hide Answer


ANSWER: is NP-com lete

(5) Out of the three roblems S, Q and R, S is an NP-com lete roblem and Q and
R are the two other roblems not known to be in NP. Which one of the following s
tatements is true if Q is olynomial time reducible to S and S is the olynomial
time reducible to R?
(A)
(B)
(C)
(D)

Q
R
Q
R

is
is
is
is

NP-com lete
NP-com lete
NP-hard
NP-hard

View Answer / Hide Answer


ANSWER: R is NP-com lete

(6) From the o tions given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that is recursivel
y enumerable but not recursive is
(A)
(B)
(C)
(D)

X2
X2
X2
X1

X1
X1
X1
X3

is
is
is
is

recursively
recursively
recursively
recursively

enumerable
enumerable
enumerable
enumerable

View Answer / Hide Answer


ANSWER: X1 X3 is recursively enumerable

(7) For the language {a


(A)
(B)
(C)
(D)

It
It
It
It

is
is
is
is

I P is a rime}, the statement which hold true is

not regular but


regular but not
neither regular
not acce ted by

context free
context free
nor context free, but acce ted by a turing machine
turing machine

View Answer / Hide Answer


ANSWER: It is neither regular nor context free, but acce ted 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
(9) The language described by the regular ex ression (0+1)*0(0+1)*0(0+1)* over t
he al habet {0 1} is the set of
(A)
(B)
(C)
(D)

All
All
All
All

strings
strings
strings
strings

containing
containing
that begin
containing

at least two 1s
at least two 0s
and end with either 0s or 1s
the substring 00

View Answer / Hide Answer


ANSWER: All strings containing at least two 0s

(10) 3-SAT and 2-SAT


(A)
(B)
(C)
(D)

roblems are

NP-com lete and in P res ectively


Undecidable and NP-com lete
Both NP-com lete
Both in P

View Answer / Hide Answer


ANSWER: NP-com lete and in P res ectively

(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 acce ted by a deterministic
automaton
(C) The union of two context free languages is context free
(D) The com lement of a context free language is context free.

ush down

View Answer / Hide Answer


ANSWER: The union of two context free languages is context free

(12) Let n be the ositive integer constant and L be the language with al habet
{a}. To recognize L the minimum number of states required in a DFA will be
(A)
(B)
(C)
(D)

2k + 1
k + 1
2n + 1
n + 1

View Answer / Hide Answer


ANSWER: n + 1

(13) Consider a stack, which is limited to 10 items. The language acce ted by a
ush- down automaton in such stack is best described as
(A)
(B)
(C)
(D)

Regular
Deterministic context free
Context free
Recursive

View Answer / Hide Answer


ANSWER: Regular

(14) Which one of the following statement is true if L denotes the language gene
rated by the grammar S->0S0/00?
(A)
(B)
(C)
(D)

L
L
L
L

is not context free


is regular but not 0+
= 0+
is context free but not regular

View Answer / Hide Answer


ANSWER: L is regular but not 0+

(15) Consider the regular ex ression 0 * (10 *) which is similar to the same set
as
(A)
(B)
(C)
(D)

0 + (0 + 10) *
(0 +1) * 10 (0 + 1) *
(1 * 0) * 1*
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-st
rings of W. The minimum number of states in a non-deterministic finite automaton
that acce ts L is
(A)
(B)
(C)
(D)

n
2n
n + 1
n - 1

View Answer / Hide Answer


ANSWER: n + 1

(17) The DFA shown below acce ts the set of all strings over {0, 1} that

(A)
(B)
(C)
(D)

End with 00
End with 0
Begin either with 0 or 1
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 n1I is a regular language.
Which one of the following statements is correct?
(A)
(B)
(C)
(D)

Both S1
Only S2
Only S1
Neither

and S2 are correct


is correct
is correct
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 0s in s is denoted by no(s) a


nd the number of 1s in s is denoted by n1(s). The language that is not regular is
(A)
(B)
(C)
(D)

L
L
L
L

=
=
=
=

{s
{s
{s
{s

(0+1)*
(0+1)*
(0+1)*
(0+1)*

I
I
I
I

for every refix s of s, I no(s)-n1(s) I 2}


no(s) mod 7 = n1(s) mod 5 = 0}
no(s) is a 3 digit rime}
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 contex
t-free grammar are always binary trees
(B) If W is the string of a terminals and Y is a non-terminal, the language gene
rated by a context free grammar, all of whose roductions are of the form x->W o
r X->WY is always regular
(C) By using suitable transformation all -productions can b rmovd from any con
txt-fr grammar.
(D) Evry lft rcursiv grammar can b convrtd to a right rcursiv grammar a
nd vic-vrsa
Viw Answr / Hid Answr
(21) Stat tabl of an FSM is givn blow. Thr ar two stats A And B, on inp

ut and on output.

Lt th initial stat b A = 0 and B = 0. To tak th machin to th stat A = 0
and B = 1 with output = 1 th minimum lngth of input string rquird will b
(A)
(B)
(C)
(D)

2
7
4
3

Viw Answr / Hid Answr


ANSWER: 3

For qustions 22 and 23 rfr to th data givn blow:


Th figur shown blow is a finit stat automaton

(22) Which on of th following is tru for this automaton?


(A)
(B)
(C)
(D)

b*ab*ab*ab*
b*a(a+b)*
b*ab*ab*
(a+b)*

Viw Answr / Hid Answr


ANSWER: b*a(a+b)*

(23) For th abov FSA th quivalnt minimum stat automaton has th following
numbr of stats
(A)
(B)
(C)
(D)

1
2
3
4

Viw Answr / Hid Answr


ANSWER: 2

(24) Out of th thr dcision problms P1, P2 and P3, P1 is dcidabl and P2 is
undcidabl. Th statmnt that holds tru is
(A)
(B)
(C)
(D)

P3
P3
P3
P3

is
is
is
is

dcidabl if P3 is rducibl to complimnt of P2


dcidabl if P1 is rducibl to P3
undcidabl if P1 is rducibl to P3
undcidabl if P2 is rducibl to P3

Viw Answr / Hid Answr

ANSWER: P3 is undcidabl if P2 is rducibl to P3

(25) G = {S->SS, S->ab, S->ba, S->?} is th contxt fr grammar whos statmnt
s ar givn blow:
a. G is ambiguous
b. G producs all strings with qual numbr of as and bs.
c. Dtrministic PDA accpts G
Which of th following statmnt is tru about G?
(A)
(B)
(C)
(D)

a, b, c all ar tru


Only and b ar tru
Only b and c ar tru
Only a is tru

Viw Answr / Hid Answr


ANSWER: a, b, c all ar tru

(26) Th minimum numbr of stats in any DFA accpting th rgular languag L =
(111+11111)* is
(A)
(B)
(C)
(D)

5
7
9
11

Viw Answr / Hid Answr


ANSWER: 9

(27) Considr th languag L = {W I W {0, 1}*, whr 0s and 1s in W ar divisibl
by 3 and 5 rspctivly. Th minimum stat dtrministic finit automaton accpt
ing th languag L has
(A)
(B)
(C)
(D)

20 stats
5 stats
10 stats
15 stats

Viw Answr / Hid Answr


ANSWER: 15 stats

(28) W hav an undirctd graph G(V, E) with two problms givn blow:
Does G hve n independent set of size IVI 4?
Does G hve n independent set of size 5?
The sttement tht holds true is
(A) is NP-complete nd is in P

(B) is in P nd is NP-complete


(C) Both nd re NP-complete
(D) Both nd re in P
View Answer / Hide Answer
ANSWER: is in P nd is NP-complete

(29) Figure shows deterministic finite stte utomton M. Let the set of seven 
it inry strings whose 1st, 4th nd the lst its re 1 is denoted y S. How m
ny strings in S is ccepted y M?

(A)
(B)
(C)
(D)

1
9
3
5

View Answer / Hide Answer


ANSWER: 5

(30) Which one of the following sttement is true for  regulr lnguge L over
{} whose miniml finite stte utomtion hs two sttes?
(A)
(B)
(C)
(D)

L
L
L
L

must
must
must
must

e
e
e
e

either {n I n is odd} or {n I n is even}


{n I n is odd}
{n I n is even}
{n I n = 0}

View Answer / Hide Answer


ANSWER: L must e either {n I n is odd} or {n I n is even}

(31) Consider  grph G = (V, E) where I V I is divisile y 3. The prolem of f


inding  Hmiltonin cycle in  grph is denoted y SHAM3 nd the prolem of det
ermining if  Hmiltonin cycle exits in such grph is denoted y DHAM3. The opt
ion, which holds true, is
(A)
(B)
(C)
(D)

Only DHAM3 is NP-hrd


Only SHAM3 is NP-hrd
Both SHAM3 nd DHAM3 re NP-hrd
Neither SHAM3 nor DHAM3 is NP-hrd

View Answer / Hide Answer


ANSWER: Both SHAM3 nd DHAM3 re NP-hrd

(32) Which one of the following is true for the lnguge {m n c m+n I m, n1}?
(A) It is context-free ut not regulr

(B) It is regulr
(C) It is type-0 ut not context-sensitive
(D) It is context-sensitive ut not context-free
View Answer / Hide Answer
ANSWER: It is regulr

(33) We hve decision prolems P1 nd P2 s descried elow:


P1: Does  given finite stte mchine ccept  given string?
P2: Does  given context-free grmmr generte n infinite numer of strings?
The sttement tht holds true for P1 nd P2 is
(A)
(B)
(C)
(D)

Only P2
Only P1
Neither
Both P1

is decidle
is decidle
P1 nor P2 re decidle
nd P2 re decidle

View Answer / Hide Answer


ANSWER: Both P1 nd P2 re decidle

(34) Prolem X is given elow:


We hve  turing mchine M over the input lphet , ny stte q of M nd  word
W *, does the computtion of M on W visit the stte q? The sttement, which holds
true

out X, is
(A)
(B)
(C)
(D)

X
X
X
X

is
is
is
is

undecidle ut prtilly decidle


decidle
not  decision prolem
undecidle nd not even prtilly decidle.

View Answer / Hide Answer


ANSWER: X is undecidle ut prtilly decidle

(35) The stte digrm descries the finite stte mchine. A is the strting st
te nd n rc lel is x/y where x stnds for 1 it input nd y stnds for 2 it
output

(A)
(B)
(C)
(D)

Whenever the input sequence is 10 it outputs 00


Whenever the input sequence is 11 it outputs 01
It outputs the sum of the present nd the previous its of the input
None of the ove

View Answer / Hide Answer

ANSWER: It outputs the sum of the present nd the previous its of the input

(36) Which one of the following sttement is true for the C lnguge?
(A)
(B)
(C)
(D)

It
It
It
It

is
is
is
is

 regulr lnguge
context-sensitive lnguge
context-free lnguge
prsle fully only y  turing mchine

View Answer / Hide Answer


ANSWER: It is context-free lnguge

(37) How mny sttes re present in the smllest finite utomton which ccepts
the lnguge {x I length of x is divisile y 3}?
(A)
(B)
(C)
(D)

5
4
3
2

View Answer / Hide Answer


ANSWER: 4

(38) The lst two symols of L which is the set of ll inry strings re sme.
In the minimum stte deterministic finite stte utomton, which is ccepting L
_____, sttes re present
(A)
(B)
(C)
(D)

4
6
3
5

View Answer / Hide Answer


ANSWER: 5

(39) The true regulr expression is


(A)
(B)
(C)
(D)

(r*s*)* = (r+s)*
(r+s)* = r* + s*
r*s* = r* + s*
r(*) = r*

View Answer / Hide Answer


ANSWER: (r*s*)* = (r+s)*

(40) Let n e the length of  chrcter string. How mny sustrings (of ll leng

ths inclusive) cn e formed from n?


(A)
(B)
(C)
(D)

n(n-1)/2
n
(n (n+1)/2) + 1
n

View Answer / Hide Answer


ANSWER: (n (n+1)/2) + 1

(41) The set which is not countle if we hve = {, }, is


(A)
(B)
(C)
(D)

Set
Set
Set
Set

of
of
of
of

ll
ll
ll
ll

lnguges over ccepted y turing mchine


regulr lnguges over
strings over
lnguges over

View Answer / Hide Answer


ANSWER: Set of ll lnguges over

(42) How mny sttes re present in the minimum stte finite utomton tht reco
gnizes the lnguge represented y the regulr expression (0+1)(0+1)..N times?
(A)
(B)
(C)
(D)

n+1
n+2
n
2n

View Answer / Hide Answer


ANSWER: n+2

(43) Consider the stte tle of  finite stte mchine tht hs input x nd  s
ingle output z. The shortest input sequence to rech the finl stte C if the in
itil stte is unknown is

(A)
(B)
(C)
(D)

10
01
101
110

View Answer / Hide Answer


ANSWER: 10

(44) The set tht cn e recognized y  deterministic finite stte utomton is
(A) The set {1, 101, 11011, 1110111, .}

(B) The set of inry string in which the numer of 0s is sme s the numer of 1s
(C) 1, 2, 4, 82n .. written in inry
(D) 1, 2, 4, 82n .. written in unry
View Answer / Hide Answer
ANSWER: 1, 2, 4, 82n .. written in inry

(45) Consider the four regulr expressions given elow;

.
b.
c.
d.

(00)*( +0)
(00)*
0*
0(00)*

Th quivalnt rgular xprssion out of th four is


(A)
(B)
(C)
(D)

b
c
a
a

and
and
and
and

c
d
b
c

Viw Answr / Hid Answr


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)
(C)
(D)

a*
{}
{, a}

Viw Answr / Hid Answr


ANSWER: {}

(47) W hav th languag L = {ab, aa, baa} and th four strings givn blow:
I) abaabaaabaa
II) aaaabaaaa
III) baaaaabaaaab
IV) baaaaabaa
Th strings prsnt in L* ar
(A)
(B)
(C)
(D)

I, II and IV
I, II and III
II, III and IV
I, III and IV

Viw Answr / Hid Answr

ANSWER: I, II and IV

(48) Which on of th following is tru rgarding FOTRAN?


(A)
(B)
(C)
(D)

It is a
It is a
It is a
Non of

contxt fr languag


contxt snsitiv languag
rgular languag
th abov

Viw Answr / Hid Answr


ANSWER: It is a contxt snsitiv languag

(49) Th fatur that cannot b capturd by contxt fr grammar is


(A)
(B)
(C)
(D)

Rcursiv procdur Syntax


Syntax of if-thn-ls statmnt
Arbitrary lngth of variabl nams
Variabl dclard bfor its us

Viw Answr / Hid Answr


ANSWER: Variabl dclard bfor its us

(50) Which on of th following is applicabl for contxt fr languags?
Ths
Ths
Ths
Ths

(A)
(B)
(C)
(D)

ar
ar
ar
ar

closd
closd
closd
closd

undr
undr
undr
undr

union, Kln closur


complmnt, Kln closur
union, intrsction
intrsction, complmnt

Viw Answr / Hid Answr


ANSWER: Ths ar closd undr union, Kln closur

(51)
S ->
S ->
S ->

S -> a  I   c I 
S I 
 I 
d I 

The grmmr descried ove is


(A)
(B)
(C)
(D)

Context free
Context sensitive
Regulr
LR(k)

View Answer / Hide Answer


ANSWER: Context sensitive

(52) Mtch the following

.
.
c.
d.

Regulr expression I. Syntx nlysis


Pushdown utomt II Code genertion
Dtflow nlysis III Lexicl nlysis
Register lloction IV Code optimiztion

(A)
(B)
(C)
(D)






III,  - IV, c - I, d - II
IV,  - III, c - I, d - II
III,  - I, c - IV, d - II
II,  - III, c - IV, d - I

View Answer / Hide Answer


ANSWER:  - III,  - I, c - IV, d - II

(53) Which of the following sttement is flse for  turing mchine?


(A) There exists n equivlent deterministic turing mchine for every non-determ
inistic turing mchine
(B) Turing decidle lnguges re closed under intersection nd complementtion
(C) Turing recognizle lnguges re closed under union nd intersection
(D) Turing recognizle lnguges re closed under union nd complementtion
View Answer / Hide Answer
ANSWER: Turing recognizle lnguges re closed under union nd complementtion

(54) The prolem, which is not NP-hrd, is


(A)
(B)
(C)
(D)

Finding i-connected prolem of  grph


The grph colouring prolem
Hmiltonin circuit prolem
The 0/1 Knpsck prolem

View Answer / Hide Answer


ANSWER: Hmiltonin circuit prolem

(55) If PNP the sttement which holds true is


(A)
(B)
(C)
(D)

NP-hrd = NP
NP-complete P =
P=NP-complete
NP-complete=NP

View Answer / Hide Answer


ANSWER: NP-complete P =

1: Number of states of the SM 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
Option: B
Explanation :

or every data here length is n nd memorys sttes re defined in terms of power
of 2,
Here the totl memory cpility for ll the words = mn
Hence numer of sttes re 2mn
2:

An FSM with

A.1 stck is more powerful thn n FSM with no stck


B.2 stcks is more powerful thn  FSM with 1 stck
C.oth () nd ()
D.None of these
Option: C
3. If two finite sttes mchine M nd N re isomorphic, then
A.M cn e trnsformed to N, merely re-lelling its sttes
B.M cn e trnsformed to N, merely re-lelling its edges
C.Both () nd ()
D.None of these
Option: A
4.
A.DFSM
B.DFSM
C.DPDM
D.Both

Power of

nd
nd
nd
(A)

NDFSM re sme


NDFSM re different
NDPDM re diferent
nd (C)

Option: D
5: Which of the folowing pirs of regulr expressions re equivlent ?
A.1 (01)* nd (10)* 1
B.x (xx) * nd (xx) * x
C.x+ nd x+x*+
D.All of these
Option: D
Explntion :
Option () nd option () re similr deriving expressions using rule :- (pq)*p
= p(qp)*
Option (c) will lso e vlid since:-

(x+x*+) will e
--->(xx*)(x*x**)
--->(xx*)(x*x*)
--->(xx*)(x*)
--->(xx*)

(Using x** = x*)


(Using x*x* = x*)
(Using x*x* = x*)

--->x+
So, the nswer will e ll of these (Option d)
6. An FSM cn e used to dd how mny given integers ?
A.1
B.3
C.4
D.2
Option: B
7.If two finite stte mchines re equivlent, they should hve the sme numer
of
A. sttes
B. edges
C.sttes nd edges
D. none of these
Option: D
8. For which of the following pplictions regulr expressions cn e used ?
A.Designing compilers
B.Developing text editors
C.Simulting sequentil circuits
D.All of these
Option: D
9. L = {P | p ; } is prime is
A.regulr
B.not regulr
C.ccepted y DFA
D.ccepted y PDA
Option: B
10. In n incompletely specified utomt
A.no edge should e lelled epsilon
B.from ny given stte, there cnt e ny token leding to two different sttes
C.oth () nd ()
D.strt stte my not e there
Option: D