Theory of computations
An Introduction to formal language and automata 6th edition.
Chapter 6: Simplification of context free grammars and normal forms.
Solve the following questions.
Please solve it clearly
use Keyboard not hand writtin answers.
Thank you.
A Contest-Free- Grammer(CFG) is in Chomsky Normal Form(CNF) if the productions are in the form:
S->/AB
A -> BC
A->a
Where S(Start symbol),A,B,C are non terminals, and a is the terminal.
First of all, we should find out whether the start symbol(S) is in right hand side of productin are not.
Here there is no si in righ hand side production.
Start with S->baAB
Now b is replaced with M, then production is S->MaAB, M->b
Now a is replaced with X, then production is S->MXAB,M->b,X->a,
Now XAB is replaced with P, then,S->MP,M->b,P->XAB,X->a,
Now AB is replaced with L, then, S->MP,M->b,P->XL,X->a,L->AB,
Now come to second production A ->bAB|
Replace AB with L(since L->AB from above), and replace b with M, then
A->ML|, M->b,L->AB,
Now come to third production B->BAa|A|
Replace BA with K and a with X, then
B->KX|A| , K->BA,X->a
Now check with Chormsky Normal form rules,
productions are now in Chomsky Normal Form(CNF)
Theory of computations An Introduction to formal language and automata 6th edition. Chapter 6: Simplification of...
Formal Languages & Automata Theory 1411372 Pages 169, 170 Problems: 5, 13. 6.2 Two IMPORTANT NORMAL FORMS 169 heorem 6.7 For every context-free grammar G with λ ¢ L (G), there exists an equivalent grammar G in Greibach noma or EXERCISES 5Convert the grammar / into Chomsky ormal for
Formal Languages and Automata Theory Q2. Give context-free grammars that generate the following language: { w є {0, 1} | w contains at least three 1's)
Theory of Computation 7. Write down the Chomsky Normal Form for the context-free language de- fined by the productions: S bAļaB. A bAA laSla, and B aBB bS b, where S, A, B are nonterminal symbols and a, b are terminal symbol 8. For the context-free grammar Ģ -(X, T, R, S) with X (A, B. C, a, b), T a, b and productions R: SAB |BC, ABAa, BCClb,C AB la, check by applying the CYK Theorem whether the string...