Questions: Context-Free Grammars (CFGs)

3 questions to test your understanding

Score: 0 / 3
Question 1 Multiple Choice

Which of the following languages requires a context-free grammar and cannot be described by any regular expression?

A{ aⁿ | n ≥ 0 }
B{ aⁿbⁿ | n ≥ 0 }
C{ strings over {a,b} containing at least one a }
D{ ab, ba }
Question 2 True / False

If two different context-free grammars both generate the same string w, then w is ambiguous.

TTrue
FFalse
Question 3 Short Answer

What is the difference between a context-free grammar and the context-free language it defines?

Think about your answer, then reveal below.