Definition
A finite automaton is a -tuple , where:
- is a finite set called the states
- is a finite set called the alphabet
- is the transition function
- is the start state
- is the set of accept states
Informal Description
A finite automaton (also called a finite state machine) is an idealized model of a computer with a fixed, limited amount of memory.
Components
- States: The machine is always in one of a finite number of states.
- Start State is indicated by arrow pointing at it from nowhere
- Accept State is indicated by double circle
- Transition: The machine moves from one state to another based on an input symbol it receives.
- Output:
- Either accept or reject
Processing
- Begins in ‘s start state
- Automaton receives symbols from the input string one-by-one from left to right
- After reading each symbol , moves from one state to another along the transition that has the symbol as its label
- When the automaton reads last symbol, produces its output
- accept if is now in an accept state
- reject if is not in an accept state
Example
Input:
- Start in state .
- Read , follow transition from to .
- Read , follow transition from to .
- Read , follow transition from to .
- Read , follow transition from to .
- Accept because is in an accept state at the end of the input.
How it Computes (Deterministic Computation)
- Start: The process begins in the start state .
- Read: The machine reads the input string symbols one by one from left to right.
- Move: After reading a symbol, it follows the transition to a new state.
- Output: After the last symbol is read, the machine accepts the string if it is in an accept state; otherwise, it rejects it.
Key Terminology
- State Diagrams: A visual representation of the automaton where circles represent states and arrows represent transitions.
- Transition Table: A tabular representation of the transition function , showing the next state for every combination of current state and input symbol.
- Language of a Machine (): The set of all strings that the machine accepts.
- Recognize: A machine recognizes a language if it accepts every string in that language and rejects all others. Note that while a machine may accept many strings, it recognizes exactly one language.
Regular Operations
The power of finite automata is often discussed in the context of three “regular operations” used to manipulate languages.
- Union: takes all the strings in both and , lumps them into one language
- Concatenation: Attaching strings from one language to strings of another.
- Star: Repeating strings from a language any number of times.
- “any number” includes , so the empty string is always a member of
Theorem
The Class of Regular Languages is Closed Under the Union Operation ()
Proof by Construction
Assume:
recognize where
recognize where
Construct to recognize , where
This set is the Cartesian Product of sets and and is written
It is the set of all pairs of states, the first from and the second from- is the same as in and
- , the transition function, is defined as follows:
For each and each , let
Hence $\delta$ gets a state of $M$ (which actually is a pair of states from $M_{1}$ and $M_{2}$), together with an input symbol and returns $M$'s next state
4. is the pair
5. is the set of pairs in which either member is an accept state of or , written as
This expression is the same as $F=(F_{1} \times Q_{2}) \cup (Q_{1} \times F_{2})$
Note that is it *not* the same as $F = F_{1} \times F_{2}$
