Consider the grammar G: S → AbB, A → aAb | λ, B → bB | λ. Which language does G generate?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: A. {aⁿbᵐ : n ≥ 0, m > n}
Explanation
A gives aⁿbⁿ, then a mandatory b, then B gives any number of b's: aⁿ b^(n+1+k). So m > n, n ≥ 0.
More Theory of Computation and Compilers questions
- Consider L = {ab, aa, baa}. Which string is NOT in L*?
- Consider the NPDA ({q0, q1, qf}, {a, b}, {1, z}, δ, q0, z, {qf}) with δ(q0, λ, z) = {(qf, z)}, δ(q0, a, z) = {(q1, 11z)}, δ(q1, a, 1) = {(q…
- Consider two PCP instances over {0, 1}, each with lists A and B of three strings. X: A = (1, 10111, 10), B = (111, 10, 0). Y: A = (10, 011,…
- Match List I with List II. List I: (A) Activation record, (B) Location counter, (C) Reference count, (D) Address relocation. List II: (I) L…
- Consider the grammar S → SbS | a. The string abababa has (A) two parse trees (B) two leftmost derivations (C) two rightmost derivations. Wh…
- Match List I with List II. List I: (A) Type 0, (B) Type 1, (C) Type 2, (D) Type 3. List II: (I) Finite automata, (II) Turing machine, (III)…