0% found this document useful (0 votes)
47 views2 pages

Automata Theory Chapter 14

The document discusses whether the class of regular languages and the class of languages recognized by NFAs are closed under complement operations. It first shows that the class of regular languages is closed under complement by demonstrating that swapping accept and non-accept states in a DFA recognizing a language yields a new DFA recognizing the complement language. It then gives a counterexample to show that swapping states in an NFA may not necessarily yield an NFA for the complement, but explains that the class of NFA languages is still closed under complement due to equivalences with DFAs.

Uploaded by

athegreat231
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views2 pages

Automata Theory Chapter 14

The document discusses whether the class of regular languages and the class of languages recognized by NFAs are closed under complement operations. It first shows that the class of regular languages is closed under complement by demonstrating that swapping accept and non-accept states in a DFA recognizing a language yields a new DFA recognizing the complement language. It then gives a counterexample to show that swapping states in an NFA may not necessarily yield an NFA for the complement, but explains that the class of NFA languages is still closed under complement due to equivalences with DFAs.

Uploaded by

athegreat231
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Problem

a. Show that if M is a DFA that recognizes language B, swapping the accept and nonaccept states in M yields a new DFA recognizing the
complement of B. Conclude that the class of regular languages is closed under complement.

b. Show by giving an example that if M is an NFA that recognizes language C, swapping the accept and nonaccept states in M doesn’t necessarily
yield a new NFA that recognizes the complement of C. Is the class of languages recognized by NFAs closed under complement? Explain your
answer.

Step-by-step solution

Step 1 of 4

(a)

M is a DFA that recognizes the regular language B

Let be the new DFA that has swapped accept and non accept states in M.

• Consider accepts a string .

• Run on then surely enters into accept state.

• The machines have swapped accept and non-accept states.

• So if we run M on x, then M will end in a non-accept state.

• Thus if x is accepted by then x does not accepted by M.

• Similarly if x is accepted by M then x does not accepted by .

• One can say that if then (complement of B) and vice – versa

• So will accept the strings that are not accepted by M.

• Therefore recognizes the languages which are complement of B.

• As M recognizes a regular language B, there exists which recognizes complement of B which is also regular.

• Hence class of regular languages closed under complement.

Comment

Step 2 of 4

(b)

Let M be a NFA that recognizes a languages C.

The state diagram of M is as follows

Comments (5)
Step 3 of 4

Clearly the string a is accepted by M.

If we swap accept and non accept states of M then we will get the following

Comment

Step 4 of 4

Clearly the string a is accepted by .

This shown that swapping accept and non - accept states of NFA doesn’t necessarily yield a new NFA recognizing the complement of the original
one.

Consider the facts,

“The class of languages recognized by NFAs is precisely the class of languages recognizes by DFAs” …… (a)

“The class of languages recognized by DFAs is closed under complement” …… (b)

Therefore from the facts (a) and (b)

Class of languages recognize by NFAs closed under complement.

Comment

You might also like