Are the DFAs for these languages the same?

66 Views Asked by At

Given language 1: $\{a\}$ and language 2: $\{a\}^+$ of the alphabet $\{a,b\}$

For each language, I have to construct a DFA which accepts it (with as few states as possible). I believe the DFAs would be the same:

1 state, accepting, 1 transition for $a$ to itself

Is my assumption correct?

1

There are 1 best solutions below

0
On

This is not correct. Your first language is the language containing the single word $a$, and your second language is the language containing all words made of any strictly positive number of $a$ and no $b$ at all.

The DFA you offer works for neither : it accepts the empty word $\epsilon$ because your starting state is accepting, but the empty word is in neither languages.