You are on page 1of 103

UNI

T-I
:FI
NITEAUTOMATA

1.Analy
tical
l
y,af
ini
teaut
omat
oncanber
epr
esent
edbya_
___
___
__t
upl
es:
a.6
b.4
c. 5
d.7

2.Fi
nalstat
e( s)maynotbeapar
toft
hegi
venst
atesofaf
ini
teaut
omat
on.
a.Tr ue
b.Fal se
c. Both
d.NoneofThese

3.Tr
ansit
ionSystemsistheothernamegi
vent
o:
a.Transit
iontable
b.Transit
iondiagram
c. St
atesofautomata
d.Automat aasawhol e

4.I
mpli
cit
ly,δ(q,^)=_ _
___
__
a.q
b.^
c. Ini
tial stat
e
d.Fi nal state

5.Foranytr
ansiti
onfunct
ionδandf
oranyt
woi
nputst
ri
ngsxandy
,δ(
q,xy
)=_
___
___
__
a.δ(q,x).
δ(q,y)
b.δ(q,yx)
c. δ(
q,x)×δ(q,
y)
d.δ(δ(q,x),
y)

6.DFAst
andsfor
:
a.Determi
nist
icFi
nalAutomata
b.Determi
nist
ici
n-Fi
nit
eAut omata
c. Det
ermi
nedFini
teAutomat a
d.Determi
nist
icFi
nit
eAut omata

7.Thefunct
ionZ(t)=λ( q(
t),
x(t)
)repr
esent
s:
a.Moor eMachi ne
b.Det er
minist
icFinit
eAut omat
a
c. MealyMachine
d.Non- Det
erministi
cFinit
eAutomata
8.Thefunct
ionZ(t)=λ( q(
t))repr
esent
s:
a.Moor eMachi ne
b.Det er
minist
icFiniteAutomata
c. MealyMachine
d.Non- Det
erministi
cFi ni
teAut
omat
a

9.I
natr
ansit
iontable,i
nitial
statei
sdepict
edbywhi
choft
hef
oll
owi
ngsy
mbol
?
a.Ar r
owpoi nti
ngt oast at
e(→)
b.Circleoverast ate
c. Concentri
ccirclesoverastat
e
d.Under l
inedstate

10.NDFAst andsfor:
a.Non- Determi
ni sticFi
nalAutomata
b.Non- Fini
teDeter mini
sti
cAut omata
c. Non-Determi
ni sticFi
nit
eAut omata
d.Non- Determi
nedFi ni
teAutomat a
11.Fi
nalstateinaTransitionDiagram isdepict
edby
:
a.Ar rowpointi
ngt oastate(
→)
b.Ci rcl
eoverast ate
c. Concentri
ccirclesoverast ate
d.Under li
nedstat e

12.Mi
nimi
zat
ionofFini
teaut
omatameans:
a.Converti
nganNDFAint oaDFA
b.Reducingnumberofstatesi
nafini
teautomata
c. Cr
eati
ngfini
teaut
omatawi t
hminimum numberoffi
nal
stat
es
d.Reducingnumberoftr
ansiti
onsi
naf i
nit
eautomata

Answerkey
s:Uni
t-
I

1.c 4.a 7.c 10.c


2.b 5.d 8.a 11.c
3.b 6.d 9.a 12.b
UNI
T-I
I:REGULAREXPRESSI
ONSANDREGULARSETS

1.Machinef or
matofRegul
arEx
pressi
oni
s
a.FiniteAutomata
b.PushDownAut omata
c. TuringMachine
d.Al loftheabove

2.Regul
arExpr
essi
oni
saccept
edby

a.FiniteAut
omata
b.PushDownAut omat
a
c. Turi
ngMachine
d.Al l
oftheabove

3.Thel
anguageofal
lwor
dswi
that
least
2a'
scanbedescr
ibedbyt
heRegul
arExpr
essi
on

a.a( ab)*
a
b.( a+b) *ab*
a(a+b)
*
c. b*ab*a(a+b)*
d.Al loftheabove

4.Whi
cht
ypeofl
anguagei
sRegul
arExpr
essi
on?

a.Type0
b.Type1
c. Ty
pe2
d.Type3.

5.Whi
chofthefol
l
owi
ngRegul
arExpr
essi
onov
er{
0,1}denot
essetofal
lst
ri
ngsnotcont
aini
ng
100assubst
ri
ng?

a.( 1+0)*0*
b.0* 1010*
c. 0*1*01
d.Al loft
heabov
e.

6.^
+RR*
=?

a.R
b.R*
c. R+
d.^

7.IfL=languageofwor
dscont
aini
ngev
ennumberofa’
s.Thecor
respondi
ngRegul
ar
Expressi
onis:
a.( a+b)*
aa(a+b)
*
b.( b+ab*a)
*
c. a+bb*aab*a
d.( a+b)*
ab(a+b)
*

8.Thel
anguaget
hatcanbeexpr
essedbyanyr
egul
arexpr
essi
oni
scal
l
edaNon-
regul
arl
anguage.

a.True
b.False

9.Ar
den’
stheor
em st
atest
hati
fR=Q+RP,
then_
___
___
__i
sit
suni
quesol
uti
on.

a.R=QP*
b.R=PQ*
c. R=P*
Q*
d.R=Q*P*

10.Ther
egul
arexpr
essi
ondescr
ibedbyf
oll
owi
ngaut
omat
ais,

a.01* 01*
b.( 01)
*
c. 0*1*
d.1* 0*

11.Whi
choft
hef
oll
owi
ngar
etheexampl
esofnon-
regul
arl
anguages.

a.PALINDROMEandPRIME
b.PALINDROMEandEVEN-EVEN
c. EVEN-
EVENandPRI
ME
d.FACTORIALandSQURE

12.Languagesar
epr
ovedt
ober
egul
arornon-
regul
arusi
ngpumpi
ngl
emma.

a.True
b.False

Answerkey
s:Uni
t-
II
1.a 4.d 7.b 10.c
2.a 5.c 8.b 11.a
3.d 6.b 9.a 12.a
UNI
T-I
II
:FORMALLANGUAGESANDREGULARGRAMMARS

1.Noam Chomskygav
eamat
hemat
ical
model
ofagr
ammari
n:
a.1966
b.1956
c. 1946
d.1976

2.Agr
ammari salsocal
l
eda_
___
___
__st
ruct
uredgr
ammar
.
a.Phr ase
b.Pr e
c. Parse
d.Class

3.TheelementsofVN inagrammarar
ecal
l
ed:
a.Ter minal
s
b.St ar
ti
ngSy mbols
c. Vari
ables
d.Pr oducti
onrules

4.ForanygrammarG=(
VN,Σ,
P,S)
,VN∩Σ=_
___
___
___
a.Σ
b.VN∪Σ
c. ϴ
d.VN

5.Si
nagr ammarG=( VN,Σ,
P,S)i
scal
l
edt
he:
a.St opsymbol
b.Speci al
symbol
c. Syntaxsymbol
d.St ar
tsymbol

6.Gr
ammat i
calruleswhichi
nvol
vet
hemeani
ngofwor
dsar
ecal
l
ed:
a.Semant i
cs
b.Sy ntacti
c
c. Bothaandb
d.Noneofgi ven

7.Gr
ammat i
calruleswhichdonoti
nvol
vet
hemeani
ngofwor
dsar
ecal
l
ed:
a.Semant i
cs
b.Sy ntacti
c
c. Bothaandb
d.Noneofgi ven
8.Thesymbolsinagr ammart
hatcan’
tber
epl
acedbyany
thi
ngar
ecal
l
ed:
a.Producti
ons
b.Terminals
c. Non-
terminals
d.Allofabove

9.Thesymbolsinagr ammart
hatmustber
epl
acedbyot
hert
hingsar
ecal
l
ed:
a.Producti
ons
b.Terminals
c. Non-
terminals
d.Noneofgi ven

10.Thegrammat i
calrul
esar
eof
tencal
l
ed:
a.Productions
b.Terminals
c. Non-
terminal
s
d.Noneofgi ven

11.Theterminal
sar edesi
gnat
edby_
___
_let
ter
s,whi
l
ethenon-
ter
minal
sar
edesi
gnat
edby
___
_let
ter
s.
a.Capi t
al,bol
d
b.Smal l,
capital
c. Capit
al,small
d.Smal l,
bold

12.L(
G)isanacr onym usedf or
:
a.Leav esofderivati
ontreeforagr
ammarG
b.Lengt hofagr ammarG
c. Lef
thandsy mbol sofallpr
oduct
ionsi
nG
d.Languagegener at
edbyagr ammarG

Answerkey
s:Uni
t-
II
I

1.b 9.c
2.a 10.a
3.c 11.b
4.c 12.d
5.d
6.a
7.b
8.b
UNI
T-I
:FI
NITEAUTOMATA

13.Whi
lemini
mizi
ngafiniteautomat
a,wegener
all
ycr
eat
ethe:
a.Equival
encestates
b.Equival
encetransi
tions
c. Equi
val
enceclasses
d.Equival
encegroups

14.AMooremachinei sasix-
tupl
e(Q,
Σ,Δ,
δ,λ,
q0)wher
eΔi
sthe:
a.Outputal phabet
b.Inputalphabet
c. Tr
ansit
ionf unct
ion
d.Outputf uncti
on

15.Af
ini
teautomat
amaycont
ainmor
ethanonef
inal
stat
es:
a.Tr ue
b.Fal se

16.Thenumberofcolumnsinatransi
ti
ontablef
orafini
teaut
omat
aar
e:
a.Three
b.Onelessthanthenumberofinputsymbols
c. Sameasthenumberofinputsymbols
d.Onemor ethanthenumberofinputsymbols

17.Thetr
ansiti
onfunctiont hatmapsQXΣ*int
oQi
scal
l
ed:
a.Directtr
ansitionf unct i
on
b.Indir
ecttransitionf unction
c. Si
mpl etr
ansitionf unction
d.Directedtransitionf unction

18.Whennextst ateofanautomataatanyi
nst
antoft
imei
sdet
ermi
nedbyt
hepr
esentst
ate
andthepr esentinput,
theni
tiscal
leda:
a.St ater el
ati
on
b.Out putrel
ati
on
c. Setofst ates
d.Setofi nputsymbols

19.Ast
ri
ngxisaccept edbyafi
nit
eaut
omat
aifδ(
q0,
x)=q;
wher
eqi
s:
a.Init
ialstat
e
b.Finalstate
c. Anystate
d.Noneoft heabove
20.Qisasetofst at esinfini
teautomat a.Whathol dstr
ueforQ:
a.Qmaycont ainanynumberofst ates
b.Qcont ainsf i
nit
enumberofst ates
c. Qdoesnotcont ainanyfinalstate
d.Qi nnotasetofst ates.
21.DeterminetheEquav entMachinet hattakespresentst
ateandout
put
a.Moor e
b.Meal y
c. Both
d.None
22.Howmanyt uplesar ethereinFini
teAut omata
a.4
b.5
c. 6
d.7
23.Minimizedautomat ashouldbe
a.DFA
b.NFA
c. Both
d.None
24.Fi
niteAutomat acandeal withwhichlangauge
a.Regul arLanguages
b.Cont extFr ee
c. ContextSensi ti
ve
d.Recur siveEnnumer able

Answerkey
s:Uni
t-
I

1.C
2.A
3.A
4.D
5.B
6.A
7.B
8.B
9.B
10.
B
11.
A
12.
A
UNI
T-I
I:REGULAREXPRESSI
ONSANDREGULARSETS

i
1.I
npumpi
ngl
emmat
heor
em (
xyz)t
her
angeofi
is

a.i=…….-
3,-
2,-
1,1,
2,3,
4……
b.i=0,1,
2,3,4……….
c. i
=…….-
3,-
2,-
1,0,
1,2,
3,4……
d.i
=1,
2,3,
4……….

2.Toexaminewhet
heracer
tai
nFAaccept
sanywor
ds,
iti
srequi
redt
oseekt
hepat
hsf
rom
___
___
_stat
e.

a.Finaltoi
niti
al
b.Finaltof
inal
c. I
nit
ial
tofinal
d.Init
ial
toinit
ial

3.I
fΣ={
a,b}andgi
venpr
oduct
ionsar
e

S→XaaX

X→aX|
bX|
Λ

Thent
heabov
egr
ammardef
inest
hel
anguageexpr
essedby
___
___
___
__r
egul
arexpr
essi
on

a.(a+b)
*aa(a+b)*
b.(a+b)
*a(a+b)*
a
c. (
a+b)
*aa(a+b)*
aa
d.(a+b)
*aba+b)*

4.Ar
egul
arexpr
essi
oncanbedef
inedasal
anguageorst
ri
ngaccept
edbyaf
ini
teaut
omat
a.

a.True
b.False

5.I
fwBELONGSTO(
a,b)
*sat
isf
yabw=wab,
then(
w)i
s

a.Null
b.Odd 
c. Ev
en
d.Noneoft
hese

6.I
dent
it
y:^+R=_
___
___
_

a.^
b.RR
c. R*
d.R

7.I
dent
it
y:R+R=_
___
___
_

a.2R
b.RR
c. R
d.R*
8.I
dent
it
y:(
R*)
*=_
___
___
_

a.R* *
b.R* R*
c. R*
d.R
9.Thelanguageswhi
chcannotacceptPDA_
___
___
_

A.REGULARLANGUAGES

B.CONTEXTFREE

C.CONTEXTSENSI
TIVE

D.NONE.

10.CONVERSI
ONOFNFATODFAWI
LLLEADTOHOW MANYI
NITI
ALSTATES

A.2

B.1

C.NONE

D.BOTH

11.Howmanyst
ringsoflengt
hlesst
han4cont
ainst
hel
anguagedescr
ibedbyt
her
egul
ar
expr
essi
on(
x+y)
*y(a+ab)
*?
a)7
b)10
c)12
d)11

12.Al anguagei
sregul
ari
fandonl
yif
a)acceptedbyDFA
b)acceptedbyPDA
c)acceptedbyLBA
d)acceptedbyTuri
ngmachine

Answerkey
s:Uni
t-
II

