Introduction

Optimization studies how an agent who can rank the available actions chooses a best one. Dynamic optimization extends this choice over time: today’s action affects tomorrow’s options, and the objective ranks entire paths.

The origin of optimization problems

Rationality

What determines a person’s behaviour? The factors split into the external (coercion, example, the pull of the crowd) and the internal (instinct, habit, experience, character, belief, knowledge, taste). Economics uses the internal factor rationality to formulate optimization problems. We adopt a deliberately narrow working definition: rationality is the capacity for logical inference and precise computation; it is a mode of thought that prizes rigorous deduction over intuition, hearsay, or the worship of forces one does not understand. In this sense rationality is, as von Mises argued at length in Human Action (Mises 1949), the defining feature of deliberate human conduct, and one of the twin pillars of modern science (the other being the discipline of experiment).

Complete versus bounded rationality. An agent has complete rationality if, facing a situation, they can survey every feasible course of action and select the most advantageous one and carry it out. An agent has bounded rationality if they want to choose the most advantageous action but their powers of inference and computation fall short of identifying it. Real agents are boundedly rational; the theory of optimization idealizes them as completely rational and then studies how far the idealization can be pushed.

  • The “advantage” (the gain, the good) need not be selfish. Under a given moral framework, every action has a well-defined worth, and that worth may incorporate altruism, concern for others’ welfare, without ceasing to be a sharp, quantifiable standard. A purely self-regarding agent is the special case in which “advantage” means private benefit alone. So long as the worth of each action is unambiguous, the rational-agent method applies, even to the analysis of moral behaviour. In physics and engineering the objective carries no ethical content: physical laws can be expressed as extremum principles.

  • The word “most” presupposes an order on the feasible actions under which a top element can be defined. The rest of this section specifies that order.

The five steps of a rational agent

Faced with a matter to settle, a completely rational agent proceeds through five steps:

  1. Frame the matter: state what is to be decided.
  2. Enumerate all courses of action available to the agent; collect them into a set, the choice set \(X\).
  3. Order \(X\): install on it a relation \(\preceq\), read “is no better than” (the course writes this as \(\le\) and reads it “is inferior to”).
  4. Optimize: find a \(\preceq\)-greatest element of \(X\).
  5. Execute it.

Modelling comprises steps 1–3. These notes focus on step 4: analytic solutions and, where no closed form exists, existence, uniqueness, monotonicity, and asymptotic behaviour.

An order on the choice set

Definition 1 (Preorder (the course’s “order”)) A binary relation \(\preceq\) on a set \(X\) is a preorder (the course simply calls it an order) if it is

  • reflexive: \(x\preceq x\) for every \(x\in X\);
  • transitive: if \(x_1\preceq x_2\) and \(x_2\preceq x_3\) then \(x_1\preceq x_3\).

We read \(x_1\preceq x_2\) as “\(x_1\) is no better than \(x_2\)” (equivalently \(x_2\succeq x_1\), “\(x_2\) is at least as good as \(x_1\)”). If \(x\preceq y\) and \(y\preceq x\) we say \(x\) and \(y\) are indifferent, written \(x\sim y\). If \(x\preceq y\) but not \(y\preceq x\) we write \(x\prec y\) and say \(x\) is strictly inferior to \(y\).

We write the abstract order as \(\preceq\) and the choice set as \(X\); the course uses \(\le\) and \(\aleph\). We reserve \(\le\) for numerical comparisons (see notation).

Definition 2 (Optimal element) An element \(x^\ast\in X\) is optimal for \(\preceq\) if no element strictly dominates it: there is no \(x\in X\) with \(x^\ast\prec x\). Equivalently, \(x^\ast\) is a \(\preceq\)-maximal element of \(X\).

Reflexivity and transitivity do not guarantee that every pair of elements can be compared. A preorder is complete when every pair can be compared. Antisymmetry is a separate property: \(x\preceq y\) and \(y\preceq x\) imply \(x=y\). A preorder with this property is a partial order.

The Pareto order and incomparability

A preorder under which some pairs are incomparable, neither \(x\preceq y\) nor \(y\preceq x\), is an incomplete preorder. The coordinatewise Pareto order on attribute vectors is also antisymmetric, so it is a partial order. It arises whenever a choice carries several incommensurable dimensions of value. The classic construction: each course of action \(x\) is scored by a vector of attributes \((x^1,\dots,x^n)\in\mathbb{R}^n\), and we declare

