edited by
1,596 views
1 1 vote
$L1 = \bigl\{a^mb^nc^pd^q   \mid m+q = n+p \bigr\}$
$L2 = \bigl\{a^mb^nc^pd^q   \mid m+p = n+q \bigr\}$

1. L1 is DCFL, L2 is not
2. L2 is DCFL, L1 is not
3. Both are not DCFL
4. Both are DCFL

2 Answers

Best answer
6 6 votes
Both are DCFL.

L1:
Push $x$ on stack for $a$ and $d$, if the stack is empty or has $x$ on top. If however, the stack has $y$ on top, remove the $y$.
Push $y$ on stack for $b$ and $c$, if the stack is empty or has $y$ on top. If however, the stack has $x$ on top, remove the $x$.
The DFA accepts if the stack is empty at the end of the input.

 L2:
Push $x$ on stack for $a$ and $c$, if the stack is empty or has $x$ on top. If however, the stack has $y$ on top, remove the $y$.
Push $y$ on stack for $b$ and $d$, if the stack is empty or has $y$ on top. If however, the stack has $x$ on top, remove the $x$.
The DFA accepts if the stack is empty at the end of the input.
selected by
0 0 votes
option 2
Because in L1 automata, you find at the end of operation stack actually not empty to compare it.
Position:
Show:

Related questions

4 4 votes
2 2 answers
3.5k
3.5k views
srestha asked Jun 22, 2018
3,526 views
$\left \{ a^{m+n}b^{m+n}c^{n}|m,n\geq 1 \right \}$$\left \{ a^{m+n}b^{m+n}c^{k} |m,n,k\geq 1\right \}$$\left \{ a^{m+n}b^{m+k}c^{n+k} |m,n,k\geq 1\right \}$Which one DCFL...
1 1 vote
1 1 answer
583
583 views
vedantk asked Jan 10, 2024
583 views
If it’s DCFL then also construct the DPDA ?
1 1 vote
2 2 answers
1.9k
1.9k views
atulcse asked Jan 21, 2022
1,913 views
Is the following language a DCFL? Please explain your reasoning.
0 0 votes
1 1 answer
1.4k
1.4k views
shivangi5 asked Dec 2, 2017
1,358 views
Consider the following languages:L1={abna2n|n>=0}L2={aabna3n|n>=0}Why L1UL2 is DCFL please explain?