P D is a DFA and LD LD Is P decidable Why or why notSolutio
P = {D is a DFA and L(D)= L(D)*}. Is P decidable? Why or why not?
Solution
It is true because DFA accepts if and only if all reachable states from the start state, q0, are accepting. This can easily be decided in polynomial-time by performing a breadth- or depth-first search on the DFA from q0. If at any time a non-accepting state is visited, reject, otherwise, if only accepting states are found, accept
