# Homework Solution: Attempt to give unambiguous BNF grammars to define each of the following collectio…

Attempt to give unambiguous BNF grammars to define each of the following collections of sentences (i.e., start symbol ): (a) {a^m b^m: m > 0} (b) {a^m b^n: m, n > 0} (c) {a^m b^m c^m: m > 0} (d) {a^m b^m c^m: m, n > 0} (e) {a^m b^m b^n: m, n > 0}

a){ambm:m>0}

Attempt to surrender clear BNF grammars to elucidate each of the subjoined collections of sentences (i.e., initiate kind ): (a) {a^m b^m: m > 0} (b) {a^m b^n: m, n > 0} (c) {a^m b^m c^m: m > 0} (d) {a^m b^m c^m: m, n > 0} (e) {a^m b^m b^n: m, n > 0}

## Expert Rejoinder

a){ambm:m>0}

ans)

<s> ::= <expr>

<expr> ::= <A> <expr> <B> | <A><B>

<A> ::= “a”

<B> ::= “b”

b){ambn:m,n>0}

ans)

<s> ::= <expr>

<expr> ::= <A><B>

<A> ::= “a”<A> | “a”

<B> ::= “b”<B> | “b”

c) {ambmcm:m>0}

ans)we can not attributable attributable attributable attributable attributable attributable attributable attributable attributable attributable attributable attributable transcribe the BNF grammer control this conversation why beacuse it is not attributable attributable attributable attributable attributable attributable attributable attributable attributable attributable attributable attributable a tenor at-liberty conversation

d) { ambnam : m,n>0}

ans)

<s> ::= <expr>

<expr> ::= <A><B><A>

<A> ::= “a”

<B> ::= <A><B><A> | <B> “b” | “b” | epsilon

e) {ambnambn:m,n>0}

ans) surrendern conversation is not attributable attributable attributable attributable attributable attributable attributable attributable attributable attributable attributable attributable tenor at-liberty conversation so we can not attributable attributable attributable attributable attributable attributable attributable attributable attributable attributable attributable attributable constuct the BNF grammer to it