What does COD Deposits and Prepay Screening conclude, in numbers, about “A Fixed-Seed Order Simulation: Four Payment Policies Applied to the Same Buyers”?

Answer: Chapter 6 simulates four policies with fixed seeds; the deposit rule with appeal and review earns 3535.44 more than cash on delivery alone.

Scope of the numbers: No peer-reviewed estimate of refusal rates in Southeast Asia was found, so all parameters are illustrative, and all calculations are generated by the book's programs. This is general analysis, not individualised business or legal advice.

中文版

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: 3535.44

buyers 4000 (committed 2995, casual 1005)
pol orders fails rate profit total per order flag H flag L
P031843 3949 0.1240 118763.04 3.7296 0.0000 0.0000
P131843 3569 0.1121 120472.25 3.7833 0.0000 0.0000
P231277 3204 0.1024 122358.96 3.9121 0.0097 0.4876
P331285 3211 0.1026 122298.48 3.9092 0.0060 0.4826
analytic P0 profit per order 3.7134
P1 minus P01709.20 u
P2 minus P03595.92 u
P3 minus P03535.44 u
Show the full program
# Chapter 6. p61: a fixed-seed simulation of four payment policies.
# 4000 buyers, a quarter casual; each places 2 to 14 orders with a
# basket drawn from {10, 15, 20, 30, 45} u. Failures per COD attempt:
# buyer refusal 0.025 (committed) or 0.325 (casual), buyer absent
# 0.015, carrier or address error 0.01; a fifth of the last two are
# wrongly recorded as refusals. Trust cost phi is uniform on
# [0, 0.16]; surplus per order uniform on [0, 6] u. Policies:
#   P0 COD only;  P1 COD plus a prepay discount of 0.0278 of the basket
#   (p41); P2 = P1 plus the deposit rule of p32 from the buyer's own
#   record (flagged buyers pay a deposit, deterred as in p51, or leave
#   when the expected deposit cost exceeds their surplus); P3 = P2
#   with appeal and human review that strikes wrongly recorded
#   refusals from the record. Costs follow p13. The same random draws
#   serve every policy. Illustrative parameters throughout.
import math
import random

SO = SR = 1.8
RATE, DR, DF, FEE, A, E = 0.12, 21, 10, 0.03, 0.8, 0.015
QH, PHI, RHO, H, THETA = 0.05, 0.08, 0.6, 1.8, 6.0
QD = (0.025, 0.325)
QA, QC, MIS = 0.015, 0.01, 0.2
DISC = 0.0278


def costs(p):
    c = 0.65 * p
    m = p - c - SO - FEE * p - p * RATE * DF / 365
    k = math.fsum([SO, SR, 0.05 * c, (c + SO) * RATE * DR / 365])
    return c, m, k


def dstar(p, ql):
    _, _, k = costs(p)
    d0 = (ql * k + A) / (1 - ql) - (QH * k + A) / (1 - QH)
    return (1 - ql) * d0 / (ql + PHI - (1 - ql) * QH / (1 - QH))


def deposit(p, n, k):
    qhat = (k + 1) / (n + 10)
    if n < 5 or qhat <= 0.15:
        return 0.0
    return math.floor(min(dstar(p, qhat), costs(p)[2]) * 2) / 2


def draw(seed):
    rng = random.Random(20261113)
    rng.seed(seed)
    buyers = []
    for _ in range(4000):
        t = 1 if rng.random() < 0.25 else 0
        phi, surplus = rng.uniform(0, 0.16), rng.uniform(0, 6)
        orders = [(rng.choice((10, 15, 20, 30, 45)), rng.random(),
                   rng.random(), rng.random())
                  for _ in range(rng.randint(2, 14))]
        buyers.append((t, phi, surplus, orders))
    return buyers


def run(buyers, pol):
    prof, n_ord, n_fail, flagged = [], 0, 0, [0, 0]
    for t, phi, sur, orders in buyers:
        rec_n, rec_k, was = 0, 0, False
        for p, u1, u2, u3 in orders:
            c, m, k = costs(p)
            d = DISC * p if pol >= 1 else 0.0
            qtot = QD[t] + QA + QC
            if pol >= 1 and d >= phi * (p - d) + RHO * qtot * H:
                n_ord = n_ord + 1
                if u1 < RHO * QD[t]:
                    prof.append(-math.fsum([SO, 0.05 * c, A, E * (p - d),
                                            (c + SO) * RATE * DR / 365]))
                else:
                    prof.append(p - d - c - SO - E * (p - d) - A)
                continue
            dep = deposit(p, rec_n, rec_k) if pol >= 2 else 0.0
            if dep > 0:
                was = True
                if (qtot + phi) * dep > sur:
                    break
            qd = QD[t] * math.exp(-dep / THETA)
            n_ord, rec_n = n_ord + 1, rec_n + 1
            if u1 < qd:
                n_fail, rec_k = n_fail + 1, rec_k + 1
                prof.append(dep - k - A)
            elif u1 < qd + QA + QC:
                n_fail = n_fail + 1
                if u2 < MIS and pol != 3:
                    rec_k = rec_k + 1
                prof.append(-k - A)
            else:
                prof.append(m - A)
        if was:
            flagged[t] = flagged[t] + 1
    return math.fsum(prof), n_ord, n_fail, flagged


if __name__ == "__main__":
    buyers = draw(20261113)
    nt = [0, 0]
    for b in buyers:
        nt[b[0]] = nt[b[0]] + 1
    print("buyers {} (committed {}, casual {})".format(
        len(buyers), nt[0], nt[1]))
    print("pol orders  fails  rate    profit total per order flag H flag L")
    for pol in range(4):
        tot, no, nf, fl = run(buyers, pol)
        print("P{} {:6d} {:6d} {:6.4f} {:13.2f} {:9.4f} {:6.4f} {:6.4f}"
              .format(pol, no, nf, nf / no, tot, tot / no, fl[0] / nt[0],
                      fl[1] / nt[1]))
    ana = []
    for p in (10, 15, 20, 30, 45):
        _, m, k = costs(p)
        for t, w in ((0, 0.75), (1, 0.25)):
            q = QD[t] + QA + QC
            ana.append(0.2 * w * ((1 - q) * m - q * k - A))
    print("analytic P0 profit per order {:.4f}".format(math.fsum(ana)))
    base = run(buyers, 0)[0]
    for pol in (1, 2, 3):
        print("P{} minus P0: {:9.2f} u".format(pol, run(buyers, pol)[0]
                                                - base))

Single source and citation

Fan, Y. (2026). Cash-on-Delivery Refusal Games and the Trust Deficit in Southeast Asian E-Commerce: Deposit Thresholds and Prepayment-Discount Incentive Design (Version 1.0.0), Chapter 6: A Fixed-Seed Order Simulation: Four Payment Policies Applied to the Same Buyers. 5D Library. DOI pending

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

BibTeX
@book{fan2026314,
  author    = {Fan, Yafu},
  title     = {Cash-on-Delivery Refusal Games and the Trust Deficit in Southeast Asian E-Commerce: Deposit Thresholds and Prepayment-Discount Incentive Design},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book