0% found this document useful (0 votes)
10 views15 pages

Finite Automata: States, Transitions and Finite-State Transition System

The document discusses finite automata, including deterministic finite automata (DFA) and non-deterministic finite automata (NFA), detailing their definitions, components, and operational mechanisms. It explains the equivalence between DFA and NFA, the concept of state transitions, and the process of constructing equivalent automata without epsilon transitions. Additionally, it covers the acceptance of strings and the formal definitions of languages recognized by these automata.

Uploaded by

yashkol44
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)
10 views15 pages

Finite Automata: States, Transitions and Finite-State Transition System

The document discusses finite automata, including deterministic finite automata (DFA) and non-deterministic finite automata (NFA), detailing their definitions, components, and operational mechanisms. It explains the equivalence between DFA and NFA, the concept of state transitions, and the process of constructing equivalent automata without epsilon transitions. Additionally, it covers the acceptance of strings and the formal definitions of languages recognized by these automata.

Uploaded by

yashkol44
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/ 15

mywbut.

com

Finite Automata

Automata (singular: automation) are a particularly simple, but useful, model of computation.
They were initially proposed as a simple model for the behavior of neurons. The concept of a
finite automaton appears to have arisen in the 1943 paper “A logical calculus of the ideas
immanent in nervous activity", by Warren McCullock and Walter Pitts. In 1951 Kleene
introduced regular expressions to describe the behaviour of finite automata. He also proved the
important theorem saying that regular expressions exactly capture the behaviors of finite
automata. In 1959, Dana Scott and Michael Rabin introduced non-deterministic automata and
showed the surprising theorem that they are equivalent to deterministic automata. We will study
these fundamental results. Since those early years, the study of automata has continued to grow,
showing that they are indeed a fundamental idea in computing.

States, Transitions and Finite-State Transition System:

Let us first give some intuitive idea about a state of a system and state transitions before
describing finite automata.

Informally, a state of a system is an instantaneous description of that system which gives all
relevant information necessary to determine how the system can evolve from that point on.

Transitions are changes of states that can occur spontaneously or in response to inputs to the
states. Though transitions usually take time, we assume that state transitions are instantaneous
(which is an abstraction).

Some examples of state transition systems are: digital systems, vending machines, etc.

A system containing only a finite number of states and transitions among them is called a finite-
state transition system.

Finite-state transition systems can be modeled abstractly by a mathematical model called finite
automation.

