• Home
  • Queen's University
  • Software Specifications
  • State Diagrams and Regular Expressions

State Diagrams and Regular Expressions

CISC 223 - Assignment 2 (Winter 2014) Due: beginning of class (3:30 PM), Wednesday January 22 1. (4 marks) Let E = {0, 1} and consider the state-transition diagram given in Figure 1. Figure 1: State-transition diagram for Question 1. (a) Give examples of three strings that are accepted by the state diagram and examples of three strings that are not accepted by the state diagram. (b) Write out explicitly the transition table (or transition function) that defines the state transitions of the diagram. (c) What is the language recognized by the state diagram? Describe (in words) a con- dition that characterizes the strings of the language. (d) Based on your solution above in (c), design a regular expression that defines the same language.1 2. (3 marks) Let ? = {a, b, c} and consider the nondeterministic state diagram with E- transitions given in Figure 2. Using the systematic method described in class (and in the text), convert the state dia- gram into an equivalent nondeterministic state diagram without E-transitions. You should not further modify/simplify the resulting nondeterministic state diagram (and it is not required to convert the result into a deterministic state diagram.) 3. (3 marks) Let ? = {a, b, c}. Using the systematic method described in class (subset construction), convert the nondeterministic state diagram given in Figure 3 into a deter- ministic state diagram. Your answer should indicate how the deterministic state diagram is obtained from the nondeterministic one: the states of the deterministic diagram should be labeled by sets of states of the nondeterministic diagram. 1Later we will discuss an algorithm that converts a state diagram into a regular expression. Here you are just expected to design the regular expression based on the property that characterizes the strings of the language. a 00 ? A ? 00 ? ? ? ? I C ? ? ? ? ? ? 0 0 ? ? ? B ? ? ? ? ? ? ? 70 b ? C ? a Figure 2: State diagram with E-transitions for Question 2. Figure 3: State-transition diagram for Question 3. Regulations on assignments · The assignments may be done in groups consisting of one, two, three or four students. If more than one students are collaborating on an assignment, they must submit a single joint solution. . Clearly print (or type) the name(s) and student number(s), and course number, at the top of the first page. Additionally each student collaborating on an assignment must sign the top of the first page. . If the submission consists of more than one page, the pages must be stapled together. . Note: You are asked to write your solutions using non-erasable pen (or to type the solutions). Solutions written in pencil or erasable ink will be marked, but they will not be considered for remarking after the assignments are returned.