# Context Free Grammar

51 views
L=0^i 1^j 2^k | i=j or j=k

is the grammar DCFG?

0
No, I don't think so.

Push 0 when you encounter it

Pop 0 when you encounter 1.

Here we lost the track of 'j' so we will not able to compare with 'k' if the first condition(i==j) failed.

But we can construct a NPDA for this.
0
Yes i also getting same.
0
it is non deterministic CFL

it is the union of

0^i 1^i 2^k union 0^i 1^j 2^j

so for j is not clear that we r to consider it equal to i or j

NPDA can do that not DPDA

## Related questions

1
105 views
Consider the following CFG 'G' S--> aA/bSS/SS A--> aAb/bAa/AA/ε The language generated by G is: a)Set of all strings with atleast one 'a' b)Set of all strings with atleast two a's c)Set of all strings with atleast one more 'a' than number of b's d)None of these
1 vote