This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: ECS 120: Theory of Computation Homework 3 Due: Oct. 19, beginning of class or 1pm in 2131 Kemper Problem 1. 1.19 in Sipser. 0,1 1 1 1 q0 q1 q2 q3 1 1 1 1 q0 q1 q2 q3 q4 H 0,1 q0 q1 Problem 2. 1.48 in Sipser. Soln: A DFA cannot count the number of occurences of 01a and 10s, so we need a trick. Notice that any string s { , 1 } is one and only one of the following, where n 1 and i j 1: (a) (b) 0 i 1 1 i 2 i 3 . . . 1 i n 1 i n (begins and ends with a 0) (c) 1 i 1 i 2 1 i 3 . . . i n 1 1 i n (begins and ends with a 1) (d) 0 i 1 1 i 2 i 3 . . . i n 1 1 i n (begins with a 0 and ends with a 1) (e) 1 i 1 i 2 1 i 3 . . . 1 i n 1 i n (begins with a 1 and ends with a 0) Now, strings of the form (a), (b) and (c) are in D , and strings of the form (d) and (e) are not in D (just count the number of occurences of 01 and 10 in each). Therefore, a string x { , 1 } is in D if and only if x starts and ends with the same character or x = . So D is described by the regular expression...
View
Full
Document
 Fall '07
 Filkov

Click to edit the document details