← Quiz: DFA Minimisation (Table Filling): all 10 questions
Quiz: DFA Minimisation (Table Filling) · Question 6 of 10
What does this print? (code)
What does this print?
delta = {"p": {"0": "q", "1": "p"}, "q": {"0": "q", "1": "r"}, "r": {"0": "r", "1": "r"}}
acc = {"r"}
p, q, w = "p", "q", ""
for c in "1":
p, q, w = delta[p][c], delta[q][c], w + c
print(w, p in acc, q in acc)
- A.1 True False
- B.1 False True
- C.0 False True
- D.1 False False
Answer & explanation
Correct answer: 1 False True
Reading 1 keeps p in p (rejecting) and moves q to r (accepting), so "1" distinguishes p and q.
Can you get the rest right without peeking?
Take the timed Quiz: DFA Minimisation (Table Filling) quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →