Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Sect. 13.2.4.1: random ordering, E[Qr]=Nμ\mathbb{E}[Q^r] = N\muE[Qr]=Nμ and Var[Qr]=Nσ2+μ2N(R−1)\mathrm{Var}[Q^r] = N\sigma^2 + \mu^2N(R-1)Var[Qr]=Nσ2+μ2N(R−1)

Proved
SupplyChainTheory.batch_random_ordering

by naimengye · Sep 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

bullwhip-effectoperations-researchprobabilitysupply-chain

NNN retailers face i.i.d. N(μ,σ2)N(\mu, \sigma^2)N(μ,σ2) period demands and each orders every R≥1R \ge 1R≥1 periods the demand of the previous RRR periods, on a day chosen uniformly at random from the RRR days of the interval. The number XXX of retailers ordering on a given day is then binomial with parameters NNN and 1/R1/R1/R, and the total order QtrQ^r_tQtr​ received by the supplier satisfies

E[Qtr]=Nμ,Var[Qtr]=Nσ2+μ2N(R−1)  ≥  Nσ2.\mathbb{E}[Q^r_t] = N\mu, \qquad \mathrm{Var}[Q^r_t] = N\sigma^2 + \mu^2 N(R-1) \;\ge\; N\sigma^2.E[Qtr​]=Nμ,Var[Qtr​]=Nσ2+μ2N(R−1)≥Nσ2.

The book conditions on XXX: given XXX, the order is a sum of XRXRXR i.i.d. demands, so E[Q∣X]=XRμ\mathbb{E}[Q \mid X] = XR\muE[Q∣X]=XRμ and Var[Q∣X]=XRσ2\mathrm{Var}[Q \mid X] = XR\sigma^2Var[Q∣X]=XRσ2, and the variance decomposition Var[Q]=E[Var[Q∣X]]+Var[E[Q∣X]]\mathrm{Var}[Q] = \mathbb{E}[\mathrm{Var}[Q\mid X]] + \mathrm{Var}[\mathbb{E}[Q\mid X]]Var[Q]=E[Var[Q∣X]]+Var[E[Q∣X]] gives the result. If R=1R = 1R=1 the variances coincide, as they should.

Formalization Note The binomial law of XXX enters as a hypothesis on the probabilities Pr⁡[X=j]\Pr[X = j]Pr[X=j], and QtrQ^r_tQtr​ is supplierOrder, the sum over retailers 1,…,X1, \dots, X1,…,X of their RRR demands.

Preamble
import Definitions.Def_SupplyChainTheory_bullwhip
Formal statement
namespace SupplyChainTheory

theorem batch_random_ordering {Ω : Type*} [MeasurableSpace Ω] {P : MeasureTheory.Measure Ω}
    [MeasureTheory.IsProbabilityMeasure P] {N R : ℕ} {mu sigma : ℝ} (hR : 0 < R)
    (B : BatchOrders P N R mu sigma)
    (hX : ∀ j : ℕ, P.real {ω | B.X ω = j}
      = (Nat.choose N j : ℝ) * (1 / R) ^ j * (1 - 1 / R) ^ (N - j)) :
    (∫ ω, B.supplierOrder ω ∂P) = N * mu
      ∧ ProbabilityTheory.variance B.supplierOrder P
          = N * sigma ^ 2 + mu ^ 2 * N * (R - 1) := by sorry

end SupplyChainTheory
Source
Lawrence V. Snyder and Zuo-Jun Max Shen, Fundamentals of Supply Chain Theory, 2nd ed., Wiley 2019, DOI 10.1002/9781119584445, p. 549, Sect. 13.2.4.1 'Random Ordering'
Human review
  • Endorsed by Shuze Chen · Sep 25, 2026

    Confirmed by the moderator at approval.

  • Endorsed by naimengye · Sep 25, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me