Sie sind auf Seite 1von 6

1

Exercise 2.1
a) 0*42

b) The number must either be a one-digit number, a two-digit number different from 42 or have at east three significant digits! 0*"#0$%& ' #1$(&#0$%& ' 4#0$1& ' 4#($%& ' #)$%&#0$%& ' #1$%&#0$%&#0$%&*) c) The number must either be a two-digit number greater than 42 or have at east three significant digits! 0*"4#($%& ' #)$%&#0$%& ' #1$%&#0$%&#0$%&*)

Exercise 2.2
a)
2 1 a a 5 6 b a 7 a 8 2

b) + / 1 2 E 4 6

, -c osure"-1.) , -1,2,(,4,). , move"+,a) , -c osure"-1,0.) , move"+,b) , -c osure"-0.) , move"/,a) , -c osure"-1,0,3.) move"/,b) , -c osure"-0.) , move"1,a) , -c osure"-3.) move"1,b) , -c osure"-.) , move"2,a) , -c osure"-1,0,3,5.) move"2,b) , -c osure"-0.) , move"E,a) , -c osure"-5.) move"E,b) , -c osure"-.) move"4,a) , -c osure"-1,0,3,5.) move"4,b) , -c osure"-0.) move"6,a) , -c osure"-.) move"6,b) , -c osure"-.)

, -1,0,2,(,4,). , -0. , -1,0,3,2,(,4,). ,1 , -3. , -. , -1,0,3,5,2,(,4,). ,1 , -5. , -. ,4 ,1 , -. , -.

7tates 4 and 6 are acce8ting since the9 contain the acce8ting :4+ state 5. ;n diagram form, we get!
A a b B b C a b a E D b a G a F a

Exercise 2.)
4irst 9, u must note that there are no dead states, second 9 u divide into grou8s of acce8ting and non-acce8ting states! 0 , -0. + , -1,2,(,4. :ow, chec< if grou8 + is consistent! + 1 2 ( 4 a + + + + b $ $ 0 0

= see that u must s8 it + into two grou8s! / , -1,2. 1 , -(,4. :ow chec< these, starting with / / a b 1 / $ 2 1 $ 7o u need to s8 it / into it individua states. The on 9 non-sing eton grou8 eft is 1. so to chec<! 1 a b ( 1 0 4 1 0 This is consistent, so states ( and 4 can be combined into a grou8 1. The resu ting diagram is!

a b a 1

b a C

Exercise 2.7
a. a a b a b a b

0
b. a

2
a

2
a

b b

c.
b

1
bb b a

0
a

Exercise 2.5

Exercise 2.% a) The number must be 0 or end in two >eroes!


0 0 0 1 0 2

1 1

b) ?e use reading a 0 is the same as mu ti8 9ing b9 2 and reading a 1 is the same as mu ti8 9ing b9 two and adding 1. 7o of u have remainder m, reading a 0 wi give u remainder "2m)mod ) and reading a 1 wi give u remainder "2m*1)mod ). = can now ma<e the fo owing transition tab e! m 0 1 2 ( 4 01 01 2( 40 12 (4

The state corres8onding to m , 0 is acce8ting. ?e must a so start with remainder 0, but since the em8t9 string isn@t a va id number, we can@t use the acce8ting state as start state. 7o we add an extra start state 0A that has the same transitions as 0, but isn@t acce8ting!

c) ;f n , a *2b, the binar9 number for n is the number for a fo owed b9 b >eroes. ?e can ma<e a 24+ for an odd number a in the same wa9 we did for ) above b9 using the ru es that reading a 0 in state m gives us a transition to state "2m)mod a and reading a 1 in state m gives us a transition to state "2m*1)mod a. ;f we "for now) ignore the extra start state, this 24+ has a states. This is minima because a and 2 "the base number of binar9 numbers) are re ative 8rime "a com8 ete 8roof reBuires some number theor9). ;f b , 0, the 24+ for n is the same as the 24+ constructed above for a, but with one extra start state as we did for the 24+ for ), so the tota number of states is a*1. ;f b C 0, we ta<e the 24+ for a and ma<e b extra states! 01, 02, . . . , 0b. + of these have transitions to state 1 on 1. 7tate 0 is changed so it goes to state 01 on 0 "instead of to itse f). 4or i , 1, . . . , b$1, state 0i has transition on 1 to 0"i*1) whi e 0b has transition to itse f on 0. 0b is the on 9 acce8ting state. The start state is state 0 from the 24+ for a. This 24+ wi first recogni>e a number that is an odd mu ti8 e of a "which ends in a 1) and then chec< that there are at east b >eroes after this. The tota number of states is a*b. 7o, if n is odd, the number of states for a 24+ that recognises numbers divisib e b9 n is n, but if n , a D 2b, where a is odd and b C 0, then the number of states is a*b. Exercise 2.10 a)

's , s because E")=E"s) , F=E"s) , E"s) s , because there are no strings in f to 8ut in front of strings in s s , because there are no strings in f to 8ut after strings in s * , because * , '* , ' , b)

c) +s there can now be dead states, the minimi>ation a gorithm wi have to ta<e these into consideration see section 2.5.2. Exercise 2.11 ;n the fo owing, we wi assume that for the regu ar anguage E, we have an :4+ : with no dead states. 1 osure under 8refix. ?hen : reads a string w E, it wi at each 8refix of w be at some state s in :. /9 ma<ing s acce8ting, we can ma<e : acce8t this 8refix. /9 ma<ing a states acce8ting, we can acce8t a 8refixes of strings in E. 7o an automaton :8 that acce8ts the 8refixes of strings in E is made of the same states and transitions as :, with the modification that a states in :8 acce8ting. 1 osure under suffix. ?hen : reads a string w E, where w , uv, it wi after reading u be in some state s. ;f we made s the start state of :, : wou d hence acce8t the suffix v of w. ;f we made a states of : into start states, we wou d hence be ab e to acce8t a suffixes of strings in E. 7ince we are on 9 a owed one start state, we instead add a new start state and -transitions from this to a the o d states "inc uding the origina start state, which is no onger the start state). 7o an automaton :s that acce8ts a suffixes of strings in E is made of the same states and transitions as : 8 us a new start state sA0 that has e-transitions to a states in :. 1 osure under subseBuences. + subseBuence of a string w can be obtained b9 de eting "or Gum8ing over) an9 number of the etters in w. ?e can modif9 : to Gum8 over etters b9 for each transition sct on a etter c add an -transition set between the same 8air of states. 7o an automaton :b that acce8ts a subseBuences of strings in E is made of the same states and transitions as :, with the modification that we add an -transitions sct whenever : has a transition sct. 1 osure under reversa . ?e assume : has on 9 one acce8ting state. ?e can safe 9 ma<e this assum8tion, since we can ma<e it so b9 adding an extra acce8ting state f and ma<e e-transitions from a the origina acce8ting states to f and then ma<e f the on 9 acce8ting state. ?e can now ma<e N acce8t the reverses of the strings from L b9 reversing a transitions and swa8 start state and acce8ting state. 7o an automaton Nr that acce8ts a reverses of strings in E is made the fo owing wa9!

1. 1o89 a states "but no transitions) from N to Nr. 2. The co89 of the start state s0 from N is the on 9 acce8ting state in Nr. (. +dd a new start state s0 to Nr and ma<e -transitions from s0 to a states in Nr that are co8ies of acce8ting states from N. 4. ?hen N has a transition sct, add a transition tAcsA to Nr, where sA and tA are the co8ies in :r of the states s and t from N.

Das könnte Ihnen auch gefallen