1,872 views
2 votes
2 votes

$L_1 = \left\{ca^nb^n\right\} \cup \left\{da^nb^{2n}\right\}$

$L_2 = \left\{a^nb^n c\right\} \cup \left\{a^nb^{2n} d\right\}$

  1. Both are DCFL’s
  2. Both are NCFL’s
  3. L1 is DCFL, L2 is NCFL
  4. L1 is NCFL, L2 is DCFL

2 Answers

Best answer
4 votes
4 votes
L1 is DCFL because der is one to one comparison between no of a and b and  c & d are used to identify which {ca^nb^n} ∪ {da^nb^2n} sub language execute first.

i think L2 is NCFL because union of two DCFL always be an CFL but der is no CLUE to identify which  sub language executes first thats why it is not DCFL..
selected by
0 votes
0 votes

For L1 :

{q,c} = {q1}

{q,d} = {q2}

{q,a, Z0} = {q1 , aZ0 }

{q1 ,a, a} = {q1, aa }

{q1 ,b,a} = {q3,∈ }

{q3 ,b,a} = {q3,∈ }

{q,∈,Z0} = {qf ,∈}

{q2 ,a, Z0} = {q2 , aaZ0 }

{q2 ,a, a} = {q2, aaa }

{q2 ,b,a} = {q4,∈ }

{q4 ,b,a} = {q4,∈ }

{q4 ,∈,Z0} = {qf ,∈}

Similarly you can construct for L2.. So both are NCFL..