- #1
EonsNearby
- 43
- 0
Homework Statement
As the topic states, I need to define a language, for a grammar, using set notation.
Homework Equations
Here is the grammar:
S -> aaSB | λ
B -> bB | b
The Attempt at a Solution
Okay, I know that this creates strings that are either empty or consist of an even number of 'a' characters followed by 1 or more 'b' characters.
My first set notation is as follows:
{(a^2m)(b^np) | m ≥ 0, n > 0, 0 < p ≤ m}
Another variation of this I thought of but discarded (b/c I thought it would give negative exponents) is as follows:
{(a^2m)(b^np) | m ≥ 0, n > 0, p ≤ m}
This is a separate set notation I came up with (but I'm less confident about it):
{(a^2m)(b^n) | m > 0, n > 0} U {(a^m)(b^m) | m = 0}
Are either of these correct, and if not, could someone help me come up with a correct one?