The Theory of Dynamic Programming: The Index Rule for Bellman's Stochastic Gold-Mining ProblemResearch Paper
Motivation
Richard Bellman's survey The theory of dynamic programming (Bull. Amer. Math. Soc. 60 (1954), 503–515, DOI 10.1090/s0002-9904-1954-09848-8) introduced dynamic programming to a general mathematical audience. It states the principle of optimality (§2, p. 504): "An optimal policy has the property that whatever the initial state and initial decisions are, the remaining decisions must constitute an optimal policy with regard to the state resulting from the first decisions", and derives from it the functional equations of finite and infinite stochastic decision processes, (4.2) and (5.1) (p. 506).
The survey illustrates the method on a small number of worked examples. The second of them, §8 "Stochastic gold mining" (pp. 508–509), is the one with a sharp answer: a two-armed sequential allocation problem with an absorbing failure state, whose optimal policy is a simple index rule. It is an early instance of the allocation-index phenomenon later made general by Gittins and Jones (1974) and Gittins (1979), and the paper itself notes (p. 509) that the rule "is not valid generally in more complicated decision processes", citing a counterexample of Karlin and Shapiro. The full treatment is in Bellman's RAND report R-245 and his 1957 book Dynamic Programming.
Setting
Two gold mines, Anaconda () and Bonanza (), hold amounts and of gold. A single machine can be used in either mine. A use in Anaconda succeeds with probability : it then mines a fraction of the gold currently in Anaconda and the machine stays undamaged. With probability it mines nothing and the machine is destroyed. Bonanza behaves the same way with probability and fraction . While the machine works, the operator chooses the next mine; the aim is to maximize the expected amount mined before the machine is destroyed.
The only information the operator ever receives is that the machine still works. A policy is therefore a choice sequence : the mine for use number , applied if uses succeeded. With , the numbers of - and -uses among the first , use collects if and if , and does so with probability (, ). The expected return is
and Bellman's (8.1) defines the optimal return
In Lean these are expectedReturn p q r s σ x y and optimalReturn p q r s x y in the namespace BellmanTheoryDP.GoldMining.
Formalization targets
Milestone: the functional equation (8.2), p. 508
Goal: the decision rule (8.3), p. 509, corrected
Write and for the two branches of (8.2). For and :
The paper prints the rule with and in the denominators:
a. For , choose A, b. For , choose B, c. For , choose either.
and glosses it as "the locus of points where immediate expected gain over immediate expected loss is the same for both choices". The immediate expected loss is the probability of destroying the machine, (resp. ), not . As printed the rule is false: with , , , , , the printed indices are , but . The mission's goal is the corrected rule, the one the paper describes in words.
Companion: the index policy is optimal, p. 509
"Using this prescription, may be computed recurrently": the choice sequence generated by applying the corrected rule to the current amounts at every use satisfies .
Significance
The decision rule reduces an optimization over infinite sequences to comparing two explicit numbers, one per mine, each depending only on that mine's own data. This is the defining property of an index policy, and gold mining is one of the earliest problems where it was observed. The functional equation (8.2) is the concrete form, for this process, of the infinite-horizon equation (5.1) that the paper states formally.
Formalizing the example yields a complete machine-checked instance of the principle of optimality for an infinite-horizon stochastic process whose state space (the amounts left in the two mines) is infinite, where the supremum over policies is not attained trivially and the finite-horizon recursion does not apply directly. It also records, with a checked statement, the correction of the misprint in (8.3). No machine-checked proof of (8.2) or (8.3) is known to exist.
Difficulty
The equation (8.2) looks immediate, and the paper calls it "easily seen". The informal argument treats as the value of an optimal policy, but is a supremum over infinite sequences that need not be attained a priori, and the return of a sequence is an infinite series. The finite-horizon recursion (4.2) does not apply as it stands, because the process has no last stage and its state space, the amounts left in the two mines, is infinite.
The rule (8.3) compares the two optimal continuations and , which are themselves unknown. A comparison of the one-step gains alone does not decide it, as the misprinted rule shows. Parts a and b are strict preferences, so it is not enough to show that one choice is at least as good as the other.
Formalization scope
- Representation. The mines are a two-element inductive type
Mine; a policy is a functionℕ → Mine(ChoiceSeq). All quantities are real numbers. Randomized policies are mixtures of choice sequences and give no larger return, so they are not modelled. No restriction to stationary or Markov policies is made: is the supremum over all sequences. - Parameter ranges. The paper does not state them. The theorems assume and (zero amounts allowed). keeps the indices , well defined.
- Series and supremum. is a real
tsumand a realiSup. For the parameter ranges above the terms are nonnegative, the partial sums are bounded by , and the family is bounded above, so neither Lean default value (0 for a divergent series or an unbounded supremum) arises; this is stated as the auxiliary theoremexpectedReturn_le_add. - Survival indexing. The gold of use is counted only if use itself succeeds, so the survival product runs over .
- The misprint. The goal and the index policy use , in place of the printed , . The printed rule appears only as the quotation above.
- No trivializing encoding. is defined as the supremum of expected returns over all choice sequences, per (8.1); it is not defined as a solution of (8.2), as the value of the index policy, or as a limit of value iteration, any of which would make the milestone or the goal true by definition.
- Auxiliary theorems (not from the paper). The bound with summability, the one-step unrolling when (and symmetrically), and the single-mine values , are included as footholds. They are not milestones.
- Related platform content.
AllocationIndices.two_discount_index_policy_optimal(Gittins et al., Theorem 3.4) concerns Markov bandits whose rewards are discounted by at global time ; gold mining multiplies by the success probability of each use of the mine used, so it is a different model and is not reused.BertsekasDP.dp_algorithm_optimalityis finite-horizon and does not give (8.2).
Contributions welcome: proofs of the auxiliary theorems, of (8.2), of the decision rule, and of the optimality of the index policy.
Selected references
- R. Bellman, The theory of dynamic programming, Bull. Amer. Math. Soc. 60 (1954), no. 6, 503–515. https://doi.org/10.1090/s0002-9904-1954-09848-8
- R. Bellman, Dynamic Programming, Princeton University Press, 1957.
- J. C. Gittins, Bandit processes and dynamic allocation indices, J. Roy. Statist. Soc. Ser. B 41 (1979), 148–177. https://doi.org/10.1111/j.2517-6161.1979.tb01068.x
- J. C. Gittins, K. D. Glazebrook, R. Weber, Multi-armed Bandit Allocation Indices, 2nd ed., Wiley, 2011. https://doi.org/10.1002/9780470980033