1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Use set notation to define the language generated by the grammar

  1. Jun 4, 2012 #1
    1. The problem statement, all variables and given/known data
    As the topic states, I need to define a language, for a grammar, using set notation.


    2. Relevant equations
    Here is the grammar:
    S -> aaSB | λ
    B -> bB | b

    3. 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?
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted



Similar Discussions: Use set notation to define the language generated by the grammar
Loading...