Skip to content

Vol. II, Ch. 1seed 26201

DCT Laboratory — Volume II, Chapter 1

Introduction to Enterprise Optimization

Seed 26201 · Companion to the chapter and AXIOM Module AXIOM-01 (Vol. II)

Volume II's laboratory line opens where Volume I's closed: with choosing. Three instruments: a closed-form allocation (marginal values equalized at the optimum), feasibility as conjunction (a 36-point grid under three simultaneous constraints), and the proposition that optimal decisions depend on objectives — same feasible set, two different argmaxes. Mirrored in DCT_V2_Ch01_Lab.xlsx.

import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['figure.dpi']=110

import numpy as np
SEED = 26201
# --- closed-form allocation: max 3*sqrt(x) + 4*sqrt(B-x), B=100 ---
A1, A2, B = 3.0, 4.0, 100.0
def f_alloc(x): return A1*np.sqrt(x) + A2*np.sqrt(B-x)
X_STAR = B*A1**2/(A1**2+A2**2)          # 36
# --- feasibility as conjunction: integer grid under three constraints ---
def grid_points():
    return [(x1,x2) for x1 in range(6) for x2 in range(6)]
def feasible(p):
    x1,x2 = p
    return (x1+x2 <= 6) and (2*x1+x2 <= 8) and (x2 <= 4)
# --- objectives choose optima ---
def fA(p): return 3*p[0]+2*p[1]
def fB(p): return 4*p[0]+p[1]

def reference_values():
    feas = [p for p in grid_points() if feasible(p)]
    argA = max(feas, key=fA); argB = max(feas, key=fB)
    mval = (A1/(2*np.sqrt(X_STAR)))/(A2/(2*np.sqrt(B-X_STAR)))
    return {
        "x_star": round(float(X_STAR),4),
        "f_star": round(float(f_alloc(X_STAR)),4),
        "marginal_ratio": round(float(mval),4),
        "n_grid": len(grid_points()),
        "n_feasible": len(feas),
        "fA_max": fA(argA), "fB_max": fB(argB),
        "argA_x1": argA[0], "argA_x2": argA[1],
        "argB_x1": argB[0], "argB_x2": argB[1],
    }
if __name__ == "__main__":
    [print(f"{k:16s} {v}") for k,v in reference_values().items()]
x_star           36.0
f_star           50.0
marginal_ratio   1.0
n_grid           36
n_feasible       19
fA_max           14
fB_max           16
argA_x1          2
argA_x2          4
argB_x1          4
argB_x2          0

Panel 1 — The anatomy, in closed form

Allocate a budget of 100 across two channels with square-root response: f(x)=3x+4100−xf(x) = 3\sqrt{x} + 4\sqrt{100-x}. The first-order condition equalizes marginal values, giving x∗=100⋅32/(32+42)=36x^* = 100 \cdot 3^2/(3^2+4^2) = 36 and f∗=50f^* = 50 — every piece of the Anatomy of an Optimization Problem (Prop.) visible: decision, objective, constraint, optimum, and the optimality certificate (marginal ratio 1.0000).

xs = np.linspace(0.5, 99.5, 300)
fig, ax = plt.subplots(figsize=(8.0,4.2))
ax.plot(xs, f_alloc(xs), c="#C8A24B", lw=2.5)
ax.scatter([X_STAR],[f_alloc(X_STAR)], c="#0B3D2E", s=90, zorder=5, label=f"x* = {X_STAR:.0f}, f* = {f_alloc(X_STAR):.0f}")
ax.set(xlabel="x (channel 1 budget)", ylabel="f(x)", title="3√x + 4√(100−x) — seed 26201")
ax.legend(frameon=False); ax.grid(alpha=.25); plt.tight_layout(); plt.show()
m1 = A1/(2*np.sqrt(X_STAR)); m2 = A2/(2*np.sqrt(B-X_STAR))
print(f"marginal values at x*: {m1:.6f} vs {m2:.6f}   ratio {m1/m2:.4f}")
3√x + 4√(100−x) — seed 26201
marginal values at x*: 0.250000 vs 0.250000   ratio 1.0000