\[ (x^1,\dots,x^n)\ \preceq_{\mathrm{P}}\ (y^1,\dots,y^n) \quad\Longleftrightarrow\quad x^i\le y^i\ \text{ for every } i=1,\dots,n . \tag{1}\]

This is the product order: a course is Pareto-better only if it is at least as good on every attribute. Two courses that each beat the other on some attribute are incomparable. A \(\preceq_{\mathrm{P}}\)-optimal element, one that cannot be improved in any dimension without being worsened in another, is called Pareto optimal. A Pareto optimum need not exist, and when it exists it need not be unique.

Example 1 (Choosing among incomparable options) Suppose one must rank a set \(X\) of candidates, scoring each by character and competence, \(f(x)=(f^1(x),f^2(x))\in\mathbb{R}^2\). The natural order on \(\mathbb{R}^2\) is the Pareto order 1: candidate \(x\) is unambiguously worse than \(y\) only if \(y\) is at least as good in both character and competence. Two candidates, one of finer character and the other of greater competence, are incomparable under \(\preceq_{\mathrm{P}}\). A weighted sum \(\theta_1 f^1(x)+\theta_2 f^2(x)\) trades the two attributes off against each other at fixed rates \(\theta_1,\theta_2>0\). This defines a complete preorder. A best element exists when \(X\) is finite, or when \(X\) is compact and both attribute functions are continuous. Distinct candidates can still tie.

Preferences: a complete preorder

Definition 3 (Complete preorder (preference)) A preorder \(\preceq\) on \(X\) is a complete preorder, or an economic preference, if it is

  • complete: for every \(x,y\in X\), \(x\preceq y\) or \(y\preceq x\) (every pair is comparable).

Under a complete preorder any two courses of action can be ranked, so, on a finite or suitably well-behaved \(X\), a best element exists.

A total order also requires antisymmetry; economic preferences generally allow indifference between distinct actions. When attributes admit no rate of substitution against one another, a weighted-sum completion is unavailable; the problem retains the Pareto order and its Pareto optima.

From the order to a numerical objective

Choose an ordered value set \((Y,\le_Y)\) and a map

\[ f : X \longrightarrow Y , \tag{2}\]

the objective, which pulls back the order on \(Y\) to an order on \(X\):

\[ x_1 \preceq x_2 \quad\Longleftrightarrow\quad f(x_1)\le_Y f(x_2). \tag{3}\]

The modelling task is to choose an \(f\) that reproduces the agent’s ranking.

Two cases recur:

  • \(Y=\mathbb{R}\) (a single real-valued objective). The order \(\le_Y\) is the usual order on the line, automatically complete, so \(f:X\to\mathbb{R}\) delivers a complete order for free, and “find the best \(x\)” becomes “maximize \(f\)”. This is the case the whole book treats.

  • \(Y=\mathbb{R}^n\), \(n>1\) (a vector-valued objective), with \(\le_Y\) the Pareto order

    1. Now \(f\) induces only a partial order; the problem is multi-objective, and one either accepts Pareto optimality or completes the order by a weighted sum, as in

Classification of optimization problems

Four distinctions classify the problem \(\max_{x\in X}f(x)\) and determine the methods used below.

(i) Static versus dynamic. A static problem chooses a point \(x\in X\) when future consequences can be ignored. A dynamic problem chooses a sequence \((x_0,x_1,\dots)\) or path \(x(\cdot)\) when present actions affect future outcomes.

(ii) Discrete versus continuous time. A dynamic problem is discrete-time when decisions are made at a sequence of isolated instants \(t=0,1,2,\dots\) (the unknown is a sequence), and continuous-time when decisions are made throughout an interval \([0,T]\), possibly with \(T=\infty\) (the unknown is a path \(x:[0,T]\to\mathbb{R}^n\)). Discrete-time problems use difference equations and recursions; continuous-time problems use differential equations.

(iii) Deterministic versus stochastic. When the agent’s environment is known with certainty, the problem is deterministic. When the law of motion or payoff is random, the problem is stochastic. The objective is an expected value, and the methods use conditional expectations and Itô calculus.

(iv) By the type of decision variable. When the decision variable ranges over a discrete set the problem is combinatorial, a family that includes integer programming and 0–1 programming (binary choices). When the decision variable ranges over a continuum the problem is the smooth optimization of calculus, and carries no special name.

