the reverse of the string w. Which of these languages are deterministic Context-free languages?
Correct Answer: C
For L1 and L2 we can design Deterministic Push down automata, so both are DCFL. But for L3, it is not possible to design deterministic PDA, because DPDA cannot determine where 'w' ends exactly so it could start poping symbols (for wr ) from the stack. Therefore, option (C) is Correct.
In the correct grammar of above question, what is the length of the derivation (number of steps starring from S) to generate the string albm with l ? m?
We can recognize strings of given language using one Stack. These given languages are context free, so also context sensitive. Because CFLs are closed under Union property, so union of given languages will also be Context free. But CFLs are not closed under Intersection property, so Intersection of two CFLs may not be CFL. Given L1 and If L2 are two context free languages, their intersection L1 ? L2 is not context free because we cannot identify strings of resultant language with help of one Stack: L1 = { anbncm | n > 0 and m > 0 } and L2 = { ambncn | n > 0 and m > 0 } L3 = L1 ? L2 = { anbncn | n > 0 } is not context free. So, option (a) is false. See wikipedia page for closure properties.
Consider the following languages:
I. {ambncpdq ? m + p = n + q, where m, n, p, q ? 0}
II. {ambncpdq ? m = n and p = q, where m, n, p, q ? 0}
III. {ambncpdq ? m = n = p and p ? q, where m, n, p, q ? 0}
IV. {ambncpdq ? mn = p + q, where m, n, p, q ? 0}
Which of the above languages are context-free?