What does The Nightly Funnel conclude, in numbers, about “The Reward Function: Net Contribution per Visitor, Not the Conversion Rate”?

Answer: With the pay rate as reward, the realised pay rate is 0.0550 and net contribution per visitor 1.7140; the discount version takes 0.623 of the traffic and the trust version only 0.124. With net contribution as reward the pay rate is 0.0505, a little lower, but net contribution per visitor is 1.9453, well above; the trust version receives 0.615 of the traffic and the discount version only 0.064.

Scope of the numbers: Its parameters are illustrative; all calculations are generated by its 23 programs; it is general business analysis, not business, legal or financial advice, and it promises no rise in conversion.

中文版

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.0505, 0.0550, 0.064, 0.124, 0.615, 0.623

rewardpay ratenet/visitorshare: control disc20 trust bundle
conv0.05501.71400.0680.623 0.1240.185
net0.05051.94530.1740.064 0.6150.146
visitors 20,000 per run, 40 runs
Show the full program
# Chapter 3. p32: Thompson sampling with two reward definitions.
# Rule "conv" rewards a payment (Bernoulli). Rule "net" keeps a Beta
# posterior for the pay rate and one for the refund rate of each
# variant, and ranks the draw conv * ((1 - r) * margin - r * handling),
# with margins known from the price list. Variants as in p31.
import math
import random

HANDLING = 6.0
NAMES = ["control", "discount20", "trust_sample", "bundle_low"]
CONV = [0.046, 0.058, 0.050, 0.052]
MARGIN = [42.0, 30.0, 42.0, 36.0]
REFUND = [0.040, 0.050, 0.035, 0.040]
T = 20000
REPS = 40
rng = random.Random(40532)


def run(rule):
    k = len(NAMES)
    pay, n, ref = [0] * k, [0] * k, [0] * k
    net = []
    for _ in range(T):
        best, arm = None, 0
        for a in range(k):
            c = rng.betavariate(1 + pay[a], 1 + n[a] - pay[a])
            if rule == "conv":
                v = c
            else:
                r = rng.betavariate(1 + ref[a], 1 + pay[a] - ref[a])
                v = c * ((1 - r) * MARGIN[a] - r * HANDLING)
            if best is None or v > best:
                best, arm = v, a
        n[arm] += 1
        if rng.random() < CONV[arm]:
            pay[arm] += 1
            if rng.random() < REFUND[arm]:
                ref[arm] += 1
                net.append(-HANDLING)
            else:
                net.append(MARGIN[arm])
    paid = 0
    for a in range(k):
        paid += pay[a]
    return paid / T, math.fsum(net) / T, [x / T for x in n]


print("reward  pay rate  net/visitor  share: control disc20 trust bundle")
for rule in ["conv", "net"]:
    pr, nv, sh = [], [], [[] for _ in NAMES]
    for _ in range(REPS):
        a, b, c = run(rule)
        pr.append(a)
        nv.append(b)
        for i in range(len(NAMES)):
            sh[i].append(c[i])
    m = [math.fsum(x) / REPS for x in sh]
    print("{:<6} {:>9.4f} {:>12.4f}   {:>12.3f} {:>6.3f} {:>5.3f} {:>6.3f}"
          .format(rule, math.fsum(pr) / REPS, math.fsum(nv) / REPS, *m))
print("visitors {:,} per run, {} runs".format(T, REPS))

Single source and citation

Fan, Y. (2026). Autonomous Nightly Funnel Micro-Surgery, Bandit Traffic Allocation and Zero-Touch Conversion Self-Improvement (Version 1.0.0), Chapter 3: The Reward Function: Net Contribution per Visitor, Not the Conversion Rate. 5D Library. DOI pending

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

BibTeX
@book{fan2026405,
  author    = {Fan, Yafu},
  title     = {Autonomous Nightly Funnel Micro-Surgery, Bandit Traffic Allocation and Zero-Touch Conversion Self-Improvement},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book