# XHWans - University of Central Florida School of Computer...

This preview shows pages 1–2. Sign up to view the full content.

University of Central Florida School of Computer Science COT 4210 Spring 2004 Prof. Rene Peralta Extra credit HW: answers to selected problems 1. Consider the following grammar over Σ = { a, b } : S AB ; A AS + Sb + a ; B BS + aA + λ ; Convert the grammar to Chomsky Normal Form (please use rules U a and V b ). answer: Besides some simpler transformations, we must remove unallowed λ -productions and chain rules. The general technique I taught in class is to remove a given production P , add redundant productions until P itself becomes redundant. Then remove P . First deal with the mixed (terminals and variables) terms using U a and V b : S AB ; A AS + SV + a ; B BS + UA + λ ; To make B λ redundant, add S A and B S : S AB + A ; A AS + SV + a ; B BS + UA + S . To make S A redundant, add S AS + SV + a . Reasoning: when the rule S A is used in a derivation, the variable A must at some point later be substituted for AS or SV or a .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern