Similar questions 2 more →
Context-Free Grammars & Languages

Answer & solution
Official answer: B,C,D
The copy language L1={ww} is not context-free: intersecting with a+b+a+b+ gives {aⁱbʲaⁱbʲ: i, j>0}. For pumping length p, aᵖbᵖaᵖbᵖ has any pumping window of length at most p within at most two adjacent blocks. Pumping changes at least one block without changing its matching nonadjacent block, or creates extra alternations, contradicting this language’s form. L2 and L3 are deterministic context-free by pushing one block and matching the adjacent equal-count block; their intersection is {aⁿbⁿcⁿ}, not context-free. Thus A is true and B, C are false. D is also false because the complement of L1 is context-free: include all odd-length words, and for even length choose two different symbols in corresponding half-positions. Let Ea={uav:|u|=|v|} and Eb={ubv:|u|=|v|}; each is context-free via Sa→cS_a d | a for c, d∈Σ, and similarly Sb. E_aE_b ∪ E_bE_a describes exactly the even noncopies, since the two centers differ and are separated by half the total length. Closure under concatenation and union proves the complement claim. Select false statements B, C, D.
For the complement construction, Ea contains odd strings whose center is a and Eb those whose center is b. Concatenating lengths 2r+1 and 2s+1 puts their centers r+s+1 positions apart, exactly half the total length. Thus choosing unequal centers witnesses unequal half-positions. Conversely any mismatching pair in two equal halves determines such a split. Odd-length strings are automatically noncopies and form a regular language.