Ilovepdf Merged
Ilovepdf Merged
A→ SbA | SS | ba
Find
a) Leftmost derivation
b) Rightmost derivation
c) Parse tree
S → a │ Sa │ b │ bS .
Construct a CFG
S -> Aa|B|c
B -> A|bb
A -> a|bc|B
B) Explain Chomsky classification of grammar. Remember 6
C) When does context free grammar is said to be in Chomsky Normal Understand 6
Form(CNF)? Write steps to convert context free grammar into CNF.
(Level/CO) Marks
Q. 1 Solve Any Two of the following. 12
A) Explain in brief FSM Properties and Limitations? Write Applications of Understand / 6
FSM?
CO-1
B) Construct Mealy Machine for the given Moore Machine? Apply/ CO-2 6
Present state Next State Output
a=0 a=1
→q1 q1 q2 0
q2 q1 q3 0
q3 q1 q3 1
C) Understand/ 6
Design a FSM to check whether a given decimal number is divisible by 5?
CO-1
b. A → bS / aAAb
1
Q. 3 Solve Any Two of the following. 12
A) Consider a left linear grammar as given below − Apply / CO-3 6
a. S→ Sa|Abc
b. A→ Sa|Ab|a
a. S → 0S1 | A
b. A → 1A0 | S | ε