The Gateway to Computer Science Excellence

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$

+1 vote

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

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

52,345 questions

60,481 answers

201,804 comments

95,280 users