Friday, 25 October 2013

2.28 b. { w | the number of a's and b's in w are equal}

2.28 b. { w | the number of a's and b's in w are equal}

Solution:

S → aSbS | bSaS | ε

Don't ask me why? Work it out.

1 comment:

  1. Unfortunately, this is incorrect. The following paths give the same result,
    S -> aSbS -> aSbASb -> abab
    S -> aSbS -> abSaSbS -> abab

    ReplyDelete