# Deterministic finite automata that accepts the only the string “aabb”

Lets construct a DFA over{a,b} That accepts only the string "aabb" in it. My problem with this video is that the tutor has moved arrow from state D to B why didn't he set a self loop on D .Im really helpless .

Move forward to minute 11

• You should improve the title. It is too broad. Please take some time to improve it. – fade2black Oct 23 '17 at 23:24
• The question should be self contained, could you transcribe relevant part? – Evil Oct 25 '17 at 20:02
• @fade2black may I start a conversation with you if that doesn't bother you ?I'm new to this website sorry for posting answers instead of comments – Kolyx akos Oct 30 '17 at 17:18

Your purpose is to detect a substring $aabb$. When the FA is in state $D$ it already has read $aab$ (pay attention that in order to get to $D$ from the start state the FA must read $aab$ or $a\dots aab$). While in state $D$ there are two possible inputs: $a$ or $b$. If it reads $a$ it enters the state $B$ because it already has $a$ (it remains to read $abb$). On $b$ it enters the accept state. If on $a$ it stays on $D$ then it would accept a wrong string, for example, $aabab$ which does not contain $aabb$ as a substring. In other words, on $a$ you should send it back to the state $B$ as if FA switches from state $A$ into state $B$.