Prerequisite Diagnostic
Spend 30–45 minutes before opening the feedback. These are prerequisites, not a test of the strategies you are here to learn.
- Trace
total=0; for x in [2,-1,4]: total += xafter each iteration. - Negate “every input has at least one valid output.” State the domains.
- List all subsets of
{a,b}. Distinguish the empty set from no result. - Solve
2x+3=11, then substitute the result into the original equation. - Explain what additional information you need to evaluate “this code is fast.”
Feedback and routing
- Totals 2, 1, 5: repair basic loop tracing in Semester 0 if needed.
- “There exists an input with no valid output”: repair quantifiers in Module 1.
- Empty, {a}, {b}, {a,b}: repair finite sets in Module 1.
- x=4, verified by 8+3=11: repair arithmetic before numerical examples.
- Input sizes/distribution, operations or timing boundary, machine and target. An incomplete answer is a prompt to learn cost contracts here, not a blocker.
Write one fresh example for a missed prerequisite. Continue when you can trace and explain it unaided; do not repeat whole books for an isolated gap.