4. Find a CFG for each of the following non-regular languages and write the parse tree or the derivation for each of the give

4. Find a CFG for each of the following non-regular languages and write the parse tree or the derivation for each of the given strings: L set of words in which the number of a’s is twice the number of b’s. Please note that the empty string A belongs to L. (4 points) a. w ab5a aba3 and w babaabaaba3 Parse tree or derivation tree for b. L-{a”b m>=n; n=1,2,3…… } (4 points) Parse tree or derivation tree for w ab5 and c. L{a”bc p-2n+m, n 1,2,3,….. and m-0,1,2,…… } (4 points) wl a2b’c w2=a b’c3 and Parse tree or derivation tree for d. L ab”c p=2n+3m; n 0,1,2,3,….. and m=1,2,3,………} (4 points) wl ab’c w2 a’c Parse tree or derivation tree for and



Source link

Leave a Reply

Your email address will not be published.