edited by
1,952 views
0 votes
0 votes

Convert the following $\text{CFG}$ into an equivalent $\text{CFG}$ in Chomsky normal form,using the procedure given in $\text{Theorem 2.9.}$

  • $A\rightarrow BAB \mid B \mid \epsilon$
  • $B\rightarrow 00 \mid \epsilon$
edited by

1 Answer

1 votes
1 votes
CNF doesn't allows ε-productions

first we've to eliminate ε-productions

A->B | AB | BA | BB | ε

B->00

the language contains ε so A->ε can't be eliminated

Eliminating unit productions

A->00 | AB | BA | BB | ε

B->00

Now converting to CNF

A->CC | AB | BA | BB | ε

B->CC

C->0

Related questions

1 votes
1 votes
1 answer
1
admin asked May 4, 2019
506 views
Show that if $G$ is a $CFG$ in Chomsky normal form$,$ then for any string $w\in L(G)$ of length $n\geq 1,$ exactly $2n − 1$ steps are required for any derivation of $w....
0 votes
0 votes
1 answer
2
admin asked May 4, 2019
369 views
Let $C = \{x\#y \mid x, y\in\{0,1\}^{*}$ and $x\neq y\}.$ Show that $C$ is a context-free language$.$
0 votes
0 votes
1 answer
3
admin asked May 4, 2019
267 views
Let $\Sigma = \{a,b\}.$ Give a $CFG$ generating the language of strings with twice as many $a’s$ as $b’s.$ Prove that your grammar is correct$.$