{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Problem_Set_01

# Problem_Set_01 - w 1/7(W ARSDIGITA VNIVERSITY Month 8...

This preview shows pages 1–4. Sign up to view the full content.

A R S D I G I T A V N I V E R S I T Y Month 8: Theory of Computation Problem Set 1 Solutions - Mike Allen and Dimitri Kountourogiannis 1. DFAs a. All strings that contain exactly 4 0s. b. All strings ending in 1101. c. All strings containing exactly 4 0s and at least 2 1s. d. All strings whose binary interpretation is divisible by 5. e. (1.4c) All strings that contain the substring 0101. f. (1.4e) All strings that start with 0 and has odd length or start with 1 and has even length. g. (1.4f) All strings that don't contain the substring 110. 页码， 1/7(W) w 2/19/2011 http://aduni.org/courses/theory/courseware/psets/Problem_Set_01_Solutions.html

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

View Full Document
h. (1.4g) All strings of length at most 5. i. (1.4i) All strings where every odd position is a 1. 2. NFAs a. All strings containing exactly 4 0s or an even number of 1s. (8 states) b. All strings such that the third symbol from the right end is a 0. (4 states) c. All strings such that some two zeros are separated by a string whose length is 4i for some i>=0. (6 states) d. (1.5b) All strings that contain the substring 0101. (5 states) e. (1.5c) All strings that contains an even number of 0s or exactly two 1s. (6 states) f. (1.5e) The language 0*1*0*0 (3 states) 页码， 2/7(W) w 2/19/2011 http://aduni.org/courses/theory/courseware/psets/Problem_Set_01_Solutions.html
3. Converting NFAs to DFAs a. Convert the NFA in 2f into a DFA. b. 1.2a in the text c. 1.2b in the text 4. Discrete Math Review - Proofs L1: The set of strings where each string w has an equal number of zeros and ones; and any prefix of w has at least as many zeros as ones. L2: The set of strings defined inductively as follows: if w is in the set then 0w1 is also in the set; if u and v are in the set then so is uv; and the empty string is in the set. a. Prove that every string in L2 is contained in L1 We can analyze L2 inductively to see that it maintains the property of L1 for each case: 1. The empty set. This is a member of L1, since it satisfies the properties vacuously. 2. 0w1. Assuming that w is in L1, we maintain the equal number of 0s and 1s because we add one of each. We also maintain the prefix condition, since the 0 is added before the 1. 3. uv. Assuming that u and v are both in L1, simply concatenating them together will maintain the equal number of 0s and 1s. The prefix condition is slightly more difficult. We consider the following prefixes: a. PREFIX(u). Since u is in L1, this must be in L1. b. u. Again, since u is in L1, this must be in L1. c. uPREFIX(v). Since u has an equal number of 0s and 1s, and v is in L1, this must maintain the prefix property. b. For those of you who are paying attention, this problem is extemely similar to the stream- crossing ghostbusters problem from algorithms. The proof is by induction on the length of strings in L1: 1. The base case is the empty string. This is in L2 by definition.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 7

Problem_Set_01 - w 1/7(W ARSDIGITA VNIVERSITY Month 8...

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

View Full Document
Ask a homework question - tutors are online