All three questions have the same mathematical content as combinatorial optimisation, where all 29 answer parts are solved. This MSc version has a three-hour duration and different answer instructions and mark allocations; the undergraduate version has a two-hour duration. Their formal paper codes and cover metadata differ.
Solutions to all four questions and all ten marked lettered parts of the University of Oxford examination held on 1 June 2023. Every unlabelled bullet task within those parts is covered. Source release: released examination archive, member 2022/T/a15684w1.pdf; the cover identifies the paper as Trinity Term 2023. Question statements and original diagrams are omitted. Necessary conventions about finite representations, repeated-game payoffs and empty-coalition normalization are stated at the affected parts.
Under the expected utility hypothesis, use positive affine uniqueness of affine preference representations to normalize the extreme outcomes to and . The stated indifference relations then give
The two lotteries have expected utilities
Hence , with normalized expected utility difference . Equivalently, substitution reduces them to lotteries with probabilities and of the better extreme outcome. The inference uses the independence axiom for lottery preferences; the three displayed outcome comparisons alone would not determine preferences over all compound lotteries without the expected utility hypothesis.
Yes: the stated order has an expected utility representation. For outcomes whose monetary amounts are , respectively, choose
Then
Since , this utility function gives exactly the required strict preferences.
The distinction is that the expected utility hypothesis does not by itself require the utility function to increase with monetary amount. This nonmonotone monetary utility ranks the outcome paying 2 below the outcome paying 1. If increasing monetary utility were imposed as an additional assumption, the stated order would fail: requires because
That additional monotonicity assumption is not printed in this part.
For the intended finite representation, put . For each , form the minterm
A Boolean valuation satisfies exactly when its selected subset is . Therefore the weighted formula utility representation
represents exactly: at the Boolean valuation for , only that minterm contributes, with weight . This proves completeness and the bound of rules simultaneously. Zero-weight rules may be omitted. The bound counts rules; writing each minterm also requires symbols in Big O notation.
For the computational question, assume rule weights are rational numbers encoded in binary. This makes exact equality of sums a finite computational task. With this conventional encoding, equivalence of weighted formula utility representations is co-NP-complete.
For membership, the complement has a short witness: a Boolean valuation on the variables occurring in either rule base. Evaluate each propositional formula, sum the weights of satisfied rules, and accept the witness if the sums differ. Propositional formula evaluation takes polynomial time. Exact sums of binary rational numbers also have polynomially bounded bit lengths: the product of their denominators has bit length at most the sum of the input denominator lengths. Thus non-equivalence lies in NP, and equivalence lies in co-NP.
For hardness, take a Boolean satisfiability problem instance and construct
The first utility function is one at satisfying Boolean valuations and zero elsewhere, while the second is always zero. Consequently
The unsatisfiable Boolean formula problem is co-NP-complete, as the complement of the NP-complete Boolean satisfiability problem. The construction is a polynomial-time reduction, proving hardness even with the single weight .
Two qualifications matter in the literal wording. First, unrestricted real weights have no specified finite encoding, so a standard bit-complexity classification needs the encoding assumption above. Second, the problem says only that is nonempty. If infinite is allowed while rule bases remain finite, its completeness claim is false. For , take when is infinite and when is finite. A finite rule base mentions only a finite subset of the variables. The Boolean valuations for and agree on all those variables but have different required values. No such rule base represents this . Thus the construction answers the intended finite-set question and identifies the missing hypothesis in the unrestricted statement.
Read the lower-left entry of each cell as player 1's payoff and the upper-right entry as player 2's payoff, as indicated by the source diagram. Against , player 1 strictly prefers because ; against , player 1 strictly prefers because . Against , player 2 strictly prefers because ; against , player 2 strictly prefers because . Thus the pure strategy Nash equilibria are
For a fully mixed strategy Nash equilibrium, write and . Player 1's expected payoffs from the two pure strategies are
Equality, required when both pure strategies have positive probability, gives
Player 2's corresponding expected payoffs are
so equality gives
Both probabilities lie strictly between zero and one. Hence the unique fully mixed strategy Nash equilibrium is
with complementary probabilities on and . Its expected payoffs are
These are all three Nash equilibria. There are no equilibria with just one player genuinely mixing: against each opposing pure strategy, the other player's best response is unique, so that player cannot mix. When both players mix, the two linear indifference equations have the unique solution just obtained. This is support enumeration for a bimatrix game with all possible supports checked.
The definition in this part uses a single Boolean valuation, so the relevant Nash equilibria are pure strategy equilibria of a Boolean game. Use its standard convention that the players' control sets form a set partition of the variables.
Membership follows from an existential choice of a strategy profile and a universal check of all unilateral deviations. Assign payoff one to satisfying a player's goal and zero otherwise. A strategy profile is a Nash equilibrium precisely when, for every player and every alternative Boolean valuation of that player's variables,
is true: either the goal is already satisfied or no deviation can satisfy it. Thus the requested property is
The strings encoding , and have polynomial length, and evaluating the bracketed propositional formulas takes polynomial time. Invalid encodings of a player index can simply be ignored by the test. This is the existential second level of the polynomial hierarchy, .
For hardness, reduce the canonical complete problem of deciding a two-block quantified Boolean formula
Make a two-player Boolean game: player 1 controls and has goal ; player 2 controls and has goal . Set the query formula to . The construction has size linear in the input formula.
If an assignment satisfies , combine it with any assignment . Player 1 already satisfies its goal, and player 2 cannot satisfy by any unilateral deviation. Thus is a Nash equilibrium satisfying the query.
Conversely, let be a Nash equilibrium satisfying . Player 2 currently has payoff zero. If some alternative made false, that deviation would satisfy player 2's goal and increase its payoff to one. The Nash equilibrium condition therefore implies . This proves the required equivalence and the polynomial-time reduction.
Together, membership and hardness prove -completeness of existential equilibrium checking in a Boolean game. The reduction works with only two players and one constant goal.
Measure all payoffs in millions of dollars, in the order (Ann, Bob). Since both players maximize expected money, those numbers are already their expected utility scale.
In the extensive-form game, Ann moves first. Staying out terminates at . Entering leads to Bob's observed decision between fighting, with terminal payoffs , and acquiescing, with terminal payoffs . Each decision node is its own information set, so this is a perfect-information game.
The corresponding normal-form game gives Ann the pure strategies (stay out) and (enter), and Bob the complete contingent pure strategies (fight if entry occurs) and (acquiesce if entry occurs). The payoff matrix is
The pure strategy Nash equilibria are and . Against , Ann prefers ; against , Ann prefers . When Ann stays out, Bob's contingent response does not affect his payoff, so is a best response there.
There is exactly one subgame perfect equilibrium, . In the subgame following entry, Bob strictly prefers to , so backward induction selects acquiescence; Ann then strictly prefers entering for to staying out for . The threat supporting is not optimal in that one-shot subgame.
For infinite repetition, the paper specifies no discount factor. First take the long-run average payoff convention, with all past actions observed. The feasible payoff set is the convex hull
Ann can guarantee in every stage by staying out; Bob can guarantee at least in every stage by acquiescing whenever entry occurs. These guarantees are also their minmax payoffs: fighting holds Ann's best possible stage payoff to , and entering holds Bob's best possible stage payoff to .
Therefore the sustainable Nash equilibrium average payoffs are exactly the feasible, weakly individually rational payoffs in a repeated game:
This is the closed triangle with vertices .
Here is a direct sufficiency argument for this particular game. Choose a publicly known sequence of stage outcomes whose frequencies give the target point. Before any observed deviation, follow that sequence. After an Ann deviation, Bob fights forever, so Ann can thereafter obtain at most per stage. After a Bob deviation, Ann enters forever, so Bob can thereafter obtain at most per stage. A finite prefix has no effect on long-run average payoff, so no unilateral deviation improves a target with . Rational frequencies can be implemented periodically; arbitrary real frequencies can be implemented by a deterministic sequence with convergent frequencies. Thus even the weak boundary is covered here. In particular, staying out forever and entry followed by acquiescence forever are sustainable; fighting forever is not.
For discounted payoffs , the folk theorem for repeated games instead gives the usual patience qualification: every feasible point with can be sustained for all sufficiently large . It does not classify the whole region for an unspecified fixed . The two one-shot Nash equilibrium outcomes remain sustainable for every .[ref]
Finally consider the particular history-dependent pair in the paper. Initially Bob has never acquiesced, so Ann stays out. That preserves the same condition forever, giving payoffs . The pair is a Nash equilibrium. Holding Bob's strategy fixed, Ann cannot induce an acquiescence: he fights whenever she enters, and his rule never changes unless he has previously acquiesced. Every entry would give her instead of , so no unilateral deviation helps. Holding Ann's strategy fixed, Bob never reaches a decision node because she stays out; changing his strategy alone cannot create a history in which he actually acquiesces. Hence he also cannot improve.
This direct argument works for both discounted and long-run average payoffs. The outcome gives Ann exactly her minmax payoff and Bob more than his, so it is compatible with the folk theorem for repeated games. A version requiring strict gains above both minmax payoffs is a sufficient condition, and cannot be used to rule out this boundary example.
This is an absent-minded decision problem: the two decision nodes belong to the same information set. A behavioural strategy must therefore use the same probability at both visits. Put and ; fresh randomization occurs independently at each visit.
The terminal probabilities are for stopping immediately, for going down once and then right, and for going down twice. Thus the expected payoff is
This expression gives the unique global maximum on :
Figure 1.
The optimal behavioural strategy improves on either fixed plan
. Details.
The independence of repeated randomizations is essential. A mixed strategy choosing once between the two deterministic plans “always ” and “always ” gives at most , since their payoffs are and . It cannot arrange “ first, then ” as a deterministic plan respecting this information set. The failure of perfect recall is exactly why mixed strategies and behavioural strategies need not have the same attainable outcome distributions here.
It suffices to take four players. Both two-player coalitions and win, because two is a prime number, while the empty coalition and the four-player coalition lose.
Suppose real weights and quota represented this game. The empty coalition loses, so . The two winning coalitions require
Adding gives
so the four-player coalition must win, a contradiction. Hence prime-cardinality games cannot in general be represented as weighted voting games. The same four-player obstruction appears inside every such game with at least four players.
This proof permits negative individual weights, as the printed definition does. An argument based solely on monotonicity would require a nonnegative-weight assumption and would not suffice for that definition.
Let . If the two disjoint winning coalitions exchange players, the aggregate weight is conserved:
If both resulting coalitions lost, each weight would be strictly below , making their sum strictly below . This is impossible. Thus every weighted voting game has swap robustness for disjoint winning coalitions, even when the weights or quota are negative.
The converse is false. The four-player prime-cardinality game from part (a) has swap robustness for disjoint winning coalitions: swapping one player each way preserves each coalition's cardinality, so in fact both winning coalitions remain winning. Part (a) proves it is not a weighted voting game.
Even imposing monotonicity would not repair the converse under the printed disjointness restriction. As a stronger counterexample, use five players and declare a coalition winning exactly when it contains player and contains either both or both . This is a simple cooperative game, and all its winning coalitions contain player , so no two are disjoint; the stated swap condition holds vacuously.
Nevertheless and win, while and lose. Both pairs contain every player the same total number of times. A weighted representation would therefore give
a contradiction. This is a trade obstruction to weighted voting and pinpoints how weak the disjoint-only swap requirement is.
Use the usual empty-coalition normalization for a transferable utility game. Write , so the proposed payoff is the marginal contribution
The vector is the marginal contribution vector for the natural player order.
First, convex cooperative games have increasing marginal contributions. If and , apply the defining supermodular set function inequality to and :
Rearranging gives
The vector is efficient by a telescoping sum:
Now fix any coalition . For each , its earlier members are . Increasing marginal contributions therefore give
Sum over the members of in increasing order. The right-hand side is another telescoping sum, now along the growing coalition :
Efficiency and these inequalities for every coalition are exactly the defining requirements of the core of a cooperative game. Thus belongs to the core. The same proof works for any player ordering, not only the natural order.
The normalization is essential to the literal statement: the printed part does not explicitly state it. Without , take the constant characteristic function of a coalitional game . It satisfies the displayed convex cooperative game inequality with equality, but every proposed is zero, so efficiency fails when is nonempty. Under the standard normalized definition, the proof above establishes the intended result.
Solutions to all four questions of the 3 June 2022 paper, including every marked part. Both examination codes identify this same shared undergraduate and MSc paper. Source release: released examination archive. The cover date controls despite the archive member's misleading 2021 directory.
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.
Write and for the two deterministic outcomes. Under the expected utility hypothesis, indifference between them implies . The expected utility of the fair lottery is consequently
It 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.
First evaluate the inner lottery: . By reduction of compound lotteries, the outer expected utility is
Since 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.
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 values
The 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.
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.
The succinct input is the players' variable-control sets, their goal propositional formulas, and a complete candidate Boolean valuation; an exponentially expanded payoff matrix is not part of the input. This representation is essential to candidate equilibrium checking in a Boolean game.
For membership in co-NP, consider the complement: the candidate is not a Nash equilibrium. A complexity certificate consists of a player and an alternative Boolean valuation of that player's controlled Boolean variables. Evaluate the current goal and the goal after this unilateral deviation, keeping every other player's variables fixed. A profitable unilateral deviation exists precisely when the current goal is false and the new goal is true. The certificate has at most the number of input variables plus the player index, and both propositional formula evaluations take polynomial time. Thus the complement belongs to NP, and the original decision problem belongs to co-NP.
For hardness, start with a propositional formula and introduce a fresh Boolean variable . Construct a one-player Boolean game in which that player controls and has goal
Choose the candidate pure strategy assigning every variable false. Its payoff is zero because is false, regardless of . If has a satisfying assignment, changing to that assignment and to true is a profitable unilateral deviation. If is an unsatisfiable Boolean formula, no unilateral deviation can satisfy the goal. Therefore
The construction increases the formula length by only a constant and writes a candidate of linear length, so it is a polynomial-time many-one reduction. Unsatisfiability is co-NP-complete; combining hardness and membership proves that candidate Nash equilibrium checking for Boolean games is co-NP-complete. If a convention requires at least two players, add a player controlling a fresh unused variable and having the always-true goal; this changes neither direction of the proof.
There is no perfect recall. Player 1's later information set joins histories following both of her initial actions, so she has forgotten whether she chose or . It also hides player 2's intervening action, but failure to observe another player's action is imperfect information, whereas forgetting one's own earlier action is the particular violation of perfect recall. Player 2's two nodes form a single information set because player 2 does not observe the initial choice.
For a behavioural strategy, let be player 1's initial probability of and her later probability of . These are separate information sets, so and need not be equal; their random draws are independent. Name player 2's unlabeled branches left and right, and let be the probability of taking the left branch. The only unit-payoff paths are left–left–left and right–right–right. Consequently
Because this is a zero-sum game, the natural meaning of the claimed best behavioural strategy is its maximum guaranteed expected payoff. Player 2 can choose either branch, so the guarantee at is
For nonnegative numbers, their minimum is at most their geometric mean. Also and , hence
Taking makes both possible branch-conditioned success probabilities , so this upper bound is attained against every . Thus the optimal guaranteed behavioural strategy success probability is .
A mixed strategy can instead select the complete plan with probability and the complete plan with probability . The two choices within a sampled plan are correlated. If player 2 chooses left, exactly the sampled plan succeeds; if player 2 chooses right, exactly succeeds. Therefore the success probability is
against every opposing mixed strategy. It is optimal among mixed strategies too: player 2's uniform mixture gives success probability to each of and zero to , so no mixture of the four plans can exceed against that opponent. This establishes mixed and behavioural security levels without perfect recall directly.
Figure 1.
Independent behavioural choices guarantee at most , whereas a mixed plan correlates the choices and guarantees
. Details.
The guarantee qualification matters: if player 2's branch were known to be left, the deterministic plan would succeed with probability one. The number is not an upper bound against every fixed opposing choice separately.
Against Tit for tat, let be an arbitrary deviator's action at round , and set to encode the opponent's initial cooperation. The opponent then plays . Define and . The four possible transitions give
Thus every stage payoff is at most . The telescoping sum yields the uniform payoff bound against Tit for tat:
After division by , no long-run average payoff can exceed three. The bound applies to every action sequence, so in particular it covers every finite-state machine representing a unilateral deviation. Mutual Tit for tat produces in every round and gives each player three. Neither player can improve, proving is a Nash equilibrium.
Another pair is . Here grim trigger initially cooperates and continues cooperating until the opponent first defects, after which it defects forever. Both strategies are two-state finite-state machines: Tit for tat records the opponent's previous action, while grim trigger records whether defection has ever occurred. Their prescribed play again consists entirely of cooperation and gives .
The player using grim trigger faces Tit for tat, so every unilateral deviation is bounded by the same telescoping sum and cannot improve on three. The player using Tit for tat faces grim trigger. If that player never defects, the payoff remains three. If the first defection occurs at a finite round , it gives a one-time payoff six; thereafter the opponent always defects, against which each subsequent payoff is at most one. Any finite initial prefix has zero contribution to the long-run average payoff, so such a unilateral deviation has limiting upper average at most one. It cannot improve on three either. Both players are therefore best responses, proving the second claimed Nash equilibrium.
For deterministic finite-state machines, the joint state path is eventually periodic, so the displayed averages have a limit. The first bound also controls the limiting upper average for arbitrary action sequences, making the no-improvement argument stronger than an enumeration of finite-state deviations. Notice that equality in the bound permits alternating exploitation to average three: equilibrium requires absence of a strict improvement, not uniqueness of a best response.
Write . The core of a cooperative game is
Take any and , and form the convex combination . Its total payoff is . For every coalition ,
Hence remains in the core. The core is a convex set, even when the transferable utility game is not a convex cooperative game. An empty core is a convex set vacuously; the argument does not claim nonemptiness. Geometrically, the same conclusion follows because the constraints intersect an affine hyperplane with closed half-spaces.
Assume the standard empty-coalition normalization . A convex cooperative game has increasing marginal contributions: whenever and ,
This follows from the supermodular inequality applied to and . Fix a permutation of all players, let be the players preceding , and form its marginal contribution vector
Summing along the full permutation is a telescoping sum, so . For an arbitrary coalition , list its members in their induced order , and put . Since , increasing marginal contributions give
Thus every marginal contribution vector belongs to the core. The vector of Shapley values is exactly their uniform average over the permutations, hence a convex combination. By the preceding part, that average is in the core. This proves that the Shapley value allocation belongs to the core of a convex cooperative game, including every coalition constraint. It is the result Shapley value belongs to the core of a convex game.
Yes. Use the simple cooperative game in which a coalition wins exactly when it contains at least two players. In every permutation, precisely the second arrival changes a losing coalition into a winning one. Each player is second in two of the six permutations, so each Shapley value is . This constructs the required vector while verifying that singleton coalitions lose and the grand coalition wins.
No. In a simple cooperative game, a player's marginal contribution along any permutation is zero or one. With three players there are six equally likely permutations, so every Shapley value is an integer multiple of , by the Shapley value denominator in a simple game. But and are not integers. The vector sums to one, but fails this necessary denominator condition.
Yes. Give players weights , respectively, and let the quota be three. This weighted voting game is a simple cooperative game whose minimal winning coalitions are and . In orders , player 3 supplies the winning marginal contribution. In order player 1 does, and in order player 2 does. Averaging the six marginal contribution vectors gives exactly as the vector of Shapley values.
No. The denominator test from part ii is satisfied here, so a stronger obstruction is needed. Put and . In a three-player simple cooperative game, the Shapley value formula gives, for distinct ,
Subtract the corresponding expression for :
Each coalition value is zero or one, so this difference must be an integer multiple of . This is the obstruction from pairwise Shapley differences in a three-player simple game. The proposed first two coordinates differ by , which is not an integer multiple of . Therefore the vector cannot occur, even though each coordinate separately passes the denominator test.
Solutions to the single paper shared by the two printed routes, dated 8 June 2021. Oxford examination source release. The probabilistic programming calculations below use only information supplied in the paper. Question 2 contains two notation or naming issues, identified at the affected parts; Question 3 requires an explicit choice of prior distribution.
Assume , and work on the support . In rejection sampling, choose a normalized proposal probability mass function and a known finite constant satisfying everywhere. Draw independent random variables and , accepting when . The joint probability of proposing and accepting is , so the overall acceptance probability is and the accepted value has probability mass function . Fresh trials therefore produce independent and identically distributed random variables with the desired probability distribution. For a fixed positive number of accepted values, the sample average is an unbiased estimator of the expectation when that expectation is finite. Its variance is if the second moment is finite. Finding a valid envelope can be difficult, and a small acceptance probability makes the method expensive.
For the Metropolis–Hastings algorithm, choose a proposal transition matrix and, at the current state , propose . Accept with the Metropolis–Hastings acceptance probability
A proposal outside is rejected; an impossible proposal need not be assigned a ratio. Otherwise remain at . This constructs a Markov chain satisfying detailed balance with , without computing or a global envelope. Estimate the expectation by averaging over iterations, including repeated states after rejections. Keeping only accepted jumps generally changes the stationary distribution of the recorded process.
The Metropolis–Hastings algorithm produces dependent samples, so the variance of its average includes autocovariances; starting outside stationarity can also cause finite-run bias. With Markov chain irreducibility, suitable recurrence and an integrable , the countable-state Markov chain ergodic theorem gives consistency. Aperiodicity is additionally needed for the usual convergence of one-time probability distributions. In contrast, accepted rejection sampling values need no initial transient. Neither method is universally faster: envelope rejection competes with the proposal quality and mixing time of the Markov chain. Nonnegativity of alone does not guarantee a finite expectation or variance.
Here , with fresh proposal randomness independent of the past. For , the Metropolis–Hastings acceptance probability is
Thus is independent of , and are independent and identically distributed random variables with probability distribution , even if was chosen arbitrarily in . The method becomes ordinary Monte Carlo method sampling from . The average of is an unbiased estimator, with the variance stated in part (a). Including an arbitrary initial state would spoil this finite-sample property. This is the independent stationary proposal lemma.
Neither Markov chain irreducibility nor fast convergence follows from detailed balance. On two states, the identity transition matrix satisfies detailed balance for the uniform probability distribution, but neither state can reach the other.
Even after imposing Markov chain irreducibility and aperiodicity, consider
It satisfies detailed balance for . Its nontrivial eigenvalue is , and, from state zero, its total variation distance from after steps is . This approaches zero arbitrarily slowly as decreases. Detailed balance without rapid convergence separates correctness of a stationary distribution from reachability and speed.
Put and . For , the off-diagonal probability flux of the proposed rule is
If , define both acceptance probabilities to be zero; both fluxes are zero. The diagonal detailed balance equations hold automatically, including the probability of rejected proposals. Summing the detailed balance equations over gives stationarity:
The alternative rule therefore preserves . The unknown normalizing constant cancels after replacing by . This Barker acceptance probability is no larger than the Metropolis–Hastings acceptance probability for the same proposed move: if , then . Preservation of still requires separate Markov chain irreducibility and convergence checks before it guarantees useful sampling.
Use the Poisson distribution with probability mass function on . A symmetric nearest-neighbour proposal with a reflecting boundary is
All other entries vanish. In particular, the boundary proposal does not force a move to one: retaining the probability makes .
The adjacent ratios of the Poisson distribution are and . The Metropolis–Hastings acceptance probability consequently gives
where the symbol denotes the upward transition probability. Thus the complete transition matrix is
with no downward entry at zero and all other entries zero. In matrix form,
Every row is nonnegative and sums to one. An executable Python step of this Poisson Metropolis chain is:
def poisson_step(n, lam, rng):
    if lam <= 0 or n < 0 or int(n) != n:
        raise ValueError("require lam > 0 and an integer n >= 0")
    y = n + 1 if rng.random() < 0.5 else max(0, n - 1)
    ratio = lam / (n + 1) if y > n else n / lam if y < n else 1.0
    return y if rng.random() < min(1.0, ratio) else n
