Context Free Language: GATE CS Previous Year Questions

Context Free Language · Theory of Computation

41 questions · asked in 24 of 27 years (2000–2026)

MCQ 36 · MSQ 51-mark 23 · 2-mark 18

2000Questions per year2026

Questions 11–15 of 41

Q11GATE 20202 marksMCQ−0.67 if wrong
Consider the following languages.
L1={wxyx∣w,x,y∈(0+1)+}L_1=\{wxyx|w,x,y \in (0+1)^+\}
L2={xy∣x,y∈(a+b)∗,∣x∣=∣y∣,x≠y}L_2=\{xy|x,y \in (a+b)^*,|x|=|y|,x\neq y\}

Which one of the following is TRUE?

Q12GATE 20192 marksMCQ−0.67 if wrong
Which one of the following languages over Σ={a,b}\Sigma =\{a,b\} is NOT context-free?

Q13GATE 20182 marksMCQ−0.67 if wrong
Consider the following languages:

I. {ambncpdq∣m+p=n+q,  where  m,n,p,q≥0}\{a^{m}b^{n}c^{p}d^{q}|m+p=n+q, \; where \; m,n,p,q \geq 0 \}
II. {ambncpdq∣m=n  and  p=q,  where  m,n,p,q≥0}\{a^{m}b^{n}c^{p}d^{q}|m=n \; and \; p=q, \; where \; m,n,p,q\geq 0 \}
III. {ambncpdq∣m=n=p  and  p≠q,  where  m,n,p,q≥0}\{a^{m}b^{n}c^{p}d^{q}|m=n=p \; and \; p\neq q, \; where \; m,n,p,q\geq 0 \}
IV. {ambncpdq∣mn=p+q,  where  m,n,p,q≥0}\{a^{m}b^{n}c^{p}d^{q}|mn=p+q, \; where\; m,n,p,q\geq 0\}

Which of the languages above are context-free?

Q14GATE 2017 (Session 1)2 marksMCQ−0.67 if wrong
Consider the context-free grammars over the alphabet {a,b,c} given below. S and T are non-terminals

G1:S→aSb∣T,T→cT∣ϵG_{1}:S\rightarrow aSb|T, T\rightarrow cT|\epsilon G2:S→bSa∣T,T→cT∣ϵG_{2}:S\rightarrow bSa|T,T\rightarrow cT|\epsilon

The language L(G1)∩L(G2)L(G_{1})\cap L(G_{2}) is

Q15GATE 2017 (Session 1)2 marksMCQ−0.67 if wrong
Consider the following languages over the alphabet Σ={a,b,c}\Sigma = \{a, b,c\}.
Let L1={anbncm∣m,n≥0}L_{1}=\{a^{n}b^{n}c^{m}|m,n\geq 0\} and L2={ambncn∣m,n≥0}L_{2}=\{a^{m}b^{n}c^{n}|m,n\geq 0\}

Which of the following are context-free languages ?
I. L1∪L2L_{1}\cup L_{2}
II. L1∩L2L_{1}\cap L_{2}

Keep practising

Topics in Theory of Computation

All CS topics ›