Let
be two regular languages with their corresponding DFAs being
. Let the description of the DFAs be:
.
To construct DFA for
, do the following cross product construction. Let the DFA be D,
which will have the following description:
where
i.e. the set of states is the set product of the two set of
states.
i.e. the starting state is the tuple of starting states of the two
DFAs.
i.e. the set of final states is the tuple of states where the
first state is final but the second is not.
i.e. a transition happens in D if it happens in both the DFAs
respectively.
D will accept the language
. 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
if and only if it is in
but not in
. 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
if it is either in both
and
, or if it's not in
. In this case, the word will either reach a final state in both
DFAs or reach a non-final state in
. 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.
Show using a cross-product construction that the class of regular languages is closed under set difference....
Show using a cross-product construction that the class of regular languages is closed under set difference. You do not need an inductive proof, but you should convincingly explain why your construction works.
2. (15) Show using a cross-product construction that the class of regular languages is closed under set difference. You do not need an inductive proof, but you should convincingly explain why your construction works.
Prove that the class of regular languages is closed under intersection. That is, show that if ? and ? are regular languages, then ? ∩ ? = {? | ? ∈ ? ??? ? ∈ ?} is also regular. Hint:givenaDFA? =(?,Σ,?,?,?)thatrecognizes?andaDFA? =(?,Σ,?,?,?)that11111 22222 recognizes ?, construct a new DFA ? = (?, Σ, ?, ?0, ?) that recognizes ? ∩ ? and justify why your construction is correct.
Automata Prove that regular languages are closed under difference, using an indirect proof (leveraging the closure of other set operators).
(20 pt.) Prove that the class of regular languages is closed under reverse. That is, show that if ? is a regular language, then ?? = {?? | ? ∈ ?} is also regular. Hint: given a DFA ? = (?, Σ, ?, ?0, ?) that recognizes ?, construct a new NFA ? = (?′, Σ, ?′, ?0′, ?′)that recognizes ?? and justify why your construction is correct.
(20 pt.) Prove that the class of regular languages is closed under reverse. That is, show that if A is a regular language, then AR = {wR WE A} is also regular. Hint: given a DFA M = (Q,2,8,90, F) that recognizes A, construct a new NFA N = (Q', 2,8', qo',F') that recognizes AR and justify why your construction is correct.
5. (20 pt.) Prove that the class of regular languages is closed under reverse. That is, show that if A is a regular language, then AR = {wR W E A} is also regular. Hint: given a DFA M = (Q,2,8,90, F) that recognizes A, construct a new NFA N = (Q', 2,8', qo',F') that recognizes AR and justify why your construction is correct.
Show that the class of context-free languages is closed under the regular operation union. For simplicity, you may assume that the alphabets of G1 and G2 are the same. [Hint: Use a constructive proof. Start with the formal definitions, G1 = (V1 ,∑, R1,S1) and G2 = (V2, ∑, R2, S2) and derive the formal definition of G∪.]
Show that the class of context-free languages is not closed under difference. Use either of the following facts: a. The class of context-free languages is not closed under intersection. b. The language {ww | w ∈ {a,b}*} is not a CFL.
Problem 3 [20 points Prove that the class of regular languages is closed under reverse. That is, show that if A is a regular language, then AR -[wR | w e A is also regular. [Hint: given a DFA M = (Q,Σ, δ, q0,F) that recognizes A, construct a new NFA (Q', Σ,8,6, F') that recognizes AR.]