I. Introduction toFinite Automata: Finite Automata (FA) are one of the foundational
concepts in theoretical computer science, used to model and analyze computation. They are a
type of abstract machine designed to recognize patterns or process sequences of symbols
from a given alphabet.
1.1. What is a Finite Automaton?
A finite automaton is a mathematical model consisting of:
A finite set of states: These represent the various conditions the automaton can be in.
An alphabet (Σ): A set of symbols the automaton can process. Σ: SIGMA
Transition functions (δ): Rules that determine how the automaton moves from one
state to another based on input symbols. δ or Δ DELTA
A start state (q )
₀ : The initial state of the automaton.
A set of accept states (F): States in which the automaton can halt and accept the
input.
1.2. Types of Finite Automata
There are two main types of finite automata:
1. Deterministic Finite Automaton (DFA):
o Each state has exactly one transition for every symbol in the alphabet.
o At any point, the machine’s behavior is deterministic (no ambiguity).
2. Nondeterministic Finite Automaton (NFA):
o A state may have zero, one, or multiple transitions for a given symbol.
o It can transition to multiple states simultaneously or move without consuming
a symbol (ε-transitions).
Key Note: DFAs and NFAs are equivalent in terms of the languages they recognize (regular
languages), though they differ in structure and implementation.
1.3. Key Concepts
States: Represent the machine's memory.
Alphabet (Σ): Set of symbols processed by the automaton (e.g., {0, 1} for binary
input).
Transition Diagram: A visual representation of states as nodes and transitions as
directed edges.
Acceptance: If the automaton ends in an accept state after processing the input string,
it accepts the string. Otherwise, it rejects it.
1.4. Applications
Finite automata are widely used in:
2.
Lexical analysis:Tokenizing strings in compilers.
Pattern recognition: Text search engines (e.g., finding keywords in a document).
Control systems: Simplifying hardware and software designs.
Regular expressions: Underlying mathematical model for regex engines.
1. 5. Finite Automata and Regular Languages
Finite automata are closely linked with regular languages, which are sets of strings defined
by:
Regular expressions.
Operations like union, concatenation, and closure.
For example:
DFA or NFA can recognize strings like aa* (any number of 'a's).
II.Structural Representation: Structural representation is crucial for understanding
automata and complexity theory, as it visually and mathematically illustrates the components,
transitions, and behaviors of computational models. Here's an overview of how automata and
computational problems are structurally represented.
2.1. Structural Representation of Automata
Automata are represented using state diagrams and mathematical notation to define their
components and transitions. Let’s look at the main automata:
Finite Automata (FA)
A finite automaton is represented as a 5-tuple:
M=(Q,Σ,δ,q0,F)
Where:
Q: A finite set of states.
Σ: The input alphabet (symbols the automaton processes).
δ:Q×Σ→Q: The transition function.
q0∈Q: The start state.
F⊆Q: The set of accept states.
State Diagram:
States: Represented as circles.
o Start state: Marked with an arrow pointing to it.
o Accept states: Double circles.
Transitions: Directed arrows labeled with input symbols.
3.
Example: DFA forrecognizing strings ending in "01" over Σ={0,1}:
q0 --0--> q1 --1--> q2 (accept)
q0 --1--> q0
q1 --0--> q1
q2 --0,1--> q0
2.2.Pushdown Automata (PDA)
A pushdown automaton is represented as a 7-tuple:
M=(Q,Σ,Γ,δ,q0,F)
Where:
Q,Σ,q0,F: Same as finite automata.
Γ: Stack alphabet (symbols stored in the stack).
δ:Q×Σ×Γ→Q×Γ∗: Transition function considering the current state, input symbol, and stack
top.
State Diagram: Similar to finite automata, but transitions also include stack operations, e.g., a,Z→bZ
(read a, pop Z, and push bZ).
2.3.Turing Machine (TM)
A Turing machine is represented as a 7-tuple:
M=(Q,Σ,Γ,δ,q0,qaccept,qreject)
Where:
Q,Σ,q0 : Same as finite automata.
Γ: Tape alphabet (includes input symbols and a blank symbol).
qaccept, qreject∈Q: Halting states.
δ:Q×Γ→Q×Γ×{L,R}: Transition function, specifying state changes, tape symbol writes, and
tape head movements (left or right).
Tape Representation:
A tape is infinite, divided into cells, with a tape head pointing to a specific cell.
Operations include writing symbols, moving left/right, and transitioning states.
III.Automata Theory: Automata and Complexity are fundamental topics in theoretical computer
science, focusing on computational models and their capabilities, as well as the resources (time,
space, etc.) required to solve computational problems.
4.
Automata theory studiesabstract computational machines (automata) and the
problems they can solve. It provides a hierarchy of automata models, each with increasing
computational power.
Key Automata Models:
1. Finite Automata (FA):
o Recognize regular languages.
o Limited in computational power; no memory beyond the current state.
o Deterministic (DFA) and Nondeterministic (NFA) automata are equivalent in terms of
language recognition.
2. Pushdown Automata (PDA):
o Recognize context-free languages.
o Extend finite automata by adding a stack, allowing them to handle nested structures
like parentheses.
3. Turing Machines (TM):
o Recognize recursively enumerable languages.
o A theoretical model for general computation, with infinite tape as memory.
o Forms the basis for the Church-Turing Thesis, which asserts that Turing machines
capture the concept of algorithmic computation.
4. Linear Bounded Automata (LBA):
o Recognize context-sensitive languages.
o A restricted form of Turing machine with bounded memory proportional to the input
size.
Language Hierarchy (Chomsky Hierarchy):
Automata theory is closely tied to the classification of formal languages:
Type-3: Regular Languages (Finite Automata)
Type-2: Context-Free Languages (Pushdown Automata)
Type-1: Context-Sensitive Languages (Linear Bounded Automata)
Type-0: Recursively Enumerable Languages (Turing Machines)
4. Central Concepts of Automata Theory: Alphabets, Strings, Languages, and Problems
Automata theory revolves around these fundamental concepts, which provide the building blocks for
understanding computation and formal languages.
1. Alphabets (ΣSigmaΣ)
An alphabet is a finite, non-empty set of symbols or characters used to construct strings. It is denoted
by ΣSigmaΣ.
5.
Examples:
o Σ={0,1}:Alphabet for binary numbers.
o Σ={a,b,c}: Alphabet for strings over English letters.
o Σ={a, b, …, z }: Lowercase English alphabet.
2. Strings
A string is a finite sequence of symbols taken from an alphabet. It is a key construct in automata and
formal languages.
Definitions:
o Empty string (ε): A string with no symbols (∣ε∣=0).
o Length of a string (∣w∣): The number of symbols in the string.
Example: If w=1011, ∣w∣=4.
o Concatenation: Joining two strings w1 and w2 to form a new string.
Example: w1=101,w2=01⇒w1w2=10101.
o Powers of a string: Repeated concatenation.
Example: If w=ab, w3=ababab.
Examples of Strings:
o Over Σ={a,b}: a,b,ab,aab,bbb.
o Over Σ={0,1}: 0,1,01,10100, 1, 01, 1010.
3. Languages
A language is a set of strings over a given alphabet (Σ). It is a subset of all possible strings (Σ∗
).
Definitions:
o Kleene Star (Σ∗
):
The set of all possible strings (including the empty string) that can be formed
using the alphabet Σ.
Example: If Σ={a,b}, Σ∗
={ε,a,b,aa,ab,ba,bb,...}.
o Language (L):
Any subset of Σ∗
.
Example: If Σ={0,1}, a language could be L={0,01,101}.
o Empty Language (∅):
A language with no strings.
6.
Example: L=∅.
Types of Languages:
1. Regular Languages:
Recognized by finite automata.
Example: Strings over {a,b} that start with a: L={a,ab,aa,abb,...}.
2. Context-Free Languages:
Recognized by pushdown automata.
Example: Balanced parentheses: L={ε,(),(()),(()())}.
3. Context-Sensitive Languages:
Recognized by linear bounded automata.
Example: Strings of the form an
bn
cn
(n≥1).
4. Recursively Enumerable Languages:
Recognized by Turing machines.
Example: Any computable problem.
IV. Formal Definition of a Nondeterministic Finite Automaton (NFA): A Nondeterministic Finite
Automaton (NFA) is a computational model that allows multiple possible transitions from a given
state for the same input symbol. It is formally defined as a 5-tuple.
M=(Q,Σ,δ,q0,F)
Where:
1. Q: A finite set of states.
2. Σ: A finite set of input symbols (the alphabet).
3. δ:Q×(Σ∪{ε})→2Q
: The transition function, which maps a state and an input symbol (or ε
varepsilonε, the empty string) to a subset of states.
4. q0∈Q: The start state (initial state).
5. F⊆Q: A set of accept states (final states).
Key Differences Between NFA and DFA
1. Transitions:
In a Deterministic Finite Automaton (DFA), for every state q∈Q and every symbol a∈Σ,
there is exactly one transition (δ(q,a) is a single state).
In an NFA, for a state q∈Q and symbol a∈Σ∪{ε}, the transition δ(q,a) is a set of states,
allowing:
Multiple possible transitions.
Transitions without consuming any input (ε -transitions).
7.
2. Acceptance:
An NFAaccepts a string if at least one computation path leads to an accept state.
In contrast, a DFA requires a single deterministic path to lead to an accept state.
Formal Acceptance Definition: An NFA M=(Q,Σ,δ,q0,F) accepts a string ω∈Σ∗
if there
exists a sequence of states q0,q1,q2,…,qn such that:
1. q0∈Q is the start state.
2. For each i≥0, qi+1∈δ(qi,ai+1), where ai+1 is the i-th symbol of ω or ε(epsilon).
3. qn∈F, where qn is an accept state.
In simpler terms:
An NFA accepts www if there is at least one path through the state transition graph
that consumes ω and ends in an accept state.
Example
NFA to Recognize Strings Ending with "01"
1. Definition:
Q={ q0, q1, q2} (states).
Σ={0,1} (alphabet).
δ: Transition function
δ(q0)={ q0, q1}, δ(q0,1)={ q0}
δ(q1,1)={ q2}, δ(q1,0)=∅
δ(q2,0)=∅, δ(q2,1)=∅
q0= q0 (start state).
F={ q2} (accept state).
Explanation:
8.
The NFA"branches" whenever it sees a 0, potentially entering q1.
If it then sees a 1, it can enter q2, an accept state.
Input: ω =101
Visual Representation (State Diagram)
States: q0, q1, q2.
Arrows represent transitions; double circles represent accept states.
(q0) --0--> (q1) --1--> (q2) (accept)
| ^
|--0,1--------------|
Key Properties of NFAs
1. Equivalence with DFA:
o NFAs and DFAs are equally powerful (recognize the same class of languages:
regular languages).
o Any NFA can be converted to an equivalent DFA, though the DFA might have
exponentially more states.
2. Non-Determinism:
o Allows multiple possible transitions for the same input.
o Useful for simplifying automaton design.
3. ε-Transitions:
o NFAs can include transitions that do not consume input.
o These transitions allow state changes "for free."