For each one of the following languages construct a contextf

For each one of the following languages construct a context-free grammar that generates that language: {0, 1}*. {0^m 1^n | m greaterthanorequalto n and m - n is even}. The complement of {0^n 1^n | n greaterthanorequalto 0} over the alphabet {0, 1}. The set of strings in {0, 1}* which are not palindromes: {w element {0, 1}* | w notequalto w^R}.

Solution

a) S->0S/1S/0/1/e

b) S-> 00/00A/e

A->0A1/e

c) S S1 | S2

S1 0S11 | T | U

S2 R10R

T 0T | 0

U U 1 | 1

R RR | 0 | 1 | e

d) S-> 0S0/1S1/D

D-> 1A0/0A1

A-> 0A/1A/ e

Here e means Epsilon

 For each one of the following languages construct a context-free grammar that generates that language: {0, 1}*. {0^m 1^n | m greaterthanorequalto n and m - n i

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site