Automata

NFA for strings containing 'a'

We will follow below steps to create NFA
L = {a, ab, aab, bab, aa, ...}

Follow the steps describing "how to create NFA":
  1. First like DFA cover the inputs in the start
  2. There is slight change than DFA, we will include the higer bound and then we will go ahead with the actual input
  3. Means we will go on state A for input 'a'/'b' and then also we will go to state B on input 'a'
  4. We will then include a loop for 'a'/'b' on final state to cover every possible string.

Testing

  1. We will take one string aab
  2. First input is 'a', so from state A we will go to state A and state B
  3. Now we have to ways to check for next input 'a', so from state A on 'a' we will go to A and B again
  4. And from B on 'a' we will go state B itself
  5. From B on input 'b' we will go state B itself
  6. And check all the possible ways which will lead to final state
If we will get final state anyhow then we declare the string is accepted in NFA otherwise not, there is no concept of dead state