Supply a pseudorandom number generator such as random.Random(2021) and retain each returned state, including repeats. No normalizing constant or evaluation of a factorial is needed by the algorithm.
For each adjacent pair, the detailed balance equations follows directly:
For nonadjacent distinct states both fluxes vanish, and diagonal fluxes agree trivially. Since , this is a genuine stationary distribution, rather than merely an invariant measure of infinite mass.
Every upward and downward transition probability between neighbouring states is positive for . Any two states can therefore be joined by a finite path of positive probability: the Markov chain is irreducible. Moreover,
State zero has period one; Markov chain irreducibility makes every state aperiodic. Finally, the standard countable-state recurrence theorem states that an irreducible Markov chain admitting a stationary distribution of total mass one is positive recurrent, with that stationary distribution unique. The countable-state Markov chain convergence theorem then states that Markov chain irreducibility, positive recurrence and aperiodicity imply for all states . The hypotheses just verified hold on the infinite state space , not merely on a numerical truncation.[ref]
Consequently, the unique stationary distribution and the limiting distribution are both , from every initial state. The countable-state Markov chain ergodic theorem also gives almost surely whenever .[ref]
Variational inference replaces exact Bayesian inference by an optimization problem over a tractable family . A guide program samples from this approximating family. Optimizing an evidence lower bound is equivalent to minimizing . Its appeal is that a fitted approximation can be cheap to sample and may scale well when an exact posterior distribution is inaccessible. A restricted family, such as mean-field variational inference, can miss dependence or entire modes; a local optimum can add further error. More optimization cannot remove approximation error caused by an inadequate family.
Monte Carlo method inference instead estimates posterior expectations using simulated values or weighted values. Examples include rejection sampling, importance sampling and Markov chain Monte Carlo. Under their respective support and convergence assumptions, increasing computation can yield consistent estimates without choosing a finite-dimensional posterior family. Their uncertainty includes simulation error; an inefficient proposal or slow mixing time can make that error large. Markov chain Monte Carlo additionally requires convergence and dependence diagnostics.
The central trade-off is optimization within an approximate family versus simulation under a target probability distribution. It is not an absolute distinction between deterministic and random computation: variational inference often uses Monte Carlo method estimates of its gradient, while Monte Carlo method inference may use fitted proposals. Neither method automatically guarantees accurate uncertainty estimates or superiority at a fixed computational budget.
Let , take supported where , and assume the following expectations exist. By the definition of Kullback-Leibler divergence and Bayes' theorem,
Therefore the evidence lower bound is
Nonnegativity of Kullback-Leibler divergence proves . The marginal likelihood is constant with respect to the variational parameter , so maximizing minimizes the stated Kullback-Leibler divergence.
The practical advantage is that evaluating logarithms of joint probabilities and requires no evaluation of the usually intractable marginal likelihood. One can estimate and its gradient with Monte Carlo method. Equality with the log marginal likelihood occurs only when almost everywhere. Merely maximizing the evidence lower bound over a restricted family neither computes the exact posterior distribution nor proves that the maximum attains this equality.
The discrete base factors in the displayed construction inherit their variational parameters. Accordingly write , not a parameter-independent , for the joint base probability mass function or probability density function. The continuous noise factors can be parameter independent while the discrete factors are dependent. Calling the entire base law parameterless while retaining its nonzero score function would be inconsistent.
Let push the base law forward to , and define
Use a fixed base measure , with counting measure for discrete coordinates and Lebesgue measure for continuous coordinates. Assume locally parameter-independent support, differentiability and an integrable domination permitting differentiation under the integral sign. A valid reparameterization gradient gives
Apply the product rule before simplifying:
This is the required combined score and pathwise gradient estimator. A sample from and the integrand on the last line give an unbiased stochastic gradient under the stated regularity conditions. Its first term is a score-function gradient estimator contribution; the remaining terms differentiate the sampled objective along the continuous transformation. The same separation appears in the general stochastic computation graph construction.[ref]
All derivatives inside the expectation hold fixed. They still include both explicit parameter dependence and dependence through . For a continuous coordinate ,
The model joint density is fixed as changes, but its composition with need not be constant. Discrete coordinates are not differentiated as real-valued paths; their changing probabilities enter through the score function. Moving supports or parameter-dependent branch boundaries require additional care and are not justified merely by formally interchanging a derivative and an integral.
The two limiting-case names in the printed bullets are reversed. Fully reparameterized continuous choices give a reparameterization gradient; non-reparameterized discrete choices give a score-function gradient estimator. Here are both reductions, including the extra term that vanishes only after taking an expectation.
When all choices are reparameterized with parameter-independent base noise, and . The expression in part (c) becomes
Differentiating along the sampled transformation is precisely the pathwise gradient, also called the reparameterization gradient. There is no score function of the parameter-independent base law.
When all choices are discrete and left untransformed, and . Set and . Since has no variational parameter, the integrand in part (c) is
Normalization gives the zero-mean score function identity
Thus
The first expression is the usual score-function gradient estimator; the second has a constant score baseline of one. The two random integrands are generally different even though their expectations agree. A suitable constant score baseline can reduce variance, but one is not universally the optimal baseline.[ref]
For a concrete check, take with and , and a fixed target . Direct integration gives
Using , , the combined integrand has components , and . Their expectations are respectively , and , matching direct differentiation. Dropping the discrete score function term would incorrectly give zero for the first component. This calculation checks the combination without accepting the printed reversal.
Treat each observed arrival label as a constraint on an unobserved walking duration. Departures are treated as fixed design information. Writing for the minutes available until work starts, the derived late-label thresholds have frequencies ; the early-label thresholds have frequencies . These are censoring thresholds, not measured journey times. A late label means , and an early label means ; equality has probability zero under the continuous model.
The paper specifies no prior distribution. One explicit proper model is
with independent priors; all times are in minutes. These ranges are a transparent modelling choice, not information deduced from the observations. In particular, this is a prior on the standard deviation , not a uniform prior on the variance . The normal distribution permits negative durations; it is the mathematical approximation requested here, rather than a claim that such durations are physically possible. A truncated model would be a different model.
The following Python implements hard conditioning by rejection sampling. None marks a rejected trace; an accepted Boolean answers whether all five future arrivals are late. The same parameters are shared across past and future days.
import math
import random

