A-I 305 · Exam 2
Wed Nov 4 · 8–10 pm · 103 ECoRE · closed book, no notes, no calculator, no cheat sheet
What's on it (official guidance, Nov 4)
20 points: 7 problems worth 15 points together, and 10 MCQs worth 5. Six problems come from DPV ch 4, 5 and 6 (the HW3/HW4 topics), one from ch 3. Of the MCQs, 5 are Poole–Mackworth ch 4–5 and 5 are DPV. The Nov 4 lecture is a review with more ch 3–6 exercises: go, because Exam 1 reused a lecture exercise.
| Part | Count | Priority | Lesson |
|---|---|---|---|
| Ch 4 · shortest paths | 2 problems | top | 2 · Shortest paths |
| Ch 5 · greedy | 2 problems | top | 3 · Greedy |
| Ch 6 · dynamic programming | 2 problems | top | 4 · DP |
| Ch 3 · DFS | 1 problem | medium | 1 · DFS / SCC |
| MCQs (5 PM ch 4–5, 5 DPV) | 10 · 5 pts | lower | Professor's deck questions · 5 · MCQ concepts |
| HW3 + HW4 | in scope | top (repeats likely) | HW solutions |
Ch 4, 5 and 6 are 6 of the 7 problems. Spend most of your time there. Ch 3 is one problem. It can be a hand trace (like Exam 1's DPV 3.3) or a modeling question (like the practice exam's 3.7 and 3.8).
What Exam 1 taught us
The real Exam 1 didn't look like the posted practice exam. The practice exam was mostly prove/disprove questions. The real one was:
- DPV end-of-chapter exercises, nearly word for word. Q7 was DPV 3.3 exactly: the topological sort graph, "alphabetically first", pre/post table, and count the orderings. Q5 was DPV's matrix-squaring exercise. Q1 was the Fibonacci bound from Ch 0.
- A homework repeat. Q3 was HW1 Problem 7, and the solution even says "Same as HW1 Problem 7."
- Exercises solved in lecture. MCQ 15 was DPV 1.20, solved in Lecture 13.
- MCQs: about half were Poole–Mackworth definitions, the rest quick DPV facts.
So for Exam 2, the best targets are, in order: (1) HW3/HW4 problems, (2) DPV Ch 3–6 hand traces with alphabetical tie-breaks (3.4, 4.1, 4.2, 5.1, 5.2, 5.13/5.14), (3) exercises the professor solved in class (4.3, 4.8, 4.15, 4.18, Quiz 6, knapsack table, edit distance, weighted intervals), (4) MCQs from the professor's review decks and the Poole–Mackworth ch 4–5 slides.
Most likely problems, ranked
| Slot | Most likely | Also prepare |
|---|---|---|
| Ch 3 (1) | DPV 3.4 SCC trace (DFS on GR, SCC order, source/sink SCCs, edges to add) or a modeling question like practice 3.7 and 3.8: vertex = state, edge = move, run DFS/BFS. | DPV 3.2 edge classification (tree/forward/back/cross), 3.1; HW3 P1, P3, P4 |
| Ch 4 (2) | A Dijkstra table (DPV 4.1, solved in Lecture 18) + a "modify Dijkstra" design (4.15 usp, 4.18 best, count shortest paths) | Bellman–Ford table (4.2), Quiz 6 (3-vertex graph where Dijkstra fails), 4.8 (adding a constant fails), 4.3 squares, HW3 P6 (time-dependent), HW3 P7 (currency, −log r) |
| Ch 5 (2) | An MST trace (DPV 5.1: cost, # MSTs, Kruskal order + cuts; or 5.2: Prim table) + Huffman or a greedy proof | HW4 P2 (is e in the MST?), P3 (D&C MST counterexample), P4 (greedy party counterexample), P5 (40% ⇒ 1-bit code); 5.9 true/false; fractional knapsack exchange argument; Horn formulas |
| Ch 6 (2) | Fill a DP table (0/1 knapsack as in Lecture 28, or edit distance/LCS) + design a DP (subproblem, recurrence, order, runtime) | HW4 P6 (rod cutting with cut cost), HW4 P7 (hotels = DPV 6.2), 6.1 max contiguous sum, 6.3 Yuckdonald's, weighted interval scheduling, LIS |
| 10 MCQs | Poole–Mackworth ch 4 (CSPs, arc consistency) and ch 5 (propositions, bottom-up/top-down proofs) | Heaps, hash tables, union-find, greedy vs DP facts, DFS/BFS/Dijkstra facts |
Plan for today, in order (about 4½ hours)
Check items off as you go (saved in this browser). Try each card before you open the answer. Skip anything you already get right.
- 1★ Official practice exam 2: the exact style. A few minutes per question, then open the answer. 50 min
- 2★ Likely next DPV exercises: say the technique and running time for each, then check. Do the top 3 in each chapter first. 50 min
- 3★ Shortest paths: one DPV 4.1 Dijkstra table by hand (in case of a trace), then the 4.13, 4.15, 4.18 cards. 30 min
- 4★ Greedy: the cut property, the swap argument, DPV 5.1 by hand, one Huffman card. 30 min
- 5★ DP: the recipe, one knapsack table, then the DPV 6.1–6.9 cards. 35 min
- 6HW3 + HW4: say the technique for each. Compare with the official solutions once posted. 20 min
- 7Deck questions: the two Poole–Mackworth sections (5 MCQs come from there). 20 min
- 8DFS / SCC: DPV 3.4 SCC trace, only if you haven't seen SCCs in a while. 15 min
- 9★ Last-hour sheet right before you leave. 15 min
- Short on time? Do the ★ steps only (about 3½ hours).
- Go to the Nov 4 review lecture. An exercise he works there is a strong exam candidate.
- Extra 2 hours? Take the mock exam timed and grade it with the key.
Exam technique
- Traces: follow the tie-break rule exactly ("alphabetically first"), and write the full table even when it seems obvious. The marks are in the table.
- Design questions: name the base algorithm ("modified Dijkstra", "DP over prefixes"), give pseudocode, give one sentence on why it's correct, and state the running time. Points come from all four.
- DP questions: define the subproblem in words first. That's usually worth half the credit.
- Greedy questions: if it says "show it may fail", give a concrete small counterexample with numbers, then show greedy's answer next to the optimum.
- MCQs: 10 × ½ point. Don't spend more than a minute on any one. Problems are about 2 points each, so they get the time.
Sources: Canvas lecture notes, review decks, HW3/HW4, Exam 1 and its solutions, DPV ch 3–6. Trace answers were computed by a script, not by hand.