2,260 views

1 Answer

Best answer
7 votes
7 votes

First you should know the difference between these two term.

(1)Complement of Language

(2)Complement of Machine

Complement of Language

$L^{c}=\sum ^{*}-L$

Suppose you have language $L=a^{+}$ over $\sum =\left ( a \right )$.

$L^{c}=a^{*}-a^{+}$

So $L^{c}=\epsilon$

      

Complement of Machine

Let M be any finite automata then the complement of the machine can be obtained by swapping its accepting states with its non-accepting states and vice versa.Let us take an example,

This DFA accepts the language  $L=\left \{ a,aa,aaa,aaaa,............ \right \}$

                over the alphabet $\sum =\left ( a,b \right )$.

Now we will swap its accepting states with its non-accepting states and vice versa and will get the following −

This DFA accepts the language $L=\left \{ \epsilon ,b,ab,bb,....... \right \}$.

In case of DFA complementation the language is also complemented i.e.

$L(M^{c})=\left ( L\left ( M \right ) \right )^{c}$.

But this is not hold true in case of NFA , the language may or may not  complemented.

That,s it.

selected by

Related questions