CSCI 2670
Introduction to Theory of
Computing
August 24, 2004
Agenda
• Last class
– Reviewed syllabus
– Reviewed material in Chapter 0 of Sipser
– Assigned pages 0 – 34 of Sipser
• Questions?
• This class
– Begin Chapter 1
• Goal for the week
– Section 1.1
• Continue reading Section 1.1 (pages 31 – 47)
this week
Announcements
• Website is up
• Tutorial sessions with Junfeng Qu
– Monday 8:00 – 9:00 AM
– Thursday 4:00 – 5:00 PM
• Room(s) TBA
• Quiz tomorrow (8/25)
– Material: pages 1 – 34
• Homework due next Tuesday (8/31)
– Chapter 0 numbers 0.4, 0.5, 0.7a, 0.10
– Chapter 1 numbers 1.1 (a, b, f & g), 1.2 (M2 only),
1.4 (b, d, f, h, j)
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
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
b
c
d
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”
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
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
Example
• Ball in frictionless room
• Moves left, right or not at all
– Three states: left, right, stop
– 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)
Example
• State table
Hits
Wall
Paddle
Left
Paddle
Right
Grab
Left
Right
Left
Right
Stop
Right
Left
Left
Right
Stop
Stop
Impossi
ble
Left
Right
Stop
Event
State
Impossible Impossible Impossible Impossible Impossible
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
Right
Stop
Impossible
Finite automaton (formal definition)
•
A finite automaton is a 5-tuple
(Q,,,q0,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. q0 is the start state, and
5. F Q is the set of accept states (also
called final states).
Example
• From previous example
–
–
–
–
–
Q = {Left, Right, Stop, Impossible}
= {Hit wall, Paddle left, Paddle right, Grab}
= The state table we constructed
q0 = Stop
F = {Left, Right, Stop}
• What if we accept any set of events that
ends with the ball in motion?
– F = {Left, Right}
0,1
q4
= {0,1}
Another example
0
1
1
q1
0
q2
q3
1
0
•
•
•
•
•
Q = {q1, q2, q3, q4}
= {0, 1}
(next slide)
q0 = q1
F = {q3}
0,1
= {0,1}
Another example
q4
0
1
1
q1
0
q2
q3
1
0
State table
0
1
q1
q2
q4
q2
q2
q3
q3
q2
q3
q4
q4
q4
0,1
q4
= {0,1}
Another example
0
1
1
q1
0
q2
q3
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
Group problem
•
Formally describe the DFA
(deterministic finite automaton)
illustrated in your group’s sheet
Group problem
= {0, 1} for all groups
1.
2.
3.
4.
5.
Q is a finite set called the states
is a finite set called the alphabet
: Q × Q is the transition function
q0 is the start state, and
F Q is the set of accept states (also
called final states).
Include informal description
Group 1
0,1
1
0
q1
0
1
q2
1
q5
q3
0
q4
0,1
Hint: What string doesn’t this DFA accept?
Group 2
0,1
0
q1
q2
0,1
q3
0,1
1
q4
Hint: String length counts.
0,1
q5
Group 3
0,1
1
q1
0
q2
q3
0,1
Hint: Symbol position counts.
Group 4
q1
0
q2
1
0,1
q3
0,1
0,1
q4
Hint: Can you simplify this DFA?
Group 5
q1
0
1
q3
0
0
q2
q5
1
0
1
0
1
1
q4
q6
Hint: For each state, what do you know about
how many times each symbol has appeared?
0,1
Group 6
0
q1
1
q2
0
1
q3
0, 1
Hint: What happens when you get to q3?
© Copyright 2026 Paperzz