This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 2) For a) b) (It 1'53 .3 review of regular languages. 7' “r *9 "r = rajowing languages L, state whether or not L is regular. Prove your answer:
=" * : 31': where x, y e { O, 1}* and ixlly! as 0}. (Let  mean integer multiplication). i_l._l oi _.'_\o H» Regular. For {.15  5:; to be divisible by 5, either lx or [vi (or both) must be divisible by 5. So L is deﬁned by
the thieving regtﬂar expression:  .e i a, green u 1)* u (0 u 1)*#((D L) 1)5)*, where (O u if is simply a shorthand for writing (0 u 1)
ﬁve times in a row. {W 5 {a b}* ; w : W23 m 2 b4 : izg, andz : x with every a replaced by b and every b replaced by a}.
Example: abbbabbaa e L, withx= abb,y= bab, andz : baa. Not regular, which we’ll showby pumping. Let w m akakbk. This string is in L since 3: = all, y = a’i and z = y (from the pumping theorem) 2 a" for some nonzero p. Let g = 2 (ie, we pump in once); lfp is not
dhisfble by 3, then the resulting string is not in L because it cannot be divided into three equal length
segments. pr = 31' for integer i, then, when we divide the resulting string into three segments of equal
length, each segment gets longer by 1' characters. The ﬁrst segment is still all a’s, so the last segment must
remain all b’s. But it doesn’t. It grows by absorbing a’s ﬁom the second segment Thus 2 no longer e x
with every a replaced by b and every b replaced by a. So the resulting string is not in L. ' ‘r‘
3.; {w e {1}* : wis,for semen 2 1,theunaryencoding of 10"}. (SOL: {1111111111, 1100, 11900, ...}.) Not regular, which we can prove by pumping. Let w = l‘, where t is the smallest integer that is a power of
ten and is greater than k. y must be 1” for some nonzero p. Clearly, p can be at most t. Let g = 2 (i.e.,
pump in once). Thelength of the resulting suing s is zitmost 21‘. But the next power of 10 is 10f. Thus 3
cannot be in L.  each of the following claims, state whether it is T rue or False. Prove your answer.
IfL = L; L2 and L is regular then L1 and L2 must be regular. False. Leif,
regular. (“1(ﬁL) is regular) e (L is regular). 2 {aP: 2 Sp andp is prime}. Let L2: 31*. L ={a1’1p 2 2}, which is regular. But L1 is not True, since —.(—.L) = L. (L1 — L2 is regular) —> (L1 is regular).
False. ABEII ’ AliBn = 25. :13 is regular) e (L is regular). True. since the regular languages are closed under reverse and reverse is a self inverse. So, if LR is regular
ien so is (L55. which is L. ' . :7 :j; 11,1 1) {a”b” : a 2 0} must not regular. 3) False. Let L I a*b*. L U {a”b" : n 2 0} = a*b*, which is regular.
Given any Ianguage L, it cannot be true 111th » {a"b" : n 2 O} is regular.
False. LetL = {5330" : i2 2'0}. '13  {a”b" : n 2 O} ‘—" 25, which is regular. The ﬁnite languages are closed under Kleene star. False; Counterexample: 3 Liatic1 __= {61}. L1 is ﬁnite. _
L ~—'— Lﬁ; L : a*, which is inﬁnite. ...
View
Full Document
 Spring '08
 Rich

Click to edit the document details