Sie sind auf Seite 1von 1

Problem Sheet 2

March 8, 2017

1. Suppose that L is context-free and R is regular. Is L−R necessarily

context-free? What about R − L? Justify your answers.

2. Show that for each CFG G there is a constant c such that if w ∈ L(G) and w 6=
, then w has a derivation of no more than c|w| steps.

3. Show that if L is a CFL over a one-symbol alphabet, then L is regular.

4. Which of the following are CFL's?

(a) {an bn cm |n ≤ m ≤ 2n}


n
(b) complement of {(an bm ) |n ≥ 1}
ww w|w ∈ (a + b)∗
 R
(c)

(d) {bi #bi+1 |bi is i in binary, i ≥ 1}

5. Show that CFL's are closed under the operations

(a) Quotient with a regular set, that is if L is a CFL and R is a regular

set then L/R = {x|∃y ∈ R, xy ∈ L} is a CFL.

(b) INIT

(c) CYCLE

(d) REVERSE

Das könnte Ihnen auch gefallen