1.D 4.A
2.C 5.C
3.A 6.D
7.C 11.D
8.C 12.A
9.A
10.B
UNI
T-I
II
:FORMALLANGUAGESANDREGULARGRAMMARS

13.Thehighestt
ypeofgr
ammarunderChomskycl
assi
fi
cat
ioni
s:
a.Ty pe-
3
b.Ty pe-
4
c. Type-
2
d.Ty pe-
0

14.Ty
pe-1grammar sarealsocall
ed:
a.Phr asestruct
uregrammars
b.Cont extfr
eegrammar s
c. Contextsensi
tiv
egr ammars
d.Regul argrammar s

15.Apr
oduct
ionoft
hef
orm A→ aandA→ aBi
scal
l
eda_
___
___
___
_pr
oduct
ion.
a.Type-0
b.Type-3
c. Ty
pe-1
d.Type-2

16.ThemachinecounterpartofContextFr
eeGr
ammar
sis:
a.Fini
teautomat a
b.Pushdownaut omat a
c. Tur
ingmachine
d.Linearboundedaut omata

17.ThemachinecounterpartofRegul
arGr
ammar
sis:
a.Fini
teautomat a
b.Pushdownaut omat a
c. Tur
ingmachine
d.Linearboundedaut omata

18._
___
___
_ _
_____
_isthecorr
espondi
ngaut
omat
aforCont
extSensi
ti
vel
anguages:
a.Linearboundedautomata
b.Tur i
ngmachi ne
c. Fi
nit
eaut omata
d.Pushdownaut omata

19.Thesymbol
usedf
orst
epbyst
epder
ivat
ionofagr
ammari
s:
a.→
b.⇒
c. ↔
d.⇄
e.
20.Languagegener atedbygr ammarG=({ S,
C},{
a,b}
,P,
S)wher
ePconsi
stsofS→ aCa,
C→ aCa| bis:
a.abna
b.anbnan
nn
c. aba
n n
d.aba
21.Regulargr ammari s
a)Cont extfreegrammar
b)Noncont extfreegrammar
c)Engl i
shgr ammar
d)Noneoft hement i
oned
22.Regularexpr essi
onar e
a)Type0l anguage
b)Type1l anguage
c)Type2l anguage
d)Type3l anguage
23.Land~Lar erecursiveenumerabl
ethenLis
a)Regul ar
b)Cont extfree
c)Cont extsensiti
v e
d)Recur sive
24..Regul arexpressionsareclosedunder
a)Uni on
b)Intersecti
on
c)Kleenest ar
d)Alloft hement ioned

Answerkey
s:Uni
t-
II
I

13.a 19.b 24.d


14.c 20.d
15.b
16.b
17.a 21.a
18.a 22.a
23.d
Uni
t4:
CONTEXTFREEGRAMMARS+SI
MPLI
FICATI
ONOFCONTEXT-FREEGRAMMARS

1. Thepr
oducti
onoft
hef
orm not
ermi
nal
→ Λi
ssai
dtobenul
lpr
oduct
ion.
a. TRUE
b. FALSE

2. Apr
oduct
ioni
scal
l
ednul
labl
epr
oduct
ioni
fiti
soft
hef
orm N→ Λ
a. TRUE
b. FALSE

3. Theproducti
onsoft hefor
m nont
ermi
nal
→ onenont
ermi
nal
,i
scal
l
ed_
___
___
__
a. Nullproducti
on
b. Unitproduction
c. Nullableproducti
on
d. Noneofgi ven

4. CNFisstandsf or
a. ContextNor malFor
m
b. Compl eteNormalForm
c. ChomskyNor malForm
d. Compar edNul
lForm

5.GNFst
andsf
or

a.Gr
ayNor
mal
For
m

b.Gr
eibachNor
mal
For
m

c. Gr
aphi
teNor
mal
For
m

d.Gr
eat
estNor
mal
For
m

6.Thederi
vat
ionofthewordW generat
edbyaCFG,suchthatateachst
ep,
apr
oduct
ioni
s
appl
iedt
othelef
tmostnonterminali
nthewor
kingst
ri
ngissaidtobe
a.Leftmosttermi
nal

b.Lef
tmostdev
iat
ion

c. Noneoft
hese

d.Bot
haandb

7.Theprocessoffi
ndi
ngt
heder
ivat
ionofwor
dgener
atedbypar
ti
cul
argr
ammari
scal
l
ed:
a.PLUSTI MING

b.Par
sing

c. HALT
d.Al
lofabov
e

8.Apr oduct i
oni nCFGconsi stsof:
a.Onet er minal
b.Mor et hanonet er
mi nal
c. Onenon- terminal
d.Ter mi nalsandnon- t
erminals
9.Theent itywhi chgener ateLanguagei ster
medas:
a)Aut omat a
b)Tokens
c)Gr ammar
d)Dat a
10.
 TheGr ammarcanbedef i
nedas: G=(V,∑,p,S)
Inthegi vendef ini
ti
on, whatdoesSr epr
esents?
a)Accept ingSt ate
b)St art
ingVar iable
c)Sensi ti
veGr ammar
d)Noneoft hese
11.
Whi choft heexpr essionisappr opri
ate?
Forpr oductionp: a->bwher ea∈Vandb∈_ __
_ __
_
a)V
b)S
c)(V+∑) *
d)V+∑
12.
ForS- >0S1|ef or∑={0,1}*,whichofthefoll
owi ngiswr
ongf
ort
hel
anguagepr
oduced?
a)Nonr egularlanguage
b)0n1n |n>=0
c)0n1n |n>=1
d)Noneoft hement i
oned

AnswerKey
s:Uni
t4

4.c 10.B
5.b 11.C
6.b 12.d
1.a 7.b
2.a 8.d
3.b 9.C
Uni
tV:PUSHDOWNAUTOMATAANDPARSI
NG

1.Foragi
v enPushdownaut
omat
a,wecanconst
ructanequi
val
entcont
extf
reegr
ammar
:
a. True
b. False

2.I
n_____
_____parsing,
weattemptt
oconst
ructader
ivat
ionoft
hei
nputst
ri
ng,
star
ti
ngf
rom t
her
ootand
endi
nginthegiveninputst
ri
ng.
a. Top-down
b. Top-Up
c. Bott
om- Up
d. Bott
om- Down

3.In_____
_____parsi
ng,
weat
temptt
oconst
ructader
ivat
ionf
rom t
hegi
veni
nputst
ri
ngt
othet
opi
e,t
he
rootwit
hlabelS.
a. Top-
down
b. Top-
Up
c. Bott
om- Up
d. Bott
om- Down

4.I
nLL(k),
thefi
rstLstandsf
or_
___
___
___
:
a. Left
b. Lookfr
om right
c. Lostsy
mbol s
d. Lookahead

5.I
nLL(k),
thesecondLstandsf
or_
___
___
___
:
a. Lookfr
om right
b. Left
c. Lostsymbols
d. Lookahead

6.I
nLL(k)
,kr
epresents:
a. Numberofsymbolstolookbehi
nd
b. Numberofsymbolstolookahead
c. Numberofinputsy
mbol si
nthestr
ing
d. Numberofsymbolstowardsl
eftofcur
rentsy
mbol

7.I
nLL(k),thev
alueofkcanal
sobenegat
ive.
a. True
b. False

8.I
nor dertodot op-downpar
singf oragener
alst
ri
nginL(G),
wepr epareatabl
ecall
ed:
a. Transit
iontable
b. ParseTabl e
c. Top-downTabl e
d. ProductionTable
9.Thet r
ansiti
onaPushdownaut omat onmakesi
saddit
ional
lydependentuponthe:
a)stack
b)inputtape
c)terminals
d)noneoft hement ioned
10. Withrefer
enceofaDPDA, whi chamongthefoll
owi
ngdoweper f
ormf r
om thest
artst
atewi
than
empt ystack?
a)processt hewhol est ri
ng
b)endi nf i
nalst
ate
c)endwi thanempt yst ack
d)alloft hementioned
11.IfthePDAdoesnotst oponanaccepti
ngstat
eandthest
ackisnotempty,t
hestr
ingi
s:
a)rejected
b)goesi ntoloopforev er
c)bot h(a)and(b)
d)noneoft hement i
oned
12.Al anguageaccept edbyDet er
minist
icPushdownautomat
aisclosedunderwhi
chofthef
oll
owi
ng?
a)Compl ement
b)Uni on
c)Bot h(a)and(b)
d)Noneoft hement ioned

Answerkey
s:Uni
t-
V

1. a 7. b
2. a 8. b
3. c 9. a
4. d 10.d
5. b 11.a
6. b 12.a
Uni
tV1:TURI
NGMACHI
NESANDCOMPLEXI
TY

1.ATur
ingmachi
necanbe:

a.Multi-
TapeTuri
ngMachi
ne
b.Multi-
headTuri
ngMachi
ne
c. Uni
versal
Turi
ngmachi
ne
d.Alloftheabove

2.ATur
ingmachi
necanonl
ybedet
ermi
nist
ic.

a.True
b.False

3.ATur
ingmachi
necanbeaMul
ti
-Tr
ackTur
ingmachi
ne.

a.True
b.False

4.Whoi
sknownast
hef
atherofComput
erSci
ence?

a.S.C.Kleene
b.AlanzoChurch
c. Char
lesBabbage
d.AlanTuring

5.A_ _
_____
___
__isatheor
eti
cal
comput
ingmachinei
nvent
edbyAl
anTur
ing(
1937)t
oser
veas
anideali
zedmodelf
ormathemati
cal
cal
culat
ion.

a.LinearBoundedAut
omat
a
b.TuringMachine
c. Fi
nit
eAutomata
d.PushdownAut omat
a

6.ATuri
ngmachi
necanrunf
orev
er,
ent
eral
oop,
orr
eachapar
ti
cul
arst
ateorsetofcondi
ti
ons
atwhi
chiti
spr
escri
bedt
ohalt
.

a.True
b.False

7.I
ncomputersci
ence,a___
___
_____
___
_isaTur
ingmachi
net
hatcansi
mul
ateanar
bit
rar
y
Tur
ingmachineonarbi
tr
aryi
nput.

a.Uni
ver
salTuri
ngmachi
ne
b.Det
ermini
sti
cTur
ingmachi
ne
c. Non-Det
ermini
sti
cTur
ingmachi
ne
d.Mul t
i-
TapeTuri
ngmachine

8.A_
___
___
_isthesi
mplestf
orm ofacomput
er.
a. Fi
nit
eAutomata
b. Li
nearBoundedAut omata
c. Tur ingMachine
d.PushdownAut omata
9. 
Themachi neacceptthestri
ngbyent
eri
ngi
ntohAori
tcan:
a)expli
cit
lyrejectxbyenteri
ngint
ohR
b)enteri
ntoani nf
int
eloop
c)Both(a)and( b)
d)Noneoft hement i
oned

10.Whichoft
hefoll
owi
ngcanacceptev
enpal
i
ndr
omeov
er{
a,b}
a)PushdownAutomata
b)Turi
ngmachine
c)NDFA
d)All
ofthementi
oned

11.I
fT1andT2ar
etwoturi
ngmachi
nes.Thecomposi
tecanber
epr
esent
edusi
ngt
heexpr
essi
on:
a)T1T2
b)T1UT2
c)T1XT2
d)Noneoft
hementi
oned

12.Thenumberofst
atesr
equi
redt
oaut
omat
ethel
astquest
ioni
.e.{
a,b}
*{aba}
{a,
b}*usi
ngf
ini
te
automat
a:
a)4
b)3
c)5
d)6

AnswerKey
s:Uni
tV1:

7.a
8.c
9.c
10.c
11.a
12.a

1.d
2.b
3.a
4.d
5.b
6.a
Q1Whi chofthefoll
owingpai
rsofr
egul
arexpr
essi
onsar
eequi
val
ent
?
a)1(
01) *and(10)
*1
b)x(xx)*and(xx)
*x
c)x^
+andx^ +x^ (
*+)
d)Al
loft hementioned

Q2Whati
stheRegul
arExpr
essi
onMat
chi
ngZer
oorMor
eSpeci
fi
cChar
act
ers
a)x
b)#
c)*
d)&

Q3

Ans.C

Q4
Ans.A

Q5

Ans.B

Q6
Ans.A

Q7Consi
dert
het
woaut
omat
a

A.AandBar
eEqui
val
ent

B.AandBar
enotEqui
val
ent

C.Cannotbedef
ined

D.Noneoft
hese

Ans.
A

Q8Regul
arexpr
essi
on(
x/y
)(x/
y)denot
est
heset

a.{
xy,
xy}

b.{
xx,
xy,
yx,
yy}

c.{
x,y
}

d.{
x,y
,xy
}
Ans.
b

Q9Ther
egul
arexpr
essi
onwi
thal
lst
ri
ngsof0′
sand1′
swi
thatl
eastt
woconsecut
ive0′
sis:

a.1+(
10)
*

b.(
0+1)
*00(
0+1)
*

c.(
0+1)
*011

d.0*
1*2*

Ans.B

Q10Fi
ndt
hepai
rofr
egul
arexpr
essi
onst
hatar
eequi
val
ent

a.(
0+1)
*and(
0*+1*
)*

b.(
0+1)
*and(
0+1*
)*

c.(
0+10)
*and(
0*+10)
*

d.Al
loft
hement
ioned

Ans.D

Q11

Whi
choft
hef
oll
owi
ngi
ssameast
hegi
venDFA?

a.(0+1)*001(
0+1)*
b.1*001(0+1)*
c.(01)*
(0+0+1)(01)
*
d.Noneoft hement i
oned

Ans.A

Q12

Whi
choft
hegi
venr
egul
arexpr
essi
onscor
respondt
otheaut
omat
ashown?
a. (
110+1)
*0

b. (
11+110)
*1

c. (
110+11)
*0

d. (
1+110)
*1

Ans.C

Q13Whi
chamongt
hef
oll
owi
ngl
ookssi
mil
art
othegi
venexpr
essi
on?

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

a. {
xϵ{
0,1}*
|xi
sal
lbi
nar
ynumberwi
thev
enl
engt
h}

b. {
xϵ{
0,1}|
xisal
lbi
nar
ynumberwi
thev
enl
engt
h}

