CS 390 Solutions to Unit 4 Exercises



pp. 37 - 38

1.38   Since and , the difference between them is L0 which is equal to { }. Hence L* = L+ if and only if is in L.

1.40 (a)   For example let L1 = { a } and L2 = { aa }.

1.43   We are going to prove L* ( L+ )* ( L* )+ ( L* )* L* . That will prove that all those languages are equal.

(1) L* ( L+ )* :
Let x be an arbitrary nonempty string of L*. Then there are strings w1, w2, ..., wk in L such that x = w1w2...wk. Since w1, w2, ..., wk are strings of L, they are also in L+. Hence x = w1w2...wk is in (L+)k. Hence it is in ( L+ )*. If x is an empty string, then it is obviously in ( L+ )*.
Hence L* ( L+ )* holds.

(2) ( L+ )* ( L* )+ :
Let x be an arbitrary nonempty string of ( L+ )*. Then there are strings w1, w2, ..., wk in L+ such that x = w1w2...wk. Since w1, w2, ..., wk are strings of L+, they also belong to L*. Also since x is a nonempty string, at least one wi is nonempty. Hence x is in (L* )m for some non-zero integer m. Hence x is in ( L* )+.
If x is empty, then since the empty string is in L*, it is also in ( L* )+.
Hence ( L+ )* ( L* )+ .

(3) ( L* )+ ( L* )* :
Since X+ X* holds for any language X, it holds for L. Hence ( L* )+ ( L* )* .

(4) ( L* )* L* :
Let x be an arbitrary nonempty string of ( L* )*. Then there are nonempty strings w1, w2, ..., wk in L* such that x = w1w2...wk. Since w1, w2, ..., wk are strings of L*, for each wi there are strings wi1, wi2, ..., wimi in L such that wi = wi1wi2...wimi
Hence x = w11 ...w1m1w21...w2m2...wm1...wmmk . Hence x is in L* .
If x is an empty string, then it is obviously in L* .
Hence ( L* )* L* .