101 views
find the DFA which accept strings such that 2nd symbol from RHS is $'a'$ .

$w=\{a,b\}^*$
edited | 101 views

+1 vote

Either construct NFA and then convert it into DFA. Or  If you want to construct directly then here is the Idea :

While constructing DFA, Whenever you see $a$, think of it as 2nd last symbol. So, After this $a$ you can allow $a,b$ and accept. But after this when you see $a,b$ you must make a transition to relevant state.

The DFA will look like this :

selected by
0
What if the 3rd symbol from the right has to be 'a'?
+1
Then we will extend the idea and construct accordingly. We will have 8 states in minimal DFA with 4 final states.

1
2
3
4
5
6