c. {
xϵ{
0,1}*
|xi
sal
lbi
nar
ynumberwi
thoddl
engt
h}

d. {
xϵ{
0,1}|
xisal
lbi
nar
ynumberwi
thoddl
engt
h}
Ans.A

Q14(
a+b*
c)mostcor
rect
lyr
epr
esent
s:

a. (
a+b)*
c

b. (
a)+(
(b)
*.c)

c. (
a+(
b*)
).
c

d. a+(
(b*
).c)

Ans.D

Q15

Whi
chNDFAcor
rect
lyr
epr
esent
sthef
oll
owi
ngRE

a(
bab)
*∪a(
ba)
*
Ans.a
Q16Whi
choft
hef
oll
owi
ngdoest
hegi
venNFAr
epr
esent
?

a. {
11,
101}*{
01}

b. {
110,
01}*{
11}

c. {
11,
110}*{
0}

d. {
00,
110}*{
1}

ans.C

Quest
ion1:Whil
eapplyi
ngPumpingl
emmaov
eral
anguage,
weconsi
derast
ri
ngwt
hatbel
ong
t
oLandf ragmenti
tint
o_ _
___
___
_part
s.

a)2

b)5

c)3

d)6

Ans:
c
Questi
on2:I
fweselectastri
ngwsucht
hatw∈L,
andw=xy
z.Whi
choft
hef
oll
owi
ngpor
ti
ons
cannotbeanempt
yst r
ing?

a)x

b)y

c)z

d)al
loft
hement
ioned

Ans:
b

Quest
ion3:Ther
eexist
sal anguageL.Wedefi
neastri
ngwsucht
hatw∈Landw=xyzand|w|
>=nforsomeconstanti
ntegern.Whatcanbethemaxi
mum l
engt
hofthesubst
ri
ngxyi
.e.|
xy|
<=?

a)n

b)|
y|

c)|
x|

d)noneoft
hement
ioned

Ans:
a

Quest
ion4:
Fil
li
nthebl
anki
nter
msofp,
wher
epi
sthemaxi
mum st
ri
ngl
engt
hinL.

St
atement
:Fi
nit
elanguagest
ri
vi
all
ysat
isf
ythepumpi
ngl
emmabyhav
ingn=_
___
__

a)p*
1

b)p+1

c)p-
1

d)Noneoft
hement
ioned

Ans:
b

Quest
ion5:
Letwbeast r
ingandf r
agment
edbyt
hreev
ari
abl
ex,
y,andzasperpumpi
ngl
emma.
Whatdoesthesev
ari
abl
esrepresent?

a)st
ri
ngcount

b)st
ri
ng
c)bot
h(a)and(
b)

d)noneoft
hement
ioned

Ans:
a

Quest
ion6:
Whi
choft
hef
oll
owi
ngi
snotanappl
i
cat
ionofPumpi
ngLemma?

a){
0i1i
|
i>=0}

b){
0ix|
i
>=0,
x∈{
0,1}
*and|
x|
<=i
}

c){
0n|
nispr
ime}

d)Noneoft
hement
ioned

Ans:
d

Quest
ion7:
Pumpi
ngl
emmamet
hodi
susedt
ogeneat
e..
..
..
.fr
om .
..
..
..
..

a)(
i)manyi
nputst
ri
ngs(
ii
)onest
ri
ng

b)(
i)onest
ri
ng(
ii
)manyi
nputst
ri
ngs

c)Ei
theraorb

d)Noneoft
hement
ioned

Ans:
a

Quest
ion8:
Amongstt
hev
ari
ouspai
rs,
whi
chpai
rist
akeni
nthepumpi
ngl
emma

a)1st

b)2nd

c)4t
h

d)Noneoft
hement
ioned

Ans:
a

Quest
ion9:
Letw=xy
zandyr
efer
stot
hemi
ddl
epor
ti
onand|
y|
>0.
Whatdowecal
lthepr
ocess
ofr
epeat
ingy0ormor
eti
mesbef
orechecki
ngt
hatt
heyst
il
lbel
ongt
othel
anguageLornot
?

a)Gener
ati
ng

b)Pumpi
ng

c)Pr
oduci
ng

d)Noneoft
hement
ioned

Ans:
b

Quest
ion10:
Answeri
naccor
dancet
othet
hir
dandl
astst
atementi
npumpi
ngl
emma:

Foral
l__
___
__xy
iz∈L

a)i
>0

b)i
<0

c)i
<=0

d)i
>=0

Ans:
d

Quest
ion11:
Whi
choft
het
echni
quecanbeusedt
opr
ovet
hatal
anguagei
snonr
egul
ar?

a)Ar
denst
heor
em

b)Pumpi
ngLemma

c)Ogden’
sLemma

d)Noneoft
hement
ioned

Ans:
b

Quest
ion12:
IfL1′
andL2′
arer
egul
arl
anguages,
thenL1.
L2wi
l
lbe

a)r
egul
ar

b)nonr
egul
ar

c)mayber
egul
ar

d)noneoft
hement
ioned
Ans:
a

Quest
ion13:
IfL1andL2′
arer
egul
arl
anguages,
L1∩(
L2′
UL1′
)’
wil
lbe

a)r
egul
ar

b)nonr
egul
ar

c)mayber
egul
ar

d)noneoft
hement
ioned

Ans:
a

Quest
ion14:
IfAandBar
eregul
arl
anguages,
!(A’
UB’
)is:

a)r
egul
ar

b)nonr
egul
ar

c)mayber
egul
ar

d)noneoft
hement
ioned

Ans:
a

Quest
ion15:
Whi
chamongt
hef
oll
owi
ngi
sthecl
osur
epr
oper
tyofar
egul
arl
anguage?

a)Empt
iness

b)Uni
ver
sal
i
ty

c)Member
shi
p

d)Noneoft
hement
ioned

Ans:
d

1. Ther
ear
e__
___
___t
upl
esi
nfi
nit
est
atemachi
ne.
a)4
b)5
c)6
d)unl
i
mit
ed
Ans:
-B

2. Tr
ansi
ti
onf
unct
ionmaps.
a)Σ*Q-

b)Q*Q->Σ
c)Σ*Σ-
>Q
d)Q*Σ-
>Q

Ans:
-d

3. Numberofst
atesr
equi
resaccept
ingst
ri
ngendswi
th10.
a)3
b)2
c)1
d)can’
tber
epr
esent
ed.

Ans:
-a

4. Numberoff
inal
stat
erequi
resaccept
ingΦi
nmi
nimal
fini
teaut
omat
a.
a)1
b)2
c)3
d)Noneoft
hement
ioned

Ans:
-d

5. Numberofst
atesr
equi
resi
nNFAsi
mul
ati
ngacomput
erwi
th
memor ycapabl
eofstori
ng‘
3’wor
dseachofl
engt
h‘8’
.
8
a)3*2
b)2(3*8)
c)2(3+8)
d)Noneoft hement
ioned

Ans:
-b
6. AnNFA’
str
ansi
ti
onf
unct
ionr
etur
ns

a.ABool
eanv
alue
b.Ast
ate
c.Asetofst
ates
d.Anedge
Ans:
C
7.Thebehav
iourofaNFAcanbest
imul
atedbyDFA
a.Al
way
s
b.Somet
imes
c.
Nev
er
d.DependsonNFA
Ans:
-a
8.Therelat
ionbet
weenNFA-
accept
edl
anguagesandDFAaccept
ed
l
anguages is
a.>
b.
<
c.
=
d.
<=
Ans:
-c
9.Exami
net
hef
oll
owi
ngDFA:
Ifi
nputi
s011100101,
whi
chedgei
sNOT
t
raver
sed?

a.AB
b.C
c.CD
d.DA
Ans:
-C
10.Thet
ransi
ti
onal
funct
ionofaNFAi
s
a.QXΣ→Q
b.QXΣ→2Q
c.QXΣ→2n
d.
QXΣ→Qn
Ans:
-B
11.Whi
chi
str
uef
orDeadSt
ate?
a.I
tcannotber
eachedany
time
b.Ther
eisnonecessi
tyoft
hest
ate
c.I
fcont
rol
ent
ersnowayt
ocomeoutf
rom t
hest
ate
d.
Ifcont
rol
ent
ersFAdeads
Ans:
-C
12.Whichamongt hefol
l
owi
ngst
ateswoul
dbenot
atedast
hef
inal
stat
e/accept
ancestat
e?

L={
xϵ∑={
a,b}|
lengt
hofxi
s2}

a.q1
b.q2
c.q1,
q2
d.q3
Ans:
-b
13.Whichofthefoll
owi
ngar
ethef
inal
stat
esi
nthegi
venDFAaccor
dingt
o
theLanguagegiven?
L={xϵ∑={a,b}|
l
engthofxi
satmost2}

a.q0,
q1
b.q0,
q2
c.
q1,
q2
d.q0,
q1,
q2
Ans:
D
14.Whichofthefol
l
owi
ngxi
saccept
edbyt
hegi
venDFA(
xisabi
nar
y
str
ing∑={0,
1})?
a. di
vi
sibl
eby3
b. di
vi
sibl
eby2
c. di
vi
sibl
eby2and3
d. di
vi
sibl
eby3and2
Ans:
-d
15.Chooset
hecor
rectopt
ionf
ort
hegi
venst
atement
:

St
atement:TheDFAshownr
epr
esent
sal
lst
ri
ngswhi
chhas1atsecond
l
astposi
ti
on.

a. Cor
rect
b. I
ncor
rect
,Incompl
eteDFA
c. Wr
ongpr
oposi
ti
on
d. Maybecor
rect
MCQ’
sonr
egul
arl
anguagesandr
egul
arexpr
essi
ons

1.Al
anguagei
sregul
ari
fandonl
yif

a)accept
edbyDFA

b)accept
edbyPDA

c)accept
edbyLBA

d)accept
edbyTur
ingmachi
ne

2.Regul
argr
ammari
s

a)cont
extf
reegr
ammar

b)noncont
extf
reegr
ammar

c)engl
i
shgr
ammar

d)noneoft
hement
ioned

3.Regul
arexpr
essi
onar
e

a)Ty
pe0l
anguage

b)Ty
pe1l
anguage

c)Ty
pe2l
anguage

d)Ty
pe3l
anguage

4.Consi
dert
hel
anguagesL1=ɸandL2={
a}.Whi
choneoft
hef
oll
owi
ngr
epr
esent
sL1L2*U
L1*

a)A

b)B

c) C

d)D

5.Gi
vent
hel
anguageL={
ab,
aa,
baa}
,whi
choft
hef
oll
owi
ngst
ri
ngsar
einL*
?

1)abaabaaabaa

2)aaaabaaaa

3)baaaaabaaaab

4)baaaaabaa
a)1,
2and3

b)2,
3and4

c)1,
2and4

d)1,
3and4

6.Letwbeanystri
ngoflengthni
s{0,
1}*
.LetLbethesetofal
lsubstri
ngsofw.Whati
sthe
minimum numberofst
atesinanon-
det
ermini
sti
cfi
nit
eautomatonthataccept
sL?

a)n-
1

b)n

c)n+1

d)2n-
1

7.Whichoneofthef
oll
owinglanguagesov
ert
heal
phabet{
0,1}i
sdescr
ibedbyt
her
egul
ar
expr
ession:
(0+1)
*0(
0+1)*
0(0+1)*?

a)Thesetofal
lst
ri
ngscont
aini
ngt
hesubst
ri
ng00

b)Thesetofal
lst
ri
ngscont
aini
ngatmostt
wo0’
s

c)Thesetofal
lst
ri
ngscont
aini
ngatl
eastt
wo0’
s

d)Thesetofal
lst
ri
ngst
hatbegi
nandendwi
thei
ther0or1.

8.Ther
egul
arexpr
essi
on0*
(10*
)*denot
est
hesamesetas

a)(
1*0)
*1*

b)0+(
0+10)
*
c)(
0+1)
*10(
0+1)
*
d)noneoft
hese
9.Thesmal
l
estf
ini
teaut
omat
ionwhi
chaccept
sthel
anguage{
x|l
engt
hofxi
sdi
vi
sibl
eby3}
has:
a)2st
ates
b)3st
ates
c)4st
ates
d)5st
ates
10.Consi
dert
hef
oll
owi
ngl
anguages

   
   

Whi
choft
hel
anguagesar
e r
egul
ar?
a)Onl
yL1andL2
b)Onl
yL2,
L3andL4
c) Onl
yL3andL4
d)Onl
yL3

Q1)Consi
dert
hel
anguagesL1=   
andL2={
a}.Whi
choneoft
hef
oll
owi
ngr
epr
esent
s
L1L2* 
UL1*
a)
{epsi
l
on}b)a* c)
{epsi
l
on,
a}d)
none
Answer
: A
Q2)

ConsidertheDFAgi ven.
  
Whi chofthef oll
owi
ngar eFALSE?
1.Compl ementofL(A)iscont ext-
fr
ee.
2.L(A)=L( (
11*0+0)(
0+1) *0*1*)
3.Forthelanguageaccept edbyA, Aist heminimalDFA.
4.Aaccept sal
lstri
ngsov er{0,1}oflengthatleast2.
Answer:3and4
Q3)Gi
vent
hel
anguageL={
ab,
aa,
baa}
,whi
choft
hef
oll
owi
ngst
ri
ngsar
einL*
?
1)abaabaaabaa
2)aaaabaaaa
3)baaaaabaaaab
4)baaaaabaa
Answer:1,2,
4

Q4)Fi
ndt
her
egul
arexpr
essi
onf
ort
hegi
ven

Answer:
c*a(
d+bc*
a)*
Q5)Fi
ndt
her
egul
arexpr
essi
onf
ort
hegi
ven

Answer
:b*
(aa*
(bb*
+∈)
+∈)
Q6)Fi
ndt
her
egul
arexpr
essi
onf
ort
hegi
ven
Answer
:(ab+b(
a+bb)
)*
Q7)Fi
ndt
her
egul
arexpr
essi
onf
ort
hegi
ven

