(5 marks) In class, we discussed the fact that the following language is known to be decidable.
A_DFA = {<M, w> | M is a DFA, w is a string, and M accepts w}
(In other words, there exists an algorithm that can take any DFA M and any string w as input and can always correctly answer the question of whether or not M accepts w.)
Consider the language A3DFA = {<M> | M is a DFA, and M accepts at least one string x in {0,1}* that has a length of 3}.
For example, if we pass the DFA below as input, it should be accepted because the DFA accepts the string 011 (as well as some other strings of length 3):
1
0
0
However, if we pass the DFA below as input, it should not be accepted because the DFA does not accept any strings of length 3:
0,1
B
0,1
Prove that A3DFA is decidable, using the fact that ApFA is decidable.
In other words, describe an algorithm that can take any DFA M as input and can always correctly determine whether or not there is at least one string x in {0,1}* that has length 3 and is accepted by M. In order to do that, you can use the algorithm that exists for the ApFA problem.