The document discusses finite automata and regular languages. It begins by asking what is a computer and noting that real computers are too complex to model entirely, so simpler abstract mathematical models called finite automata are used. It then discusses the formal definition of finite automata, deterministic vs non-deterministic finite automata, regular languages, and operations on regular languages. Examples are provided of modeling an automatic door and a simple finite automaton over the binary alphabet.
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Compute1 dfa
1. Finite Automata
Question: What is a computer?
real computers too complex for any theory
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.1
2. Finite Automata
Question: What is a computer?
real computers too complex for any theory
need manageable mathematical abstraction
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.1
3. Finite Automata
Question: What is a computer?
real computers too complex for any theory
need manageable mathematical abstraction
idealized models: accurate in some ways, but not
in all details
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.1
4. Finite Automata – Important ideas
formal definition of finite automata
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.2
5. Finite Automata – Important ideas
formal definition of finite automata
deterministic vs. non-deterministic finite
automata
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.2
6. Finite Automata – Important ideas
formal definition of finite automata
deterministic vs. non-deterministic finite
automata
regular languages
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.2
7. Finite Automata – Important ideas
formal definition of finite automata
deterministic vs. non-deterministic finite
automata
regular languages
operations on regular languages
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.2
8. Finite Automata – Important ideas
formal definition of finite automata
deterministic vs. non-deterministic finite
automata
regular languages
operations on regular languages
regular expressions
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.2
9. Finite Automata – Important ideas
formal definition of finite automata
deterministic vs. non-deterministic finite
automata
regular languages
operations on regular languages
regular expressions
pumping lemma
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.2
10. Example: An Automatic Door
front rear
pad pad
door
open when person approaches
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.3
11. Example: An Automatic Door
front rear
pad pad
door
open when person approaches
hold open until person clears
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.3
12. Example: An Automatic Door
front rear
pad pad
door
open when person approaches
hold open until person clears
don’t open when someone standing behind door
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.3
13. The Automatic Door as DFA
REAR FRONT FRONT
BOTH REAR
NEITHER BOTH
closed open
NEITHER
States:
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
14. The Automatic Door as DFA
REAR FRONT FRONT
BOTH REAR
NEITHER BOTH
closed open
NEITHER
States:
OPEN
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
15. The Automatic Door as DFA
REAR FRONT FRONT
BOTH REAR
NEITHER BOTH
closed open
NEITHER
States:
OPEN
CLOSED
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
16. The Automatic Door as DFA
REAR FRONT FRONT
BOTH REAR
NEITHER BOTH
closed open
NEITHER
States:
OPEN
CLOSED
Sensor:
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
17. The Automatic Door as DFA
REAR FRONT FRONT
BOTH REAR
NEITHER BOTH
closed open
NEITHER
States:
OPEN
CLOSED
Sensor:
FRONT: someone on rear pad
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
18. The Automatic Door as DFA
REAR FRONT FRONT
BOTH REAR
NEITHER BOTH
closed open
NEITHER
States:
OPEN
CLOSED
Sensor:
FRONT: someone on rear pad
REAR: someone on rear pad
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
19. The Automatic Door as DFA
REAR FRONT FRONT
BOTH REAR
NEITHER BOTH
closed open
NEITHER
States:
OPEN
CLOSED
Sensor:
FRONT: someone on rear pad
REAR: someone on rear pad
BOTH: someone on both pads
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
20. The Automatic Door as DFA
REAR FRONT FRONT
BOTH REAR
NEITHER BOTH
closed open
NEITHER
States:
OPEN
CLOSED
Sensor:
FRONT: someone on rear pad
REAR: someone on rear pad
BOTH: someone on both pads
NEITHER no one on either pad.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
21. The Automatic Door as DFA
DFA is Deterministic Finite Automata
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.5
22. The Automatic Door as DFA
DFA is Deterministic Finite Automata
REAR FRONT FRONT
BOTH REAR
NEITHER BOTH
closed open
NEITHER
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.5
23. The Automatic Door as DFA
DFA is Deterministic Finite Automata
REAR FRONT FRONT
BOTH REAR
NEITHER BOTH
closed open
NEITHER
neither front rear both
closed closed open closed closed
open closed open open open
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.5
24. DFA: Informal Definition
0 1
1 0
q1 q q3
2
0,1
The machine :
states: , and .
¡
¥¡
¥¡
£
¤
¦
¢
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.6
25. DFA: Informal Definition
0 1
1 0
q1 q q3
2
0,1
The machine :
states: , and .
¡
¥¡
¥¡
£
¤
¦
¢
start state: (arrow from “outside”).
¡
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.6
26. DFA: Informal Definition
0 1
1 0
q1 q q3
2
0,1
The machine :
states: , and .
¡
¥¡
¥¡
£
¤
¦
¢
start state: (arrow from “outside”).
¡
accept state: (double circle).
¤¡
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.6
27. DFA: Informal Definition
0 1
1 0
q1 q q3
2
0,1
The machine :
states: , and .
¡
¥¡
¥¡
£
¤
¦
¢
start state: (arrow from “outside”).
¡
accept state: (double circle).
¤¡
state transitions: arrows.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.6
28. DFA: Informal Definition (cont.)
0 1
1 0
q1 q q3
2
0,1
On an input string
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.7
29. DFA: Informal Definition (cont.)
0 1
1 0
q1 q q3
2
0,1
On an input string
DFA begins in start state
¡
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.7
30. DFA: Informal Definition (cont.)
0 1
1 0
q1 q q3
2
0,1
On an input string
DFA begins in start state
¡
after reading each symbol, DFA makes
state transition with matching label.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.7
31. DFA: Informal Definition (cont.)
0 1
1 0
q1 q q3
2
0,1
On an input string
DFA begins in start state
¡
after reading each symbol, DFA makes
state transition with matching label.
After reading last symbol, DFA produces output:
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.7
32. DFA: Informal Definition (cont.)
0 1
1 0
q1 q q3
2
0,1
On an input string
DFA begins in start state
¡
after reading each symbol, DFA makes
state transition with matching label.
After reading last symbol, DFA produces output:
accept if DFA is an accepting state.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.7
33. DFA: Informal Definition (cont.)
0 1
1 0
q1 q q3
2
0,1
On an input string
DFA begins in start state
¡
after reading each symbol, DFA makes
state transition with matching label.
After reading last symbol, DFA produces output:
accept if DFA is an accepting state.
reject otherwise.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.7
34. Informal Definition - Example
0 1
1 0
q q q3
1 2
0,1
What happens on input strings
¡
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.8
35. Informal Definition - Example
0 1
1 0
q q q3
1 2
0,1
What happens on input strings
¡
¡
¡
¡
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.8
36. Informal Definition - Example
0 1
1 0
q q q3
1 2
0,1
What happens on input strings
¡
¡
¡
¡
¡
¡
¡
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.8
37. Informal Definition
0 1
1 0
q q q3
1 2
0,1
This DFA accepts
all input strings that end with a 1
all input strings that contain at least one 1, and
end with an even number of 0’s
no other strings
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.9
41. Languages and Examples
A language over is a subset . For example
Modern English.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.11
42. Languages and Examples
A language over is a subset . For example
Modern English.
Ancient Greek.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.11
43. Languages and Examples
A language over is a subset . For example
Modern English.
Ancient Greek.
All prime numbers, writen using digits.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.11
44. Languages and Examples
A language over is a subset . For example
Modern English.
Ancient Greek.
All prime numbers, writen using digits.
¡
¡
¨
has at most seventeen 0’s
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.11
45. Languages and Examples
A language over is a subset . For example
Modern English.
Ancient Greek.
All prime numbers, writen using digits.
¡
¡
¨
has at most seventeen 0’s
¡
¡
¨
¡
¡
¡
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.11
46. Languages and Examples
A language over is a subset . For example
Modern English.
Ancient Greek.
All prime numbers, writen using digits.
¡
¡
¨
has at most seventeen 0’s
¡
¡
¨
¡
¡
¡
¡
¡
¨
has an equal number of 0’s and 1’s
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.11
47. Languages and DFA
¡
Definition: , the language of a DFA , is the
¡
set of strings that accepts, .
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.12
48. Languages and DFA
¡
Definition: , the language of a DFA , is the
¡
set of strings that accepts, .
Note that
may accept many strings, but
accepts only one language
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.12
49. Languages and DFA
¡
Definition: , the language of a DFA , is the
¡
set of strings that accepts, .
Note that
may accept many strings, but
accepts only one language
What language does accept if it accepts no strings?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.12
50. Languages and DFA
¡
Definition: , the language of a DFA , is the
¡
set of strings that accepts, .
Note that
may accept many strings, but
accepts only one language
What language does accept if it accepts no strings?
A language is called regular if some deterministic finite
automaton accepts it.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.12
51. Formal Definitions
A deterministic finite automaton (DFA) is a 5-tuple
¡
, where
¡
¡ ¢
¢
¢
¢
¢
is a finite set called the states,
is a finite set called the alphabet,
¤
is the transition function,
¥
£
is the start state, and
¦
¡¡
is the set of accept states.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.13