NFA (Non-Deterministic finite automata)
In the following image, we can see that from state q0 for input a, there are two next states q1 and q2, similarly, from q0 for input b, the next states are q0 and q1. Thus it is not fixed or determined that with a particular input where to go next. Hence this FA is called non-deterministic finite automata. Formal definition of NFA:NFA also has five states same as DFA, but with different transition function, as shown follows: δ: Q x ∑ →2Q where, Graphical Representation of an NFAAn NFA can be represented by digraphs called state diagram. In which:
Example 1:Solution: Transition diagram: Transition Table:
In the above diagram, we can see that when the current state is q0, on input 0, the next state will be q0 or q1, and on 1 input the next state will be q1. When the current state is q1, on input 0 the next state will be q2 and on 1 input, the next state will be q0. When the current state is q2, on 0 input the next state is q2, and on 1 input the next state will be q1 or q2. Example 2:NFA with ∑ = {0, 1} accepts all strings with 01. Solution: Transition Table:
Example 3:NFA with ∑ = {0, 1} and accept all string of length atleast 2. Solution: Transition Table:
Next TopicExamples of NFA
|