150 likes | 166 Views
Finite Automata. Lecture 4 Section 1.1 Wed, Sep 6, 2006. The Automatic Door. The automatic door at the grocery store has two pads: One in front of the door. One behind the door. The door is in one of two possible states: Open Closed. The Automatic Door.
E N D
Finite Automata Lecture 4 Section 1.1 Wed, Sep 6, 2006
The Automatic Door • The automatic door at the grocery store has two pads: • One in front of the door. • One behind the door. • The door is in one of two possible states: • Open • Closed
The Automatic Door • There are two independent input signals: • A person is or is not standing on the front pad. • A person is or is not standing on the rear pad. • There are four combinations of input signals.
The Automatic Door • In terms of input signals and door states, describe the behavior of the door.
The Automatic Door • Express the behavior as a table. • Express the behavior as a graph.
A Canal Lock • Describe the operation of a canal lock designed so that the gates can never be opened when the water on the two sides is not at the same level.
A Canal Lock • The working parts of the lock are • Upper gate • Upper paddle • Lower gate • Lower paddle
Definition of a Finite Automaton • A finite automaton is a 5-tuple (Q, , , q0, F), where • Q is a finite set of states, • is a finite alphabet, • : Q Q is the transition function, • q0 is the start state, and • F Q is the set of accept states.
Definition of a Finite Automaton • If, at the end of reading the input string, the automaton is in an accept state, then the input is accepted. • Otherwise, it is rejected.
Definition of a Finite Automaton • Describe the automatic door formally. • Describe the canal lock formally. • An accept state is any state that doesn’t cause a disaster.
The Language of a Machine • A given finite automaton accepts a specific set of input strings. • That is called the language of the automaton. • A language is called regular if it is the language of some finite automaton.
Examples • Design a finite automaton that accepts all strings that start with a and end with b. • Design a finite automaton that accepts all strings that contain an even number of a’s.
The Regular Operations • We may define operations on languages: • Union: AB = {x | xA or xB}. • Concatenation: A B = {xy | xA and yB}. • Star: A* = {x1x2…xk | xiA and k 0}.
Closure under Union • Theorem: If A and B are regular languages, then so are • AB • A B • A*
Examples • Let A = {x | x contains an even number of a’s}. • Let B = {x | x contains an even number of b’s}. • Try to design finite automata for • AB • A B • A*