Vous êtes sur la page 1sur 27

FT

FINITE STATE AUTOMATA

RA Dr. Sheetal A. Takale

Vidya Pratishthan’s Kamal Nayan Bajaj Institute of Engineering and Technology


sheetal.takale@vpkbiet.org

June 27, 2019

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 1 / 27
Finite Automata

FT
RA Figure: Finite Automata Modeling an on/off Switch

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 2 / 27
Finite Automata

FT
RA
Figure: Finite Automata

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 3 / 27
Finite Automata

FT
One-way, infinite tape, broken into cells
One-way, read-only tape head
RA Finite control, i.e.,
finite number of states, and
transition rules between them, i.e.,
a program, containing the position of the read head, current symbol
being scanned, and the current“state.”
A string is placed on the tape, read head is positioned
at the left end, and the DFA will read the string one
symbol at a time until all symbols have been read.
.
.
.
.
.
. . . . .
. . . .
. . . .
. . . .
. . . .
. . . . .
.
.
.
.
.
.
.
.
.

Sheetal Takale (VPKBIET) TOC June 27, 2019 4 / 27


Example of Finite Automata

FT
RA One state is final/accepting, all others are rejecting.
The above FA accepts those strings that contain an
even number of 0’s, including the null string, over
Σ = {0, 1}
L = all strings with even no of zeros
The DFA rejects all other strings. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 5 / 27
Finite Automata

FT
A Finite Automaton(FA) is defined as a collection of
5-tuple M = (Q, Σ, δ, q0 , A)
where
Q- is finite set of states
Σ - finite input alphabet
q0 - initial state
RA
A- finite set of accepting states
δ - transition function(STF)
Q×Σ→Q
Finite Automata is represented by:
A transition diagram
A transition table . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 6 / 27
Transition Diagram

FT
A transition diagram for a DFA (Q, Σ, δ, q0 , A) is a graph
For each state in Q there is a node
For each state q in Q and each input symbol a in Σ.
Let δ(q, a) = p, Then the transition diagram has an
arc from node q to node p labeled a. If there are
several input symbols that cause transitions from q to
RA p, then the transition diagram can have one arc
labeled by the list of these symbols
Initial state is represented with an arrow into the start
state q0 labeled Start
Nodes corresponding to accepting states are marked
by a double circle States not in F have a single circle.
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 7 / 27
Transition Table

FT
A transition table is a conventional tabular
representation of a function δ : Q × Σ → Q that takes
two arguments and returns a single value
The rows correspond to the states Q and the columns
RA correspond to the inputs Σ
The entry for the row corresponding to state q and the
column corresponding to input a is the state δ(q, a)

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 8 / 27
Finite Automata and Finite State Machine

FT
A few notation differences between Finite Automata and
Finite State Machine are
Q is analogous to S
RA Σ is analogous to I
δ : Q × Σ → Q is analogous to STF:I × S → S
FA does not include Output set O of FSM.Hence, is
FA without output.
FA instead has Final States A, which can be reached
only if input is acceptable.

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 9 / 27
Finite Automata Examples

FT
Example 1: Design FA accepting strings over Σ = {a, b}
ending with “aa”.

RA
Figure: Finite Automata Example 1

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 10 / 27
Finite Automata Examples

FT
Example 2: Design FA accepting strings over Σ = {a, b}
ends with b and does not contain the substring “aa”.

RA
Figure: Finite Automata Example 2
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 11 / 27
Finite Automata Examples

FT
Example 3: Design FA accepting strings over Σ = {0, 1}
and containing odd number of 1s.

RA
Figure: Finite Automata Example 3

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 12 / 27
Finite Automata Examples

FT
Example 4: Design FA accepting strings over Σ = {0, 1}
and containing 101 as substring.

RA
Figure: Finite Automata Example 4

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 13 / 27
Finite Automata Examples

FT
Example 5 : Design FA accepting strings over Σ = {0, 1}
having 1 in the third position from the right.

RA
Figure: Finite Automata Example 5
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 14 / 27
Finite Automata Examples

FT
Example 6 : Design FA accepting strings over Σ = {0, 1}
strings w having every odd position of w is a 0 (the first
position is always position 0, similar to an array).

RA
Figure: Finite Automata Example 6

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 15 / 27
Finite Automata Examples

FT
Example 7 : Design FA accepting strings over Σ = {0, 1} divisible by 3 or
it ends in 00.

RA
Figure: Finite Automata Example
.
. . .
7.
. . . . . .
. . .
. . . .
. . . .
. . . .
. . . . .
.
.
.
.
.
.
.
.
.

Sheetal Takale (VPKBIET) TOC June 27, 2019 16 / 27


Finite Automata Examples

FT
Example 8 : Design FA accepting strings over Σ = {0, 1} having even no.
of 0s followed by even no. of 1s.

RA
Figure: Finite Automata Example
. . 8. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 17 / 27
Finite Automata Examples

FT
Example 9 : Design FA accepting strings over Σ = {0, 1} with every block
of 4 consecutive symbols contains the substring 01.

RA
Figure: Finite Automata Example 9
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 18 / 27
Finite Automata Examples

FT
Example 10 : Design FA accepting strings over Σ = {a, b}
where, all strings that do not contain the substring aba.

RA
Figure: Finite Automata Example 10

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 19 / 27
Finite Automata Examples

FT
Example 11 : Design FA accepting strings over
Σ = {0, 1} binary numbers that are multiples of 5.

RA
Figure: Finite Automata Example
.
. . .
11. .
. . . . . .
. .
. . . .
. . . .
. . . .
. . . . .
.
.
.
.
.
.
.
.
.

Sheetal Takale (VPKBIET) TOC June 27, 2019 20 / 27


Finite Automata Examples

FT
Example 12 : Design FA accepting strings over
Σ = {0, 1} strings having 001 as substring.

RA
Figure: Finite Automata Example 12

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 21 / 27
Finite Automata Examples

FT
Example 13 : Design FA accepting strings over Σ = {0, 1}
strings having an odd number of 1s and odd number of 0s.

RA
Figure: Finite Automata Example 13
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 22 / 27
Finite Automata Examples

FT
Example 14 : Design FA accepting strings over
Σ = {a, b} having even number of a’s and b’s.

RA
Figure: Finite Automata Example 14

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 23 / 27
Finite Automata Examples

FT
Example 15 : Design FA accepting strings over
Σ = {a, b}strings containing the substring abbaab.

RA
Figure: Finite Automata Example 15

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 24 / 27
Finite Automata Examples

FT
Example 16 : Design FA accepting strings over
Σ = {0, 1}strings are binary representations of integers
divisible by 3.

RA
Figure: Finite Automata Example
.
. . .
16. .
. . . . . .
. .
. . . .
. . . .
. . . .
. . . . .
.
.
.
.
.
.
.
.
.

Sheetal Takale (VPKBIET) TOC June 27, 2019 25 / 27


Finite Automata Examples

FT
Example 16 : Design FA accepting strings over
Σ = {0, 1} strings are of length 4i and each consecutive
block of 4 bits contains at least two 0s.

RA
Figure: Finite Automata Example 17
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 26 / 27
FT
RA The End

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Sheetal Takale (VPKBIET) TOC June 27, 2019 27 / 27

Vous aimerez peut-être aussi