The course develops continuous-variable dynamic optimization, mostly deterministic. The calculus of variations and optimal control are treated in continuous time only; dynamic programming is treated in both discrete and continuous time, and is where the stochastic case enters. Static optimality conditions (Mathematical statement) and ODE theory support the continuous-time methods. Combinatorial problems such as the knapsack (Example 6.4) appear only to motivate; we do not develop their algorithmics.

Mathematical statement

The standard form

Every optimization problem in this book is written in the standard form

\[ \max_{x\in X} f(x), \qquad\text{equivalently}\qquad \max_x\ f(x)\ \ \text{s.t.}\ \ x\in X , \tag{4}\]

where “s.t.” abbreviates subject to. The ingredients have fixed names:

  • \(X\) is the feasible set (the choice set, the admissible decisions);
  • \(x\) is the decision variable (optimization variable);
  • \(f\) is the objective, and \(\max\) means the greatest value of \(f\) under the order on its codomain.

Decision variables versus parameters. Writing the decision variable underneath the \(\max\) specifies which symbols are chosen and which are held fixed. Every symbol not under the \(\max\) is a parameter: a constant for the purposes of this problem, though one may later ask how the optimum responds to it (comparative statics). Compare \[ \max_{x}\ \theta x-x^2 \quad\text{s.t.}\quad x\in[0,\theta] \qquad\text{versus}\qquad \max_{(x,\theta)}\ \theta x-x^2 \quad\text{s.t.}\quad x\in[0,\theta],\ \theta\in[0,1]. \] In the first, \(\theta\) is a fixed parameter and the optimizer chooses only \(x\) (obtaining a value \(V(\theta)\) that depends on \(\theta\)); in the second, \(\theta\) is also chosen. The nested-maximization identity relates them: \[ \max_{(x,\theta)}f(x,\theta) =\max_{\theta}\Bigl(\max_{x}f(x,\theta)\Bigr) =\max_{x}\Bigl(\max_{\theta}f(x,\theta)\Bigr), \tag{5}\] The nested maximization underlies dynamic programming.

In the static problems of Chapter 1 the feasible set is a subset of Euclidean space carved out by constraints, \(X=\{x\in\mathbb{R}^n: g(x)\ge 0,\ h(x)=0\}\), and \(f:X\to\mathbb{R}\) is an ordinary function. In the dynamic problems the feasible set is a subset of a function space, paths \(x(\cdot)\) in \(C^1[0,T]\) in continuous time, sequences \((x_t)\) in discrete time, and the objective is a functional: an integral \(\int_0^T(\cdots)\,\mathrm{d}t\) in continuous time or a sum \(\sum_t(\cdots)\) in discrete time.

The three canonical dynamic problems

The three methods use the following standard problems.

Table 1: The three methods of dynamic optimization, their standard problems, and their central tools.
Method Standard problem Central tool
Calculus of variations \(\displaystyle\max\int_0^T F(t,x,\dot x)\,\mathrm{d}t\), \(\ x(0)=x_0\) Euler equation
Optimal control \(\displaystyle\max\int_0^T f(t,x,u)\,\mathrm{d}t\) s.t. \(\dot x=g(t,x,u)\), \(\ x(0)=x_0\) Pontryagin’s maximum principle
Dynamic programming \(\displaystyle\max\sum_{t=0}^{T}\beta^t\,\pi(t,x_t,u_t)\) s.t. \(x_{t+1}=f(t,x_t,u_t)\), \(\ x_0\) given Bellman / HJB equation

Calculus of variations. The unknown is the path \(x(\cdot)\) itself; its rate of change \(\dot x\) enters the integrand \(F(t,x,\dot x)\) directly. With \(F\) twice differentiable, \(T\) a positive number or \(\infty\), and \(x_0\) a constant, the necessary condition for optimality is the Euler equation \[ F_x = \frac{\mathrm{d}}{\mathrm{d}t}F_{\dot x}, \tag{6}\] a (generally second-order) differential equation for the optimal path. This is the subject of Chapter 3.

Optimal control. The state \(x\) and control \(u\) are linked by a state equation (law of motion) \(\dot x=g(t,x,u)\); the agent chooses \(u(\cdot)\) and the state responds. The running payoff is \(f(t,x,u)\). The necessary condition is Pontryagin’s maximum principle (Pontryagin et al. 1962), organized around the Hamiltonian \[ H(t,x,u,\lambda)=f(t,x,u)+\lambda\,g(t,x,u), \tag{7}\] in which the multiplier \(\lambda\) on the state equation, the costate, is the shadow price of the state. The maximum principle says the optimal control maximizes \(H\) pointwise while the costate obeys its own differential equation \(\dot\lambda=-H_x\). This is Chapter 4. The calculus of variations is the special case \(g(t,x,u)=u\), \(\dot x=u\), i.e. the control is the velocity, so optimal control strictly generalizes it.

Dynamic programming. Written here in discrete time, the agent maximizes a discounted sum of per-period payoffs \(\pi(t,x_t,u_t)\) subject to a transition \(x_{t+1}=f(t,x_t,u_t)\), with the discount factor \(\beta\in(0,1)\). The central tool is the Bellman equation (Bellman 1957), the recursion \[ V_t(x)=\max_{u}\bigl\{\pi(t,x,u)+\beta\,V_{t+1}\bigl(f(t,x,u)\bigr)\bigr\}, \tag{8}\] for the value function \(V\), the optimized objective seen as a function of the current state. Its continuous-time analogue is the Hamilton–Jacobi–Bellman (HJB) partial differential equation. This is Chapter 5.

Discount rate and factor. Write \(\rho>0\) for the continuous-time rate and \(\beta\in(0,1)\) for the discrete-time factor. For a unit-length period, \(\beta=e^{-\rho}=1/(1+r_d)\), where \(r_d=e^\rho-1\) is the equivalent simple rate. The course uses \(\rho\) for both a rate and a factor; these notes keep them separate.

Relation between the methods

Optimal control and dynamic programming describe the same optimal path. Their link is the costate:

Costate \(=\) gradient of the value function. Pontryagin’s costate \(\lambda(t)\) equals the gradient of Bellman’s value function evaluated along the optimal path, \[ \lambda(t)=V_x\bigl(t,x^\ast(t)\bigr). \tag{9}\] Both measure the marginal value of the state along the optimal path. The Hamiltonian Equation 7 is the HJB maximand; Chapter 5 derives Equation 9.

The Hamiltonian and Bellman maximand use the static optimality conditions of Chapter 1. ODE theory then describes the resulting continuous-time systems.

A few examples

Static and combinatorial examples

Example 2 (The knapsack problem (combinatorial)) A traveller with a knapsack of capacity \(W\) faces \(n\) stones of weights \(\omega_1,\dots,\omega_n\) and values \(v_1,\dots,v_n\), and must choose which to carry to maximize total value. With a binary decision variable \(x_i\in\{0,1\}\) (carry stone \(i\), or not), the problem is \[ \max_{(x_1,\dots,x_n)}\ \sum_{i=1}^{n} v_i\,x_i \qquad\text{s.t.}\qquad \sum_{i=1}^{n}\omega_i\,x_i\le W,\quad x_i\in\{0,1\}\ \ (i=1,\dots,n). \] This 0–1 (binary) program is solved by discrete dynamic programming in Chapter 5.

Example 3 (The consumer’s problem (static, continuous)) An agent with budget \(C>0\) buys quantities \(x_1,\dots,x_n\) of \(n\) goods at prices \(p_1,\dots,p_n>0\) to maximize utility \(U(x_1,\dots,x_n)\): \[ \max_{(x_1,\dots,x_n)}\ U(x_1,\dots,x_n) \qquad\text{s.t.}\qquad p_1 x_1+\cdots+p_n x_n\le C,\quad x_1\ge 0,\dots,x_n\ge 0 . \] The decision variable is a continuous consumption bundle; the feasible set is the budget simplex (a polytope cut out by one inequality constraint and \(n\) non-negativity constraints). This is the prototypical static, constrained, continuous problem, solved by the Kuhn–Tucker conditions of Chapter 1.

Continuous-time dynamic examples

Example 4 (Optimal resource extraction (continuous-time, optimal control)) An owner holds the rights to a mineral deposit for \(T\) years. Let \(x(t)\) be the stock remaining at time \(t\) and \(y(t)\ge 0\) the extraction rate, so the stock depletes according to \(\dot x=-y\). The product sells at price \(p(t)\) in a competitive market; extracting at rate \(y\) from a stock \(x\) costs \(c(x,y)\) per unit time; the discount rate is \(\rho>0\) and the initial stock is \(x(0)=x_0\). The owner solves \[ \max_{y(\cdot)}\ \int_0^T e^{-\rho t}\bigl[\,p(t)\,y - c(x,y)\,\bigr]\,\mathrm{d}t \qquad\text{s.t.}\qquad \dot x=-y,\quad x(0)=x_0,\quad y\ge 0, \] which is a textbook optimal-control problem with state \(x\) (the stock) and control \(y\) (the extraction rate). Eliminating the control via \(y=-\dot x\) turns it into the equivalent variational problem \[ \min_{x(\cdot)}\ \int_0^T e^{-\rho t}\bigl[\,p(t)\,\dot x + c(x,-\dot x)\,\bigr]\,\mathrm{d}t \qquad\text{s.t.}\qquad x(0)=x_0 , \] a concrete instance of the equivalence “calculus of variations \(=\) optimal control with \(\dot x=u\)” noted after Equation 7. Its solution, Hotelling’s rule, that the resource’s marginal value rises at the discount rate, is derived in Chapter 3 and revisited with the maximum principle in Chapter 4.

