assignment 1 theory of computation fall 11

1
Theory of Computation Fall 2011 Assignment 1 Due Date: September 14 th , 2011 1) Let L 1 = {peach, apple, cherry} and L 2 = {pie, cobbler, }. List the elements of L 1 L 2 in lexicographic order. 2) For each of the following languages L, give a simple English description. Show two strings that are in L and two that are not (unless there are fewer than two strings in L or two not in L, in which case show as many as possible). a) L = {w {a, b}* : exactly one prefix of w ends with a}. b) L = {w {a, b}* : all prefixes of w ends with a}. 3) For each of the following statements, state whether it is True or False. Prove your answer. a) L 1 , L 2 (L 1 = L 2 iff L 1 * = L 2 *). (Hint: Try to find counterexample) b) Every infinite language is the complement of a finite language. (Hint: Try to find counterexample) c) L ((L R ) R = L). d) L 1 , L 2 , ((L 1 L 2 )* = L 1 * L 2 *). (Hint: Try to find counterexample) e) L 1 , L 2 ((L 1 L 2 )* = L 1 * L 2 *). (Hint: Try to find counterexample) f) L 1 , L 2 , L 3 ((L 1 L 2 ) L 3 = (L 1 L 3 ) (L 2 L 3 )). (Hint: Try to find counterexample) g) L ((L + )* = L*). (Hint: Consider definition of L + ) 4) Let ∑ = {0,1}, how many strings are there in the following languages a) <=0 b) =2 c) <=3

Upload: eric-barton

Post on 28-Nov-2014

162 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Assignment 1 Theory of Computation Fall 11

Theory of Computation

Fall 2011

Assignment 1

Due Date: September 14th

, 2011

1) Let L1 = {peach, apple, cherry} and L2 = {pie, cobbler, }. List the

elements of L1L2 in lexicographic order.

2) For each of the following languages L, give a simple English description. Show two

strings that are in L and two that are not (unless there are fewer than two strings in L

or two not in L, in which case show as many as possible).

a) L = {w {a, b}* : exactly one prefix of w ends with a}.

b) L = {w {a, b}* : all prefixes of w ends with a}.

3) For each of the following statements, state whether it is True or False. Prove your

answer.

a) L1, L2 (L1 = L2 iff L1* = L2*). (Hint: Try to find counterexample)

b) Every infinite language is the complement of a finite language. (Hint: Try to find

counterexample)

c) L ((LR)R = L).

d) L1, L2 , ((L1 L2)* = L1* L2*). (Hint: Try to find counterexample)

e) L1, L2 ((L1 L2)* = L1* L2*). (Hint: Try to find counterexample)

f) L1, L2, L3 ((L1 L2) L3 = (L1 L3) (L2 L3)). (Hint: Try to find

counterexample)

g) L ((L+)* = L*). (Hint: Consider definition of L

+ )

4) Let ∑ = {0,1}, how many strings are there in the following languages

a) ∑<=0

b) ∑=2

c) ∑<=3