0% found this document useful (0 votes)
24 views5 pages

Automata

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views5 pages

Automata

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Discrete Structures 2

Automata
----------------------------------------------------------------------------------------------------
Instructions:
Review the notes. Provide an illustration with an explanation of the following:
1. Deterministic Finite Automata (DFA)
2. Non-deterministic Finite Automata (NFA)
----------------------------------------------------------------------------------------------------
The term “Automata” is derived from the Greek word “αὐτόματα” which means
“self-acting”. An automation (Automata in plural) is an abstract self-propelled
computing device which follows a predetermined sequence of operations
automatically.
An automation with a finite number of states is called a Finite Automata (FA) or
Finite State Machine (FSM).
A finite automata 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.
- 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).

1. Deterministic Finite Automata (DFA)


DFA refers to Deterministic Finite Automaton. A Finite Automata (FA) is said to
be deterministic if corresponding to an input symbol, there is a single resultant
state i.e., there is only one transition. A deterministic finite automata is a set of five
tuples represented as,
M = {Q, Σ, δ , q0, F}
Where,
- Q is a non-empty finite set of states in the finite control (q0, q1, q2, …).
- Σ is a non-empty finite set of input symbols called the alphabet.
- δ is a transition function that takes two arguments, a state, and an input symbol, it
returns a single state (δ : Q × Σ → Q).
- q0 is a starting state, and one of the states in Q, or the initial state from where any
input is processed (q0 ∈ Q).
- F is a non-empty set of final state(s)/accepting states from the set belonging to Q
(F ⊆ Q).

A DFA is represented by digraphs called state diagram.


- The vertices/circles represent the states.
- The arcs labeled with an input alphabet show the transitions.
- The initial state is denoted by an empty single incoming arc.
- The final state is indicated by double circles.

Example:
Let a deterministic finite automaton be
- Q = {a, b, c},
- Σ = {0, 1},
- q0 = {a},
- F = {c}, and
- Transition function δ as shown by the following table:
Present State Next State for Input 0 Next State for Input 1
a a b
b c a
c b c

Its graphical representation would be as follows:


2. Non-deterministic Finite Automata (NFA)
NFA refers to Non-deterministic Finite Automaton. A Finite Automata (FA) is said
to be non-deterministic if there is more than one possible transition from one state
on the same input symbol. A non-deterministic finite automata is also a set of five
tuples and represented as,
M = {Q, Σ, δ , q0, F}
Where,
- Q is a set of non-empty finite states.
- Σ is a set of non-empty finite input symbols called the alphabet.
- δ is a transition function that takes a state from Q and an input symbol from Σ and
returns a subset of Q (δ : Q × Σ → 2Q, the power set of Q (2Q) has been taken
because in the case of NFA, from a power state, transition can occur to any
combination of Q states).
- q0 is the initial state of NFA from where any input is processed and member of Q
(q0 ∈ Q).
- F is a non-empty set of final state((s) and member of Q (F ⊆ Q).

An NFA, similar to the DFA, is also represented by digraphs called state diagram.
- The vertices/circles represent the states.
- The arcs labeled with an input alphabet show the transitions.
- The initial state is denoted by an empty single incoming arc.
- The final state is indicated by double circles.

Example:
Let a non-deterministic finite automaton be
- Q = {a, b, c},
- Σ = {0, 1},
- q0 = {a},
- F = {c}, and
- Transition function δ as shown by the following table:
Present State Next State for Input 0 Next State for Input 1
a a, b b
b c a, c
c b, c c

Its graphical representation would be as follows:

Differences between DFA and NFA:


DFA NFA
DFA stands for Deterministic Finite NFA stands for Non-deterministic
Automata. Finite Automata.
For each symbolic representation of the No need to specify how does the NFA
alphabet, there is only one state
react according to some symbol.
transition in DFA.
DFA cannot use Empty String
NFA can use Empty String transition.
transition.
NFA can be understood as multiple
DFA can be understood as one
little machines computing at the same
machine.
time.
In NFA, each pair of state and input
In DFA, the next possible state is
symbol can have many possible next
distinctly set.
states.
DFA is more difficult to construct NFA is easier to construct.
DFA rejects the string in case it NFA rejects the string in the event of
terminates in a state that is different all branches dying or refusing the
from the accepting state. string.
Time needed from executing an input Time needed from executing an input
string is less. string is more.
All DFA are NFA. Not all NFA are DFA.
DFA requires more space. NFA requires less space than DFA.
Dead state may be required. Dead state is not required.
δ : Q × Σ → Q i.e., next possible state δ : Q × Σ → 2Q i.e., next possible state
belongs to Q. belongs to power set of Q.
Backtracking is not always possible in
Backtracking is allowed in DFA.
NFA.
Conversion of Regular expression to Conversion of Regular expression to
DFA is difficult. NFA is simpler compared to DFA.
----------------------------------------------------------------------------------------------------

You might also like