0% found this document useful (0 votes)
29 views

Finite Automata2

A finite automaton is a mathematical model of computation that consists of a finite number of states. It transitions between these states based on an input sequence of symbols, according to its transition function. There are two main types: deterministic finite automata (DFAs) which transition deterministically to a single next state, and non-deterministic finite automata (NFAs) which may transition non-deterministically to multiple next states. Both can be represented as 5-tuples defining their states, inputs, transitions, initial state, and accepting states.

Uploaded by

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

Finite Automata2

A finite automaton is a mathematical model of computation that consists of a finite number of states. It transitions between these states based on an input sequence of symbols, according to its transition function. There are two main types: deterministic finite automata (DFAs) which transition deterministically to a single next state, and non-deterministic finite automata (NFAs) which may transition non-deterministically to multiple next states. Both can be represented as 5-tuples defining their states, inputs, transitions, initial state, and accepting states.

Uploaded by

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

Finite Automaton

A Finite State Machine (FSM) or finite state automaton is an abstract machine used in the study
of computation and language that has only a finite, constant amount of memory.

Finite Automata
o Finite automata are used to recognize patterns.
o It takes the string of symbol as input and changes its state accordingly. When the desired
symbol is found, then the transition occurs.
o At the time of transition, the automata can either move to the next state or stay in the
same state.
o Finite automata have two states, Accept state or Reject state. When the input string is
processed successfully, and the automata reached its final state, then it will accept.

Formal Definition of FA

A finite automaton is a collection of 5-tuple (Q, ∑, δ, q0, F), where:

1. Q: finite set of states


2. ∑: finite set of the input symbol
3. q0: initial state
4. F: final state
5. δ: Transition function
Types of Finite Automaton:

 Deterministic Finite Automata (DFA)


 Non-Deterministic Finite Automata (NFA or NDFA)

Description of Finite Automaton

A finite automaton is defined as 5-tuples (Q, Σ, δ, q0, F). where, Q is finite non-empty set of
states, Σ is finite non-empty set of input d alphabets, δ is transition function which maps Q × Σ
into Q, q0 is initial state and q0 ∈ Q, F is set of final states and F ⊆ Q.

 For DFA: Q × Σ → Q
 For NFA: Q × Σ → 2Q

 Deterministic Finite Automaton (DFA) In DFA, for each input symbol, one can determine the
state to which the machine will move. Hence, it is called Deterministic Automaton. As it has a
finite number of states, the machine is called Deterministic Finite Machine or Deterministic
Finite Automaton.

Formal Definition of a DFA 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.

 δ 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).

NFA (Non-Deterministic finite automata)


o NFA stands for non-deterministic finite automata. It is easy to construct an NFA than
DFA for a given regular language.
o The finite automata are called NFA when there exist many paths for specific input from
the current state to the next state.
o NFA is defined in the same way as DFA but with the following two exceptions, it
contains multiple next states, and it contains ε transition.

In the following image, we can see that from state q0 for input a, there are two next states q1 and
q2, similarly, from q0 for input b, the next states are q0 and q1. Thus it is not fixed or determined
that with a particular input where to go next. Hence this FA is called non
non-deterministic
deterministic finite
automata.

Formal definition of NFA:

NFA also
lso has five states same as DFA, but with different transition function, as shown follows:

δ: Q x ∑ →2Q

 Transition Diagrams

 A transition diagram is a finite directed labelled graph in which each vertex represents a
state and directed edges indicate the transition from one state to another. Edges are
labelled with input/output. In this, the initial state is represented by a cir
circle
cle with an arrow
towards it, the final state is represented by two concentric circles and intermediate states
are represented by just a circle.

 Example: Consider the following Finite Automata

Important observations for the above FA:

1. The finite automaton M1 has three states, labeled q1, q2, and q3; since these are the labels
found in the three circles. Thus, Q = { q1, q2, q3 }
2. The input symbols for M1 are 0 and 1, as these are the only labels found on the arrows
that represent the transitions. Thus, Σ = { 0, 1 }.

3. The start state is q1, the state shown with an unlabeled input arrow coming
from nowhere.
4. The only state marked with the double circle is q3, so F = {q3}.

5. Transitions:

d(q1, 0 ) = q2 d(q1, 1 ) = q1
d(q2, 0 ) = q2 d(q2, 1 ) = q3
d(q3, 0 ) = q2 d(q3, 1 ) = q1

6. FA accepts all strings where each string ends with 01.

You might also like