Week 8 Finite Automata I

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

I an alphabet is finite sets of symbols

eg
-

(a,b,c,...,z
-

30,13
- word or
string (over an alphabets) is a finite sequence of
written without
symbols from 3 commas

e.g-tortoise
-
11(100001
- the
empty word, denoted by 3, is a word over
any
alphabet (assuming is not a symbol of any alphabet
->
length of a word wis

(w) number
=
of symbols in w

-> the concatenation of words handy (written xy):


word a followed by
wordy
e.g
www.... wh
"
(01) = 010101
word
xE Ex
= x
=

for every b

->
if n =

xy them as is
prefix of wand is suffix of
w

eg for is
prefix and suffix of tortoise
so is

tortoise is both prefix and suffix of tortoise


set of words
-A language lover an
alphabets) is a over

e.g
S 9a,b,c,...,z7
=

LIFARengUshwordsthis
E

Lz all latin words


=
is a
langet

Finite Automaton

-> A theoretical model for programs using a constant


amount of
memory regardless of input form
Finite Control Device

-> In any moment it can be in one of its states, it is hard-


wired to change from one state to another.

-> there are some special states:


finite control device
↳ initial state %
8
↳ favourable states
·oto
Reading
0.

head of
a balbiblalcIc...
Input tape: cells, having
divided into
a leftmost cell, but as
long as needed on
the Each cell may contain one
right. the
of alphabet.
character input
How a finite automaton works

-> the finite control device is in its unique initial state

-> The
tape contains a finite word of the input alphabet
starting from the left and blank cells after.

-
reading head is positioned on leftmost cell containing
First character of input word.

->
At regular
intervals, the automation
↳ reads character from input tape
one

↳ moves
reading head
↳ chooses next state
one cell to
right
of control device.

-> the control device is hard wined such that the next
state depends on the previous state and on the
character read from the
tape.
->
As the input is finite, at some moment the reading
reaches the end of the input word (i.e the first
blank cell)
- if at this
point the controlderice is in favourable state
a
3
the automation. Otherwise, it
the input word is accepted by is

rejected
Each finite automation is kind of or decision
->

all
a
recognition
words of its input alphabet
device over possible
-> Each automaton can be tried on infinitely many input words and
each time.
gives a YES/NO answer

State Transition Diagrams


-> We can
represent the hardwired control device of finite a

automation
by directed multigraph
a

↳ With the vertices


representing the states
is the
arrowledge being labelled by symbols of the input alphabet
& & ↳ga
xs
q r
-

La

↳initial state is marked


by 7 b

Favourable state is double circled


wired the
↳ Each arrow represents a
possible transition, hard in

control device.
e.g for
automation above
input 1: abba
computation: (s,abba), (s.bba),(q,ba), (q,a),(v,9)
abba is rejected

input 2:aabb
computation: (s,aabb). (s,abb), (s,bb), (q,b), (9,2)
aabb is accepted
Deterministic Finite Automaton (DFA)

-> In order to describe a DFA we need 5 things:


↳its states
↳ its input alphabets
↳ its (unique) initial state
↳ its favourable (or states (there can be x, 0
accepting)
↳ its transition function: for
every (state, symbol) pair we
tell what next state should be.

-
why deterministic
and each
↳ for each state
symbol, there is a
unique arrow

coming out of the state labelled


by the symbol. The pair
essentially uniquely determines the next state

tables
transition
->

&
a

& &
A,.>sc r -
La

states: 3, g,r input alphabet: 9a, b3 initial


state:s favourable state:

& rr m
q

COnly for DFAs]


->
if we collect all words the DFA A accepts, we obtain the
language of the DFAA

L(A) set of all words accepted by


= A

You might also like