CMSC330-10/20

CMSC 330 — Fall 2026 · October 20, 2026 · 185 players · Max 10 pts

Questions & Results

Q1 of 10Multiple ChoiceAccuracy45s · 1 pt

Which language can be described by a context-free grammar but NOT by any regular expression?

A a*b*
1
B {aⁿbⁿ | n ≥ 0}
145
✓ Correct
C (ab)*
D Strings over {a, b} with an even number of a's
5
151 / 185 answered · 96% correct
Q2 of 10Multiple ChoiceAccuracy45s · 1 pt

Which of the following is NOT a component of a context-free grammar?

A A set of terminals
8
B A set of nonterminals
25
C A start symbol
8
D A set of accepting states
124
✓ Correct
165 / 185 answered · 75% correct
Q3 of 10Multiple ChoiceAccuracy60s · 1 pt

Consider the grammar:

S → aSb | ε

Which string does it generate?

A abab
1
B aab
4
C aabb
161
✓ Correct
D ba
3
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
162
✓ Correct
B S ⇒ AB ⇒ ab
6
C S ⇒ aB ⇒ ab
3
D S ⇒ ab
3
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}
6
C Strings of the form aⁿbⁿ
D Palindromes over {a, b}
171
✓ 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?

A aabb
5
B abba
172
✓ Correct
C abab
5
D ε (the empty string)
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?

A ab*
12
B (ab)*
1
C a*b*
6
D a*b
162
✓ Correct
181 / 185 answered · 90% correct
Q8 of 10Multiple ChoiceAccuracy60s · 1 pt

Consider the grammar:

E → E - E | n

Which string does it generate?

A n -
2
B n n
3
C n - n - n
177
✓ Correct
D - n - n
1
183 / 185 answered · 97% correct
Q9 of 10Multiple ChoiceAccuracy60s · 1 pt

Which grammar generates the same strings as E → E - E | n?

A E → n - n | n
5
B E → n - E | n
173
✓ Correct
C E → E - E
7
D E → n 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?

A 1
1
B 2
15
C 3
162
✓ Correct
D 4
6
184 / 185 answered · 88% correct

Score Distribution

4
3
4
9
11
26
54
74
0
1
2
3
4
5
6
7
8
9
10

Score (points) →

Players
185
Average Score
8.7
High Score
10
Max Possible
10