6 - 2 For a b(It 1'53.3 review of regular languages 7 “r*9"r = raj-owing languages L state whether or not L is regular Prove your answer

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2) For a) b) (It 1'53 .3 review of regular languages. 7' “r *9 "r = raj-owing languages L, state whether or not L is regular. Prove your answer: =" * : 31': where x, y e { O, 1}* and ixl-ly! 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 defined by the thieving regtflar 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) five 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 show-by 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 first 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 fiom 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). The-length of the resulting suing s is zit-most 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(fiL) 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 finite languages are closed under Kleene star. False; Counterexample: 3 Lia-tic1 __= {61}. L1 is finite. _ L- ~—'— Lfi; L : a*, which is infinite. ...
View Full Document

This note was uploaded on 03/25/2008 for the course CS 341 taught by Professor Rich during the Spring '08 term at University of Texas at Austin.

Page1 / 2

6 - 2 For a b(It 1'53.3 review of regular languages 7 “r*9"r = raj-owing languages L state whether or not L is regular Prove your answer

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online