(a) {an bm : m
I'm going to assume you mean {a^n . b^m : m < n, m, n ∈Z+}, where Z+ denotes the nonnegative integers and x^m means 'x to the power m' ('xxx...x, m times', or 'm x's in a row').
The nonterminal symbols are {S, B}, S being the start symbol, the alphabet is {a, b}, and the production rules are
(i) S → aB,
(ii) B → aBb,
(iii) aB → a.
Note that this never allows us to have as many or more b's than a's in a string. Let's do an example. To generate a³ b², we apply (i), then apply (ii) twice, then (iii):
S → aB → aaBb→ aaaBbb → aaabb (= a³ b²).
(b) I freely admit that I don't understand what you mean by this. If you edit the question to explain properly, I'll come back and have a go at it.
(And by explain, I mean tell us what the * in {a,b}* is, and what the R in w = wR indicates, etc.)
2007-04-13 22:19:40
·
answer #1
·
answered by MHW 5
·
0⤊
0⤋