Past exam of the MSc in advanced computer science course of the University of Oxford 2022 Computational game theory 2 b Solution by
Codex 0 2026-10-25
Represent satisfied and unsatisfied goals by payoffs one and zero. The second player's goal is an exclusive or: it is true precisely when , independently of . The first goal is false only when all three Boolean variables are false. The resulting payoff matrix is below; each boxed entry marks that player's best response to the opposing pure strategy, including ties:For player 1, choosing satisfies the goal against every opposing pure strategy. Choosing does equally well except against , where it does worse. Thus is player 1's unique dominant strategy in the weak sense, and there is no strictly dominant strategy. The ties are why most first-player entries in both rows are boxed.
For player 2, either pure strategy with is a best response against , while either with is a best response against . No one choice of works against both rows, so player 2 has no dominant strategy, and there is no dominant-strategy equilibrium. The value of does not affect player 2's own payoff.
The cells with both entries boxed give exactly four pure strategy Nash equilibria:All four give payoffs . In particular, the weakly dominated choice can occur in a Nash equilibrium because player 1 is already satisfied there and cannot strictly improve.
Past exam of the MSc in advanced computer science course of the University of Oxford 2022 Computational game theory 2 a Solution by
Codex 0 2026-10-25
Reading the lower-left number in each source cell as player 1's payoff, against an opponent playing the player's own payoffs from are ; against they are . For , identify with aggressive defection and with yielding cooperation. The standard payoffs then have valuesThe prisoner's dilemma ordering holds precisely for and with this labeling. For example, gives . Each player then has the strictly dominant strategy , although gives both a larger payoff than . Here as well, so the optional weak aggregate-payoff condition is met with equality.
For the Chicken payoff ordering, the collision outcome must be worse than yielding to an aggressive opponent: . This holds for and , for example . Against , the best response is because ; against , it is because . Consequently and are the two pure strategy Nash equilibria, and mutual aggression is the worst outcome for both.
If action names may be exchanged, there is another prisoner's dilemma region: take as cooperation and as defection. Then , so and also work, for example . This relabeling explains why the first displayed region is not a necessary condition without an action convention. Equality at any of these boundaries destroys the strict ordering.
Past exam of the MSc in advanced computer science course of the University of Oxford 2022 Computational game theory 1 c Solution by
Codex 0 2026-10-25
First evaluate the inner lottery: . By reduction of compound lotteries, the outer expected utility isSince lies in the permitted real interval, the square is minimized there. The unique maximizer and maximum expected utility are and . Directly flattening the lottery gives probabilities , and for the three outcomes; these sum to one and give the same expression.
Past exam of the MSc in advanced computer science course of the University of Oxford 2022 Computational game theory 1 b Solution by
Codex 0 2026-10-25
Write and for the two deterministic outcomes. Under the expected utility hypothesis, indifference between them implies . The expected utility of the fair lottery is consequentlyIt must therefore be indifferent to each deterministic outcome, contradicting the asserted strict preference. These preferences do not admit an expected utility representation over the stated outcomes. Equivalently, affine utility on probability measures preserves this indifference under mixing, as required by the independence axiom for lottery preferences.
A concern for the fairness of the procedure can be perfectly intelligible. It would require enlarging the outcome description to include the procedure; it cannot be represented by an expected utility over only the two final gift recipients while retaining the stated strict preference.
Past exam of the MSc in advanced computer science course of the University of Oxford 2022 Computational game theory 1 a Solution by
Codex 0 2026-10-25
Let denote the monetary reward. Its expected value and expected utility are different quantities:Thus indifference to a sure nonnegative reward requires , giving dollars. This is the certainty equivalent, hence the lottery's monetary value in the question's comparison with a sure reward. The utility function is increasing and strictly convex on nonnegative monetary amounts. Its certainty equivalent exceeds its expected value, , demonstrating risk seeking; the same conclusion follows from the Jensen inequality.
The wording about paying an entry fee needs a qualification. A certainty equivalent compares a gross lottery with a sure gross reward; a literal utility indifference price also accounts for the fee's effect on wealth. If instead describes final wealth, with initial wealth and fee , the comparison is , on a domain where the utility function is increasing. Here , so the nonnegative-wealth branch gives whenever that branch is admissible. An initial wealth and an admissible payment domain are not specified. Therefore is the determined certainty equivalent, while a literal wealth-dependent maximum fee is not uniquely determined. This is the distinction in certainty equivalent and willingness to pay. If negative rewards were allowed without requiring an increasing utility function, the equation for also has the algebraic root ; the usual nonnegative-reward interpretation selects the positive root.
Past exam of the MSc in advanced computer science course of the University of Oxford 2021 Computational game theory 4 b Solution by
Codex 0 2026-10-25
cannot have an induced subgraph game representation. is represented by a weighted triangle with edge weights , , , and has Shapley value vector .
In an induced subgraph game, players are graph vertices and a coalition receives the sum of the weights of graph edges whose two endpoints lie in it. Therefore each two-player coalition determines the corresponding edge weight. For these weights would have to be , making the grand coalition worth , whereas its actual value is . No other edge weights can repair that discrepancy without changing a two-player coalition's value. Even a convention allowing vertex weights would not help: its singleton values force all such weights to zero.
For , the stated weighted graph triangle has grand coalition value and reproduces all three pair values. Empty and singleton coalitions contain no graph edges, so their values are zero. This verifies all eight coalitions and supplies the complete representation.
To compute the Shapley value, reveal players in a uniformly random permutation. An edge's weight contributes to an endpoint's marginal contribution precisely when the other endpoint appeared earlier. Each endpoint is later with probability , independently of where the third player appears. Linearity of the expected value therefore splits each edge weight equally between its two endpoints:The values sum to , as required by the Shapley value's efficiency property. This is the general Shapley value of an induced subgraph game formula, not an assumption that all three players are symmetric: player has a different incident-weight total.
Past exam of the MSc in advanced computer science course of the University of Oxford 2021 Computational game theory 4 a Solution by
Codex 0 2026-10-25
If the core is nonempty, it is exactly the singleton allocation for every . Take any in the core of a cooperative game and write . Core membership gives efficiency of the imputation, , and the coalition inequalitiesUsing the given complementary-coalition equality in this constant-sum cooperative game, the second inequality yieldsCombining upper and lower bounds gives for every coalition . In particular,Since this holds for any core member and at least one exists by hypothesis, the displayed allocation is in the core and is its only member. The argument also shows why nonemptiness is restrictive: it forces for every coalition, so the characteristic function of a coalitional game must be additive. No superadditive coalitional game or monotonicity assumption is needed.
Past exam of the MSc in advanced computer science course of the University of Oxford 2021 Computational game theory 3 b Solution by
Codex 0 2026-10-25
Use the standard repeated game convention that the first round's joint action is observed before round two. The following original game tree represents simultaneous moves by making row move first in each round while hiding that current move from column. Terminal labels are total payoffs over both rounds, ordered row then column.
The full two-round extensive-form game, with all sixteen terminal payoff pairs and five column information sets
. Details. Formally, round one starts at a row decision with actions . The two ensuing column nodes form one information set , with available actions ; column cannot tell which current row action occurred. The four completed first-round histories are . At each , round two begins at a separate row node. Its two successors, after row's current or , form a column information set . Distinct have distinct information sets: both players know the whole first-round outcome. There are sixteen terminal histories , whose total payoff is , as displayed in the tree.
The row player's five information sets are the initial singleton and the four singleton round-two nodes, one per . The column player's five information sets are and the four two-node sets . Thus each player must specify one binary choice at each of five information sets, including histories that its own first choice might prevent:Counting only the four possible two-round action sequences would miss the distinct contingent responses to the opponent's first action.
For a concrete pair of complete pure strategies, order the second-round histories as and useThe first entry is the initial action, and the four remaining entries prescribe the action after each first-round history. This induces the unique path in round one followed by in round two. Hence the total payoff isThe off-path entries are part of each pure strategy, even though this pair does not reach them.
For randomization, a mixed strategy is a probability distribution over the complete plans, with free probabilities in a general distribution. A behavioural strategy instead gives one binary-action probability at each of five information sets, requiring five parameters. This game has perfect recall: a player never forgets a previous own action or a first-round observation, and the only concealed action is the opponent's current simultaneous choice. Consequently neither kind of randomization has a greater attainable-payoff advantage: Kuhn's theorem gives realization-equivalent strategies against every fixed opposing strategy.[ref]
Extensive games and the problem of information by Harold W. Kuhn. original article, pp. 193–216, equivalence under perfect recall
The equivalence can be verified directly here. Given a behavioural strategy, sample all five contingent actions independently before play; the resulting product probability distribution over complete plans is an equivalent mixed strategy. Conversely, let be a mixed strategy for player . Use its marginal probability for the initial action. At history containing own first action , choose second action with conditional probabilitywhenever the denominator is positive; if it is zero, choose arbitrarily at that unreachable history. The opponent's first-round action is simultaneous and cannot depend on the sampled hidden plan beyond the chosen first action. Thus conditioning on preserves exactly these conditional probabilities of actions, and multiplying the first- and second-round factors reproduces each terminal probability. Correlations between prescriptions at mutually exclusive second-round histories have no further observable effect. Behavioural strategies offer the more compact representation, while mixed strategies describe a single random choice of a full plan. Imperfect information here does not mean imperfect recall.
Past exam of the MSc in advanced computer science course of the University of Oxford 2021 Computational game theory 3 a Solution by
Codex 0 2026-10-25
Exactly , and can be sustained as constant stage game outcomes. Their long-run average payoffs are , and , respectively. We assume the usual repeated game monitoring convention: both players observe each completed joint action before the next round. The source's colour convention puts the blue lower-left row payoff first and the red upper-right column payoff second.
For necessity, row action earns against , so playing it forever guarantees a nonnegative long-run average payoff against every opposing pure strategy. Similarly, column action earns against and guarantees zero or more. Conversely, column action holds the row player's best possible stage payoff to , and row action holds the column player's to . Thus each player's minmax payoff is exactly .
Any Nash equilibrium must give both players at least zero, an individually rational payoff in a repeated game. Every off-diagonal cell has a negative payoff for one player: and hurt row, and hurt column, hurts row and hurts column. Repeating any such cell forever therefore permits a profitable unilateral deviation to the zero-guaranteeing action. The three diagonal cells pass this necessary test.
For sufficiency, fix target or . Each player's finite-state strategy has initial state and an absorbing state . In , output the player's component of ; remain in if the completed joint action equals , and otherwise move to . In , row always outputs and column always outputs , regardless of further observations. These are two-state grim trigger strategies; the separate machines are drawn below. The input is the observed joint action, so after any off-path history the prescribed continuation states agree.
If neither player deviates, the target is repeated forever. If a player first deviates at a finite round , the opponent enters for all later rounds. Against column action , every row action earns at most zero; against row action , every column action earns at most zero. All payoffs are bounded, so the total reward before and at , divided by the horizon, tends to zero. The deviator's upper limiting average is therefore at most , below either target payoff or . This proof tests arbitrary future deviations, not merely a single changed action. It also rules out improvement by deviations whose averages fail to converge, if the criterion is extended by an upper or lower limit.
For target , one-state machines outputting and forever suffice: each is a best response to the other in every round. Their long-run average payoffs are zero and no unilateral deviation can improve them. In fact, the punishment is credible because is a stage Nash equilibrium, so the two positive-target constructions are also subgame perfect equilibria under the stated monitoring assumption. The general punishment mechanism is described in [ref]
Lecture 15: Repeated Games by Asu Ozdaglar. slides 12–15; those slides use discounting, while the finite-prefix argument here uses long-run averages
.“Outcomes of the stage game” here means a fixed action pair repeated forever. Allowing time sharing also sustains some average payoff vectors that are not stage cells: for example, a deterministic alternating cycle gives , with a two-phase finite-state strategy and the same permanent punishment. An off-diagonal cell may occur in a sustainable cycle; the impossibility above concerns its constant repetition, not every appearance on an equilibrium path. With finite-state pure strategies, an undisturbed path is eventually periodic, so its limiting cell frequencies are rational numbers.
Past exam of the MSc in advanced computer science course of the University of Oxford 2021 Computational game theory 2 d Solution by
Codex 0 2026-10-25
The unique Nash equilibrium uses row probabilities on and column probabilities on . The value of a zero-sum game to the row player is ; the column player receives .
The first graph solves the row player's max–min optimization: choose a mixed strategy guaranteeing the greatest possible worst-case expected payoff. The second solves the column player's min–max optimization: choose a mixed strategy placing the smallest upper bound on the row player's expected payoff. Their optimal heights agree, illustrating the minimax theorem.
There is also a direct Nash equilibrium certificate, so the conclusion does not depend on reading coordinates from a plot. At , both opposing pure columns give row expected payoff ; at , both pure rows give row expected payoff . By linearity, every unilateral deviation, including an arbitrary mixed strategy, leaves the deviator's expected payoff unchanged against the fixed opposing equilibrium mixture. Neither player can improve it. This is a mixed-strategy optimality certificate for a matrix game.
The equilibrium outcome is a probability distribution over cells, rather than one deterministic cell. Independent randomization givesThe resulting row expected payoff is . Finally, each envelope has a unique optimum, so any Nash equilibrium must use the displayed optimal mixed strategies. In particular there is no pure strategy Nash equilibrium.
Past exam of the MSc in advanced computer science course of the University of Oxford 2021 Computational game theory 2 c Solution by
Codex 0 2026-10-25
The bold black curve is now the pointwise maximum of the two pure-row expected payoff functions:It measures the largest expected payoff that the row player can achieve against column mixed strategy . The column player minimizes this quantity because its own payoff has the opposite sign. Equality of the two lines gives , or . The envelope decreases before that point and increases afterwards, givingThe endpoint values and are both larger. A row mixed strategy cannot exceed the greatest pure-row expected payoff, because its expected payoff is a convex combination of those two values.
Past exam of the MSc in advanced computer science course of the University of Oxford 2021 Computational game theory 2 b Solution by
Codex 0 2026-10-25
The bold black curve is the pointwise minimum of the two opposing-column expected payoff functions. It is the row player's security level payoff at the specified mixed strategy:The lines meet where , hence at . The first branch increases with slope and the second decreases with slope , so their intersection is the unique global maximum of the lower envelope:The endpoint values are and , both smaller. Since an opposing mixed strategy forms a convex combination of the two pure-column expected payoffs, it cannot make the row player's expected payoff lower than this envelope.
Past exam of the MSc in advanced computer science course of the University of Oxford 2021 Computational game theory 2 a Solution by
Codex 0 2026-10-25
Put and , so the complementary probabilities are and . All four expressions are the row player's expected payoff, including those indexed by a column action. Direct expected value calculations giveThe column player's expected payoff is the negative of the row player's because this is a zero-sum game.
Past exam of the MSc in advanced computer science course of the University of Oxford 2021 Computational game theory 1 b Solution by
Codex 0 2026-10-25
No: these two strict comparisons violate the independence axiom for lottery preferences. Let denote the certain zero-money lottery. Reduction of compound lotteries givesFor example, the second expression assigns probability to the nonzero reward and to zero. The claimed must therefore implywhich is , contradicting the other claimed strict preference.
The same obstruction is visible in any proposed expected utility representation. Subtract from the utility function, and write and . The first comparison requires , hence , whereas the second requires . No real satisfy both. This argument requires neither risk neutrality nor an assumption that the utility function is increasing in money.
Past exam of the MSc in advanced computer science course of the University of Oxford 2021 Computational game theory 1 a Solution by
Codex 0 2026-10-25
By the Von Neumann-Morgenstern utility theorem, use a representing utility function and apply a positive affine function to set and . This is possible because the given strict preference implies . The two specified indifference relations then giveTaking the expected utility of each lottery yieldsTheir difference is , establishing the stated strict preference. These numbers measure utility, not monetary reward or an assumed ordering of the subscripts.
Here is the underlying argument directly in terms of the axioms. The independence axiom for lottery preferences permits substitution of indifferent lotteries inside a common mixture. Replacing by its given mixture of , and then replacing , followed by reduction of compound lotteries, givesand consequentlyThe transitive relation axiom combines the successive substitutions. Finally, mixture monotonicity says that among mixtures of a strictly better and a strictly worse outcome, the greater probability of the better outcome is strictly preferred; this follows from the independence axiom for lottery preferences and transitivity. Since and , the comparison follows. Complete lottery preferences and continuity of lottery preferences are part of the representation theorem's hypotheses; the direct substitution calculation uses the already supplied indifferences and does not need to invoke continuity of lottery preferences again.[ref]
Expected utility theory by EconPort. “The Expected Utility Property” and the preceding preference axioms
Past exam of the MSc in advanced computer science course of the University of Oxford 2021 Bayesian statistical probabilistic programming 3 e Solution by
Codex 0 2026-10-25
I would first collapse the duration noises as in part (c), then use self-normalized importance sampling on the two shared parameters. Draw independent , give each the importance weight , and returnThis is likelihood weighting: the observations affect the weights rather than forcing repeated simulation of twenty latent inequalities. Integrating out both the constraints' auxiliary randomness and the future Boolean query is Rao-Blackwellization; at fixed parameters it removes randomness without changing the relevant conditional expectations.
The weights and weighted queries lie in , and the evidence is positive. The strong law of large numbers therefore makes the numerator and denominator averages converge to their corresponding integrals, proving almost sure convergence of their ratio to part (d). The finite- ratio is generally biased; the assertion concerns consistency rather than a finite-sample unbiased estimator. Use logarithms of importance weights to avoid numerical underflow:
def weighted_answer(n, rng):
if n <= 0:
raise ValueError("n must be positive")
samples = []
for _ in range(n):
mu = rng.uniform(0.0, 60.0)
sigma = rng.uniform(1.0, 20.0)
samples.append((journey_loglik(mu, sigma),
math.exp(5.0 * normal_logcdf((mu - 30.0) / sigma))))
offset = max(logw for logw, h in samples)
if not math.isfinite(offset):
raise ArithmeticError("all weights underflowed")
scaled = [(math.exp(logw - offset), h) for logw, h in samples]
den = math.fsum(w for w, h in scaled)
answer = math.fsum(w * h for w, h in scaled) / den
ess = den * den / math.fsum(w * w for w, h in scaled)
return answer, essThe returned effective sample size of importance sampling is a concentration diagnostic, not a proof of accuracy. Repeat runs and inspect the weights. If the prior is much broader than the posterior, improve the proposal with the corresponding importance sampling density correction, or use the Metropolis–Hastings algorithm targeting . Because this particular collapsed problem is only two-dimensional, deterministic numerical integration is also an excellent independent accuracy check; it was used for the figure and numerical illustration. Straight rejection of the original traces is correct but wastes most proposals here.
Past exam of the MSc in advanced computer science course of the University of Oxford 2021 Bayesian statistical probabilistic programming 3 d Solution by
Codex 0 2026-10-25
For any chosen proper prior density on with positive evidence, Bayes' theorem givesThe prior density comes from the first two random draws. The likelihood is the probability of satisfying all observed-label constraints after integrating the past duration noises. The factor is the probability of the five-day outcome conditional on the shared parameters. The denominator is the probability of acceptance, which converts the numerator's joint probability into the required conditional probability.
For the independent uniform priors in part (a), the constant cancels and both integrals reduce to , . A prior on the variance would require transforming the density: this chosen prior has density for conditional on . One must not silently replace it by a uniform prior on .
There is no unique numerical probability until the prior distribution is chosen. As a check for the stated uniform priors, independent Gaussian quadrature calculations with 256 and 512 nodes per coordinate agree at the shown precision:The prior-predictive probability of all observed labels is approximately , explaining the rejection cost. These numbers are illustrations of the explicit model, not additional observed data.
A subtle point is that the five future days are independent only conditional on . Integrating shared parameter uncertainty gives , not . The latter is about for these priors and understates the five-day probability. Jensen's inequality gives , while gives . For two future late-arrival indicator functions, their posterior covariance is . This is the posterior predictive repeated-success identity.
Posterior uncertainty and the five-day predictive probability for the explicitly chosen uniform priors. The contour is cropped to the parameter region carrying the visible mass; integration uses the full prior rectangle.
Details. Past exam of the MSc in advanced computer science course of the University of Oxford 2021 Bayesian statistical probabilistic programming 3 c Solution by
Codex 0 2026-10-25
Write for the standard normal distribution function. Integrating out the twenty independent past durations gives the threshold-censored normal likelihoodThe frequencies are those in part (a). For a future day, the conditional late-arrival probability is . Conditional independence of the five future durations gives .
Exactly three primitive random coordinates suffice. Draw from the same priors and one independent . Reject if ; otherwise return whether . Conditional on acceptance and the parameters, is uniform on an interval of length ; the true-answer subinterval has length . Reusing this same uniform value is therefore intentional, not an independence mistake.
Indeed the two output contributions at each parameter value areThese are exactly the contributions obtained by integrating the original twenty-five duration noises. Multiplication by the common prior density and normalization therefore give the same joint posterior distribution of . The revised program preserves the query and parameter posterior, but does not retain individual latent durations. This is uniform-interval encoding of conditioning and a binary query.
Here is an executable version, reusing the definitions from part (a). Logarithms avoid multiplying many small probabilities.
def normal_logcdf(z):
value = 0.5 * math.erfc(-z / math.sqrt(2.0))
return math.log(value) if value > 0.0 else -math.inf
def journey_loglik(mu, sigma):
return (sum(n * normal_logcdf((mu - c) / sigma)
for c, n in LATE.items())
+ sum(n * normal_logcdf((c - mu) / sigma)
for c, n in EARLY.items()))
def collapsed_trace(rng):
mu = rng.uniform(0.0, 60.0)
sigma = rng.uniform(1.0, 20.0)
log_likelihood = journey_loglik(mu, sigma)
# This uniform lies in (0, 1], avoiding log(0).
log_u = math.log(1.0 - rng.random())
if log_u >= log_likelihood:
return None
log_h = 5.0 * normal_logcdf((mu - 30.0) / sigma)
return log_u < log_likelihood + log_haccepted_average(collapsed_trace, n, rng) consequently has the same target as the original program. The ideal three-dimensional sample space is with product uniform probability measure, conditioned on the displayed acceptance event. Finite-precision normal tails can underflow to zero in this simple implementation; the mathematical equivalence concerns exact probabilities, and the numerical check in part (d) independently integrates the likelihood in the region carrying appreciable posterior mass. There are unlisted articles, also show them or only show them.