Answer
:regul
arexpr
essi
oni
sonl
ya,
becausest
ateBi
sdeadst
ate.
Q8)Fi
ndt
her
egul
arexpr
essi
onf
ort
hegi
ven
Answer
:aa*+ba*
Q9)Ar egularl
anguageov
eranal
phabetai
sonet
hatcanbeobt
ainedf
rom
a)uni
on
b)concatenati
on
c)kl
eene
d)Allofthementioned
Answer
:d
Q10)
Regul
arexpr
essi
onΦ*i
sequi
val
entt
o
a)ϵ
b)Φ
c)0
d)1
Answer
:A

Q:
1Howmanyst
atesar
erequi
ret
oconst
ructami
nimal
dfaf
rom t
hegi
venDFA
a)
2b)
3c)
4d)
5
2.
From t
hegi
venDFAwhi
chst
ri
ngi
saccept
ed

a)abbabbb)abbabbac)aabbad)aaba

ansa

3.
Whi
chDFAi
sacceptt
hest
ri
ngi
nwhi
chev
eryai
sfol
l
owedbybwher
eΣ={
a,b}.

a)

b)

c)
d)Noneoft
hese

4.
9.
)Consi
dert
hef
ini
teaut
omat
oni
nthef
oll
owi
ngf
igur
e.Whati
sthesetofr
eachabl
est
atesf
ort
hei
nput
st
ri
ng0011?
a.q0,
q1,
q2

b.q0,
q1

c.q0,
q1,
q2,
q3

d.q3

5.
Whatt
hef
oll
owi
ngDFAaccept
s?

a)xi
sast
ri
ngsucht
hati
tendswi
th‘
101’
b)xi
sast
ri
ngsucht
hati
tendswi
th‘
01’
c)xi
sast
ri
ngsucht
hati
thasodd1’
sandev
en0’
s
d)xi
sast
ri
ngssucht
hati
thasst
art
ingandendi
ngchar
act
eras1

6.Mi
nimi
zet
hedf
abel
owgi
vent
ransi
ti
ont
abl
e

a)3b)
4c)
2d)
5
7.
Howmanyst
atesar
erequi
redaf
terconst
ructami
nimal
DFA
A)
3B)
2C)
5D)
4
8)
Stat
ement1:
Accept
anceofst
ri
ngonl
ywheni
tgoest
ofi
rstst
atet
ofi
nal
stat
e.
st
atement2:
Str
ingi
saccept
edonl
ywheni
tst
ati
sfyt
hel
anguage.
a)St
atement1i
scor
rect,
Stat
ement2i
scor
rect.
b)St
atement1i
snotcor
rect,
Stat
ement2i
scor
rect.
c)St
atement1i
scor
rect,
Stat
ementi
snotcor
rect
d)St
atement1i
snotcor
rect,
stat
ement2i
snotcor
rect
9)Atwhi
chst
ateSt
ri
ng'
aa'accept
ed

a)Db)Ac)Bd)C
10)Howmanyst
atesaf
terMi
nimi
zet
hebel
owdf
a

a)3b)2c)4d)5

11)Whi
chst
atei
saccept
edSt
ri
ng'
110101'
a)q2b)q3c)q1d)q4
12)Mi
nimi
zegi
vendf
a

a){
A,B,
}{F},
{C,
D,E}
b)
{A,
F},
{B}
,{
C,D,
E}
C)
{A}{
B,F}{
C,D,
E}
D)
{A,
B,F)
{C,
D,E}
13.
)Gi
vent
hel
anguageL={
ab,
aa,
baa}
,whi
choft
hef
oll
owi
ngst
ri
ngsar
einL*
?
1)abaabaaabaa
2)aaaabaaaa
3)baaaaabaaaab
4)baaaaabaa
a)
1,2and3
b)
2,3and4
c)
1,2and4
d)
1,3and4
14.
)Letwbeanyst
ri
ngoflengt
hnis{0,
1}*
.LetLbethesetofal
lsubst
ri
ngsofw.Whati
sthe
mini
mum numberofst
atesinanon-
det
ermini
sti
cfi
nit
eautomat
onthataccept
sL?
A)
n-1
b)
n
c)
n+1
D)
2n-
1
15)Whi
chst
ri
ngi
saccept
edbyDFA
n
a)a
n n
b)ab

c)anbncn

1)a,
b2)c3)a,
b,
c4)a

1. Alanguageisregul
ari
fandonl
yif
a)accept
edbyDFA
b)acceptedbyPDA
c)accept
edbyLBA
d)acceptedbyTuri
ngmachi
ne

Answer
-a

2.Regul
argr
ammari
s

a.cont
extf
reegr
ammar

b.noncont
extf
reegr
ammar

c.Engl
i
shgr
ammar

d.noneoft
hement
ioned

Answer
-a

3.Regul
arexpr
essi
onar
e

a.Ty
pe0l
anguage

b.Ty
pe1l
anguage

c.Ty
pe2l
anguage

d.Ty
pe3l
anguage

4.Regul
arl
anguagesar
ecl
osedunder(
closur
epr
oper
ti
es)

a.Concat
enat
ion
b.Uni
on

c.Compl
ement

d.Al
loft
heabov
e

Answer
-d

5.IfL1isr
egul
ar,
thent
hereexist
ssomer
egul
arexpr
essi
onr
1whi
chdescr
ibesi
t.Samef
orL2.
Then:L1UL2=L(r
1)UL(r2)=r1+r 2

r
1+r
2isar
egul
arexpr
essi
onandt
her
efor
edescr
ibesar
egul
arl
anguage.

a. Tr
ue

b. Fal
se

Answer:
a

6. IfL1={an 
|n≥0}andL2={ bn 
|n≥0}i
sregular
thenL3=L1.L2={a 
m
.b 
n
|
m ≥0andn≥0}isalsoregul
ar?
a.Fal
se
bTr
ue
Answerb
7.Whi choneoft hefol
lowingl
anguagesov ertheal
phabet{
0,1}i
sdescr
ibedbyt
her
egul
ar
expression?
(0+1)*0(0+1)
*0(0+1)*
a.Thesetofal l
st r
ingscontai
ningthesubstri
ng00.
b.Thesetofal lstr
ingscontai
ningatmostt wo0’s.
c.Thesetofal
lst
ri
ngscontai
ningatleastt
wo0’s.
d.Thesetofal
lst
ri
ngsthatbeginandendwi t
heit
her0or1.
Answerc
8.Al
anguagei
sregul
ari
fitcanbeexpr
essedi
nter
msof…………….
.
a.Regul
arexpr
essi
on
b.Ty
pe0Language
c.Engl
i
shGr
ammer
g.Noneoft
heabov
e
Answera
9.Whi
choft
hef
oll
owi
ngpai
rsofr
egul
arexpr
essi
onsar
eequi
val
ent
?

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

b.x(
xx)
*and(
xx)
*x
c.x^
+andx
^+x^
(*+)

d.Al
loft
heabov
ement
ioned

Answerd

10.Regul
arexpr
essi
onsar
eusedt
orepr
esentwhi
chl
anguage

a)Recur
siv
elanguage

b)
 Cont
extf
reel
anguage

c)Regul
arl
anguage

d)
 Al
loft
hese

Answerc

11.Whi
choft
hef
oll
owi
ngoper
ati
oncanbeappl
i
edonr
egul
arexpr
essi
ons?

a)Uni
on

b)
 Concat
enat
ion

c)Cl
osur
e

d)
 Al
loft
hese

answerd

12.7.Whi
choft
hef
oll
owi
ngi
dent
it
yiswr
ong?

a)R+R=R

b)
 (
R*)
*=R*

c)ɛR=Rɛ=R

d)
 ØR=RØ=RR*

Answerd

13.Whi
choft
hef
oll
owi
ngst
atementi
str
ue?

a)Ev
eryl
anguaget
hati
s def
ined 
byr
egul
arexpr
essi
oncanal
sobe 
def
ined 
byf
ini
te 
aut
omat
a

b)
 Ev
eryl
anguage 
def
ined 
byf
ini
teaut
omat
acanal
sobe 
def
ined 
byr
egul
arexpr
essi
on

c)Wecan 
conv
ert
 r
egul
arexpr
essi
onsi
ntof
ini
te 
aut
omat
a

d)
 Al
loft
hese

Answerd
14.Whi
choft
hef
oll
owi
ngi
dent
it
yist
rue?

a)ɛ+RR*=R*=ɛ+R*
R

b)
 (
R1R2)
*R1=R1(
R2R1)
*

c)R*
R*=R*

d)
 Al
loft
hese

15. (
a+b)*i
sequi
val
entt
o
a)b*a*
b)(a*b*
)*
c)a*b*
d)noneofthementi
oned

Answerb

16.Considerafi
nit
eautomaton,
withA-mov
es,
giv
eni
nFi
g.whi
chamongt
hef
oll
owi
ngi
sthe
Equiv
alentautomatonwit
houtA-moves.

a.

b.

c.

d.Noneofabov
e
Answera

17.Supposewewantt
orepl
aceanul
lmov
efr
om v
ert
exV1t
over
texV2i
nFAThen
Whati
sthef
ir
stst
epneedst
obedone:
a.Makeanewv
ert
exV3

b.Fi
ndal
ltheedgesst
art
ingf
rom v
2

c. Del
eteVer
texV2

d.Noneoft
heabov
e

Answerb

Acont extsensit
ivel
anguageisaccept
edby
a) 
Fini
te automata
b)Linearboundedaut omata
c)Both( a)and(b)
d)Noneoft hese

Ans-B
A gr
ammar  
G=( V,T,
P,S)i
nwhichVi
s
a)Setofvar
iabl
es
b)Setoft
erminals
c)Setofv
ariabl
esandter
minal
s
d)Noneofthese

Ans-
A
A gr
ammar  
G=( V,T,
P,S)i
nwhichTi
s
a)Setofvar
iabl
es
b)Setoft
erminals
c)Setofv
ariabl
esandter
minal
s
d)Noneofthese

Ans-B
Whichofthefoll
owingismorepower
ful
?
a)PDA
b)Turi
ngmachi ne
c) 
Fini
te 
automata
d)Contextsensi
ti
velanguage
Ans-
B

Whichofthefol
l
owi
ngst
ri
ngi
sgener
atedbyt
he 
grammar
S->0S1AB
A->4A
B->SA
a)0111
b)010101
c)00000
d)Noneofthese

 
Whichofthef oll
owingr elat
est oChomskyhi
erar
chy
?
a)Regul
ar<CFL<CSL<Unr est
ricted
b)CFL<CSL<Unr estr
icted<Regular
c)CSL<Unrestr
icted<CF<Regul ar
d)Noneoft hement ioned
Ans-
a
Alanguageisacceptedbyapushdownaut
omat
aifi
tis:
a)regul
ar
b)contextf
ree
c)both(a)and(b)
d)noneofthement i
oned
Ans-B
Whichoft hef
oll
owi
ngst
ri
ngsdonotbel
ongt
hegi
venr
egul
arexpr
essi
on?
(a)
*(a+cba)
a)aa
b)aaa
c)acba
d)acbacba
Ans-
d

Whi
choft
hef
oll
owi
ngCFG'
scan'
tbesi
mul
atedbyanFSM ?

A.
S--
>Sa|
b

B.
S -
->aSb|
ab

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

D.
Noneoft
hese

Ans-
B

Regul
arGr
ammari
saccept
edby
a.FA

b.LBA

c.Tur
ingMachi
ne

d.Al
l

Q.I
fΣ={
a,b}andgi
venpr
oduct
ionsar
e
S→XaaX
X→aX|
bX|
Λ
Thentheabov
egr
ammardef
inest
hel
anguageexpr
essedby
___
___
___
__r
egul
ar
expr
essi
on
e.(a+b)
*aa(a+b)*
f.(a+b)
*a(a+b)*
a
g.(a+b)
*aa(a+b)*
aa
h.(a+b)
*aba+b)*
Ans-A
Q.Thel
anguageswhi
chcannotacceptPDA_
___
___
_
A.REGULARLANGUAGES
B.CONTEXTFREE
C.CONTEXTSENSI
TIVE
D.NONE.

Ans-C
QRegulargr
ammari s
a)Cont
extfreegrammar
b)Noncontextfr
eegrammar
c)Engl
ishgrammar
d)Noneofthement i
oned
Ans-A
Regul
arexpressi
onare
a)Type0l anguage
b)Type1l anguage
c)Type2l anguage
d)Type3l anguage
Ans-A
Land~Lar erecursi
veenumerabl
ethenLi
s
a)Regul ar
b)Cont extfree
c)Cont extsensiti
ve
d)Recur sive
Ans-D
Regularexpr essi
onsareclosedunder
a)Uni on
b)Intersecti
on
c)Kleenest ar
d)Alloft hement i
oned

Ans-
d

