Assignment No 03

You might also like

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

ASSIGNMENT NO.

03
ODD SEM 2022 - 2023

CLASS: T.E. COMPUTER SUBJECT : TCS

ASSIGNED DATE LAST DATE OF EVALUATION


06.10.2022 12.10.2022

Q1.Let G be the grammar

S -> aB | bA
A -> a | aS | bAA
B -> b | bS | aBB
Find leftmost derivation, right most derivation and parse tree for the string “ bbaaabbaba ”

Q2.Consider the following grammar

S -> SAS
S -> b
A -> ba
A -> b
for the sttring “ bbabbbbab ” derive Left most derivation,Rightmost derivation,Parse tree.

Q3. Convert the given grammar to CNF

S -> aSb / bSa / ab /ba / Ɛ


Q4. Convert the following grammer to CNF

S -> abAB
A -> bAB | Ɛ
B -> Baa | A | Ɛ
Q5. Consider the following grammer

S -> ASB | Ɛ
A -> aAS | a
B -> SbS | A | bb
Put the above grammer in Chomsky normal form.

Q6. Convert the following CFG to CNF

S -> bA | aB
A -> bAA | aS | a
B -> aBB | bS | b

Q7. Convert the following CFG to CNF

S -> AACD
A -> aAb | Ɛ
C -> aC | a
D -> aDa | bDb | Ɛ
Q8.Consider the following grammer G = {V,T,P,S},V= {S,X}, T ={A,B} and productions P are

S -> aSb | aX
X -> Xa | Sa | a
convert this grammer in greibach Normal form (GNF).

Q8. Convert the following grammar to GNF.

S -> XA | BB
B-> b| SB
X -> b
A -> a
Q9.Conver the following grammar in GNF

S -> AA | 0
A -> SS | 1

Q10. Conver the following grammar to GNF

S -> XY1 | 0
X -> 00X | Y
Y -> 1X1

You might also like