Download presentation
Presentation is loading. Please wait.
Published byBeverley Hope Newton Modified over 9 years ago
1
August 23, 2005 CSCI 2670 Introduction to Theory of Computing August 23, 2005
2
2 Agenda Last class –Reviewed syllabus –Reviewed material in Chapter 0 of Sipser –Assigned pages Chapter 0 of Sipser Questions? This class –Begin Chapter 1 Goal for the week –Section 1.1 Read Section 1.1 (pages 29 – 47) this week
3
August 23, 2005 3 Announcements Website is up Quiz tomorrow (8/24) –Material: Chapter 0 Homework due next Tuesday (8/30) –Chapter 0 numbers 0.3 all, 0.7b, 0.12 –Chapter 1 numbers 1.3, 1.4c, 1.5f, 1.6(a, c, h) Unregistered students Please give me your student id after class
4
August 23, 2005 4 Relation on A Function R:A×A×…×A { true, false } –Often described as a set of elements for which the relation is true Example –A={1,2,3,4,5} –R:A×A×A { true, false } R is true if the three-tuple is increasing –{(1,2,3),(1,2,4),(2,3,4),(3,4,5)} R –(1,1,5) R
5
August 23, 2005 5 Graphical representation (binary relations only) Directed arrow with edge (a,b) if (a,b) R Example: A={a,b,c,d}, R=“earlier in alphabet” –R={(a,b),(a,c),(a,d),(b,c),(b,d),(c,d)} a c b d
6
August 23, 2005 6 Equivalence Relation Symmetric –{(a,a) | a A} R Reflexive –(a,b) R (b,a) R Transitive –(a,b) R (b,c) R (a,c) R Examples –Equality –“Has the same eye color”
7
August 23, 2005 7 Languages Alphabet –Finite collection of objects (denoted ) String –Concatenation of 0 or more elements of an alphabet Language –Collection of strings * is the set of all strings over (including ε) This week we will define a specific class of languages – regular languages
8
August 23, 2005 8 Deterministic finite automata (DFA) Method for modeling computers with limited memory –Language recognizer Idea –Keep track of current state –Events can move you from one state to another Today’s goal –Formally describe DFA’s –Interpret DFA’s
9
August 23, 2005 9 Example Ball in frictionless room Moves left, right or not at all –Three possible states: left, right, stop –One other state: impossible –Start at rest (in stop state) State changes under four conditions –Ball hits a wall (reverse direction) –Paddle hits left (ball moves left) –Paddle hits right (ball moves right) –Hand grabs ball (stop moving)
10
August 23, 2005 10 Example State table Hits Wall Paddle Left Paddle Right Grab LeftRightLeftRightStop RightLeft RightStop Impossi ble LeftRightStop Impossible Event State
11
August 23, 2005 11 Example »Ball in frictionless room –Ball hits a wall (reverse direction) –Paddle hits left (ball moves left) –Paddle hits right (ball moves right) –Hand grabs ball (stop moving) Left Stop Right Impossible
12
August 23, 2005 12 Finite automaton (formal definition) A finite automaton is a 5-tuple (Q, , ,q 0,F), where 1.Q is a finite set called the states 2. is a finite set called the alphabet 3. : Q × Q is the transition function corresponds to the event function from previous example 4.q 0 is the start state, and 5.F Q is the set of accept states (also called final states).
13
August 23, 2005 13 Example From previous example –Q = – = – = –q 0 = –F = {Left, Right, Stop, Impossible} {Hit wall, Paddle left, Paddle right, Grab} The state table we constructed Stop {Left, Right, Stop} What if we accept any set of events that ends with the ball in motion? –F = {Left, Right}
14
August 23, 2005 14 Another example q1q1 q2q2 q3q3 0 01 = {0,1} 1 0 Q = = q 0 = F = {q 1, q 2, q 3, q 4 } {0, 1} (next slide) q1q1 {q 3 } q4q4 1 0,1
15
August 23, 2005 15 Another example q1q1 q2q2 q3q3 0 01 = {0,1} State table01 q1q1 q2q2 q4q4 q2q2 q2q2 q3q3 q3q3 q2q2 q3q3 q4q4 q4q4 q4q4 1 0 q4q4 1 0,1
16
August 23, 2005 16 Another example q1q1 q2q2 q3q3 0 01 = {0,1} 1 0 Informal description of the strings accepted by this DFA All strings of 0’s and 1’s beginning with a 0 and ending with a 1 q4q4 1 0,1
17
August 23, 2005 17 Group problem Formally describe the DFA (deterministic finite automaton) illustrated in your group’s sheet
18
August 23, 2005 18 Group problem = {0, 1} for all groups 1.Q is a finite set called the states 2. is a finite set called the alphabet 3. : Q × Q is the transition function 4.q 0 is the start state, and 5.F Q is the set of accept states (also called final states). Include informal description
19
August 23, 2005 19 Group 1 q1q1 q2q2 q4q4 10 1 0,1 0 q3q3 0 Hint: What string doesn’t this DFA accept? q5q5 1 0,1
20
August 23, 2005 20 Group 2 q1q1 q2q2 0,1 0 q3q3 q4q4 q5q5 1 Hint: String length counts.
21
August 23, 2005 21 Group 3 q1q1 q2q2 1 0,1 Hint: Symbol position counts. q3q3 0 0,1
22
August 23, 2005 22 Group 4 q1q1 q2q2 0 0,1 Hint: Can you simplify this DFA? q3q3 q4q4 0,1 1
23
August 23, 2005 23 Group 5 q1q1 q2q2 0 Hint: For each state, what do you know about how many times each symbol has appeared? q3q3 q4q4 0 1 1 0 q5q5 0 1 1 q7q7 0,1 1 q6q6 0 0 1
24
August 23, 2005 24 Group 6 q1q1 0, 1 Hint: What happens when you get to q 3 ? q2q2 0 1 0 q3q3 1
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.