Constructing DFA - Criteria / Multiple solutions

383 Views Asked by At

I'm currently studying for my logic exam, and looking into examples on DFA construction.

Assume the alphabet is {a, b}, and the language to be constructed is defined as follows:

{w | w has at least three a's}

All models solutions I have come across look like the following:

enter image description here

However, is this the only solution for the aforementioned language? For instance, would we still have a valid DFA if we omitted some of the b-transitions, as in the following case:

enter image description here

After all, the language would still consist of "at least three a's". However, if the latter model is not valid, why is that?

Thanks in advance!

2

There are 2 best solutions below

2
On BEST ANSWER

This depends to some extent on the terminology used in your course. However a DFA, as I understand the term, must have exactly one transition from every state for each letter. This is not the case in your second example so it is not a DFA.

Your second example is however an instance of a non-deterministic finite automaton. You will quite likely prove in your course that NDFAs accept the same languages as DFAs.

And as to your first question, there is certainly not a unique solution. Many DFAs (and NDFAs) can be constructed to accept the same language. To give a simple example, modify your DFA as follows: make the transition $b$ from $A$ go to a new non-accepting state $E$; from $E$ there are transitions $a$ to $B$ and $b$ to $E$.

0
On

The language the automaton accepts is supposed to consist of all strings that contain at least three as -- not only some of them.

The second of the automata you show fails to accept baaa -- there's no transition that will match the initial b.

Since the language accepted by the second automata does not include baaa and baaa is a string that contains at least three a, the language accepted by the automaton is not the language it's supposed to accept.