Question

Show using a cross-product construction that the class of regular languages is closed under set difference. You do not need a

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Let L_1, L_2 be two regular languages with their corresponding DFAs being D_1, D_2 . Let the description of the DFAs be:
D1 = (Qι, Σ, qo, δι, Fi) D) = (Q2, Σ, 45, 52, F2) .

To construct DFA for L_1 \setminus L_2 , do the following cross product construction. Let the DFA be D, which will have the following description:
D = (Q, \Sigma, q_0, \delta, F) where
Q = Q_1 \times Q_2 i.e. the set of states is the set product of the two set of states.
q_0 = (q_0^1, q_0^2) i.e. the starting state is the tuple of starting states of the two DFAs.
F = F_1 \times (Q_2 \setminus F_2) i.e. the set of final states is the tuple of states where the first state is final but the second is not.
\delta((q_1, q_2), a) = (q_3,q_4) \iff \delta_1(q_1, a) = q_3 \wedge \delta_2(q_2,a) = q_4 i.e. a transition happens in D if it happens in both the DFAs respectively.

D will accept the language L_1 \setminus L_2 . To argue why, note that a DFA takes exactly one path on reading a word and reaches exactly one state at the end. A word is in L_1 \setminus L_2 if and only if it is in L_1 but not in L_2 . Therefore, the first DFA will reach a final state and the second one will not. Hence in D, the word will reach a final state in the first state of the tuple and a non-final state in second state of the tuple. Therefore it will be accepted by D, as this is exactly what final states in D look like.

Similarly, a word is not in L_1 \setminus L_2 if it is either in both L_1 and L_2 , or if it's not in L_1 . In this case, the word will either reach a final state in both DFAs or reach a non-final state in D_1 . Therefore it will reach a non-final state in D, making it reject the word, as it should.

Therefore D accepts the correct language as desired.

Comment in case of any doubts.

Add a comment
Know the answer?
Add Answer to:
Show using a cross-product construction that the class of regular languages is closed under set difference....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT