Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Convert the following CFG into an equivalent CFG in Chomsky normal form, using the procedure given in Theorem 2.9.

ABAB|B|εB00|ε

Short Answer

Expert verified

Answer

SBD|BB|AB|CC|BA|εABD|BB|AB|CC|BABCCC0DAB

Step by step solution

01

Define Chomsky Normal Form (CNF)

In theory of computation, context free grammar (CFG) generates the possible strings in a language. CFG is in Chomsky normal form (CNF) if the production rules in it are of the following forms:

ABCAa

02

Add a new start symbol S

SAABAB|B|εB00|ε

03

Remove ε-productions.

The two ε-productions are:

AεBεRemove,AεSA|εABAB|BB00|εRemoveBεSA|εABAB|AB|BA|BB|B|εB00Aεiscreatedagain.RemoveAεABAB|BB|AB|B|BA|εB00RemoveAεagain.SA|εABAB|BB|AB|B|BAB00

04

Remove the unit productions.

The two-unit productions are:

SARemoveSA.SBAB|BB|AB|B|BA|εABAB|BB|AB|B|BAB00RemoveSB.SBAB|BB|AB|00|BA|εABAB|BB|AB|B|BA3B00RemoveABSBAB|BB|AB|00|BA|εABAB|BB|AB|00|BAB00

05

Add new variables

SBD|BB|AB|CC|BA|εABD|BB|AB|CC|BABCCC0DAB

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Study anywhere. Anytime. Across all devices.

Sign-up for free