retagged by
1,841 views

2 Answers

Best answer
4 votes
4 votes

L2 is dcfl and L1 is Cfl
soln for L2  Let E = { aib | i ≠ j and 2i ≠ j }
Split it as unions of  3 languages.

{ aibj | i > j } ∪ { aibj | i < j and 2i > j } ∪ { aibj | 2i < j }

G1 = { aibj | i > j }

G2 = { aibj | i < j and 2i > j }

G3 = { aibj | 2i < j }

G1 and G3 are quite easy to figure out. 
for G1
S →   aSb | aS1
S→ aS1 |ε

for G3
S → aSbb | S1b
S1 → S1b | ε 

Now tricky part is G2.
S → aSb | aS1b
S1 → aS1bb | aS2bb
S2 → ε

note- L2 is  given as problem 2.24 in shipser book.

selected by
5 votes
5 votes

L1= CSL

why ? because  two comparison at a time which is not possible with a stack so its csl if it were written as
M!=n OR M!=2n then it will be CFL .

L2 is DCFL so CFL also 

why ? because we can accept every string in l2 language deterministically push a's into stack when b's comes start poping it aftet that accept it.

so A) option true .

edited by

Related questions

3 votes
3 votes
1 answer
2
Prateek Raghuvanshi asked Nov 10, 2017
515 views
$L_1 =\{a^n b^m c^n \mid m,n \geq 0\}$ and $L_2=\{ a^n b^n\mid n\geq 0\}$. If $L=L_2-L_1$ then $L$ isfinite languageregular languageDCFL not DCFL
3 votes
3 votes
1 answer
4
saurabh rai asked Oct 21, 2016
1,132 views
Is the language $L=\left \{ (0^{n}1^{n})^{*} |n\geq 0 \right \}$ is DCFL ?