What does Hard Water, Chelation and Lather conclude, in numbers, about “Classical Sources: Lu Yu on Waters, the Guanzi on Water, Hippocrates on Hard Water and Clark's Soap Test”?

Answer: The probability that a mountain water is softer than a river water is 0.8525, against an exact value of 0.8539, so the simulation and the analytic result agree. The probability that a river water is softer than a well water is 0.8464, and that a mountain water is softer than a well water is 0.9802. The probability that the whole order holds for all three is only 0.7025. The mean Kendall rank correlation per set of three is 0.7861. The last line converts rainwater to 5.0 mg/L as calcium carbonate.

Scope of the numbers: Chapter 1 covers units of hardness, six illustrative waters and the activity of calcium. Parameters are illustrative and all calculations are generated by the book's programs.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.7025, 0.7861, 0.8464, 0.8525, 0.8539, 0.9802

draws 100,000; medians 0.5 / 1.2 / 2.8 mmol/L, spread x1.8
P(mountain softer than river)0.8525
P(river softer than well)0.8464
P(mountain softer than well)0.9802
P(whole order holds)0.7025
mean Kendall tau per triple0.7861
exact P(mountain < river)0.8539
rainwater 0.05 mmol/L is 5.0 mg/L CaCO3
Show the full program
# Chapter 7. p71: Lu Yu's ranking (mountain > river > well) as odds.
# Model: hardness of each source type is lognormal; medians 0.5, 1.2 and
# 2.8 mmol/L and a geometric spread factor of 1.8 are illustrative, not
# survey data, and rainwater is put at 0.05 mmol/L. A fixed-seed Monte
# Carlo draws one water of each type and counts how often the classical
# order (softer first) holds pairwise and for the whole triple.
import math
import random

TYPES = (("mountain", 0.5), ("river", 1.2), ("well", 2.8))
GSD = 1.8


def draw(rng, median):
    return median * math.exp(rng.gauss(0.0, math.log(GSD)))


if __name__ == "__main__":
    rng = random.Random(38971)
    n = 100000
    mr = rw = mw = triple = 0
    tau_terms = []
    for _ in range(n):
        m, r, w = (draw(rng, med) for _, med in TYPES)
        mr += m < r
        rw += r < w
        mw += m < w
        triple += m < r < w
        conc = (m < r) + (r < w) + (m < w)
        tau_terms.append((conc - (3 - conc)) / 3.0)
    print("draws {:,}; medians 0.5 / 1.2 / 2.8 mmol/L, spread x{}".format(
        n, GSD))
    print("  P(mountain softer than river)  {:.4f}".format(mr / n))
    print("  P(river softer than well)      {:.4f}".format(rw / n))
    print("  P(mountain softer than well)   {:.4f}".format(mw / n))
    print("  P(whole order holds)           {:.4f}".format(triple / n))
    print("  mean Kendall tau per triple    {:.4f}".format(
        math.fsum(tau_terms) / n))
    z = math.log(1.2 / 0.5) / (math.sqrt(2.0) * math.log(GSD))
    exact = 0.5 * (1.0 + math.erf(z / math.sqrt(2.0)))
    print("  exact P(mountain < river)      {:.4f}".format(exact))
    print("  rainwater 0.05 mmol/L is {:.1f} mg/L CaCO3".format(
        0.05 * 100.086))

Single source and citation

Fan, Y. (2026). Water-Hardness Chemistry in Personal-Care Formulations, Calcium-Magnesium Chelation and Surfactant Foam-Deposition Enhancement (Version 1.0.0), Chapter 7: Classical Sources: Lu Yu on Waters, the Guanzi on Water, Hippocrates on Hard Water and Clark's Soap Test. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-389 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026389,
  author    = {Fan, Yafu},
  title     = {Water-Hardness Chemistry in Personal-Care Formulations, Calcium-Magnesium Chelation and Surfactant Foam-Deposition Enhancement},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book