Construct DFA beginning with ‘a’ but does not have substring ‘aab’


Problem

Given language to construct the deterministic finite automata (DFA) is, the strings start with ‘a’ but not contain substring ‘aab’ over alphabet ∑={a,b}.

Solution

If the input is: “baabba”
The output is: string is not accepted

Because the string does not start with ‘a’, and generating a substring ‘abb’,

DFA transition diagram

The DFA transition diagram for the string beginning with ‘a’ but not having the substring as ‘aab’ is as follows −

Transition table

The transition table is as follows −

STATEINPUT (a)INPUT (b)
→ 01*4 (dead state)
1*2*3*
2*2*4 (dead state)
3*1*3*
4 (dead state)4 (dead state)4 (dead State)


Updated on: 15-Jun-2021

728 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements