How to solve this question from Deterministic Finite Automata?

550 Views Asked by At

With $\Sigma = \{a,b\}$, give a DFA for $L= \{ w_1aw_2 : |w_1|≥ 3, |w_2|≤ 5\}$

In this question is it necessary for the the string $w_1$ to end with $b$ ? Otherwise how will we know from where the string $w_2$ is starting or $w_1$ is ending ? How to design a DFA for this language ?

1

There are 1 best solutions below

2
On BEST ANSWER

I hope it can help you

$DFA_{L}$: $(\{q_{1},q_{2},q_{3},q_{4},q_{5},q_{6},q_{7},q_{8},q_{9},q_{10},q_{11}\},\{a,b\},\delta,\{q_{1}\},\{q_{5},q_{6},q_{7},q_{8},q_{9},q_{10}\})$

$\delta_{1}:(q_{1},\{a,b\})\to q_{2} \,\,\,\,\,\,\,\,\,\,$ $\delta_{2}:(q_{2},\{a,b\})\to q_{3} \,\,\,\,\,\,\,\,\,\,$ $\delta_{3}:(q_{3},\{a,b\})\to q_{4} $

$\delta_{4}:(q_{4},b)\to q_{4}\,\,\,\,\,\,\,\,\,\,$ $\delta_{5}:(q_{4},a)\to q_{5}\,\,\,\,\,\,\,\,\,\,$ $\delta_{6}:(q_{5},a)\to q_{5}\,\,\,\,\,\,\,\,\,\,\,\,$ $\delta_{7}:(q_{5},b)\to q_{6}\,\,\,\,\,\,\,\,\,\,$ $\delta_{8}:(q_{6},a)\to q_{5}\,\,\,\,\,\,\,\,\,\,$ $\delta_{9}:(q_{6},b)\to q_{7}\,\,\,\,\,\,\,\,\,\,$ $\delta_{10}:(q_{7},b)\to q_{8}\,\,\,\,\,\,\,\,\,\,$ $\delta_{11}:(q_{7},a)\to q_{5}\,\,\,\,\,\,\,\,\,\,$ $\delta_{12}:(q_{8},b)\to q_{9}\,\,\,\,\,\,\,\,$ $\delta_{13}:(q_{8},a)\to q_{5}\,\,\,\,\,\,\,\,$ $\delta_{14}:(q_{9},b)\to q_{10}\,\,\,\,\,\,\,\,$ $\delta_{15}:(q_{9},a)\to q_{5}\,\,\,\,\,\,\,$ $\delta_{16}:(q_{10},b)\to q_{11}\,\,\,\,$ $\delta_{17}:(q_{10},a)\to q_{5}\,\,\,\,\,\,$ $\delta_{18}:(q_{11},b)\to q_{11}\,\,\,\,\,\,$ $\delta_{19}:(q_{11},a)\to q_{5}\,\,\,\,\,\,\,\,\,\,$


$DFA_{L}$ diagram:

enter image description here