3,106 views
4 votes
4 votes

Let $L = \{a^mb^nb^kd^l  (n+k) \text{ is odd only if } m = l; m, n, k, l > 0\}$. Which of the following is true about $L$?

  1. $L$ is CFL but not DCFL
  2. $L$ is regular but not CFL
  3. $L$ is DCFL but not regular
  4. None of these

5 Answers

Best answer
3 votes
3 votes

I think the question is DCFL

We can design the satck like normal DCFL for amdl(as m=l it would be like a^nb^n)

and for bn+k we can design a stack like for one input it will insert a value let 'X' in stack and encountering a b again it will pop 'X' So when the stack iscontained the last value inserted at the time of am then it is understandable that n+k=even

So we can transit to a next state when stackhas new one value in the second state i.e ODD

so all moves are obvious and only one transition is possible for each case

it is DCFL but not regular

correction required , I am not 100%sure

selected by
5 votes
5 votes
push all a's to the stack. now check if number of b's are odd or not which can be checked by a loop.if they are not odd u can simply accept the string.. if they are odd check if number if a's=number of d's by popping one a for every 'd' u encounter. if m=l the accept, else reject
hence its clearly DCFL
2 votes
2 votes

It is not exact but may be idea is clear from this pic . since their is comparison b/w a and d so can't be regular.

Correction : On second state null, zo ,accept

edited by

Related questions

1 votes
1 votes
1 answer
1
1 votes
1 votes
2 answers
2
ggwon asked Dec 29, 2022
740 views
L = {$a^{n+m}b^{n}a^{m} | n,m \geq 0$}Is the above language DCFL or CFL ?
1 votes
1 votes
2 answers
4
vishal8492 asked Dec 2, 2016
1,411 views
Isn't WxWr DCFL as X acts as marker so DCFL should be right choice , why is it categorized as CFL and not DCFL?