Professional Documents
Culture Documents
(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.
It has a set of states and rules for moving from one state to
another but it depends upon the applied input symbol.
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
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
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
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