2021-22-finite-state-automata
2021-22-finite-state-automata
UNIT 2
Syntax: Formal Grammars of English - Word Level Analysis: Regular Expressions - Finite-
State Automata - Morphological Parsing, Syntactic Parsing, Statistical Parsing
-Spelling Error Detection and correction-Words and Word classes-Part-of Speech
Tagging. Syntactic Analysis: Context-free Grammar-Constituency- Parsing-Probabilistic
Parsing.
2.2 FINITE STATE AUTOMATA
2.1 AUTOMATA
The term automata, derived from the Greek word "αὐτόματα" meaning "self-acting".
The plural of automata is automaton.
Automaton may be defined as an abstract self-propelled computing device that
follows a predetermined sequence of operations automatically.
An automaton having a finite number of states is called a Finite Automaton (FA) or
Finite State automata (FSA).
Finite state automation is of two types. Let us see what the types are.
DFA is defined as the type of finite automation wherein, for every input symbol we can
determine the state to which the machine will move. It has a finite number of states that is
why the machine is called Deterministic Finite Automaton (DFA).
Mathematically, a DFA can be represented by a 5-tuple (Q, Σ, δ, q0, F), where −
Q is a finite set of states.
Σ is a finite set of symbols, called the alphabet of the automaton.
δ is the transition function where δ: Q × Σ → Q .
q0 is the initial state from where any input is processed (q0 ∈ Q).
F is a set of final state/states of Q (F ⊆ Q).
Whereas graphically, a DFA can be represented by diagraphs called state diagrams where −
The states are represented by vertices.
The transitions are shown by labeled arcs.
The initial state is represented by an empty incoming arc.
The final state is represented by double circle.
Example of DFA
Suppose a DFA be
Q = {a, b, c},
Σ = {0, 1},
q0 = {a},
F = {c},
Transition function δ is shown in the table as follows −
Current State Next State for Input 0 Next State for Input 1
A a B
B b A
C c C
Applications of FAs
Although FAs are limited in computational power, they have the virtue of being relatively
easy to understand. Consequently, they are often used by software developers and non-
software system designers as a means of summarizing the behavior of a complex system.
Example
Fig. 2.1 is a state diagram summarizing the behavior of processes in a typical operating
system. Most operating systems will be running more processes than can be simultaneously
accommodated on the number of physical CPUs. Therefore newly started processes start in
a Ready state and have to wait until the OS scheduler assigns a CPU to them. At that
moment, the process starts Running. It stays in this state until either the scheduler decides to
take back the CPU (because a “time slice” has expired) or because the process has initiated an
I/O operation that, compared to the CPU speed, may take a substantial amount of time. In the
latter case, the process moves into a Blocked state, surrendering the CPU back to the
schedule. When the I/O operation is completed, the process returns to the Ready state until
the scheduler decides to give it some more CPU time.
The notation used in this diagram is that of a UML state diagram. The very fact that the
notation for such state diagrams is part of an industry standard notation should give you a
sense of how common it is for developers to use FAs as a basis for reasoning about software.
Whereas graphically (same as DFA), a NDFA can be represented by diagraphs called state
diagrams where −
The states are represented by vertices.
The transitions are shown by labeled arcs.
The initial state is represented by an empty incoming arc.
The final state is represented by double circle.
Example of NDFA
Suppose a NDFA be
Q = {a, b, c},
Σ = {0, 1},
q0 = {a},
F = {c},
Transition function δ is shown in the table as follows –
Current State Next State for Input 0 Next State for Input 1
A a, b B
B C a, c
C b, c C
REFERENCES
1. https://www.cs.odu.edu/~zeil/cs390/latest/Public/fsa/index.html