I'm in my first few weeks of taking a theoretical course at my school and was wondering what is wrong with my answer to this question.
I've been told to show that the language:
L = {x | x has even length and ends with b} over the alphabet {a,b}
Is regular
I know I can prove this by showing a DFA that accepts that language, over that alphabet. I came up with this solution:
(the letters are in color blocks because the background is black and with a transparent image they wouldn't show up on a black background).
https://i.stack.imgur.com/YbqVN.jpg
This seems to work on strings I've tested such as: ab
abbb
ababab
bbaabbababab
etc
However, my textbook provides a solution with 4 states instead of 3, so I'm wondering where I have gone wrong here? Is there a way to easily check what strings wouldn't work for this DFA? It seems trivial to test every string out there, as it would be impossible.
Your answer is correct. If the exercise don’t ask the minimal DFA then the response is not unique (you can make well states).