5,199 views
4 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 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 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 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
0 0 votes

Given, m, n, l, k > 0

                                ----------- [CONSTRAINT 1]

Also, (n+k) is odd only if (m=l)

                                ------------ [CONSTRAINT 2]

Therefore, (n+k) is odd --> (m=l)

Therefore, if (n+k) is odd, we have to check if (m=l), only then will the word be accepted.

However, if the (n+k) isn't odd, we don't care if (m=l) or not, the word will be accepted (provided CONSTRAINT 1 is satisfied, i.e. there is at least 1 d).

The transition diagram is given below.

NOTE

To check whether (n+k) is odd or not, we do the following-

1. For every even occurrence of b, simply make a transition from state q1 to state q2 while popping the top of the stack.

2. For every odd occurrence of b, simply make a transition from state q2 to state q1 while pushing symbol X onto the stack.


edited by
Position:
Show:

Related questions

1 1 vote
1 1 answer
579
579 views
vedantk asked Jan 10, 2024
579 views
If it’s DCFL then also construct the DPDA ?
1 1 vote
2 2 answers
1.4k
1.4k views
ggwon asked Dec 29, 2022
1,393 views
L = {$a^{n+m}b^{n}a^{m} | n,m \geq 0$}Is the above language DCFL or CFL ?
3 3 votes
3 3 answers
4.3k
4.3k views
S Ram asked Jan 3, 2019
4,262 views
Given that:{ A^m B^n C^k/ if (k=even) then m=n}{ A^m B^n C^k/ if (n=even) then m=k}Which of the above languages are DCFL? According to me it is CFL as we have to first co...
1 1 vote
2 answers 2 answers
2.0k
2.0k views
vishal8492 asked Dec 2, 2016
1,955 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?