This preview shows pages 1–3. 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: CSE105 Homework Number 1 SOLUTIONS October 6, 2010 Guidelines: solutions to the homework should be submitted electronically, following the instructions on the class website. As part of your solutions to this assignment you should submit: 1. A le with the text of your solutions to all 4 problems, in pdf format. 2. 4 j ap les containing the automata for problems 2 and 3. The main le should be in pdf format (no doc les, etc.) and be clearly divided into 4 sections (and respective subsections) corresponding to the 4 problems. There is no j ap le for problems 1 and 4. All your les (writeup.pdf,2a.j ,2b.j ,3a.j ,3b.j ) should be named and zipped together according to the instructions. Homeworks should be submitted on the due date before class time. 1 Simple DFA questions Let M be the DFA with states Q = { q 1 ,q 2 ,q 3 ,q 4 ,q 5 }, input alphabet = { u,d } , transition function , start state q 2 and accept states F = { q 2 } where is given by the following transition table. q 1 q 2 q 3 q 4 q 5 u q 5 q 1 q 2 q 3 q 4 d q 2 q 3 q 4 q 5 q 1 1. Give 3 example strings that are accepted by the DFA Starting from state q 2 , each of the following strings causes the DFA to go (possibly through a series of states) to state q 2 (the only accepting state) (a) The empty string is accepted because the DFA starts in state q 2 which is an accept state. (b) dduu The string ddud takes the DFA from state q 2 to q 3 to q 4 to q 3 to q 2 . (c) uuuuduu The string uuuuu takes the DFA from state q 2 to q 1 to q 5 to q 4 to q 3 to q 4 to q 3 to q 2 . 2. Give 3 example strings that are not accepted by the DFA (a) u The string u is not accepted because it takes the machine from q 2 to q 1 , which is not an accept state. (b) uuuuuu The string ud is accepted because it takes the DFA from state q 2 to q 1 to q 5 to q 4 to q 3 to q 2 to q 1 . 1 (c) ddud The string ddud takes the DFA from state q 2 to q 3 to q 4 to q 3 to q 4 , which is not an accept state. 3. Give a high level English description of M using complete sentences and proper grammar and punctu ation. This description should be no more than two reasonably short sentences Where C u is de ned as the number of occurences of u and C d is de ned as the number of occurences of d in a string s, s will be accepted by this DFA if and only if C u modulo 5 is equal to C d modulo 5....
View
Full
Document
This note was uploaded on 08/31/2011 for the course CSE 105 taught by Professor Paturi during the Fall '99 term at UCSD.
 Fall '99
 Paturi

Click to edit the document details