Escolar Documentos
Profissional Documentos
Cultura Documentos
b
m
c
n
I E m &n2.
Q.4. /onsider the foowin3 "roductionK N0aR IbA.
A0aNIbAAIa
R0bN IaRRIb
For the strin3 aaabbabbba,find0
1* eftmost derivation
2* ri3htmost derivation
#* "arse tree.
Q.8. Nhow that i* N0aRIab, A0aARIa, R0ARbIb
ii*N0NENI NDNI aIb
iii* N0aNIS, S0aSIa is ambi3uous.
Q.:.@he foowin3 3rammar 3enerate re3uar e!"ression with o"erand S and T and binar, o"erator. E, 0,
And D.
95 E99I D99 I 099 I! I,.
'a* Find eftmost and ri3htmost deviation, and deviation tree for the strin3 ED 0 !,!,.
'b* Prove that this 3rammar is unambi3uous.
Q.;. Net of a strin3s of baanced "arenthesis i.e. each eft "arenthesis has a matterin3 ri3ht "arenthesis
and a "airs if matchin3 "arenthesis are "ro"er, nested.
Q.<. Proof Uit is an unambi3uous 3rammar0
N06AI6R
A01AIB
q6
q1
q
#
6,
1
q2
q
.
q4
6
6,
1
6
qV6 qV1
6,
1
6
qV
2
R06RI1
Q46. +9 '661E1*D'61*Dobtain the conte! free 3rammar.
Q41. Cbtain the 3rammar to 3enerate an3ua3e U
$&1 wI na'w*&nb'w*2
Q42. Cbtain a 3rammar to 3enerate the an3ua3e0
$&1ww
+
Iw - 1a,b2D
Q4#. Cbtain a 3rammar to 3enerate the an3ua3e0
$& 16
i
1
M
Ii W M, iL6 and ML62.
Q4.. /onstruct 3rammar 3eneratin3 1!!I! - 1a,b2D2
Q44. /onstruct 3rammar 3eneratin3 16
n
1
2n
I nL 12.
Q48. /onstruct 3rammar 3eneratin3 1a
i
b
M
c
?
I i, M, ? L1, iWM&?2
Q4:. /onsider /F= = defines the "roductionsK
N0aNbNI bNaNIB
Prove that $'=* is the set of a strin3s with an equa number of a>s and b>s.
Module-)
Q4;. +educe the foowin3 3rammar = to /NF.
= is N0aAD
A5aRIbAR
R5b.
D5d.
Q4<. Find whether the foowin3 an3ua3e are conte!t free or not.
'i* $&1a
"
I" is "rime2.
'ii* 1a
m
b
m
c
n
Im Q n Q 2m2
Q86. Find whether the foowin3 an3ua3es are conte!t free or not
16
i
1
M
I M&i
2
2
Q81. /onvert the 3rammar N5AR, A0 RNIb
R5NAIa in to =NF.
Q82.Nhow that $& 1a
n
b
n
c
n
'nL1* is not conte!t free but conte!t sensitive.
Q8#. What do ,our mean b, reduce 3rammar? Find reduce 3rammar equivaent to the
foowin3. =rammar5
N5aAa.
A5NbIbccIDaA.
/5abbIDD
D5aDA.
R5ac.
Q8..Find the reduce 3rammar equivaent to the 3rammar N0aAa, A0bRR, R0ab, /0aR.
Q84.=iven the 3rammar N0AR, A0a, R0cIb, /0D,D09,90a, find the equivaent 3rammar which is reduced
and has no unit "roduction.
Q88.+educe the 3rammar into =NF
'a* 959E@ I@
@5@DF +
F '9* JD
'b* N5NN
N56N1
N561.
Q8:.Find the +e3uar 3rammar of the foowin3K
i* N0NNNIaIab
ii* N0AAN IabIaab
iii* A0abIbaIB
Q8;. 9eminate useess s,mbo for 3rammarK
i*N0aNIAI/
A0a
R0aa
/0a/b
ii*N0aNIbA
A0aAIB
iii*A06RI1DI6
R01/I6D
/06RI1DI6
D06DI1D
Q8<.Draw an NFA acce"tin3 the an3ua3e 3enerated b, 3rammarK
N0abAIbRIaba
A0bIaRIbA
R0aRIaA
Q:6. Re3in with the 3rammar
N0ANRIB
A0aANIa
R0NbNI AI bb
a* Are there an, useess "roduction? 9eminate them if so.
b* 9iminate B "roduction.
c* Put the 3rammar into /homs?, norma form.
Module-5K
Q:1./onvert the 3rammar
N56N1IA
A51A6INI -
to a PDA that acce"t the same an3ua3e b, em"t, stac?.
Q:2. 'i* Desi3n PDA that acce"ts.1wcw
+
Iw is in '6E1*D2 b, em"t, stac?
'ii* Desi3n PDA that acce"ts.16
n
1
2n
InL 12 b, em"t, stac?
iii*Desi3n PDA that acce"ts.1a
n
b
n
In L62 b, em"t, stac?.
iv* Desi3n PDA that acce"ts.1a
n
b
m
a
nEm
2
Q:#./onstrut the PDA that acce"t the an3ua3e 3enerated b, /F =5
N5NENIND
NIid.
Q:.. Desi3n PDA that acce"ts1a
n
b
m
a
n
I m,n L 12
Q:4. Desi3n PDA that acce"t $%?&1wIw - 'a,b*D and na'w*&n b'w*2.
Q:8.Prove that the set acce"ted b, are /F$>s
N0aA
N0aAR/IbRIa
R0b
/0c
Q::. /ostruct PDA from an3ua3eK a
!
b
,
c
FI
I !EF&,.
Module-*(
Q:;. Desi3n @% for the foowin3 an3ua3e0
'a* 1a
n
b
n
c
n
I nL12
'b* 1ww
+
Iw is an, strin3 of C>s and 1>s2.
Q:<. Desi3n @% for foowin30000000000
'a* @'!*& 1!!, ! - 'a,b*D2
'b* @'n*& nE1.
Q;6. 'a* Desi3n @% to obtain the reverse strin3 from the 3iven in"ut strin3 over
(& 1a,b2.
'b* Desi3n @% to add two inte3er number.
Q;1. Desi3n a @% to com"ute 1>s com"ement.
Q;2. Jf a an3ua3e $ is acce"ted b, @% then $ is acce"ted b, two stac? @%.
DDDDDDDDDDDDDDDDDDDDDDDD9NDDDDDDDDDDDDDDDDDDDDDDDDD