2,286 views

3 Answers

Best answer
7 votes
7 votes
$L=\{a^nb^n\mid n\geq 0\}$ then $L^c=\{a^mb^n\mid m \neq n\}$(DCFL)$\cup$$\{(a+b)^*ba(a+b)^*\}$(Regular)-----

hence it is DCFL $\cup$ Regular hence DCFL. It may or may not be regular but here $L$ is not regular and hence its complement must also be not regular since regular languages are closed under complement.

$L=\{a^nc^nb^n\mid n \geq 0\}$ (CSL but not CFL) then $L^c=\{a^mb^nc^k\mid m \neq n$ or $n\neq k$ or $m\neq  k \}$$\cup$$\{(a+b+c)^*ba(a+b+c)^*\}$ $\cup$ $\{(a+b+c)^*ca(a+b+c)^*\}$ $\cup$ $\{(a+b+c)^*cb(a+b+c)^*\}$

---hence CFL
selected by
4 votes
4 votes
Complement of a^nb^n ={a^nb^m : m!=n } U { (aUb)*ba(aUb)*}

The given language is Deterministic CFL and not regular and the complement is also a DCFL and not regular language because DCFL is closed under complementation.

ii)Complement of a^nb^nc^n =a*b*c* - (a^n b^n c^n: n>=0)
                                                 
                                                 = a*b*c*  INTERSECT {(a^i b^j c^k|i=j)' U (a^i b^j c^k | j=k)'}
                                                 = a*b*c*  INTERSECT (a^i b^j c^k|i=j)' U a*b*c*  INTERSECT (a^i b^j c^k|j=k)'
                                                 = (a^i b^j c^k|i!=j)  U   (a^i b^j c^k|j!=k)
L={a^nb^nc^n,n>=0} is a NPDA but  the complement is CFL and  not regular
edited by

Related questions

7 votes
7 votes
4 answers
1
Pranav Madhani asked Nov 19, 2017
3,444 views
Determine the minimum height of parse tree in CNF for terminal string of length w, which is constructed by using CFG G(a) log2|w|+1 (b) log2|w|(c) log2|w|−1 (d) None of...
0 votes
0 votes
1 answer
4
Pranav Madhani asked Nov 17, 2017
854 views
Consider this grammar:S → SS | aHow many derivation trees are possible for a4?(a) 3 (b) 4(c) 5 (d) 6 how to generalize for any values if a^5 or a^7 is there any general...