Discrete Event Systems
暂无分享,去创建一个
a) Sometimes, even simple grammars can produce tricky languages. We can interpret the 1s and 2s of the second production rule as opening and closing brackets. Hence, L(G) consists of all correct bracket terms where at least one 0 must be in each bracket. Choose w = 102 ∈ L(G). Let w = xyz with |xy| ≤ p and |y| ≥ 1 (pumping lemma). Because of |xy| ≤ p, xy can only consist of 1s. According to the pumping lemma, we should have xyz ∈ L for all i ≥ 0. However, by choosing i = 0 we delete at least one 1 and get a word w′ = 1p−|y|02p with |y| ≥ 1. w′ is not in L since it has fewer 1s than 2s. This means that w is not pumpable and hence, L(G) is not regular.