You are on page 1of 35

Finite Automata

(FA)
Automata
An automaton is defined as a system where energy, materials, and
information are transformed, transmitted, and used for performing some
functions without the direct participation of man.
Examples are automatic machine tools, automatic packing machines, and
automatic photo printing machines.

Different Kinds of Automata


•Automata are distinguished by the temporary memory

• Finite Automata: No Temporary Memory


• Pushdown Automata: Stack
• Turing Machines: Random Access Memory
Finite Automata (FA)

Finite Automata == Finite State Machine

Finite Automata(FA) is the simplest machine to recognize


patterns.

It has a set of states and rules for moving from one state to
another but it depends upon the applied input symbol.

Basically it is an abstract model of digital computer.


Finite Automata (FA)

Figure: Features of Finite Automata


An FA has three components:
1.Input tape ( Input Buffer) contains single string
2.Head reads input string, one symbol at a time ( From Left to Right)
3.Memory is in one of a finite number of states.
Definition of a Finite Automaton

An automaton 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).


Symbols
state

Initial state

Accepting state
OR
Final State

Input Symbols
Example:

Dig.1: FA

𝛿 (S1,1)=S1
𝛿 (S1,0)=S2
𝛿 (S2,1)=S2
𝛿 (S2,0)=S1
How an FA works
0 1 0

s f

1
Input: 001101
0 0 1 1 0 1 ACCEPT

Input: 01001 0 1 0 0 1 REJECT


Example: yielding next configuration

0 1 0 (s, 001101)
s f
M (s, 01101)
M (s, 1101)
M (f, 101)
1 M (s, 01)
M (s, 1)
001101 M (f, )
Design DFA
• Q1. Design DFA which accepts set of all strings over {a, b},
where each string Starts with an ‘a’ .
Q1. Design DFA which accepts set of all strings over {a, b},
where each string Starts with an ‘a’ .
Solution

Strings: DFA: a,b


a) a a
Q1 Q2
b) aa
c) aaa b a,b
d) ab Q3

e ) aabb Q3 = Dead State


f) ababab

and so on ………
• Q2. Design DFA which accepts set of all strings over {a, b},
where each string Contains ‘a’ .
Q2. Design DFA which accepts set of all strings over {a, b},
where each string Contains ‘a’ .
Solution

Strings: DFA: a
a) a a
Q1 Q2
b) aa
c) aaa
d) bba b b

e ) aabb
f) bbabab No Dead State in DFA

and so on ………
• Q3. Design DFA which accepts set of all strings over {a, b},
which start with ‘ab’
Q3. Design DFA which accepts set of all strings over {a, b},
which start with ‘ab’
Solution

Strings: DFA: a,b


a) ab
b) aba a b
c) abb Q1 Q2 Q3

d) abbb
e ) abaa b a
f) ababaa
Q4
g) abab
and so on ……… a,b
Q4 = Dead State in DFA
• Q 4. Design DFA which accepts set of all strings over {a, b},
which ends with ‘ab’
Q 4. Design DFA which accepts set of all strings over {a, b},
which ends with ‘ab’
Solution

Strings:
a) ab
b) aab
c) bab
d) abab a a
b
e ) baaab
f) abaaaab a b Q3
Q1 Q2
g) aabbab
and so on ………
b
DFA
Q5. Design DFA which accepts set of all strings over {a, b},
which starts with ‘a’ and ends with ‘b’
Q5. Design DFA which accepts set of all strings over {a, b},
which starts with ‘a’ and ends with ‘b’
Solution

Strings:
a) ab
b) aab
c) abab
d) abaab b
a
e ) aaaabb
f) abbbaab a b Q3
Q1 Q2
g) aabbb
and so on ……… b
Q4
a
a, b
DFA Q4 = Dead State in DFA
Q6. Design DFA which accepts set of all strings over {a, b},
which starts and ends with different symbol.
Q6. Design DFA which accepts set of all strings over {a, b},
which starts and ends with different symbol.
Solution
b
Strings: a
a) ab
a b
b) aab Q1 Q2 Q3

c) abb
b
d) aabab a
e ) abaabbab Q4
b
f) ba b
a
g) bba Q5
h) bababa
a
i) bbaba DFA
and so on ………
Q7. Design DFA which accepts set of all strings over {a, b},
which starts and ends with same symbol.
Q8. Design DFA which do not accepts set of all strings over
{a, b}, which the end with ba.
Q9. Design DFA which accepts set of all strings over
{a, b}, even no of a’s and b’s.
Q9. Design DFA which accepts set of all strings over
{a, b}, even no of a’s and b’s.
Q10. Design DFA which accepts set of all strings over
{0, 1} divisible by 3. n mod 3 =0
Q11. Design DFA which accepts set of all strings over
{0, 1} divisible by 5. n mod 5 =0
Q12. Design DFA which accepts set of all strings over
{a,b} all string with prefix ab

L(M ) = { all strings with prefix }


Q13. Design DFA for given language over the alphabet {a,b}
L(M ) = { an b : n>0 }
Q14.L = { W | W belong to {a,b}* and end with
the substrings ab}
Q15.The language is regular:
L = {awa: w E {a,b}*}
Q16. Design DFA which accepts set of all strings
over {0, 1}, which starts with 00 and ends 11.
Q17. Construct a DFA which accept the
language L = {anbm | n > =1, (m) mod 3 = 1}

You might also like