Panel 2 — Feasibility is conjunction

36 candidate decisions (x1,x2)∈{0..5}2(x_1, x_2) \in \{0..5\}^2; three constraints (x1+x2≤6x_1+x_2 \le 6, 2x1+x2≤82x_1+x_2 \le 8, x2≤4x_2 \le 4). Feasibility is Conjunction (Prop.): a point survives only if it satisfies ALL three — 19 of 36 do. The feasible region is the intersection, and the intersection is smaller than any of its parts.

pts = grid_points(); feas = [p for p in pts if feasible(p)]
fig, ax = plt.subplots(figsize=(6.2,5.0))
inf = [p for p in pts if not feasible(p)]
ax.scatter(*zip(*inf), c="#C9CCC9", s=70, label="infeasible")
ax.scatter(*zip(*feas), c="#0B3D2E", s=90, label="feasible (19)")
xs = np.linspace(-0.3,5.3,50)
ax.plot(xs, 6-xs, c="#C8A24B", lw=1.5); ax.plot(xs, 8-2*xs, c="#C8A24B", lw=1.5); ax.axhline(4, c="#C8A24B", lw=1.5)
ax.set(xlim=(-0.4,5.4), ylim=(-0.4,5.6), xlabel="x1", ylabel="x2", title="Three constraints, one intersection")
ax.legend(frameon=False, fontsize=9); ax.grid(alpha=.2); plt.tight_layout(); plt.show()
print(f"grid {len(pts)}   feasible {len(feas)}")
Three constraints, one intersection
grid 36   feasible 19

Panel 3 — Optimal decisions depend on objectives

Same 19 feasible points, two objectives. fA=3x1+2x2f_A = 3x_1 + 2x_2 crowns (2,4)(2,4) at 14; fB=4x1+x2f_B = 4x_1 + x_2 crowns (4,0)(4,0) at 16. Optimal Decisions Depend on Objectives (Prop.): the feasible region proposes, the objective disposes — and publishing the objective is what makes 'the optimal decision' a checkable claim (Volume I, Ch. 11's honesty campaign, arriving at decisions).

feas = [p for p in grid_points() if feasible(p)]
argA = max(feas, key=fA); argB = max(feas, key=fB)
print(f"objective A = 3x1+2x2 → argmax {argA}, value {fA(argA)}")
print(f"objective B = 4x1+x2  → argmax {argB}, value {fB(argB)}")
print("distinct optima:", argA != argB)
objective A = 3x1+2x2 → argmax (2, 4), value 14
objective B = 4x1+x2  → argmax (4, 0), value 16
distinct optima: True

Validation — agrees with DCT_V2_Ch01_Lab.xlsx

ref = reference_values()
expected = {"x_star":36.0,"f_star":50.0,"marginal_ratio":1.0,"n_grid":36,"n_feasible":19,
 "fA_max":14,"fB_max":16,"argA_x1":2,"argA_x2":4,"argB_x1":4,"argB_x2":0}
for k,v in expected.items():
    assert abs(ref[k]-v)<5e-4, f"MISMATCH {k}"
    print(f"PASS  {k:16s} {ref[k]}")
print("\nAll checkpoints agree — seed 26201. Volume II's line is open.")
PASS  x_star           36.0
PASS  f_star           50.0
PASS  marginal_ratio   1.0
PASS  n_grid           36
PASS  n_feasible       19
PASS  fA_max           14
PASS  fB_max           16
PASS  argA_x1          2
PASS  argA_x2          4
PASS  argB_x1          4
PASS  argB_x2          0

All checkpoints agree — seed 26201. Volume II's line is open.

Next: Exercises 1.5–1.8 (Part C) reshape the constraints and re-count; AXIOM-01's anatomy bench labels every piece of the problem live. Solutions: IM Vol. II, Ch. 1.