in Theory of Computation
501 views
1 vote
1 vote
which of the below are CFL:

a. L1 ={a^i b^j c^k |( i<=j or j<=i), j=k}

b.L2 = {a^m b^nc^n d^m  | m is not equals to n}

whether CFL or DCFL....please explain
in Theory of Computation
by
501 views

2 Answers

3 votes
3 votes

1. L1 ={ai bj ck |( i<=j or j<=i), j=k} : i and j may be any number i,e. there is no relation between i and j.  i<=j or i>=j. this condition will be always true.​​​​​​​  Only comparison is between j and k so it is DCFL.

2. L2 = {am bcn dm  | m is not equals to n}: First we have to compare between m and n of am, bn. Then compare no of b and c, i,e. we require n from bn to compare n from cn. but we have lost exact no of n of b during the comparison of m and n. So it is NOT CFL. 

1 vote
1 vote
a) as i<=j and j<=i this concludes  that i>j or i<j or i=j so we have no relation but the other relation j=k alone is sufficient to prove that is  so the language L1= a^ib^jc^k hence we can more than one transitions for one state so it is dcfl  

b) as in this case we can remove b with c as there numbers are equal and a with d hence one transition exists here so it is DCFL
edited by

4 Comments

a)

L1 ={a^i b^j c^k |( i<=j or j<=i), j=k}

here only condition is j=k which makes it DCFL.

0
0
@kunal why you have not considered i=j here?? how DCFL?
0
0
just ignore this comment i got my point cleared...
0
0
@ANWER_ZAKI

I got your point...but in 2nd it is not DCFL, but how u decide whether CFL or not??

can't we do it using non deterministic PDA?
0
0