We said that automata are a model of computation. That means that they are a simplified
abstraction of `the real thing'. So what gets abstracted away? One thing that disappears is any
notion of hardware or software. We merely deal with states and transitions between states. The
distinction between program and machine executing it disappears. One could say that an
automaton is the machine and the program. This makes automata relatively easy to implement in
either hardware or software. From the point of view of resource consumption, the essence of a
finite automaton is that it is a strictly finite model of computation. Everything in it is of a fixed,
finite size and cannot be modified in the course of the computation.

1
mywbut.com

Deterministic Finite (-state) Automata

Informally, a DFA (Deterministic Finite State Automaton) is a simple machine that reads an
input string -- one symbol at a time -- and then, after the input has been completely read, decides
whether to accept or reject the input. As the symbols are read from the tape, the automaton can
change its state, to reflect how it reacts to what it has seen so far.

Thus, a DFA conceptually consists of 3 parts:

1. A tape to hold the input string. The tape is divided into a finite number of cells. Each cell
holds a symbol from .
2. A tape head for reading symbols from the tape
3. A control , which itself consists of 3 things:
o finite number of states that the machine is allowed to be in (zero or more states
are designated as accept or final states),
o a current state, initially set to a start state,
o a state transition function for changing the current state.

An automaton processes a string on the tape by repeating the following actions until the tape
head has traversed the entire string:

1. The tape head reads the current tape cell and sends the symbol s found there to the
control. Then the tape head moves to the next cell.
2. He control takes s and the current state and consults the state transition function to get the
next state, which becomes the new current state.

Once the entire string has been processed, the state in which the automation enters is examined.
If it is an accept state , the input string is accepted ; otherwise, the string is rejected .
Summarizing all the above we can formulate the following formal definition:

Deterministic Finite State Automaton: A Deterministic Finite State Automaton (DFA) is


a 5-tuple :

• Q is a finite set of states.


• is a finite set of input symbols or alphabet.

• is the “next state” transition function (which is total ). Intuitively, is a


function that tells which state to move to in response to an input, i.e., if M is in state q
and sees input a, it moves to state .
• is the start state.

2
mywbut.com

• is the set of accept or final states.

Acceptance of Strings:

A DFA accepts a string if there is a sequence of states in Q such


that

1. is the start state.


2. for all .
3. .

Language Accepted or Recognized by a DFA:

The language accepted or recognized by a DFA M is the set of all strings accepted by M , and is

denoted by i.e.

The notion of acceptance can also be made more precise by extending the transition function .

Extended transition function:

Extend (which is function on symbols) to a function on strings, i.e.


.

That is, is the state the automation reaches when it starts from the state q and finish
processing the string w. Formally, we can give an inductive definition as follows:

The language of the DFA M is the set of strings that can take the start state to one of the
accepting states i.e.

L(M) = { | M accepts w }

={ | }

3
mywbut.com

Example 1:

is the start state

It is a formal description of a DFA. But it is hard to comprehend. For ex. The language of the
DFA is any string over { 0, 1} having at least one 1.

We can describe the same DFA by transition table or state transition diagram as following:

Transition Table:

0 1

It is easy to comprehend the transition diagram.

Explanation: We cannot reach find state w/0 or in the i/p string. There can be any no. of 0's at
the beginning. (The self-loop at on label 0 indicates it). Similarly there can be any no. of 0's &
1's in any order at the end of the string.

4
mywbut.com

State transition diagram:

Transition table:

It is basically a tabular representation of the transition function that takes two arguments (a state
and a symbol) and returns a value (the “next state”).

• Rows correspond to states,


• Columns correspond to input symbols,
• Entries correspond to next states
• The start state is marked with an arrow
• The accept states are marked with a star (*).

0 1

(State) Transition diagram:

A state transition diagram or simply a transition diagram is a directed graph which can be
constructed as follows:

1. For each state in Q there is a node.


2. There is a directed edge from node q to node p labeled a iff . (If there are
several input symbols that cause a transition, the edge is labeled by the list of these
symbols.)
3. There is an arrow with no source into the start state.
4. Accepting states are indicated by double circle.

Here is an informal description how a DFA operates. An input to a DFA can be any string
. Put a pointer to the start state q. Read the input string w from left to right, one symbol at
a time, moving the pointer according to the transition function, . If the next symbol of w is a
and the pointer is on state p, move the pointer to . When the end of the input string w is

5
mywbut.com

encountered, the pointer is on some state, r. The string is said to be accepted by the DFA if
and rejected if . Note that there is no formal mechanism for moving the pointer.

A language is said to be regular if L = L(M) for some DFA M.

Removing Transition

- transitions do not increase the power of an NFA . That is, any - NFA ( NFA with
transition), we can always construct an equivalent NFA without -transitions. The equivalent
NFA must keep track where the NFA goes at every step during computation. This can be done
by adding extra transitions for removal of every - transitions from the - NFA as follows.

If we removed the - transition from the - NFA , then we need to moves from
state p to all the state on input symbol which are reachable from state q (in the - NFA
) on same input symbol q. This will allow the modified NFA to move from state p to all states on
some input symbols which were possible in case of -NFA on the same input symbol. This
process is stated formally in the following theories.

Theorem if L is accepted by an - NFA N, then there is some equivalent without


transitions accepting the same language L

Proof:

Let be the given with

We construct

Where, for all and and

Other elements of N' and N

We can show that i.e. N' and N are equivalent.

6
mywbut.com

We need to prove that

i.e.

We will show something more, that is,

We will show something more, that is,

We will show something more, that is,

Basis : , then

But by definition of .

Induction hypothesis Let the statement hold for all with .

By definition of extension of

By inductions hypothesis.

Assuming that

By definition of

Since

To complete the proof we consider the case

When i.e. then

7
mywbut.com

and by the construction of wherever constrains a state in


F.

If (and thus is not in F ), then with leads to an accepting state in


N' iff it leads to an accepting state in N ( by the construction of N' and N ).

Also, if ( , thus w is accepted by N' iff w is accepted by N (iff )

If (and, thus in M we load in F ), thus is accepted by both N' and N .

Let . If w cannot lead to in N , then . (Since can add transitions to get an


accept state). So there is no harm in making an accept state in N'.

Ex: Consider the following NFA with - transition.

0 1

Transition table

0 1

Transition table ' for the equivalent NFA


without - moves

Since the start state q0 must be final state in the equivalent NFA .

8
mywbut.com

Since and and we add moves and


in the equivalent NFA . Other moves are also constructed accordingly.

-closures:

The concept used in the above construction can be made more formal by defining the -closure
for a state (or a set of states). The idea of -closure is that, when moving from a state p to a state
q (or from a set of states Si to a set of states Sj ) an input , we need to take account of all
-moves that could be made after the transition. Formally, for a given state q,

-closures:

Similarly, for a given set

-closures:

So, in the construction of equivalent NFA N' without -transition from any NFA with moves.

the first rule can now be written as

Equivalence of NFA and DFA

It is worth noting that a DFA is a special type of NFA and hence the class of languages accepted
by DFA s is a subset of the class of languages accepted by NFA s. Surprisingly, these two classes
are in fact equal. NFA s appeared to have more power than DFA s because of generality enjoyed
in terms of -transition and multiple next states. But they are no more powerful than DFA s in
terms of the languages they accept.

Converting DFA to NFA

Theorem: Every DFA has as equivalent NFA

Proof: A DFA is just a special type of an NFA. In a DFA, the transition functions are defined
from whereas in case of an NFA it is defined from and

be a DFA. We construct an equivalent NFA as follows.

9
mywbut.com

i. e

If and

All other elements of N are as in D.

If then there is a sequence of states such that

Then it is clear from the above construction of N that there is a sequence of states (in N)

such that and and hence

Similarly we can show the converse.

Hence,

Given any NFA we need to construct as equivalent DFA i.e. the DFA need to simulate the
behavior of the NFA . For this, the DFA have to keep track of all the states where the NFA could
be in at every step during processing a given input string.

There are possible subsets of states for any NFA with n states. Every subset corresponds to
one of the possibilities that the equivalent DFA must keep track of. Thus, the equivalent DFA
will have states.

The formal constructions of an equivalent DFA for any NFA is given below. We first consider an
NFA without transitions and then we incorporate the affects of transitions later.

Formal construction of an equivalent DFA for a given NFA without transitions.

Given an without - moves, we construct an equivalent DFA

as follows

i.e.

10
mywbut.com

(i.e. every subset of Q which as an element in F is considered as a


final state in DFA D )

for all and

where

That is,

To show that this construction works we need to show that L(D)=L(N) i.e.

Or,

We will prove the following which is a stranger statement thus required.

Proof: We will show by inductions on

Basis If =0, then w =

So, by definition.

Inductions hypothesis: Assume inductively that the statement holds of length less than
or equal to n.

Inductive step

Let , then with

11
mywbut.com

Now,

Now, given any NFA with -transition, we can first construct an equivalent NFA without -
transition and then use the above construction process to construct an equivalent DFA , thus,
proving the equivalence of NFA s and DFA s..

It is also possible to construct an equivalent DFA directly from any given NFA with -transition
by integrating the concept of -closure in the above construction.

Recall that, for any

- closure :

In the equivalent DFA , at every step, we need to modify the transition functions to keep
track of all the states where the NFA can go on -transitions. This is done by replacing

by -closure , i.e. we now compute at every step as follows:

Besides this the initial state of the DFA D has to be modified to keep track of all the states that
can be reached from the initial state of NFA on zero or more -transitions. This can be done by
changing the initial state to -closure ( ).

It is clear that, at every step in the processing of an input string by the DFA D , it enters a state
that corresponds to the subset of states that the NFA N could be in at that particular point. This
has been proved in the constructions of an equivalent NFA for any -NFA

If the number of states in the NFA is n , then there are states in the DFA . That is, each state in
the DFA is a subset of state of the NFA .

12
mywbut.com

But, it is important to note that most of these states are inaccessible from the start state and
hence can be removed from the DFA without changing the accepted language. Thus, in fact, the
number of states in the equivalent DFA would be much less than .

Example : Consider the NFA given below.

Transition table

0 1

{ }

Since there are 3 states in the NFA

There will be states (representing all possible subset of states) in the equivalent DFA . The
transition table of the DFA constructed by using the subset constructions process is produced
here.

0 1 The start state of the DFA is - closures

The final states are all those subsets that contains (since
in the NFA).

{ } Let us compute one entry,

Similarly, all other transitions can be computed.

13
mywbut.com

Corresponding transition fig. for the DFA is shown as

Note that states are not accessible and hence can be


removed. This gives us the following simplified DFA with only 3 states.

It is interesting to note that we can avoid encountering all those inaccessible or unnecessary
states in the equivalent DFA by performing the following two steps inductively.

1. If is the start state of the NFA, then make - closure ( ) the start state of the
equivalent DFA. This is definitely the only accessible state.

14
mywbut.com

2. If we have already computed a set of states which are accessible. Then .

Compute because these set of states will also be accessible.

Following these steps in the above example, we get the transition table given below

0 1

15

You might also like