November 22, 1995 cs330 - Discrete Structures =========================== Homework #5 - Solutions ======================= 1 = a) LM = {bba, ba, b, abbbba, abbba, abbb, bbba, bba, bb} b) ML = {bba, bbaabb, bbab, ba, baabb, bab, b, babb, bb} c) L^0 = {E} L^1 = L(L^0) = {E, abb, b}{E} = {E, abb, b} L^2 = L(L^1) = {E, abb, b}{E, abb, b} = {E, abb, b, abbabb, abbb, babb, bb} d) M^0 = {E} M^1 = {bba, ba, b} M^2 = {bba, ba, b}{bba, ba, b} = = {bbabba, bbaba, bbab, babba, baba, bab, bbba, bba, bb} 2 = a) L = {b, ba} b) L = {E, ba} c) L = {E, b, ab} 3 = a) L(a+b) = L(a)UL(b) = {a}U{b} = {a, b} b) L(a+bc) = L(a)UL(bc) = L(a)U(L(b)L(c)) = {a}U({b}{c}) = = {a}U{bc} = {a, bc} c) L(a+b*) = L(a)UL(b*) = L(a)UL(b)* = = {a}U{b}* = {a}U{E, b, bb, bbb, bbbb, .., b^n, ...} = {E, a, b, bb, bbb, ...} d) L = {c, a, ab, abb, abbb, ..., ab^n, ..} e) L = {a, ab, abb, abbb, .., ab^n, .., b, bc, bcc, ..., bc^m, ..} m, n >= 0, natural numbers f) L = {a^mbc^n | m, n >=0 } U {ac} In plain English: either the string ac or strings starting with any number of a, followed by a b, followed by any number of c. 4 = a) a+b+c b) a(aa)* c) (a*)b(c*) d) a* + b* + c* 5 = 0 + 1(0+1)* 6 = a) ((a+b)(a+b))* which is the same as (aa+ab+ba+bb)* b) (a+b)*aba(a+b)* c) see 4b