Questions & Results
Q1 of 10Multiple ChoiceAccuracy45s · 1 pt
Which language can be described by a context-free grammar but NOT by any regular expression?
B {aⁿbⁿ | n ≥ 0}✓ Correct D Strings over {a, b} with an even number of a's 151 / 185 answered · 96% correct
Q2 of 10Multiple ChoiceAccuracy45s · 1 pt
Which of the following is NOT a component of a context-free grammar?
D A set of accepting states✓ Correct 165 / 185 answered · 75% correct
Q3 of 10Multiple ChoiceAccuracy60s · 1 pt
Consider the grammar:
S → aSb | ε
Which string does it generate?
169 / 185 answered · 95% correct
Q4 of 10Multiple ChoiceAccuracy60s · 1 pt
Consider the grammar:
S → AB
A → a
B → b
Which is a valid derivation of ab, where each step applies exactly one production rule?
A S ⇒ AB ⇒ aB ⇒ ab✓ Correct 174 / 185 answered · 93% correct
Q5 of 10Multiple ChoiceAccuracy60s · 1 pt
Consider the grammar:
S → aSa | bSb | a | b | ε
Which language does it generate?
A Strings with equal numbers of a's and b's B All strings over {a, b} C Strings of the form aⁿbⁿ D Palindromes over {a, b}✓ Correct 177 / 185 answered · 97% correct
Q6 of 10Multiple ChoiceAccuracy75s · 1 pt
Consider the grammar:
S → aSb | SS | ε
Which string is NOT generated by this grammar?
182 / 185 answered · 95% correct
Q7 of 10Multiple ChoiceAccuracy45s · 1 pt
Consider the grammar:
S → aS | b
Which regular expression describes the language it generates?
181 / 185 answered · 90% correct
Q8 of 10Multiple ChoiceAccuracy60s · 1 pt
Consider the grammar:
E → E - E | n
Which string does it generate?
183 / 185 answered · 97% correct
Q9 of 10Multiple ChoiceAccuracy60s · 1 pt
Which grammar generates the same strings as E → E - E | n?
185 / 185 answered · 94% correct
Q10 of 10Multiple ChoiceAccuracy75s · 1 pt
Consider the grammar:
E → E + T | T
T → T * F | F
F → n
In any derivation of n + n * n, how many times is the production F → n applied?
184 / 185 answered · 88% correct
Score Distribution
Score (points) →