LATE = {20: 1, 21: 3, 25: 3, 27: 1, 32: 2}
EARLY = {29: 1, 34: 1, 36: 3, 37: 1, 38: 1, 39: 1, 43: 1, 44: 1}
RECORDS = [(c, True) for c, n in LATE.items() for _ in range(n)]
RECORDS += [(c, False) for c, n in EARLY.items() for _ in range(n)]

def journey_trace(rng):
    mu = rng.uniform(0.0, 60.0)
    sigma = rng.uniform(1.0, 20.0)
    # Twenty latent past durations and five future durations.
    past = [rng.gauss(mu, sigma) for _ in RECORDS]
    future = [rng.gauss(mu, sigma) for _ in range(5)]
    if not all(t > c if late else t < c
               for t, (c, late) in zip(past, RECORDS)):
        return None
    return all(t > 30.0 for t in future)

def accepted_average(trace, n, rng):
    if n <= 0:
        raise ValueError("n must be positive")
    successes = accepted = 0
    while accepted < n:
        result = trace(rng)
        if result is not None:
            accepted += 1
            successes += int(result)
    return successes / n
For example, accepted_average(journey_trace, n, random.Random(2021)) estimates the desired conditional probability from accepted traces. Accepting False is essential: treating a false answer as a rejected trace would condition on the desired conclusion. The model deliberately emphasizes clear semantics; rejection can be inefficient because all twenty past-label constraints must hold together.
An idealized underlying probability space is
with the product Borel sigma-algebra. Its 27 independent random coordinates are , , twenty past standard-normal noises, and five future standard-normal noises. Define . Sampling an unknown variance does not mean drawing a new variance on each day; a single draw of applies to all durations in a trace.
Let be the event that the first twenty durations satisfy their corresponding observed inequalities. The observations are the twenty late/early labels, conditional on the fixed departure thresholds. They are not exact values of the latent . The posterior probability measure on traces is
Here : at every interior parameter pair each strict normal-tail probability lies in , so their finite product has positive prior integral.
The returned outcome is
Thus the underlying sample space has dimension 27, the successful output space is , and the observations define the conditioning event . The desired output probability distribution is the pushforward measure of under . Rejection is an implementation device, not a third scientific answer: None is discarded before forming the conditional output law.
Write for the standard normal distribution function. Integrating out the twenty independent past durations gives the threshold-censored normal likelihood
The 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 are
These 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_h
accepted_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.
For any chosen proper prior density on with positive evidence, Bayes' theorem gives
The 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.
Figure 1.
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.
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 return
This 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, ess
The 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.
Articles were limited to the first 100 out of 127 total.

Articles by others on the same topic (0)

There are currently no matching articles.