NFA for strings containing 'a'
We will follow below steps to create NFAL = {a, ab, aab, bab, aa, ...}
Follow the steps describing "how to create NFA":
- First like DFA cover the inputs in the start
- There is slight change than DFA, we will include the higer bound and then we will go ahead with the actual input
- Means we will go on state A for input 'a'/'b' and then also we will go to state B on input 'a'
- We will then include a loop for 'a'/'b' on final state to cover every possible string.
Testing
- We will take one string aab
- First input is 'a', so from state A we will go to state A and state B
- 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
- And from B on 'a' we will go state B itself
- From B on input 'b' we will go state B itself
- And check all the possible ways which will lead to final state