Question: Remember our rewriting game in the first lecture. (a) Given the same input, ie, a sequence of characters starting with $ and ending with #,

 Remember our rewriting "game" in the first lecture. (a) Given the

Remember our rewriting "game" in the first lecture. (a) Given the same input, ie, a sequence of characters starting with $ and ending with #, and any combination of 0s and is in-between, specify a set of rewrite rules that determine whether the string contains the same number of Os and 1s. Here is some sample "outpnt" $0011# should be rewritten as $# $1001# should be rewritten as $# $110110# should be rewritten as $11# $0001100# should be rewritten as $0004 In other words, the $# indicates that the input string has the same number of Os and 1s. If the string does not contain the same number of Os and 1s, the resulting string shows how many more Os or 1s there are in the input string. (b) Is there at most only a single rewrite rule that can be applied at any point in time during the rewrite process? Explain. Remember our rewriting "game" in the first lecture. (a) Given the same input, ie, a sequence of characters starting with $ and ending with #, and any combination of 0s and is in-between, specify a set of rewrite rules that determine whether the string contains the same number of Os and 1s. Here is some sample "outpnt" $0011# should be rewritten as $# $1001# should be rewritten as $# $110110# should be rewritten as $11# $0001100# should be rewritten as $0004 In other words, the $# indicates that the input string has the same number of Os and 1s. If the string does not contain the same number of Os and 1s, the resulting string shows how many more Os or 1s there are in the input string. (b) Is there at most only a single rewrite rule that can be applied at any point in time during the rewrite process? Explain

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!