Chapter 4: Decidability I
Now we have algorithms
We want to check problems solvable or not by computers
Need a TM to decide it
i.e., accept/reject in a finite number of steps We will show some examples
Acceptance Problems for DFA I
ADFA = {hB, w i | B is a DFA that accepts w }
hB, w i is the input
Note that a DFA can be represented as a string (Q, Σ, . . .)
Is ADFA decidable?
Idea: input hB, w i
1 simulate B on w
2 ends in an accept state ⇒ accept otherwise ⇒ reject
Proof of A
DFAI
Put
B = hQ, Σ, δ, q0, F i into a tape
Check if w ∈ Σ∗ and B a valid DFA Simulate w according to δ
After processing the last element of w , check if in a final state
A
NFAI
ANFA = {hB, w i | B is an NFA that accepts w }
We can convert B to a DFA and use the procedure for ADFA
It’s like to use the procedure for ADFA as a subroutine
A
REXI
AREX = {hR, w i | R : regular expression generates w }
It’s similar
We convert R to a DFA first
Recall that we had a procedure to convert R to an NFA. Then we can convert the NFA to a DFA The key is that the conversion is a finite procedure
E
DFAI
EDFA = {hAi | A : DFA, L(A) = ∅}
i.e. A accepts nothing Idea:
DFA accepts something
⇔ reaching a final state from q0 after several links procedure
1 mark q0
E
DFAII
2 repeat until no new state marked mark all
a → b, where a has been marked
3 if no q ∈ F marked, accept. otherwise, reject Example: a state diagram with 3 nodes and the following connections
1 → 2, 3
E
DFAIII
Marked states in running the procedure 1
12 12
Each iteration: at least one new state marked At most n iterations: n: # states
EQ
DFAI
EQDFA = {hA, Bi | A, B : DFAs, L(A) = L(B)}
EQDFA is decidable Idea for the proof:
Let a DFA C be the exclusive or of A and B If
L(A) = L(B) then
L(C ) = ∅
EQ
DFAII
A B
Exclusive or of A and B
(latex source from
https://texample.net/tikz/examples/
set-operations-illustrated-with-venn-diagrams/)
EQ
DFAIII
Formally
L(C ) = (L(A) ∩ L(B)) ∪ (L(A) ∩ L(B)) B DFA ⇒ so is B
A, B DFA ⇒ so is A ∪ B, A ∩ B
We then use EDFA to check if L(C ) = ∅ or not