懂计算理论(正则表达式,图灵机,自动化)求解
两道题目 求解答
1. Let R1 = (a|b)∗(aa|bb) and R2 = (bb|aa)(b|a)+ be two regular expressions. The operator + is a generalization of
Kleene-star that requires one or more repetitions, that is, when R is a regular expression, R+ = RR∗.
(a) Give a word w1 such that w1 ∈ L(R1) ∩ L(R2).
(b) Give a word w2 such that w2 ∈ L(R1) \ L(R2).
(c) Give a word w3 such that w3 ∈ L(R2) \ L(R1).
(d) Give a regular expression R3 such that L(R3) = L(R1) ∪ L(R2). (e) Give a regular expression R4 such that L(R4) = L(R1) ∩ L(R2).
2. Let R′ be a formalism to express languages obtained by excluding the Kleene-star * operation from regular expres- sions.
(a) Prove that R′ is strictly less expressive than regular expressions.
(b) Why R′ can only produce finite languages. Explain briefly.
(c) Let “&” be a unary operator such that R& = RR, where R is a regular expression. Will including the “&” operator in regular expressions increase their expressivity? Explain briefly.