1 Crore+ students have signed up on EduRev. Have you? 
Part II. Finite Automata
Different classes of automata are there. examples: finite automata, pushdown automata. Of them finite automata is the simplest one.In Module I, during the discussion of chomsky classification, it was seen that type3 or regular languages are recognised using finite automata.
Definition
A finite automation, M is a 5 tuple structure,
M ( Q, ∑, q_{0}, δ, F )
where M is the finite automation,
Q is a finite set of states,
∑ is a set of input symbols,
q0 is the start state,
δ is the set of transition functions,
F is the set of final states.
Consider the following example for a finite automation, M.
In the above finite automation, M,
1. Q = {q_{0}, q_{1}, q_{2}, q_{3}, q4}
Q is the set of states in the finite automata. In the above finite automata, q_{0}, q_{1}, q_{2}, q_{3}, q_{4} are the states. The states are shown in circles.
2. ∑ = a, b, c
∑ is the set of input symbols in the finite automata. In the above, a, b, c are the input symbols. The arrowsare labelled with input symbols.
3. q_{0} = {q_{0}}
q_{0} is the start state. In the above, q_{0} is the start state. For our study, a finite automata contains only one start state. A state with arrow from free space (not coming from any other state) is designated as start state.
4. δ describes the operation of finite automation. δ is the transition function.
For example,
δ(q_{0}, a) = q_{1}
This means, given the current state q0 and the input symbol, a, the finite automation moves (transits) to state q1.
Similarly,
δ(q_{1}, b) = q_{2}
δ(q_{2}, c) = q_{3}
δ(q_{1}, c) = q_{4}
δ(q_{3}, b) = q_{4}
5. F = {q_{2}, q_{4}}
F is the set of final states or accepting states. In the above finite automation, q and q_{4} are the final states. They are shown enclosed in double circles.
Transition Diagrams and Transition Tables
Consider the following finite automation, M.
The above representation of finite automation is called a transition diagram. A finite automata can also be represented as a transition table.This is shown below:
→ q_{0} denotes that q_{0} is the start state.
∗ before q_{2} and q_{4} indicates that q_{2} and q_{4 }are the final states.
3 Language Acceptibility by Finite Automata
String Processing by Finite Automation
Example 1:
Consider the following finite automation, M.
Check whether the string abcb is accepted by the above finite automation.
In the above, q_{0} is the start state. the string abcb has the first symbol, a.
So,
δ(q_{0}, abcb) = q_{1}
δ(q_{1}, abcb) = q_{2}
δ(q_{2}, abcb) = q_{3}
δ(q_{3}, abcb) = q_{4}
Thus,
Thus, after processing the string abcb, we reached the state, q4. Here q4 is a final state. So the string abcb is accepted by the finite automation.
Example 2:
Consider the following finite automation, M
Check whether the string abc is accepted by M.
On processing the string, beginning from the start state, q0,
δ(q_{0}, abc) = q_{1}
δ(q_{1}, abc) = q_{2 }
δ(q_{2}, abc) = q_{3}
Here M halts at q_{3}. But q_{3 }is not a final state. Hence the string abc is rejected by the above finite automation, M.
Example 3:
Conisder the finite automation, M,
Check whether the string abca is accepted by the finite automation, M.
Beginning from the start state, q0,
δ(q_{0}, abca) = q_{1}
δ(q_{1}, abca) = q_{2}
δ(q_{2}, abca) = q_{3}
δ(q_{3}, abca) =
Here for current state, q_{3}, and for input symbol, a, there is no transition. This means M is unable to process the string abca completely. So the string abca is rejected by M.
Language of Finite Automation
In the above, finite automation is used to check the validity of a string. A language is a finite set of strings. So we can use
finite automation to check whether a string belongs to a language.
Consider the following finite automation,
Let L be the language corresponding to the above finite automation, M. Then a string belongs to the language L only if it is accepted by the finite automation, M.
We can say that,
The string abcb belongs to the language, L.
The string abc does not belong to the language, L.
The string abca does not belong to the language, L.
The string ab belongs to the language, L.
The string ac belongs to the language, L.
The string abcbc does not belong to the language , L.
4 Types of Finite Automata
Finite automation is of different types. They are,
Nondeterministic Finite Automata (NFA), and
Deterministic Finite Automata (DFA).
4.1 Non Deterministic Finite Automata (NFA)
Consider the following finite automation, M,
In the above, from state q_{0 }with input symbol 0, there are two possible next states. The next state can be either q_{0} or q_{1}.
Also from state q_{1}, on input symbol, 1, there are two possible next states. The next state can be either q_{1}or q_{2}.
Thus some moves of the finite automation cannot be detrmined uniquely by the input symbol and the current state.
Such finite automation are called Nondeterministic Finite automata (NFA or NDFA).
Example 1:
Consider the following NFA,
Check whether the string 0100 is accepted by the above NFA.
Beginning from the start symbol, q_{0},
δ(q_{0}, 0100) = q_{0}
δ(q_{0}, 0100) = q_{0}
δ(q_{0}, 0100) = q_{3}
δ(q_{3}, 0100) = q_{4}
q_{4} is a final state. So the string 0100 is accepted by the above finite automation.
Example 2:
Consider the following NFA,
Check whether the string 01101 is accepted by the above NFA.
δ(q_{0}, 01101) = q_{0}
δ(q_{0}, 01101) = q_{0}
δ(q_{0}, 01101) = q_{0}
δ(q_{0}, 01101) = q_{1}
δ(q1, 01101) = q_{2}
q2 is a final state. So the string 01101 is accepted by the above NFA.
Example 3:
Check whether the string abbaa is accepted by the above NFA.
δ(q_{0}, abbaa) = q_{0}
δ(q_{0}, abbaa) = q_{0}
δ(q_{0}, abbaa) = q_{1}
δ(q_{1}, abbaa) = q_{2}
δ(q_{1}, abbaa) = q_{f}
q_{f} is a final state. So the string abbaa is accepted by the above NFA.
4.1.1 NFA with Epsilon Transitions
An NFA can contain certain transitions on input symbol, ε (epsilon).
ε means ’null’.
For example, consider the following NFA,
Check whether the string 100110 is accepted by the above NFA.
δ(q_{0}, 100110) = q_{0}
δ(q_{0}, 100110) =q_{0}
δ(q_{0}, 100110) = q_{0}
δ(q_{0}, 100110) = q_{1}
δ(q_{1}, 100110) = q_{2}
δ(q_{2}, 100110) = q_{2}
δ(q_{2}, ε) = q_{4}
q4 is a final state. So the string 100110 is accepted by the above NFA.
Here note that, we made an ε move to reach the final state, q_{4}.
Thus, ε transition means a transition without scanning the symbol in the input string.
Example 2:
Consider the following NFA,
Check whether the string 0012 is accepted by the above NFA.
Beginning with the start state, q0,
δ(q_{0}, 0012) = q_{0}
δ(q_{0}, 0012) = q_{0}
δ(q_{0}, ε) = q_{1}
δ(q_{1}, 0012) = q_{1}
δ(q_{1}, ε) = q_{2}
δ(q_{2}, 0012) = q_{2}
Here q_{2} is a final state. So the string 0012 is accepted by the NFA.
4.2 Deterministic Finite Automata
Consider the following finite automation,
In the above, input symbols are 0, 1 and 2. From every state, there is only one transition for an input symbol.
From state, q_{0}, for symbol, 0, there is only one transition, that is to state q_{0} itself.
From state, q_{0}, for symbol, 1, there is only one transition, that is to state q_{1}.
From state, q_{1}, for symbol, 1, there is only one transition, that is to state q_{3}, and so on.
Thus all the moves of the above finite automation can be determined uniquely by the current state and input symbol.
Such a finite automation is called Deterministic finite Automation (DFA).
Thus in a DFA, at every step, next move is uniquely determined. No ε transitions are present in a DFA.
Example 1:
The following shows a DFA,
Above transition diagram can be represented using the transition table as follows:
Check whether the string aaba is accepted by the above DFA.
Beginning from the start state, q0,
δ(q_{0}, aaba) = q_{0}
δ(q_{0}, aaba) = q_{0}
δ(q_{0}, aaba) = q_{1}
δ(q_{1}, aaba) = q_{1}
After processing all the characters in the input string, final state q_{1 }is reached. So the string aaba is accepted by the above finite automation.
Example 2:
Consider the following DFA,
Check whether the string aabba is accepted by the above DFA.
δ(q_{0}, aabba) = q_{0}
δ(q_{0}, aabba) = q_{0}
δ(q_{0}, aabba) = q_{1}
δ(q_{1}, aabba) = q_{0}
δ(q_{0}, aabba) = q_{0}
After processing all the symbols in the input string, aabba, the state q_{0} is reached. But q_{0} is not a final state. So the DFA rejects the string aabba.
18 videos56 docs41 tests

Use Code STAYHOME200 and get INR 200 additional OFF

Use Coupon Code 
18 videos56 docs41 tests