A notational convention used throughout the dynamic chapters and already visible above: a time-dependent quantity is written \(x\) rather than \(x(t)\) when no confusion results, and a dot denotes the time derivative, \(\dot x=\mathrm{d}x/\mathrm{d}t\).

Discrete-time dynamic example

Example 5 (The cake-eating problem (discrete-time, dynamic programming)) A consumer owns a cake of size \(1\) and, each period \(t=0,1,2,\dots\), eats an amount \(c_t\ge 0\), enjoying instantaneous utility \(u(c_t)\); total utility is the discounted sum of flow utilities, with discount factor \(\beta\in(0,1)\). Writing \(x_t\) for the cake remaining at the start of period \(t\) (so \(x_0=1\) and \(x_{t+1}=x_t-c_t\)), the consumer solves \[ \max_{(c_t)_{t\ge 0}}\ \sum_{t=0}^{\infty}\beta^{t}\,u(c_t) \qquad\text{s.t.}\qquad x_{t+1}=x_t-c_t,\quad 0\le c_t\le x_t,\quad x_0=1 . \] Chapter 5 solves this problem using the Bellman equation Equation 8.

The brachistochrone: where the subject began

Example 6 (The brachistochrone (the founding problem of the calculus of variations)) In a vertical plane, fix two points \(O\) (the origin) and \(A=(p,q)\) that share neither a horizontal nor a vertical line, with \(O\) above \(A\). Along which frictionless track does a bead, released from rest at \(O\) and pulled by gravity, slide to \(A\) in the shortest time? With the \(y\)-axis pointing downward and the curve written \(y=y(x)\), energy conservation \(\tfrac12 m v^2=m g y\) gives the speed \(v=\sqrt{2gy}\), and since an element of arc \(\mathrm{d}s=\sqrt{1+y'^2}\,\mathrm{d}x\) is traversed in time \(\mathrm{d}t=\mathrm{d}s/v\), the total descent time is the functional \[ T[y]=\int_0^p \frac{\sqrt{1+y'^2}}{\sqrt{2gy}}\,\mathrm{d}x . \] Dropping the constant \(\sqrt{2g}\), the brachistochrone problem is the variational problem \[ \min_{y(\cdot)}\ \int_0^p \sqrt{\frac{1+y'^2}{y}}\,\mathrm{d}x \qquad\text{s.t.}\qquad y(0)=0,\ \ y(p)=q . \] Galileo (1630) conjectured a circular arc; Johann Bernoulli (1696), Jacob Bernoulli, Leibniz, Newton, and l’Hôpital independently found the true answer, a cycloid, with parametric form \(x=a(\theta-\sin\theta)\), \(y=a(1-\cos\theta)\), the curve traced by a point on a rolling wheel. Johann Bernoulli’s solution treated the descent as light refracting through ever-finer horizontal strata, in each of which the bead moves in a straight line at constant speed; the optimal angle in each stratum obeys Snell’s law \(\sin\alpha/v=\text{const}\), exactly the optical extremal principle of Fermat. Jacob Bernoulli’s solution, by contrast, introduced the method of varying the whole curve, the embryo of the calculus of variations, and led to the same governing differential equation \(y\bigl(1+y'^2\bigr)=A\), whose solution is the cycloid. It was Euler who built on these solutions to develop the general method and the result that bears his name, the Euler equation Equation 6. We solve the brachistochrone in Chapter 3.

A historical aside. The cycloid is also the tautochrone (isochrone), the curve along which a bead reaches the lowest point in a time independent of its starting height. That a single curve solves both problems was shown by Abel, who reduced the tautochrone to an integral equation and cracked it with the Laplace transform and the convolution theorem.