hw3-sol - ECS 120: Theory of Computation Homework 3 Due:...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the 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

Page1 / 3

hw3-sol - ECS 120: Theory of Computation Homework 3 Due:...

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