Spring 2001, CSE 428: Quiz 1.4 - 18 Jan 2001

Solution

  1. The right answer is 5: The language of all the strings of the form   ab, abab, ababab,   etc.

  2. The right answer is 4: A grammar is ambiguous if there are two different derivation trees for the same string

    1. "-" is right associative false
    2. "^" has precedence over "-" true
    3. The grammar is ambiguous false

    1. 2 ^ 2 ^ 2 is derivable
    2. 16 is not derivable

  3.           A
              |
              B
             /|\
            / | \
           C  ^  B
           |    /|\
           |   / | \
           1  C  ^  B
              |     |
              2     C
                    |
                    0