3,125 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

0 votes
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.


Related questions

1 votes
1 votes
1 answer
5
1 votes
1 votes
2 answers
6
ggwon asked Dec 29, 2022
754 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
8
vishal8492 asked Dec 2, 2016
1,420 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?