in Written Exam edited by
403 views
0 votes
0 votes

6. let E ={a,b,c}. Which of the following sets are context-free languages
    A. X = {ai bj ck | i < j < k}
    B. Y = (the complement of X)
    C. Z = {an b2n c3m | n, m >=0}
    D. None of the above sets are context free languages.

in Written Exam edited by
403 views

4 Comments

Thanks
0
0
Soumya how B is CFL. Becuase in B you always have to check that whether $i \lt j \lt k$ condition becomes true or not.
0
0

See What I did -
X = {ai bck | i < j < k} 
Break it in 2 parts- {ai bj | i<j } $\cap$ {bck | j<k }  // It in not CFL
X' = Y = ({ai bj | i<j } $\cap$ {bck | j<k })'  = {ai bj | i>j } $\cup$  {bck | j>k }

Let,
L1 = {ai bj | i>j }  \\ CFL
L2 = {bck | j>k } \\ CFL
Y = L1 $\cup$ L2
Union of 2 CFLs is CFL

1
1

1 Answer

3 votes
3 votes

Ans is B, C

X = {ai bj ck | i<j<k} for this language simultaneously 2 comparisons required to accept the language.
so using single stack it's not possible. So this is not CFL.

Y = (the complement of X) .The language it represents is
{a i bj ck | i>j} U {ai bj ck | j>k} U {ai bj ck | i>k} U a*c*b* U b*a*c* U b*c*a* U c*a*b* U c*b*a*.
So this language can be recognized by PDA.

C. Z = {an b2n c3m | n,m>=0} .Here only one comparison required for comparing n(a) and n(b).So  can  be recognized by PDA.

edited by

1 comment

$ a^ib^jc^k / i\lt j \geq k$ is not in ur language.
0
0

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true