Consider the following languages; 1.A=wwrwrw|w∈Σ∗ 2.B={wwrxxr|w,x∈Σ∗} 3.C=aibjakbl|=|i,j,k,l≥0,(i+j)=(k+l)
The number of the above languges which is CFL's is/are ____.
Open in App
Solution
Only B and C are CFLs.
In language C, Push and Pop is clear means
- Input a, Tos S |a| a→ Push x
- Input b, Tos S |a| b → Push x
- Input b, Tos S |a| b → Pop x
- Input a, Tos S |a| b → Pop x
- Input completed, Tos S → String accepted
Language B, can be broken down as ww and xx an
Let L1 = ww (CFL L2 = xx (CFL)
Thus, F is CFI since B = L1, L2 and contexts free language