32 practice points. Attempt the questions before consulting their worked arguments.
Question 5: Composition of partial expression functions
8 points
Inputs and constants are rational numbers. Finite expressions have exactly these constructors: Const(c) for any rational c; Var; Add(E,F); and Div(E,F). Const(c) is defined at every rational input with value c, and Var has value x at input x. Add is defined only when both children are defined; Div is defined only when both children are defined and the denominator value is nonzero. There is no cancellation rule that changes a domain. Write D(E) for the domain. Define syntactic substitution E[F] by replacing every Var leaf of E by F, leaving constant leaves unchanged and preserving each Add and Div constructor. Separately, the partial-function composition E∘F is defined exactly when x is in D(F) and F(x) is in D(E).
(a) · 2 points
Give recursive formulas for D(Add(E,F)) and D(Div(E,F)). Prove by structural induction that every defined expression value is rational.
(b) · 4 points
Prove for every E and F that, for each x in D(F), E[F] is defined at x if and only if E is defined at F(x), and the values then agree. Deduce D(E∘F)=D(F)∩D(E[F]). Is the intersection with D(F) always removable? Give an explicit counterexample if not.
(c) · 2 points
Let E(t)=(t−1)/(t−1) and F(x)=1/(x−2), using Add with negative constants for subtraction. Determine the exact domain and simplified formula of E∘F. Identify an input at which the simplified formula alone would improperly extend this composition.
Review question 5: worked argument and scoring criteria
(a)
The domains are D(E)∩D(F) and {x in D(E)∩D(F): F(x)≠0}, respectively. Constants and the variable return rational values at rational inputs. For an Add node, the induction hypotheses give two rational defined child values, whose sum is rational. For a Div node, they give rational child values with a nonzero denominator by the domain rule, so the quotient is rational. These are every constructor of a finite expression.
- 1 point: Gives both domain formulas, including the nonzero defined denominator condition.
- 1 point: Covers both leaves and both recursive constructors in a rational-value structural induction.
(b)
Fix F and x in D(F), and put y=F(x). Induct on E. For Const(c), both substituted and original-at-y expressions are defined with value c. For Var, the substituted expression is F and the original-at-y value is y, so both are defined and agree. For Add(U,V), each child is defined at x after substitution exactly when its original is defined at y, by the induction hypotheses; when defined, the corresponding child values agree. Hence the conjunction of child-definedness and their sum agree. For Div(U,V), the same equivalence holds for both children, and equality of the denominator values makes the nonzero-denominator conditions equivalent; their quotients then agree. The induction covers every finite E. Composition also explicitly requires x in D(F), giving the stated intersection formula. It cannot be removed: take E=Const(7) and F=Div(Const(1),Var). Then E[F]=Const(7) has domain all rational numbers, while E∘F has domain all nonzero rational numbers.
- 1 point: States a strengthened definedness-and-value induction and handles constant and variable leaves with x in D(F).
- 1 point: Proves both directions for Add using both child hypotheses.
- 1 point: Handles both child domains and the denominator nonzero test for Div, then deduces the domain intersection.
- 1 point: Supplies a genuine constant-expression counterexample with the two different domains.
(c)
F requires x≠2. E requires t≠1, so F(x)≠1 further requires x≠3. On the resulting domain Q without {2,3}, E(F(x))=1. The constant expression 1 alone is defined at x=3, but the original outer denominator is zero there. At x=2 the inner function is undefined. Cancellation preserves values on the original domain but does not fill either excluded input.
- 1 point: Derives both exclusions x=2 and x=3 from the nested original domains.
- 1 point: Gives the constant value 1 on that domain and explains an invalid extension at x=3 or x=2.
Targeted review:
Question 6: A safe state need not be reachable
8 points
Two storage cells have integer capacities 11 and 13. Their current contents are (x,y), initially (6,8). A permitted transfer moves exactly 3 units from one cell to the other: (x,y)→(x−3,y+3) requires x≥3 and y+3≤13; (x,y)→(x+3,y−3) requires y≥3 and x+3≤11. There are no other transitions. An operator may stop at any time. A terminal state means a state with no permitted transition, not merely a state where the operator chooses to stop.
(a) · 3 points
Prove by induction on execution length that all reachable states satisfy the capacity bounds, x+y=14, and x≡0 (mod 3). State the corresponding congruence for y.
(b) · 3 points
List every reachable state and prove your list is complete. Give a state satisfying both capacity bounds and the conserved total that is nevertheless unreachable, identifying the obstruction.
(c) · 2 points
Does every execution terminate? Does any reachable terminal state exist? Explain how the answer differs from the operator choosing to stop after one transfer.
Review question 6: worked argument and scoring criteria
(a)
Initially 0≤6≤11, 0≤8≤13, the total is 14, and x≡0, y≡2 modulo 3. In a transfer from x to y the source guard ensures x−3≥0 and the destination guard ensures y+3≤13; the other two bounds are preserved since x decreases and y increases. The reverse transfer has the symmetric argument. Each move changes the total by zero and each coordinate by a multiple of 3. Thus induction proves all claims, including y≡2 modulo 3.
- 1 point: Checks every invariant at the initial state.
- 1 point: Uses the source and destination guards to preserve all capacity bounds in both directions.
- 1 point: Proves conservation and both congruences under either move and concludes induction.
(b)
Conservation and bounds require 1≤x≤11: y=14−x must lie between 0 and 13. The congruence leaves x=3,6,9, giving (3,11),(6,8),(9,5). Both outer states are reached from (6,8) by one legal move, so all three are reachable; the necessary invariant excludes every other candidate. The state (7,7) satisfies the bounds and total but has x not divisible by 3, so it is unreachable. Any similarly justified counterexample is acceptable.
- 1 point: Uses all invariant restrictions to obtain exactly the three candidates.
- 1 point: Provides legal paths realizing each candidate, establishing sufficiency for this specific list.
- 1 point: Gives and justifies a bound-safe, total-preserving but unreachable state.
(c)
No forced termination holds: (6,8)→(3,11)→(6,8) can repeat forever, and every move is guarded. There is no reachable terminal state: (3,11) can move to (6,8), (9,5) can move to (6,8), and (6,8) has both moves. The operator can still choose to stop at any of these states; voluntary stopping is not disabledness of all transitions.
- 1 point: Gives an explicit infinite legal cycle, rather than inferring termination from a finite state space.
- 1 point: Checks the reachable states for enabled moves and distinguishes voluntary stopping from terminality.
Targeted review:
Question 7: All maximum antichains and a resource certificate
8 points
Seven jobs A,B,C,D,E,F,G each require exactly one time unit on one worker, with no preemption. The supplied DAG has exactly four edges: A→D, D→F, B→E, E→G. There are no other edges; C is isolated. An edge means its source must finish before its target starts. The associated partial order includes transitive precedence. Two identical workers are available from time 0. A job finishing at time t permits its successor to start at that same time t. An antichain contains mutually incomparable jobs; maximum means greatest cardinality, not merely inclusion-maximal.
Diagram equivalent: Two chains A to D to F and B to E to G, together with isolated C. Only the four listed arrows are edges. Vertices: A, D, F, B, E, G, C. Directed edges: A → D; D → F; B → E; E → G. The drawing's distances have no mathematical significance.
(a) · 4 points
Determine the maximum antichain size, list ALL maximum antichains explicitly, and prove that none are missing.
(b) · 4 points
Give a two-worker schedule with minimum possible completion time and prove optimality. State both a precedence lower bound and a total-work lower bound. Explain why maximum antichain size alone is not a completion-time certificate.
Review question 7: worked argument and scoring criteria
(a)
The three chains {A,D,F}, {B,E,G}, {C} partition the vertices. An antichain uses at most one member of each, so its size is at most 3. There is no precedence across these three chains, so choosing C, one vertex from the first chain, and one from the second always gives size 3. The nine maximum antichains are {A,B,C},{A,C,E},{A,C,G},{B,C,D},{C,D,E},{C,D,G},{B,C,F},{C,E,F},{C,F,G}. To have size 3, every antichain must select one member of each partition chain, so this list is exhaustive.
- 1 point: Proves the upper bound 3 using a chain partition and transitive comparability.
- 1 point: Shows that one choice from each chain is an antichain of size 3.
- 1 point: Lists all nine distinct maximum antichains without an invalid set.
- 1 point: Explains why every maximum antichain has this form, certifying completeness.
(b)
One schedule is worker 1: A on [0,1], D on [1,2], F on [2,3], C on [3,4]; worker 2: B on [0,1], E on [1,2], G on [2,3], then idle. All four precedence constraints and the same-time finish/start rule are satisfied. A length-three chain forces completion time at least 3. Seven units of work on two workers force time at least 7/2. More strongly, each worker executes an integer number of whole unit jobs, so one must execute at least 4 jobs and needs at least 4 elapsed time units, even if arbitrary real start times are allowed. The displayed schedule attains 4. Width 3 describes mutually incomparable jobs, not their complete resource-constrained timing; it does not replace either lower-bound argument.
- 1 point: Supplies a complete schedule finishing at 4 with no overlap on a worker.
- 1 point: Checks every precedence edge and states the length-three-chain bound.
- 1 point: Proves the four-unit work-allocation lower bound, valid even with real start times.
- 1 point: Combines the lower bound and attaining schedule and distinguishes width from makespan.
Targeted review:
Question 8: Proposal traces with an unmatched participant
8 points
There are four proposers A,B,C,D and three receivers X,Y,Z. Lists are complete and strict, and every participant prefers any listed partner to being unmatched. Proposer lists, best first: A: X,Y,Z; B: X,Z,Y; C: Y,X,Z; D: Z,Y,X. Receiver lists, best first: X: C,A,B,D; Y: B,D,C,A; Z: A,C,D,B. A free proposer with an untried receiver may propose; the receiver retains the better of the new proposal and any currently held proposer. For the requested trace always choose the alphabetically first eligible free proposer. Stop when no free proposer has an untried receiver. A blocking pair is an unmatched proposer–receiver pair for which both strictly prefer each other to their current assignment, treating unmatched as worst.
(a) · 3 points
Run the specified procedure. List the ordered proposals and give the final pairs and unmatched participant. Check stability directly using all pairs that some proposer prefers to their final assignment.
(b) · 3 points
Prove for ANY strict complete lists on four proposers and three receivers, and any choice of eligible proposer at each step, that this procedure terminates after at most 12 proposals, fills all three receivers, and returns a stable matching. Do not use the specific trace as a general proof.
(c) · 2 points
Now remove the complete-list assumption: unlisted partners are unacceptable, participants prefer remaining unmatched to such partners, and only listed acceptable proposals occur. Give a four-proposer/three-receiver example with a stable result leaving a receiver unfilled. Explain exactly which inference in part (b) no longer applies.
Review question 8: worked argument and scoring criteria
(a)
The proposal sequence is A→X, B→X, B→Z, C→Y, D→Z, B→Y, C→X, A→Y, A→Z, D→Y, D→X. The final pairs are A–Z, B–Y, C–X, with D unmatched. A prefers X and Y to Z, but X prefers C to A and Y prefers B to A. B prefers X and Z to Y, but X prefers C to B and Z prefers A to B. C prefers Y to X, but Y prefers B to C. D prefers every receiver to being unmatched, but X prefers C to D, Y prefers B to D and Z prefers A to D. These exhaust possible blocking pairs.
- 1 point: Gives the ordered proposal trace with the correct replacements and rejections.
- 1 point: Identifies all three final pairs and unmatched D.
- 1 point: Checks every proposer-preferred alternative, including all three alternatives for D, against the receiver ranking.
(b)
Each proposer advances through its list without repetition, so there are at most 4·3=12 proposals. A receiver that has ever received a proposal always holds someone thereafter, and replaces that person only with someone it prefers. At termination at least one proposer is free because at most three can be held. That free proposer has exhausted all three receivers; consequently every receiver has received a proposal and remains occupied. For a putative blocking pair p,r, proposer p must have proposed to r: a free proposer exhausted its list, and a matched proposer previously proposed to every receiver it prefers to its final partner. When r rejected or displaced p, it held someone it preferred to p; its subsequent held partners only improve. Its final partner is therefore preferred to p, contradicting blocking. This proves stability for every eligible-proposer schedule.
- 1 point: Proves the no-repeat finite proposal bound.
- 1 point: Uses an exhausted free proposer and persistent receiver occupancy to prove all receivers are filled.
- 1 point: Proves stability using prior proposals and monotone receiver improvement for both matched and unmatched proposers.
(c)
Let the only mutually acceptable pairs be A–X and B–Y; C and D list nobody, Z lists nobody, and the other four lists contain only their respective one partner. A–X and B–Y form a stable matching with C,D,Z unmatched, since there is no unpaired mutually acceptable pair. An exhausted free proposer need not have proposed to all receivers: C and D have empty lists. Thus the complete-list argument that every receiver has received a proposal fails. No-repeat termination remains valid, but universal receiver saturation does not.
- 1 point: Gives a concrete stable incomplete-list example with an unfilled receiver and checks acceptability/blocking.
- 1 point: Identifies the failed exhausted-list-to-all-receivers implication without falsely rejecting termination.
Targeted review: