HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Prove that there isn't a DFA characterized by (a*)+(b*) for which |Q| = 3

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
characterizeddfaprovethatforwhichisnthere

Problem

Let $R=(a)+(b)$ be a regular expression. Prove that there cannot exist any DFA $M=(Q,\Sigma,\delta , q0, A)$ such that $|Q| = 3$ and $L(M)=L(R)$.

The problem is, I think IT IS possible to construct such a dfa that has 3 states in total.

Am I missing something?

Solution

What you draw is an NFA, because you do not have both transition for $a$ and $b$ in two accept states.
Indeed, you need 4 states at least. Because you have 4 different states:

  • Initial state



  • Detect $a^*$ strings



  • Detect $b^*$ string



  • None of them



You can't merge the first 3 steps because they are exclusive. Now, you can suppose that we can merge the 4th state with the others. Definitely you can't merge the 4th state with second and third state. Hence. the only possibility is merging the 4th state with the first state. But, we have some transitions from the initial state to other states, and if we merge the 4th and the first state, we will accept some strings that are not totally $a$ or $b$. And that is the contradiction to the definition of the language. Therefore, we need a state to go there if we found any $b$ in the middle of some $a$s or vice versa.

Context

StackExchange Computer Science Q#115865, answer score: 4

Revisions (0)

No revisions yet.