Howmanystri
ngsoflengthl
esst
han4cont
ainst
hel
anguagedescr
ibedbyt
her
egul
ar
expr
essi
on(
x+y)*
y(a+ab)*
?
a)7
b)10
c)12
d)11
Ans-
D
Gr
ammat
ical
ruleswhi chinv
olv
ethemeani
ngofwor
dsar
ecal
l
ed:
a.Semant ics
b.Sy ntact
ic
c.Bot haandb
d.Noneofgi ven
Ans-A
Gr
ammati
calrul
eswhichdonoti
nvol
vet
hemeani
ngofwor
dsar
ecal
l
ed:
a.Semant i
cs
b.Syntact
ic
c.Bothaandb
d.Noneofgi v
en
Ans-
B
Thesy
mbolsinagrammart hatcan’
tber
epl
acedbyany
thi
ngar
ecal
l
ed:
a.Producti
ons
b.Terminal
s
c.Non-ter
minals
d.Allofabove
Ans-
B
Thesy
mbol
sinagr ammart hatmustber
epl
acedbyot
herSy
nbol
sar
ecal
l
ed:
e.Pr oducti
ons
f. Terminal
s
g.Non- ter
minals
h.Noneofgi v
en
Ans-C
Q1.Consi
dert
hel
anguagesL1=ᶲandL2={
a}.Whi
choneoft
hef
oll
owi
ngr
epr
esent
s
L1L2*UL1
a){
€}b)
ᶲc)a*d){
€,a}
Q2.LetSandTbel
anguageov
er={
a,b}r
epr
esent
edbyt
her
egul
arexpr
essi
ons(
a+b*
)*
and(
a+b)
*,r
espect
ivel
y.Whi
choft
hef
oll
owi
ngi
str
ue?
(
a)ScT(
SisasubsetofT)
(
b)TcS(
TisasubsetofS)
(
c)S=T
(
d)SnT=Ø
Q3.LetLdenot
est
hel
anguagegener
atedbyt
hegr
ammarS–OSO/
00.Whi
choft
he
f
oll
owi
ngi
str
ue?
(
a)L=O
(
b)Li
sregul
arbutnotO
(
c)Li
scont
extf
reebutnotr
egul
ar
(
d)Li
snotcont
extf
ree
Q4.Consi
dert
hef
oll
owi
ngt
wost
atement
s:
S1:
{0^
2n|
n>=l
}isar
egu1arl
anguage
S2:
{0^
m 0^
n0^
(m+n)l
m >=1andn>=2}i
sar
egu1arl
anguage
Whi
choft
hef
oll
owi
ngst
atement
siscor
rect
?(GATECS2001)
a)Onl
yS1i
scor
rect
b)Onl
yS2i
scor
rect
c)Bot
hS1andS2ar
ecor
rect
d)NoneofS1andS2i
scor
rect
Q5.Whi
choft
hef
oll
owi
ngst
atement
sint
rue?(
GATECS2001)
(
a)I
fal
anguagei
scont
extf
reei
tcanal
way
sbeaccept
edbyadet
ermi
nist
icpush-
down
aut
omat
on
(
b)Theuni
onoft
wocont
extf
reel
anguagesi
scont
extf
ree
(
c)Thei
nter
sect
ionoft
wocont
extf
reel
anguagesi
scont
extf
ree
(
d)Thecompl
ementofacont
extf
reel
anguagei
scont
extf
ree
Q6.Gi
venanar
bit
rar
ynon-
det
ermi
nist
icf
ini
teaut
omat
on(
NFA)wi
thNst
ates,
the
maxi
mum numberofst
atesi
nanequi
val
entmi
nimi
zedDFAi
satl
east
.(GATECS2001)
(
a)N^
2
(
b)2^
N
(
c)2N
(
d)N!
Q7.Gi
vent
hel
anguageL={
ab,
aa,
baa}
,whi
hoft
hef
oll
owi
ngst
ri
ngsar
einL*
?
1)abaabaaabaa
2)aaaabaaaa
3)baaaaabaaaab
4)baaaaabaa
(
A)1,
2and3
(
B)2,
3and4
(
C)1,
2and4
(
D)1,
3and4
8.Whi
choft
hef
oll
owi
ngpr
obl
emsar
edeci
dabl
e?
….
1)Doesagi
venpr
ogr
am ev
erpr
oduceanout
put
?
….
2)I
fLi
sacont
ext
-f
reel
anguage,
theni
sL’
(compl
ementofL)al
socont
ext
-f
ree?
….
3)I
fLi
sar
egul
arl
anguage,
theni
sL’
alsor
egul
ar?
….
4)I
fLi
sar
ecur
siv
elanguage,
then,
isL’
alsor
ecur
siv
e?
(
A)1,
2,3,
4
(
B)1,
2,
(
C)2,
3,4
(
D)3,
4
9.LetPbear
egul
arl
anguageandQbecont
ext
-f
reel
anguagesucht
hatQ⊆P.(
For
exampl
e,l
etPbet
hel
anguager
epr
esent
edbyt
her
egul
arexpr
essi
onp*
q*andQbe
{
pnqn
|
n∈N}
).Thenwhi
choft
hef
oll
owi
ngi
sALWAYSr
egul
ar?
(
A)P∩Q
(
B)P–Q
(
C)∑*–P
(
D)∑*–Q
10.(
a+b)
*isequi
val
entt
o
a)b*
a*
b)(
a*b*
)*
c)a*
b*
d)noneoft
hement
ioned
11.a?i
sequi
val
entt
o
a)a
b)a+Φ
c)a+ϵ
d)wr
ongexpr
essi
on
12.Regul
arexpr
essi
onΦ*i
sequi
val
entt
o
a)ϵ
b)Φ
c)0
d)1
13.Al
anguagei
sregul
ari
fandonl
yif
a)accept
edbyDFA
b)accept
edbyPDA
c)accept
edbyLBA
d)accept
edbyTur
ingmachi
ne
14.Lett
hecl
assofl
anguageaccept
edbyf
ini
test
atemachi
nebeL1andt
hecl
assof
l
anguages
r
epr
esent
edbyr
egul
arexpr
essi
onsbeL2t
hen
a)L1<L2
b)L1>=L2
c)L1UL2=.
*
d)L1=L2
15.Regul
arexpr
essi
on{
0,1}i
sequi
val
entt
o
a)0U1
b)0/1
c)0+1
d)Al
loft
hement
ioned

1.Transi
ti
onfunct
ionofDFAmaps.
a)Σ*Q- >Σ
b)Q*Q- >Σ
c)Σ*Σ- >Q
d)Q*Σ- >Q
Answer
:d

2.Mini
mum Numberofst
atesr
equi
ret
oacceptst
ri
ngendswi
th10.
a)3
b)2
c)1
d)can’
tber
epr
esent
ed.

Answer
:a
3.δ*(
q,ya)isequi
valentt
o.
a)δ((q,
y),
a)
b)δ(δ*(q,
y),
a)
c)δ(q,y
a)
d)i
ndependentfrom δnot
ati
on
Answer
:b
4.Languagesofaautomat
ais
a)Ifi
tisaccept
edbyaut
omata
b)Ifi
thalt
s
c)I
faut
omatatouchfi
nalst
atei
nit
sli
feti
me
d)Al
ll
anguagearel
anguageofaut
omata
Answer
:a
5.Fi
nit
eautomatar
equir
esmini
mum _
___
___numberofst
acks.
a)1
b)0
c)2
d)Noneofthement
ioned
Answer
:b
6.FSM withoutputcapabi
li
tycanbeusedt
oaddt
wogi
veni
ntegeri
nbi
nar
y
repr
esentat
ion.Thisi
s
a)True
b)False
c)Maybet rue
d)Noneoft hement i
oned
Answer
:a
7.IfNFAof6stat
esexcl
udingtheini
ti
alst
atei
sconv
ert
edi
ntoDFA,
maxi
mum
possi
blenumberofst
atesfort
heDFAi s?
a)64
b)32
c)128
d)127
Answer
:c
8.NFA,ini
tsnamehas’ non-
deter
ministi
c’becauseof:
a)Theresulti
sundetermined
b)Thechoiceofpathi snon-
deter
mi ni
sti
c
c)Thestatetobetransit
ednextisnon-determini
sti
c
d)All
ofthement i
oned
Answer
:b
9.Theconst
ruct
iont
imef
orDFAf
rom anequi
val
entNFA(
m numberofnode)
is:
a)O(
m)2

2m)
b)O(
c)O(
m)
d)O(
logm)
Answer
:b
10.
Whichoft
hef oll
owi
ngopt i
oniscorrect?
a)NFAisslowertoprocessandit
sr epresentat
ionusesmor ememorythanDFA
b)DFAisfastert
oprocessanditsrepresentati
onuseslessmemorythanNFA
c)NFAisslowertoprocessandit
sr epresentat
ionuseslessmemorythanDFA
d)DFAisslowertoprocessandit
sr epresentat
ionuseslessmemorythanNFA
Answer
:c
11.
Choosethecorr
ectopt
ionf
orthegivenstat
ement:
Stat
ement :
TheDFAshownrepresentsal
lstr
ingswhi
chhas1atsecondl
ast
posi
tion.

a)Corr
ect
b)I
ncorrect
,Incomplet
eDFA
c)Wrongpropositi
on
d)Maybecor rect

Answer
:c

12.

TOCmcq
Defi
nit
ionanddescr i
pti
onofFA:
1.NFA,ini
tsnamehas’ non-det
ermi
nist
ic’becauseof:
a)Theresulti
sundetermined
b)Thechoiceofpathisnon-det
ermi
nisti
c
c)Thestatetobetransi
tednexti
snon-determini
sti
c
d)All
ofthement i
oned
Answer:b

2.Languagesofaautomatai
s
a)Ifastr
ingisaccept
edbyaut
omat
a
b)Ifi
thalts
c)I
fautomatatouchfi
nalst
atei
nit
sli
feti
me
d)Al
llanguagearel
anguageofaut
omata
Answer:a

3.Thebasicli
mit
ati
onoff ini
teautomat aisthat
a)Itcan’
trememberarbitr
arylargeamountofi nf
ormati
on.
b)Itsometimesr
ecognizegrammart hatarenotregul
ar.
c)Itsometimesf
ail
stor ecognizeregul
argrammar .
d)Allofthement
ioned
Answer :
a

4.Whatt
hef
oll
owi
ngDFAaccept
s?

a)xisast
ri
ngsuchthati
tendswith‘101’
b)xisast
ri
ngsuchthatitendswit
h‘01’
c)xisast
ri
ngsuchthati
thasodd1’ sandev
en0’s
d)xisast
ri
ngssuchthatithasst
arti
ngandendi
ngchar
act
eras1
AnswerA)

5.Whatdoest
hef
oll
owi
ngf
igur
emostcor
rect
lyr
epr
esent
s?

a)Finalstatewit
hloopx
b)Transiti
onalstat
ewi t
hloopx
c)I
niti
al st
ateaswel l
asf i
nalst
atewi
thl
oopx
d)Insuf
ficientData
Answer: c
6.Numberoffi
nalst
aterequi
restoacceptΦi
nmi
nimal
fini
teaut
omat
a.
a)1
b)2
c)3
d)Noneofthementi
oned
Answer:
d
Expl
anat
ion:Nofi
nalst
aterequi
res.

7.Whichofthefoll
owi
ngi
sanappl
i
cat
ionofFi
nit
eAut
omat
on?
a)CompilerDesi
gn
b)GrammarPar ser
s
c)TextSearch
d)Alloft
hement i
oned
Answer:d

8.Whi
chDFAi
scor
rectf
ort
hegi
venLanguage:
accept
ingst
ri
ngendi
ngwi
th'
01'
overi
nputal
phabet
s
∑={
a.b}

a) b) c) d)Noneoft
hese
Ansc

9.HowmanyFi
nal
stat
esi
nthegi
venl
anguage:
{an|
wher
en>=1butn≠2,
6},
Σ={
a}
a)2 b)4 c)3 d)6
Ansb)
10.Tr
ansit
ionf
unct
ionmaps.
a)Σ*Q->Σ
b)Q*Q- >Σ
c)Σ*Σ->Q
d)Q*Σ->Q Ansd)

11.Fini
teaut omatahasonl
y
a)Fi
nitememor y
b)Readonl yhead
c)Finit
econt r
ol
d)Allofthem Ansd)

TheEqui
val
enceofdeter
minist
icandnon-det
ermi
nist
icfi
nit
eautomata
12.Ther
elat
ionbet
weenNFA-accept
edlanguagesandDFAacceptedl
anguagesi
s
a)>
b)<
c)=
d)<= Ansc)
13.Whichoft
hefoll
owingiscorr
ectproposit
ion?
Stat
ement1:Nondetermini
sm i
sagener al
izati
onofDeter
mini
sm.
Stat
ement2:Ever
yDFAi sautomati
cal
lyanNFA
a)Stat
ement1iscorr
ectbecauseStat
ement2i scor
rect
b)Stat
ement2iscorr
ectbecauseStatement2i scor
rect
c)Stat
ement2isfal
seandSt at
ement1i sfal
se
d)Stat
ement1isfal
sebecauseStatement2i sfal
se Ansa)

14.Whi
chNFAi
scor
rectf
ort
het
ransi
ti
ont
abl
easgi
venbel
ow:
Pr
esentSt
ate 0 1

→q0 q0,
q1 q0,
q2
q1 q3 ε
q2 q2,
q3 q3
→q3 q3 q3

a) b)

c) d)Noneoft
hese Ansa)

15.Gi
venaNFAwi
thNst
ates,
themaxi
mum numberofst
atesi
nanequi
val
entmi
nimi
zedDFAisatl
east
a)N^2
b)2^N
c)2N
d)N! Ansb)

Q1Whati
swr
ongi
nthegi
vendef
ini
ti
on?

Def
:({
q0,
q1,
q2}
,{0,
1},
δ,q3,
{q3}
)

a)Thedef
ini
ti
ondoesnotsat
isf
y5Tupl
edef
ini
ti
onofNFA
b)Ther
ear
enot
ransi
ti
ondef
ini
ti
on

c)I
nit
ial
andFi
nal
stat
esdonotbel
ongt
otheGr
aph

d)I
nit
ial
andf
inal
stat
escan’
tbesame

Answer
:c

Q2)Numberofst
atesr
equi
ret
oacceptst
ri
ngendswi
th10.
a)3
b)2
c)1
d)can’
tber
epr
esent
ed.
Answer
:a

Q3)δ(
q,y
a)i
sequi
val
entt
o.
a)δ(
(q,
y),
a)
b)δ(
δ(q,
y),
a)
c)δ(
q,y
a)
d)i
ndependentf
rom δnot
ati
on
answer
:b

Q4Fi
nit
eaut
omat
arequi
resmi
nimum _
___
___numberofst
acks.
a)1
b)0
c)2
d)Noneoft
hement
ioned
answer
:b

Q5AnNFA’
str
ansi
ti
onf
unct
ionr
etur
ns

a.ABool
eanv
alue

b.Ast
ate

c.Asetofst
ates

d.Anedge

answer
:c

Q6 
Chooset
hecor
rectopt
ionf
ort
hegi
venst
atement
:
St
atement
:TheDFAshownr
epr
esent
sal
lst
ri
ngswhi
chhas1atsecond
l
astposi
ti
on.

a)Cor
rect
b)I
ncor
rect
,Incompl
eteDFA
c)Wr
ongpr
oposi
ti
on
d)Maybecor
rect
Answer
:c(bczi
tisnf
a)
Q7.Whi
choft
hef
oll
owi
ngi
sanotapar
tof5-
tupl
efi
nit
eaut
omat
a?

