Sketch of Solutions to Exercises

3.4.1 u = aaa, v = a, x = ab, y = b, z = bb. The parsing trees have the following form.

            S|
 |----------------------|
 |
 |
 |                     A|
 |            |-------------------|
 |                                |
 |           S                    |
 |            |                   |
 |   |-----------------|          |
 |   |                            |
 |   |                A           |
 |   |                 |          |
 |   |         |--------------|   |
 |   |                        |   |
 |   |         S              |   |
 |   |    |----------|        |   |
 |   |    |                   |   |
 |   |    |                   |   |
 |   |    |         A|        |   |
 |   |    |      |--------|   |   |
 |   |    |               |   |   |
 |   |    |     S         |   |   |
 |   |    |      |        |   |   |
 |   |    |   |-----|     |   |   |
 |   |    |   |           |   |   |
 |   |    |   |    A      |   |   |
 |   |    |   |     |     |   |   |
 |   |    |   |   |---|   |   |   |

 a   a   a   a   a   b   b   b    b
-----------  --- ------- --- -------
     u       v     x     y      z[source]

wk = a3akabbkb2
= ak+4bk+3
3.4.2

(a) Choose w = ambm+1cm+2

(b) Choose w = ambmbmamambm = amb2ma2mbm

(c) Choose w = ambmambm

(d) Choose w = a2m+1b2ma2m+1b2m

(e) Choose w = ambm#ambm

(f) Choose w = am!

wo = am!-j for some 0 < j < m

For m > 2 we have

(m - 1)! < m((m - 1)! - 1) = m! - m < m! - j < m! - 1 < m!

Thus

(m - 1)! < |wo| < m! for m > 2 and in such a case wo is not in L.

If m = 1 then w = a and w = uvxyz ==> vy = 1 ==> w3 = a3 not in L

If m = 2 then (w = aa and w = uvxyz ==> vy = a ==> w3 = a3 not in L) or (vy = aa ==> w2 = a4 not in L)

==> L not cfl.

3.4.3 Choose (w1, w2) = (ambmcm, dm)

Consider any decomposition

w1 = u1v1x1y1z1

w2 = u2v2x2y2z2

If v2y2 = e then choose k = 0. In such a case (u1v10x1y10z1, u2v20x2y20z2) = (am-j1bm-j2cm-j3, dm) with j1 > 0 or j2 > 0 or j3 > 0.

If v2y2 /= e then choose k = 2. In such a case (u1v12x1y12z1, u2v22x2y22z2) = (am+j1bm+j2cm+j3, dm+j4) with j4 > 0 and either j1 = 0 or j2 = 0 or j3 = 0.