Question

Let A and B be regular languages. Show that A \ B is also regular. (Recall...

Let A and B be regular languages. Show that A \ B is also regular. (Recall that A \ B = {x ∈ A | x ∉ B}. In other words, this operation removes from A all the strings that are also in B.)

Homework Answers

Answer #1

Let M1 be the DFA that accepts A and M2 be the DFA that accepts B.

We create a DFA M that accepts A\B.

Let Q1 be the set of states of M1 and Q2 be the set of states of M2.

We define Q=Q1xQ2 to be the set of states of M where Q1xQ2 represents the Cartesian product of Q1 and Q2.

Let d1 and d2 be the transition functions of M1 and M2 respectively. We define the transition function of M to be d where, if Qa be a state in M1 and Qb be a state in M2, and a be an alphabet then, d((qa,qb),a)=d(qa,a),d(qb,a).

If q1 and q2 be the initial states of M1 and M2 respectively then (q1,q2) is the initial state of M.

We make the accept states of M to be those states where the state from M1 is final but that from M2 is not.

The DFA M we constructed accepts only those strings which are accepted by A but rejected by B. Hence A\B is a regular language.

Know the answer?
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
Similar Questions
Prove that regular languages are closed under the set dierence operation. That is, if A and...
Prove that regular languages are closed under the set dierence operation. That is, if A and B are regular languages, then, A - B is also a regular language.
Use the pumping lemma to show that the following languages are not regular. b. A2 =...
Use the pumping lemma to show that the following languages are not regular. b. A2 = {www| w € {a, b}*}
Which one of the following languages over the alphabet {0,1} is described by the regular expression...
Which one of the following languages over the alphabet {0,1} is described by the regular expression (0+1)* 0 (0+1)* 0 (0+1)* ? a.The set of all strings that begin and end with either 0 or 1 b.The set of all strings containing at most two zeros c.The set of all strings containing at least two zeros. d.The set of all strings containing the substring 00
Are the following languages over {a, b} regular? If they are then prove it. If they...
Are the following languages over {a, b} regular? If they are then prove it. If they are not prove it with the Pumping Lemma {an bm | m != n, n >= 0} {w | w contains the substring ‘aaa’ once and only once } Clear concise details please, if the language is regular, provide a DFA/NFA along with the regular expression. Thank you. Will +1
1.2 Which of the following statements is wrong?        a). A set is a subset of itself...
1.2 Which of the following statements is wrong?        a). A set is a subset of itself        b). Emptyset is a subset of any set        c). A set is a subset of its powerset        d). The cardinality of emptyset is 0 1.3. Which of the following statements is correct?        a). A string is a set of symbols from an alphabet        b). The length of the concatenation of two strings can           be the same as one of them        c). The length of...
Let F be the set of all finite languages over alphabet {0, 1}. Show that F...
Let F be the set of all finite languages over alphabet {0, 1}. Show that F is countable
Let swap_every_two be an operation on languages that is defined as follows: swap_every_two(L) = {a2a1a4a3 ....
Let swap_every_two be an operation on languages that is defined as follows: swap_every_two(L) = {a2a1a4a3 . . . a2na2n−1 | a1a2a3a4 . . . a2n−1a2n ∈ L where a1, . . . , a2n ∈ Σ} In this definition, Σ is the alphabet for the language L. 1. What languages result from applying swap every two to the following languages: (a) {1 n | n ≥ 0}, where the alphabet is {1}. (b) {(01)n | n ≥ 0}, where the...
Let L be a regular language over {0, 1}. Show how we can use the previous...
Let L be a regular language over {0, 1}. Show how we can use the previous result to show that in order to determine whether or not L is empty, we need only test at most 2n − 1 strings.
Let sheep(x) be the string formed by replacing each b in x by the substring baa...
Let sheep(x) be the string formed by replacing each b in x by the substring baa (this transformation is done once, not recursively ad infinitum). For example, sheep(babaab) = baaabaaaabaa. Furthermore, let sheep(L) be the language formed of strings sheep(x) for x ∈ L. In this question, you will prove that if L is regular, then so is sheep(L), where L ⊆ {a, b} ∗ . Observe that if L is regular, then L can be expressed as L(α) for...
Given a language L, etc. Show that the language L is a regular language. To show...
Given a language L, etc. Show that the language L is a regular language. To show that the language L is a regular language - find/design a dfa that recognizes the language L. Given a regular expression r, etc. What is the language L, L = L(r)? L(r) is the set of all strings etc.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT