CSCI 8610 Topics in Theoretical Computer Science Fall 2006 Homework set #3 Due by 5:00 PM on Thursday, October 5 These problems are from Chapter 5 of the notes by Shallit except for the last one, on removing left-recursion. -------------------------------------------------------------------------------- Exc. numbers 4, 5, 6, and 10 (20 points each) Left-recursion (20 points): show how to modify the method given on page 125 of the notes to remove immediate left-recursion so that it works correctly when E --> epsilon is one of the E-rules. You may assume that there is no other left-recursion involving E. The goal then is to modify the E-rules so as to give an equivalent CFG having no left-recursion (immediate or not) involving E. A secondary goal is to avoid an exponential increase in the size of the set of E-rules, as can happen when a wholesale removal of epsilon rules is carried out. The size of a rule with body w is 1+|w|, and these are added up over all E-rules and all X-rules for any new X added in order to remove left-recursion among the E-rules.