a)I
nputal
phabet
b)Tr
ansi
ti
onf
unct
ion

c)I
nit
ial
Stat
e

d)Out
putAl
phabet

Answer
:d

Q8)
Transi
ti
onf
unct
ionmaps.
a)Σ*Q-

b)Q*Q-

c)Σ*Σ-
>Q
d)Q*Σ-
>Q
Answer
:d
Q9Thesum ofmini
mum andmaxi
mum numberoff
inal
stat
esf
oraDFA
hav
ing‘
n’st
atesi
sequal
to:
a)
n+1
b)
n
c)n-
2
d)n+2
answer:a
Q10Themaxi
mum numberoft
ransi
ti
onswhi
chcanbeper
for
medov
era
st
atei
naDFAusi
ngΣ={a,
b,
c}?
a)
1
b)
2
c)
3
d)4
answer:c
5.Giv
enanarbi
tr
arynon-
determi
nist
icfi
nit
eaut
omaton(NFA)wi
thNstates,
the
maximum numberofst
atesinanequiv
alentmi
nimi
zedDFAisatl
east
.(GATECS2001)
(a)N^2
(b)2^
N
(c)2N
(d)N!

Answer:(
b)
Refer
ences:
htt
p:/
/en.
wiki
pedi
a.or
g/wi
ki
/Power
set
_const
ruct
ion
p
Consi
derL={
(a)*|Pisapri
menumber}overt
healphabet{a}
,thenwhati
sthe
mini
mum numberofst
atesi
nNFAthataccept
sthelanguageL?

(
A)three
(
B)fi
ve
(
C)four
(
D)six

Expl
anat
ion:

L={
(ap)
*|Pisapr imenumber}
a2)
L=( *U(a3)*U(a5)
*U...
..
.
L={
epsil
on,a2,a3,
a4,
a5,
..
..
..
}

Thati
s,al
lst
ri
ngsofa’
sexcept‘
a’
I
ntheabov
eNFA,
onl
yst
ri
ng‘
a’i
snotaccept
ed.Hence,
numberofst
atesr
equi
redi
s
t
hree.

So,
opt
ion(
A)i
scor
rect
.

Letwbeanystri
ngoflengt
hnin{
a,b}*
.Consi
der‘L’
bethesetofal
lstr
ingsendingwi
th
atl
eastna’
s.Whatisthemini
mum numberofst
atesinnondet
ermini
sti
cfini
te
automat
athataccept‘
L’
?

(
A)(n+3)
(
B)(n+1)
(
C)n
D)2n
(

Expl
anati
on:
I
tiscorr
ectsi
nce,
theminimum numberofst
atesr
equi
redforNFAf
orendi
ngwi
that
l
east2a’sis(
2+1)i.e.
,regul
arexpr
essi
onwil
lbe(
a+b) *
aa

Hence,
Numberofst
atesr
equi
redf
oratl
eastna’
swi
l
lbe(
n+1)
.

Opt
ion(
B)i
str
ue.

Whatist
hemini
mum numberofstatesi
ndetermini
sti
cfi
nit
eaut
omat
a(DFA)f
orst
ri
ng
2
st
art
ingwit
hba andendi
ngwi
th‘a’overal
phabet{a,
b}?

(
A)Ten
(
B)Nine
(
C)Ei
ght
(
D)Si
x
nt
heabov
eDFA,
mini
mum numberofst
atesr
equi
redi
ssi
x.

Opt
ion(
D)i
scor
rect
.

Ques-5:
Whatisthenumberofst
atesinmini
malNFA(nondet
ermi
nisti
cfi
nit
eautomata)
,
whichaccept
ssetofal
lst
ri
ngsinwhichthet
hir
dlastsymbol
is‘
a’overal
phabet{a,
b}?

(
A)three
(
B)four
(
C)six
(
D)fi
ve
3)Definit
ionofalanguageLwithal
phabet{a}i
sgivenasfol
l ng.L={ank|k>0,
owi and
nisaposi t
ivei
ntegerconst
ant
}Whatistheminimum numberofstat
esneededina
DFAt or ecogni
zeL?
(A)k+1
(B)n+1
(C)2n+1
(D)2k+1

Answer(
B)
A)k+1
(B)n+1
(C)2n+1
(D)2k+1

Answer(B)
Notethatni
saconstantandkisanyposit
ivei
nteger
.Forexampl
e,i
fni
sgivenas3,
thentheDFAmustbeabletoaccept3a,
6a,9a,12a,.
.Tobuil
dsuchaDFA,
weneed4
stat
es.

4)Letwbeanystri
ngoflengthnis{0,
1}*
.LetLbethesetofallsubst
ri
ngsofw.What
i
st hemini
mum numberofstatesi
nanon- det
ermi
nist
icf
ini
teautomatonthataccept
s
L?
(A)n-1
(B)n
(C)n+1
(D)2n-1

Answer(C)
Weneedmi ni
mum n+1stat
estobui
ldNFAt hatacceptsal
lsubstr
ingsofabi
naryst
ri
ng.
Forexampl
e,fol
l
owingNFAaccept
sallsubstr
ingsof“010”andithas4stat
es.
1)Thelexicalanal ysisf
oramoder nlanguagesuchasJavaneedsthepowerofwhi
ch
oneofthef ol
lowi ngmachi nemodelsinanecessaryandsuf
fi
cientsense?
(A)Fi
nit
est at
eaut omata
(B)Det
ermi ni
sti
cpushdownaut omata
(C)Non-deter
mi nisticpushdownautomata
(D)Tur
ingmachi ne

Answer(A)
Lexi
calanaly
sisi sthefi
rstst epincompi l
ati
on.Inlexi
calanaly
sis,
progr
am isdivi
ded
i
ntotokens.Lexicalanalyzersar etypical
lybasedonf i
nit
est at
eautomata.Tokenscan
ty
pical
lybeexpr essedasdi fferentregularexpressi
ons:
Anidenti
fi
erisgi venby[a-zA-Z][a-
zA-Z0-9]*
Thekeywordifisgi venbyi f
.
I
ntegersaregivenby[ +-
]?[0-9]+.

3)Adet
ermi
nist
icf
ini
teaut
omat
ion(
DFA)
Dwi
thal
phabet∑={
a,b}i
sgi
venbel
ow
Whichofthefol
lowi
ngf
ini
test
atemachi
nesi
sav
ali
dmi
nimalDFAwhi
chaccept
sthe
samelanguageasD?

Answer(A)
Opti
ons(B)and(C)ar
einval
idbecauset
heybothaccept‘
b’asastr
ingwhichisnot
accept
edbygiveDFA.Disinval
i
dbecauseitaccept
sbb+awhicharenotaccept
edby
gi
venDFA.

Fol
l
owi
ngquest
ionshav
ebeenaskedi
nGATECS2012exam.

1)Whati
sthecompl
ementoft
helanguageaccept
edbyt
heNFAshownbel
ow?
Assume∑={a}andεist
heemptystr
ing

(
A)Φ
(
B)ε
(
C)a
(
D){
a,ε}

Answer(B)
Thegi
v enal
phabet∑contai
nsonlyonesymbol{a}andthegiv
enNFAaccept sallst
ri
ngs
wit
hanynumberofoccurrencesof‘
a’.I
notherwords,t
heNFAaccept sa+.Ther
efore
complementofthel
anguageacceptedbyautomataisemptystr
ing.

4)Consi
dert
hesetofstr
ingson{0,
1}i
nwhich,ev
erysubst
ri
ngof3sy mbol
shasat
mosttwozer
os.Forexamples,
001110and011001areint
helanguage,
but100010i
s
not
.Allst
ri
ngsoflengt
hlessthan3areal
soint
hel
anguage.Apar
ti
all
ycompl
eted
DFAthataccept
sthisl
anguageisshownbel
ow.

Themi
ssi
ngar
csi
ntheDFAar
e
Answer(
D)
State‘q’i
strapstate.Al
lotherst
atesareacceptstates.I
nstat
e00,DFAmustmov eto

q’ f
orinputsy mbol0.Al
l(non-t
rap)st
atesindicat
enamesi ndi
cat
ethecharact
ersseen
beforereachingthatpar
ti
cularstat
e.Opti
on( D)istheonl
yopti
onthatf
oll
owst hese
rul
es.

Ques-
1:Consi
dert
hef
oll
owi
ngst
atement
s:

 X:ForanylanguageeitheralanguageLorit
scompli
mentL’ mustbefi
nite.
 Y:
DFAf orlanguagewhichcontai
nsepsil
onmusthaveini
ti
alst
ateasfinalstat
e.
 Z:
Non- determini
sti
cfi
niteautomataismorepower
fult
handetermini
sti
cf i
nit
e
aut
omat
a.

ht
tps:
//www.
sanf
oundr
y.com/
aut
omat
a-t
heor
y-mcqs-
fi
nit
e-aut
omat
a/
2.I
nDFATransi
ti
onf
unct
ionmaps.
a)Σ*Q->Σ
b)Q*Q->Σ
c)Σ*Σ-
>Q
d)Q*Σ->Q
Answer
:d

3.Numberofst
atesr
equi
ret
oacceptst
ri
ngendswi
th10.
a)3
b)4
c)5
d)can’
tber
epr
esent
ed.
Answer:
a

8.Languageoff
ini
teaut
omat
ais.
a)Type0
b)Type1
c)Type2
d)Type3
ViewAnswer

Answer:
d
Expl
anat
ion:
Accor
dingt
oChomskycl
assi
fi
cat
ion.

Fi
nit
eautomatar
equir
esmini
mum _
___
___numberofst
acks.
a)1
b)0
c)2
d)Noneofthement
ioned
ViewAnswer

Answer:
b
Expl
anat
ion:
Fini
teaut
omat
adoesn’
trequi
reanyst
ackoper
ati
on

13.Thebasicli
mitati
onoff init
eautomat ai
sthat
a)Itcan’
trememberar bitr
arylargeamountofinf
ormati
on.
b)Itsometimesrecognizegr ammart hatar
enotregul
ar.
c)Itsometimesfail
stor ecognizeregul
argrammar.
d)Alloft
hement ioned

Answer:
a
Expl
anat
ion:
Becauset
her
eisnomemor
yassoci
atedwi
thaut
omat
a.

15.FSM wit
hout putcapabi
l
itycanbeusedt
oaddt
wogi
veni
ntegeri
nbi
nar
y
repr
esentat
ion.Thisi
s
a)True
b)False
c)Maybet r
ue
d)Noneoft hement i
oned
ViewAnswer

Answer:
a
Expl
anat
ion:
Uset
hem asaf
li
pfl
opout
put
5.NFA,i
nitsnamehas’ non-det
ermi
nist
ic’becauseof:
a)Theresulti
sundetermined
b)Thechoiceofpathisnon-det
ermi
nisti
c
c)Thestatetobetransi
tednexti
snon-deter
mi ni
sti
c
d)All
ofthement i
oned
ViewAnswer

Answer:
b
Expl
anat
ion:
Nondetermini
sticordeter
mi ni
sti
cdependsuponthedefi
nit
epat
hdef
ined
fort
hetr
ansi
tionf
rom onestatetoanotherorundef
ined(
mult
iplepat
hs).

1.Whichoft
hefoll
owi ngoptionsiscor
rect
?
Stat
ement1:I
nit
ialStateofNFAi sIni
ti
alStateofDFA.
Stat
ement2:Thefi
nal stat
eofDFAwi l
lbeev er
ycombinat
ionoff
inal
stat
eofNFA.
a)Stat
ement1istrueandSt atement2istrue
b)Stat
ement1istrueandSt atement2isfalse
c)Stat
ement1canbet r
ueandSt atement2ist r
ue
d)Stat
ement1isfalseandSt atement2isalsofalse
ViewAnswer

Answer:
a
Expl
anat
ion:
Stat
ement1and2al
way
str
uef
oragi
venLanguage.

6.Conv
ertt
heNFAt
oDFA
c)All
ofthement
ioned
d)Noneofthementi
oned
ViewAnswer

Answer :a
Explanati
on: I
nit
ial
lyQi sempty.Thensi ncetheini
tial
stat
eoftheDFAis{
0},{
0}is
addedt oQ.
Since2(0, a)={1, 2}, {1,2}i saddedt oQand({0}, a)={1, 2}.
Since2(0, b)=, i
saddedt oQand({0}, b)=.
AtthispointQ={{ 0},{1,2},}.Similar
ly({1, 2},b)={1, 3}.Hence{1,3}isadded
toQ.Si milarl
y({1, 3}, a)={1, 2}and({1, 3},b)=.Thust her
ear
enonewst at
es
tobeaddedt oQ.Si ncethetransit
ionsfrom allst
atesofQhavebeencomput
edandno
mor estat
esar eaddedt oQ, t
heconv ersionprocessstopsher
e.

1.LetSandTbel anguageover={
a,b}r
epresent
edbytheregul
arexpr
essi
ons(
a+b*
)*
and(a+b)
*,r
espectiv
ely.Whi
chofthefoll
owingist
rue?(
GATECS2000)

(
a)ScT(SisasubsetofT)
(
b)TcS(TisasubsetofS)
(
c)S=T
(
d)SnT=Ø

Answer
:(c)
.
2)Whichoneofthefol
l
owinglanguagesov ertheal
phabet{
0,1}i
sdescr
ibedbyt
he
regul
arexpr
essi
on:(
0+1)*
0(0+1)*0(
0+1)*?
(A)Thesetofal
lst
ri
ngscontai
ningthesubst r
ing00.
(B)Thesetofal
lst
ri
ngscontai
ningatmostt wo0’s.
(C)Thesetofal
lst
ri
ngscontai
ningatleasttwo0’s.
(D)Thesetofal
lst
ri
ngsthatbeginandendwi theit
her0or1.

Answer(C)
Theregul
arexpressi
onhast
wo0’
ssur
roundedby(
0+1)
*whi
chmeansaccept
edst
ri
ngs
musthaveatleast20’s.

3)LetL={w∈( 0+1)*
|whasevennumberof1s},
i.e.Listhesetofal
lbitst
ri
ngswi
th
evennumberof1s.Whi choneoft
heregul
arexpressionbelowrepr
esentsL?
(A)(0*10*)*
(B)0*(10*10*)
*
(C)0*(10*1*)
*0*
(D)0*1(10*1*)
*10*

Answer(B)
Opti
on(A)i
sincor
rectbecausei
tcannotaccept“110”
Opti
on(C)i
sincor
rectbecausei
tacceptastri
ngwi t
hsingl
e1.
Opti
on(D)i
sincor
rectbecausei
tcannotaccept11101

4Whi
choft
hef
oll
owi
ngst
atement
(s)i
s/ar
ecor
rect
?

(
A)onl
yX
(
B)onl
yY
(
C)onl
yZ
(
D)al
loft
heabov
e.

Explanation:
X:Itisincorrect.si
nce,alanguageLandi t
scomplimentcanbeinfi
nit
e.
Y:Itiscor r
ect.si
nce,i
fthelanguagecont ai
nsepsil
onthenit
sini
tial
statemustbef
inal
al
so, otherwiset heDFAwontbeabl etoacceptepsil
on.
Z:Itisi
ncor rect.si
nce,ev
er ylanguageacceptedbyNFAisalsoacceptedbysomeDFA.
Hence, NFAandDFAbot har eequival
entinpower.

Opt
ion(
B)i
str
ue.

5Whichoneofthef
oll
owingregularexpr
essiondescr
ibest
hel
anguageov
er{
a,b}
whi
chconsi
stsofnopairofconsecuti
veb’s?

(
A)(
a*baa*
)(b+epsi
l
on)
(
B)(
a+ba)*(b+epsi
lon)
(
C)(
a*baa*)
*(b+epsil
on)+a*
(
D)(
a*ba*)
*(b+epsi
lon)+a*(
b+epsi
l
on)

Expl
anat
ion:

 (
A)I
tisincorrect.since,i
tdoesnotcontai
ns(aorepsi
lon).
 (
B)I
tiscorrect.since,itcont
ains(
epsi
lon,a,
b,ba,ab,
…..)
,i.
e.,
nopai
rof
consecut
iveb’
s.
 (
C)I
tisi
ncor
rect
.si
nce,
itdoesnotcontai
ns‘
ab’or‘
aab’
.
 (
D)I
tisi
ncor
rect
.si
nce,
itcont
ains‘
bb’,
whichi
snotall
owed.

Opt
ion(
B)i
str
ue.

6Whati
st helengthoft
heshor
testst
ri
ngnoti
nthel
anguageov
eral
phabet{
0,1}f
or
r
egul
arexpressiongi
venbel
ow:

1*
(0+1)
*1*

(
A)seven
(
B)fi
ve
(
C)six
(
D)four

Explanati
on:
Checkeachst ri
nggeneratedovert
healphabet{0,1}unti
lyoureachtheshort
estst
ri
ng
whichi snotgener
atedbyt hegi
venregul
arexpressi
on.
I
nt hiscase,small
estst
ringwhichisnotgener
atedbyt hegiv
enr egul
arexpr
essi
onis
0110, whoselengt
hisfour.

so,
opt
ion(
D)i
str
ue.

7ConsiderXandYaretwolanguagesov eral
phabet{0,
1}represent
edbyregul
ar
expr
ession0*
(10*
)*and(0*+1*)*respecti
vel
y.whichofthefoll
owingi
str
ue?

(
A)XispropersubsetofY
(
B)YispropersubsetofX
(
C)X=Y
(
D)none

Explanat
ion:
Here,

L(
X)
=0*(10*)*
={epsil
on,0,
1,10,
01,
00,
11,
..
..
..
}
And.

L(
Y)
=(0*+1*)
*
={epsi
l
on,0,
1,10,
01,
00,
11,
..
..
}

So,
bot
hlanguagesar
eequi
val
entt
oeachot
her
.

Opt
ion(
C)i
str
ue.

TheAppl
i
cat
ionsoft
heseAut
omat
aar
egi
venasf
oll
ows:

ht
tps:
//www.
sanf
oundr
y.com/
compi
l
ers-
quest
ions-
answer
s-nf
a-epsi
l
on-
mov
es-
1/

8.S–>aSa| bSb| a|b;t


helanguagegener
atedbyt
heabov
egr
ammari
sthesetof
a)All
pal i
ndromes.
b)Alloddlengt hpali
ndromes
c)Str
ingsbegi nningandendingwiththesamesymbol
d)Allevenlengt hpali
ndromes
ViewAnswer

Answer :
b
Explanat
ion:
Thest
ri
ngsaccept
edbylanguagear
e{a,
b,aaa,
bbb,
aba,
bab,
}.Al
lthe
str
ingsareoddl
engt
hpali
ndromes.

9Whi choneofthefoll
owinglanguagesov ert
heal
phabet{
0,1}i
sdescr
ibedbyt
he
regul
arexpr
essi
on: (
0+1)*0(0+1)
*0(0+1)*?
a)str
ingswit
hthesubst r
ing00
b)str
ingswit
hatmostt wo0’ s
c)str
ingswit
hatleasttwo0’ s
d)str
ingsbegi
nningandendi ngwit
heither0or1
ViewAnswer

Answer:
c
Expl
anat
ion:TheREhav
ing20’
spaddedby(
0+1)
*whi
chmeansaccept
edst
ri
ngsmust
haveatl
east20’s.

10.Doesepsi
l
onr
ingmakesanychangei
ntheaut
omat
a
a)Yes
b)No
ViewAnswer

Answer:
b
Expl
anat
ion:
Itaddsnot
hingnewt
otheaut
omat
a.
11.Whichofthetechniquecanbeusedt
opr
ovet
hatal
anguagei
snonr
egul
ar?
a)Ardenstheorem
b)Pumpi ngLemma
c)Ogden’sLemma
d)Noneoft hement i
oned
ViewAnswer

Answer :b
Expl
anat i
on:Weusethepowerf
ultechni
quecall
edPumpingLemma,forshowi
ng
cert
ainlanguagesnottober
egul
ar.WeuseAr denst
heor
em tofi
ndoutaregul
ar
expressi
onoutofaf i
nit
eaut
omaton.

12Whi choft hef


oll
owingl
anguager
egul
ar?
a){aibi|
i>=0}
b){aibi|
0<i<5}
ii
c){ab| i>=1}
d)Noneoft hementi
oned
ViewAnswer

Answer:b
Expl
anati
on:Here,i
hasli
mitsi
.e.thelanguagei
sfini
te,
containsf
ewelement
sandcan
begraphedusingadet
ermini
sti
cf i
nit
eaut omat
a.Thus,i
tisregul
ar.Ot
her
scanbe
prov
ednonr egul
arusi
ngPumpi nglemma.

13.Whi chofthefol
lowingarenonregul
ar?
a)Thesetofst r
ingsin{a,
b}*withanevennumberofb’
s
b)Thesetofst ri
ngsin{a,b,c}
*wherether
eisnocanywheretot
helef
tofa
c)Thesetofst r
ingsin{0,1}
*thatencode,
inbi
nary
,anint
egerwthati
samult
ipl
eof3.
Inter
prettheemptystri
ngseast henumber0.
d)Noneoft hement i
oned
ViewAnswer

Answer:d
Expl
anati
on:
Alloft
hegivenlanguagesareregul
arandfinit
eandthus,canbe
repr
esent
edusingr
especti
vedetermini
sti
cfini
teautomata.Wecanalsousemeal
yor
mooremachinetor
epresentremainder
sforoptionc.

14.I
fLisDFA-regul
ar,L’
is
a)Nonregular
b)DFA-
regular
c)Non-
fi
nite
d)Noneofthementioned
ViewAnswer
Answer:b
Expl
anati
on:Thi
sisasimpleexampleofaclosur
eproper
ty:
aproper
tysay
ingt
hatt
he
setofDFA-r
egul
arlanguagesi
sclosedundercer
tai
noper
ati
ons.

IfLi
sDFA-regular
,L’
is
a)Nonregular
b)DFA-
regular
c)Non-
fi
nite
d)Noneofthement i
oned
ViewAnswer

Answer:b
Expl
anati
on:Thi
sisasimpleexampleofaclosur
eproper
ty:
aproper
tysay
ingt
hatt
he
setofDFA-r
egul
arlanguagesi
sclosedundercer
tai
noper
ati
ons.

15.Whi chofthefol
lowingopt i
onsisi
ncorr
ect
?
a)Al anguageLisregularifandonlyi
f~Lhasf i
nit
enumberofequi
valentcl
asses.
b)LetLbear egul
arlanguage.If~Lhaskequival
entcl
asses,t
henanyDFAt hat
recognizesLmusthav eat mostkstat
es.
c)Al anguageLisNFA- regul
arifandonl
yifi
tisDFA-r
egular
.
d)Noneoft hement i
oned
ViewAnswer

Answer :b
Explanati
on:LetLbear
egularl
anguage.I
f~Lhaskequi
val
entcl
asses,
thenanyDFA
thatrecogni
zesLmusthaveatl
eastkstat
es.

16My hil
lNerodedoesthefoll
owing:
a)Minimizat
ionofDFA
b)Tell
susexactlywhenal anguagei
sregul
ar
c)Both(a)and(b)
d)Noneoft hementioned
ViewAnswer

Answer:c
Expl
anation:I
nautomatatheor
y,theMy phi
ll
Ner odetheorem pr
ovi
desanecessaryand
suff
ici
entcondit
ionforal
anguaget oberegular
.TheMy phi
l
lNerodet
heorem canbe
usedtoshowal anguageLisregularbyprovi
ngt hatt
henumberofequival
enceclasses
ofRL(r
elati
on)i
sf i
nit
e.

17.NDFAswher eint
roducedby___
___
___
___
a)MichaelORabin&DanaScot t
b)DanBrown
c)Sunmi cr
osystem Labs
d)SAPLabs
Vi
ewAnswer

Answer:a
Expl
anati
on:NFAswerei
ntr
oducedDanaScot
tandMi
chael
O.Rabi
nwhoal
soshowed
thei
requi
val
encetoDFAs.

18Ther egularlanguagesar
enotcl
osedunder
a)Concatenation
b)Union
c)Kleenestar
d)Compl ement
ViewAnswer

Answer: d
Expl
anat i
on:REar ecl
osedunder
•Union(cf.pictur
e)
•Int
ersection
•Concatenation
•Negation
•Keenecl osure.

19.AnNFA’str
ansi
ti
onf
unct
ionr
etur
ns
a)ABooleanval
ue
b)Astat
e
c)Asetofstat
es
d)Anedge
ViewAnswer

Answer:
c
Expl
anat
ion:
Atr
ansi
ti
onf
unct
ionΔ:
Q×Σ→ P(
Q).
Wher
eP(
Q)denot
est
hepowerset
ofQ…

20.Howmanyst r
ingsofl
engt
hlesst
han4cont
ainst
hel
anguagedescr
ibedbyt
he
regul
arexpr
essi
on(x+y)
*y(
a+ab)
*?
a)7
b)10
c)12
d)11
ViewAnswer

Answer: d
Explanat
ion:st
ri
ngofl
engt
h0=1
str
ingoflengt
h1=4
str
ingoflengt
h2=3
str
ingoflengt
h3=3
21.Whichofthefoll
owingistr
ue?
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)Allofthementi
oned
ViewAnswer

Answer:d
Expl
ainat
ion:
None.

22.Alanguagei
sregul
ari
fandonl
yif
a)acceptedbyDFA
b)acceptedbyPDA
c)acceptedbyLBA
d)acceptedbyTuri
ngmachi
ne
ViewAnswer

Answer:a
Expl
anat
ion:Al
lofabovemachi
necanacceptr
egul
arl
anguagebutal
lst
ri
ngaccept
ed
bymachinei
sregul
aronlyf
orDFA.

23.Letthecl
assoflanguageacceptedbyfini
test
atemachi
nebeL1andt
hecl
assof
l
anguagesrepresent
edbyr egul
arexpressi
onsbeL2then
a)L1<L2
b)L1>=L2
c)L1UL2=. *
d)L1=L2
ViewAnswer

Answer: d
Explanat
ion:Fi
nit
est
atemachi
neandr
egul
arexpr
essi
onhav
esamepowert
oexpr
ess
alanguage.

24.Whi choft hef


oll
owi
ngisnotar
egul
arexpr
essi
on?
a)[(a+b)*
-(aa+bb)
]*
b)[(0+1)-
(0b+a1)*(
a+b)
]*
c)(01+11+10) *
d)(1+2+0)* (
1+2)*
ViewAnswer

Answer:b
Expl
anat
ion:
Exceptbal
lar
eregul
arexpr
essi
on*

25.Regul
arexpressi
onar
e
a)Type0language
b)Type1language
c)Type2language
d)Type3language
ViewAnswer

Answer:a
Expl
anat
ion:
Accor
dingt
oChomskyhi
erar
chy.

26.Whichofthefoll
owi ngistrue?
a)Everysubsetofar egularsetisregul
ar
b)Everyfini
tesubsetofnon- r
egularseti
sregul
ar
c)Theuni onoftwononr egularsetisnotregul
ar
d)Inf
init
eunionoffinit
eseti sregular
ViewAnswer

Answer:b
Expl
anat
ion:
None.

27.Regul arexpr
essionsar
ecl
osedunder
a)Uni on
b)Intersecti
on
c)Kleenst ar
d)Alloft hementioned
ViewAnswer

Answer:d
Expl
anat
ion:
Accor
dingt
odef
ini
ti
onofr
egul
arexpr
essi
on.

7.Myphil
l Nerodedoesthefol
lowing:
a)Minimizati
onofDFA
b)Tell
susexact lywhenalanguageisregul
ar
c)Both(a)and( b)
d)Noneoft hement i
oned
ViewAnswer

Answer:c
Expl
anation:I
nautomatatheor
y,theMy phi
ll
Ner odetheorem pr
ovi
desanecessaryand
suff
ici
entcondit
ionforal
anguaget oberegular
.TheMy phi
l
lNerodet
heorem canbe
usedtoshowal anguageLisregularbyprovi
ngt hatt
henumberofequival
enceclasses
ofRL(r
elati
on)i
sf i
nit
e.

28.Whichofthef
oll
owi
ngst
ri
ngsdonotbel
ongt
hegi
venr
egul
arexpr
essi
on?
(a)
*(a+cba)
a)aa
b)aaa
c)acba
d)acbacba
ViewAnswer

Answer:
d
Expl
anat
ion:
Thest
ri
ngacbacbai
sunaccept
abl
ebyt
her
egul
arexpr
essi
on(
a)*
(a+cba)
.

2.LetLdenot esthelanguagegener
atedbyt
hegr
ammarS–OSO/
00.Whi
choft
he
foll
owingistrue?(GATECS2000)
(a)L=O
(b)LisregularbutnotO
(c)Liscontextfreebutnotregul
ar
(d)Lisnotcont extf
ree

Answer :(
b)
Explanati
on: Pl
easenot ethatgr
ammari t
sel
fisnotregul
arbutl
anguageLisr
egul
aras
Lcanber epresentedusingaregul
argrammar,forexampleS->S00/00.
References:
htt
p://en.
wi ki
pedia.or
g/wiki
/Regul
ar_
grammar

3.Considerthefollowingtwost atement
s:
S1:{0^2n| n>=l
}i sar egu1arlanguage
S2:{0^m 0^ n0^
(m+n)l m >=1andn>=2}i saregu1arl
anguage
Whichoft hefol
lowi ngstatementsiscorr
ect?(
GATECS2001)
a)OnlyS1i scorrect
b)OnlyS2i scorrect
c)BothS1andS2ar ecorrect
d)NoneofS1andS2i scorrect

Answer:
(c)
Expl
anat
ion:
S1canbewr i
tt
enas( 00)
^nwheren>=1.AndS2canbewr i
tt
enas(
00)
^(m+n)wher
em
>=2andn>=1.S2canbef ur
therr
educedto(00)
^xwher
ex>=3.
Wecaneasilywri
teregul
argr
ammar sforbot
hS1andS2.
G1->G100/00(ForS1)
G2->G200/000000(ForS2)

Ques-
1:Whi
choneoft
hef
oll
owi
ngl
anguagei
sRegul
ar?

( wxwR|
A){ w,x∈(
a+b)
+}
( wxwR|
B){ w∈( a+b)
*,x∈{a,
b}}
R
(
C){
ww x|w,
x∈( a+b)+}
( wwR|
D){ w∈( a+b)*
}

Expl
anat
ion:

 (
A)I
tiscor
rect
,si
ncet
hisl
anguagecanf
ormr
egul
arexpr
essi
onwhi
chi
s{{a(
a+
+ +
b) a}+{ b(a+b) b}},
i.e.
,startandendwithsamesy mbol
.
 (B)Iti
sdet er
ministi
ccont extfreel
anguagesince,
stri
ngbef
oreandandaft
er‘
x’
aresameso, i
tismat ched.
 (C)Itcannotber egul
arsince, wwRisdoneatfir
stwhichr
equir
escompar
ison
whichcannotbedonev i
af i
niteaut
omata.
 (D)Iti
sal sonotregularsince,compari
sonisrequi
red.

Opt
ion(
A)i
str
ue.

Ques-
4:Consi
dert
hef
oll
owi
ngst
atement
s:

S1={
(an)
m
|n=0}
n n
S2={
ab | anbm |
n>=1}U{ n>=1,
m>=1}

Whi
choneoft
hef
oll
owi
ngi
sregul
ar?

(
A)onl
yS1
(
B)onl
yS2
(
C)bothS1andS2
(
D)none

Expl
anat
ion:
Bothgi
venlanguagesar
eregul
ar.Opt
ion(
C)i
scor
rect
.

1)S–>aSa| bSb|a|b;Thelanguagegener
atedbyt
heabov
egr
ammarov
ert
heal
phabet
{a,
b}i
sthesetof
(A)Al
lpali
ndromes.
(B)Al
loddlengthpali
ndromes.
(C)St
ri
ngsthatbeginandendwi ththesamesymbol
(D)Al
levenlengthpal
indromes.

Answer(B)
Thestri
ngsaccept
edbylanguagear
e{a,
b,aaa,
bbb,
aba,
bab,
..
}.Al
loft
hesest
ri
ngsar
e
oddlengthpal
i
ndromes.

1)LetPbear egul
arl
anguageandQbecont ext
-f
reelanguagesucht hatQ⊆P.( For
exampl e,
letPbethelanguagerepr
esent
edbytheregularexpressi
onp* q*andQbe
{pnqn|
n∈N} ).Thenwhichofthefol
l
owingisALWAYSr egular
?
(A)P∩Q
(
B)P–Q
(
C)∑*–P
(
D)∑*–Q

Answer(C)
Theexpression∑*–Pr epresentscomplementofPwhi chi
saregularlanguage.
ComplementofRegul arl
anguagesisalsor egul
ar.ThenaDFAt hatacceptsthe
complementofL, i
.e.∑*–L, canbeobtainedbyswappi ngi
tsaccepti
ngst at
eswithi
ts
non-
acceptingstat
es.

2)GiventhelanguageL={
ab,
aa,
baa}
,whi
hoft
hef
oll
owi
ngst
ri
ngsar
einL*
?
….1)abaabaaabaa
….2)aaaabaaaa
….3)baaaaabaaaab
….4)baaaaabaa
(A)1,2and3
(B)2,3and4
(C)1,2and4
(D)1,3and4

Answer( C)
Anycombi nati
onofstri
ngsinset{ab,aa,baa}wil
lbeinL*.
….1)“abaabaaabaa”canbeparti
ti
onedasacombi nati
onofst ri
ngsinset{ab,aa,baa}.
Thepar t
iti
onsare“abaabaaabaa”
….2)“aaaabaaaa”canbeparti
ti
onedasacombi nati
onofstringsinset{ab,aa,baa}.The
part
it
ionsar e“
aaabaaaa”
….3)“baaaaabaaaab”cannotbepart
it
ionedasacombi nat
ionofst r
ingsinset{ab,aa,
baa}
….4)“baaaaabaa”canbeparti
ti
onedasacombi nati
onofst r
ingsinset{ab,aa,baa}.The
part
it
ionsar e“
baaaaabaa”

3.Whichoft hefoll
owingr el
atestoChomskyhi
erar
chy
?
a)Regul
ar<CFL<CSL<Unr est
ri
ct ed
b)CFL<CSL<Unr estr
icted<Regular
c)CSL<Unrestri
cted<CF<Regul ar
d)Noneoft hement ioned
ViewAnswer

Answer:a
Expl
anati
on:Thechomskyhi
erarchyl
aysdownt
hef
oll
owi
ngor
der
:
Regul
ar<CFL<CSL<Unr
est
ri
cted

8.Whichofthef
oll
owi
ngst
ri
ngsi
snotgener
atedbyt
hegi
vengr
ammar
:
S->SaSbS|
e
a)aabb
b)abab
c)abaabb
d)Noneofthement
ioned
ViewAnswer

Answer :d
Expl
anat i
on: Al
lthegivenopti
onsaregeneratedbythegiv
engrammar.Usi
ngthe
methodsofl ef
tandrightderi
vat
ions,i
tissi
mplertolookforst
ri
ngwhi
chagrammar
cangener ate.
IfLand L'
 arerecursi
velyenumerable,
thenLis
ARegul ar
Bcont ext-f
ree
context-
sensit
ive

.Theclassofrecursi
vel
yenumer
abl
elanguagei
sknownas:
a)Turi
ngClass
b)Recursi
veLanguages
c)Uni
versalLanguages
d)RE
ViewAnswer

Answer:
d
Expl
anat
ion:REorrecur
siv
elyennumer
abl
eisonl
ycal
l
edt
hecl
assofr
ecur
siv
ely
ennumerabl
elanguage.

.Whichoft hefollowingstat
ement saref al
se?
a)Ever
yr ecursivelanguageisrecursivel
yennumerable
b)Recursivelyennumer abl
elanguagemaynotber ecursive
c)Recur
si velanguagesmaynotber ecursi
vel
yennumer abl
e
d)Noneoft hement i
oned
ViewAnswer

Answer :c
Explanati
on:Ev
eryr
ecursi
velanguageisrecur
siv
elyennumerablebutthereexi
sts
recursi
vel
yennumerabl
elanguagesthatarenotrecur
siv
e.IfLisacceptedbyaNon
determini
sti
cTM T,andever
ypossiblesequenceofmov esofTcausesi ttohal
t,t
henL
i
sr ecursi
ve.

4.Choosethecorrectopt
ion:
Stat
ement :
IfL1andL2ar erecur
siv
elyenumer
abl
elanguagesov
erS,
thent
hef
oll
owi
ng
i
s/arerecursi
vel
yenumerable.
a)L1UL2
b)L2∩L2
c)Both(a)and(b)
d)Noneofthement
ioned
ViewAnswer

Answer :c
Explanati
on:Bot
htheuni
onandint
ersect
ionoper
ati
onspr
eser
vet
hepr
oper
tyof
recursi
veennumerabl
i
ty(
Theor
em).

5.IfLi
sar ecursiv
elanguage,
L’i
s:
a)Recur
sive
b)Recur
sivelyEnnumerable
c)Both(a)and( b)
d)Noneoft hement i
oned
ViewAnswer

Answer:
c
Expl
anat
ion:IfTisatur
ingmachiner
ecogni
zingL,wecanmakei trecognizeL’by
i
nter
changingthetwooutput
s.Andever
yrecursi
velanguagei
srecursi
velyennumerabl
e.

6.Chooset heappr opr


iat
eopt
ion:
Statement :IfalanguageLisr
ecursi
ve,
iti
scl
osedundert
hef
oll
owi
ngoper
ati
ons:
a)Uni on
b)Intersection
c)Compl ement
d)Alloft hement ioned
ViewAnswer

Answer:d
Expl
anati
on:Thecl
osurepr
oper
tyofr
ecur
siv
elanguagesi
ncl
udeuni
on,
int
ersect
ionand
complementoper
ati
ons.

.Arecursivelyennumer abl
elanguageLcanberecur
sivei
f:
a)L’i
sr ecursivelyennumerabl
e
b)Everypossi blesequenceofmov esofT,
theTM whichacceptL,
causesi
ttohal
t
c)Both( a)and( b)
d)Noneoft hement ioned
ViewAnswer

Answer :c
Explanati
on:
Theor
em-IfLisarecursi
velyennumer
abl
elanguagewhosecompl
ementi
s
recursi
vel
yennumerabl
e,t
henLisrecursi
ve.

3.Alanguageisr
egul
ari
fandonl
yif
a)acceptedbyDFA
b)accept
edbyPDA
c)accept
edbyLBA
d)accept
edbyTur
ingmachi
ne
ViewAnswer

Answer:a
Expl
anat
ion:Al
lofabovemachi
necanacceptr
egul
arl
anguagebutal
lst
ri
ngaccept
ed
bymachinei
sregul
aronlyf
orDFA.

4.Regulargrammari s
a)contextfreegrammar
b)noncont extfr
eegrammar
c)engl
ishgr ammar
d)noneoft hement i
oned
ViewAnswer

Answer:a
Expl
anat
ion:
Regul
argr
ammari
ssubsetofcont
extf
reegr
ammar
.

5.Letthecl
assoflanguageacceptedbyfi
nit
est
atemachinebeL1andt
hecl
assof
l
anguagesrepresent
edbyregularexpr
essi
onsbeL2then
a)L1<L2
b)L1>=L2
c)L1UL2=. *
d)L1=L2
ViewAnswer

Answer: d
Explanat
ion:Fi
nit
est
atemachi
neandr
egul
arexpr
essi
onhav
esamepowert
oexpr
ess
alanguage.

7.Regul
arexpressi
onar
e
a)Type0language
b)Type1language
c)Type2language
d)Type3language
ViewAnswer

Answer:a
Expl
anat
ion:
Accor
dingt
oChomskyhi
erar
chy

S→ SSS→ λS→ aSbS→ bSawhi


cht
ypeofgr
ammari
sit
?
a)Li
near
b)Nonl
inear
c)Bot
hoft hementi
oned
d)Noneoft hement
ioned
Vi
ewAnswer

Answer :
a
Explanat
ion:
Grammarisnon-
li
nearbecauseoneoft
her
ules(
thef
ir
stone)hast
wonon-
ter
mi nal
sontheri
ght
-handsi
de.

5.S→ abSS→ ai swhichgr


ammar
a)RightLi
nearGrammar
b)LeftLi
nearGrammar
c)Right&LeftLi
nearGrammar
d)Noneoft hementi
oned
ViewAnswer

Answer :a
Explanati
on:grammarsi
nwhichal
loftherul
escont
ainonl
yonenon-t
ermi
nal
ont helef
t
-handside,andwher
einever
ycasethatnon-
ter
minali
sthefi
rstsy
mbolar
ecall
edright
Linear.

6.Whataret hetwotypesofLi
nearGr
ammar
?
a)RightLi
near
b)LeftLi
near
c)Noneoft hement i
oned
d)Right&Lef tLi
near
ViewAnswer

Answer:
d
Expl
anat
ion:
Lineargr
ammari
sof2t
ypesLef
tandRi
ghtLi
nearGr
ammar

8.WhichTypeofGr ammarisi
t?
S→ AaA→ Aab| λ
a)RightLi
near
b)LeftLi
near
c)Noneoft hementioned
d)Right&LeftLi
near
ViewAnswer

Answer:
b
Expl
anat
ion:
Int
hiscaset
heybot
hcor
respondt
other
egul
arexpr
essi
on(
ab)
*a

•Accept
sast
ri
ngaf
oll
owedby
b{a,
b}
•Acceptsastringcontai
ning
evennumberofa’ sandany
numberofb’ s{a,
b}
•Acceptsastringcontai
ning2
consectut
ivea’sfoll
owedby2
consectut
iveb’s{a,
b}
•Acceptsastringthatdoesnot
contai
n3consecut ivea’
s{a,b}

•Accept
sastringt
hatcont
ains
evennumberof0’
sandev en
numberof1’s
•Endswit
honebandev en
numberofa’
s
•Accept
sstr
ingaab
•Accept
sst
ringthatendsbnot
aa
•Accept
sastri
ngthatmustnot
endwit
haa

You might also like