Problem
Find the DFA for the language $L = \{a^nb: n \geq 0\} \cup \{b^na : n \geq 1\}$
This is a problem from the book "An Introduction to Formal Languages amd Automata 4th edition", exercise 2 b) page 68.
Since there are very few examples in the textbook, I found it very difficult to test my work, especially self-taught. This is my attempt, does it look reasonable?
Another question is: how does $\cup$ differ from $\cap$ in a DFA? For instance, if we change the language above to: $L = \{a^nb: n \geq 0\} \cap \{b^na : n \geq 1\}$ With NFA, the $\cup$ is straightforward, but for DFA, I'm not quite sure. Any suggestion?