Case 887

The fair price drove out the good risks

the_fair_price_drove_out_the_good_risks.eml - An insurer prices a policy at the average expected claim of the whole population, the average is computed exactly from every customer's true risk, and every customer decides rationally whether to buy. Who buys at the average price is computed below.

ok: true — round-trip fixpoint reached (python1 == python2)updated 2026-09-17

EML

eml
# Self-authored for the EML case corpus (no external origin). An insurer prices
# a policy at the average expected claim of the whole population, the average is
# computed exactly from every customer's true risk, and every customer decides
# rationally whether to buy. Who buys at the average price is computed below.
#
# The pricing is careful. Every customer's expected claim is known exactly; the
# price is the honest mean over all of them; nobody is overcharged relative to
# the population; and the intent is exactly 'a fair price that covers the claims'.
#
# A price at the population average is a bargain only for those whose risk is
# above it, so the below-average customers decline, the pool that buys is riskier
# than the population, and the price that covered the population does not cover
# the pool.

100 => customers
1 => lowest_expected_claim
100 => highest_expected_claim

int((lowest_expected_claim + highest_expected_claim) / 2) => population_average_claim
population_average_claim => price_round_one
price_round_one + 1 => lowest_risk_that_buys_round_one
highest_expected_claim - price_round_one => buyers_round_one
int((lowest_risk_that_buys_round_one + highest_expected_claim) / 2) => pool_average_round_one
pool_average_round_one - price_round_one => loss_per_policy_round_one
pool_average_round_one => price_round_two
price_round_two + 1 => lowest_risk_that_buys_round_two
highest_expected_claim - price_round_two => buyers_round_two
int((lowest_risk_that_buys_round_two + highest_expected_claim) / 2) => pool_average_round_two
pool_average_round_two - price_round_two => loss_per_policy_round_two
pool_average_round_two => price_round_three
highest_expected_claim - price_round_three => buyers_round_three
int(buyers_round_three * 10000 / customers) => population_still_covered_per_myriad

"customers                       : " + str(customers) + ", expected claims " + str(lowest_expected_claim) + " to " + str(highest_expected_claim) ^0
"population average claim        : " + str(population_average_claim) ^0
"" ^0
"round one, price                : " + str(price_round_one) ^0
"  who buys                      : risks " + str(lowest_risk_that_buys_round_one) + " to " + str(highest_expected_claim) + ", " + str(buyers_round_one) + " customers" ^0
"  average claim of the pool     : " + str(pool_average_round_one) ^0
"  loss per policy               : " + str(loss_per_policy_round_one) ^0
"round two, price                : " + str(price_round_two) ^0
"  who buys                      : risks " + str(lowest_risk_that_buys_round_two) + " to " + str(highest_expected_claim) + ", " + str(buyers_round_two) + " customers" ^0
"  average claim of the pool     : " + str(pool_average_round_two) ^0
"  loss per policy               : " + str(loss_per_policy_round_two) ^0
"round three, price              : " + str(price_round_three) + ", buyers " + str(buyers_round_three) ^0
"population still covered        : " + str(population_still_covered_per_myriad) + " per ten thousand" ^0
"" ^0

# ---- what the pricing verified ----

"the average-cost price" ^0
"  each customer's expected claim : known exactly" ^0
"  price : the honest mean over all " + str(customers) ^0
"  fairness : nobody charged above the population average" ^0
"  intent : a fair price that covers the claims" ^0
"  customers mispriced relative to the population : 0" ^0
"  verdict : THE PRICE EQUALS THE AVERAGE CLAIM" ^0
"" ^0
"  computing the exact population mean is the part done" ^0
"  right here, and it is why the price would cover the" ^0
"  claims if everyone bought" ^0
"" ^0

# ---- who buys at the average ----

"the customer's decision" ^0
"  a customer with risk below " + str(price_round_one) + " : pays more than their" ^0
"    expected claim, declines" ^0
"  a customer with risk above " + str(price_round_one) + " : pays less than their" ^0
"    expected claim, buys" ^0
"  so the pool : is the top half, averaging " + str(pool_average_round_one) ^0
"  the price that covered the population : loses " + str(loss_per_policy_round_one) + " per" ^0
"    policy on the pool" ^0
"  repricing to " + str(price_round_two) + " : repeats it - the pool is the top" ^0
"    quarter, averaging " + str(pool_average_round_two) ^0
"" ^0

# ---- what the insurer got ----

"the spiral" ^0
"  buyers by round : " + str(customers) + " assumed, " + str(buyers_round_one) + ", " + str(buyers_round_two) + ", " + str(buyers_round_three) ^0
"  is the average miscomputed : no; each mean is exact" ^0
"  does the average price cover the average customer : yes," ^0
"    and the average customer does not buy" ^0
"  does it cover the customers who buy : no; they are the" ^0
"    ones for whom it was a bargain" ^0
"" ^0

# ---- null control ----

# The same population with the price set on each buyer's own expected claim
# (risk-rated), or with participation mandatory so the pool is the population.
25 => nc_loss_per_policy_at_the_population_average
0 => nc_loss_per_policy_when_the_pool_is_the_population
100 => nc_customers_covered_when_the_pool_is_the_population

"null control - price the pool that buys, or make the pool the population" ^0
"  loss per policy, average price, self-selected pool : " + str(nc_loss_per_policy_at_the_population_average) ^0
"  loss per policy, pool equals population : " + str(nc_loss_per_policy_when_the_pool_is_the_population) ^0
"  customers covered, pool equals population : " + str(nc_customers_covered_when_the_pool_is_the_population) ^0
"  no risk and no claim changed; the price stopped selecting" ^0
"  the people it would lose money on" ^0
"" ^0

# ---- the rule ----

"what a population-average price guarantees" ^0
"  the price equals the mean expected claim of everyone :" ^0
"    exactly, every risk known, honest mean" ^0
"  the price covers the claims of the buyers : not addressed;" ^0
"    the average is a bargain only above it, so the pool is" ^0
"    the top half at " + str(pool_average_round_one) + ", then the top quarter at " + str(pool_average_round_two) + "," ^0
"    and " + str(population_still_covered_per_myriad) + " per ten thousand of the population is covered by round three" ^0
"" ^0

"a price set on everyone is accepted only by those it undercharges, and the" ^0
"average of those who accept is higher than the average it was set on; each" ^0
"correction chases a pool that moves away as fast as the price approaches it" ^0
"" ^0

"It prices at the exact population mean of " + str(population_average_claim) + " - fair to the population. But" ^0
"only risks above " + str(price_round_one) + " buy, the pool averages " + str(pool_average_round_one) + " and loses " + str(loss_per_policy_round_one) + " a policy; repricing to" ^0
"" + str(price_round_two) + " leaves a pool averaging " + str(pool_average_round_two) + ", and by round three " + str(buyers_round_three) + " of " + str(customers) + " are covered, until" ^0
"the price is set on the pool that buys or the pool is made the population." ^0

Python (deterministic transpilation)

python
customers = 100
lowest_expected_claim = 1
highest_expected_claim = 100
population_average_claim = int((lowest_expected_claim + highest_expected_claim) / 2)
price_round_one = population_average_claim
lowest_risk_that_buys_round_one = price_round_one + 1
buyers_round_one = highest_expected_claim - price_round_one
pool_average_round_one = int((lowest_risk_that_buys_round_one + highest_expected_claim) / 2)
loss_per_policy_round_one = pool_average_round_one - price_round_one
price_round_two = pool_average_round_one
lowest_risk_that_buys_round_two = price_round_two + 1
buyers_round_two = highest_expected_claim - price_round_two
pool_average_round_two = int((lowest_risk_that_buys_round_two + highest_expected_claim) / 2)
loss_per_policy_round_two = pool_average_round_two - price_round_two
price_round_three = pool_average_round_two
buyers_round_three = highest_expected_claim - price_round_three
population_still_covered_per_myriad = int(buyers_round_three * 10000 / customers)
print("customers                       : " + str(customers) + ", expected claims " + str(lowest_expected_claim) + " to " + str(highest_expected_claim))
print("population average claim        : " + str(population_average_claim))
print("")
print("round one, price                : " + str(price_round_one))
print("  who buys                      : risks " + str(lowest_risk_that_buys_round_one) + " to " + str(highest_expected_claim) + ", " + str(buyers_round_one) + " customers")
print("  average claim of the pool     : " + str(pool_average_round_one))
print("  loss per policy               : " + str(loss_per_policy_round_one))
print("round two, price                : " + str(price_round_two))
print("  who buys                      : risks " + str(lowest_risk_that_buys_round_two) + " to " + str(highest_expected_claim) + ", " + str(buyers_round_two) + " customers")
print("  average claim of the pool     : " + str(pool_average_round_two))
print("  loss per policy               : " + str(loss_per_policy_round_two))
print("round three, price              : " + str(price_round_three) + ", buyers " + str(buyers_round_three))
print("population still covered        : " + str(population_still_covered_per_myriad) + " per ten thousand")
print("")
print("the average-cost price")
print("  each customer's expected claim : known exactly")
print("  price : the honest mean over all " + str(customers))
print("  fairness : nobody charged above the population average")
print("  intent : a fair price that covers the claims")
print("  customers mispriced relative to the population : 0")
print("  verdict : THE PRICE EQUALS THE AVERAGE CLAIM")
print("")
print("  computing the exact population mean is the part done")
print("  right here, and it is why the price would cover the")
print("  claims if everyone bought")
print("")
print("the customer's decision")
print("  a customer with risk below " + str(price_round_one) + " : pays more than their")
print("    expected claim, declines")
print("  a customer with risk above " + str(price_round_one) + " : pays less than their")
print("    expected claim, buys")
print("  so the pool : is the top half, averaging " + str(pool_average_round_one))
print("  the price that covered the population : loses " + str(loss_per_policy_round_one) + " per")
print("    policy on the pool")
print("  repricing to " + str(price_round_two) + " : repeats it - the pool is the top")
print("    quarter, averaging " + str(pool_average_round_two))
print("")
print("the spiral")
print("  buyers by round : " + str(customers) + " assumed, " + str(buyers_round_one) + ", " + str(buyers_round_two) + ", " + str(buyers_round_three))
print("  is the average miscomputed : no; each mean is exact")
print("  does the average price cover the average customer : yes,")
print("    and the average customer does not buy")
print("  does it cover the customers who buy : no; they are the")
print("    ones for whom it was a bargain")
print("")
nc_loss_per_policy_at_the_population_average = 25
nc_loss_per_policy_when_the_pool_is_the_population = 0
nc_customers_covered_when_the_pool_is_the_population = 100
print("null control - price the pool that buys, or make the pool the population")
print("  loss per policy, average price, self-selected pool : " + str(nc_loss_per_policy_at_the_population_average))
print("  loss per policy, pool equals population : " + str(nc_loss_per_policy_when_the_pool_is_the_population))
print("  customers covered, pool equals population : " + str(nc_customers_covered_when_the_pool_is_the_population))
print("  no risk and no claim changed; the price stopped selecting")
print("  the people it would lose money on")
print("")
print("what a population-average price guarantees")
print("  the price equals the mean expected claim of everyone :")
print("    exactly, every risk known, honest mean")
print("  the price covers the claims of the buyers : not addressed;")
print("    the average is a bargain only above it, so the pool is")
print("    the top half at " + str(pool_average_round_one) + ", then the top quarter at " + str(pool_average_round_two) + ",")
print("    and " + str(population_still_covered_per_myriad) + " per ten thousand of the population is covered by round three")
print("")
print("a price set on everyone is accepted only by those it undercharges, and the")
print("average of those who accept is higher than the average it was set on; each")
print("correction chases a pool that moves away as fast as the price approaches it")
print("")
print("It prices at the exact population mean of " + str(population_average_claim) + " - fair to the population. But")
print("only risks above " + str(price_round_one) + " buy, the pool averages " + str(pool_average_round_one) + " and loses " + str(loss_per_policy_round_one) + " a policy; repricing to")
print("" + str(price_round_two) + " leaves a pool averaging " + str(pool_average_round_two) + ", and by round three " + str(buyers_round_three) + " of " + str(customers) + " are covered, until")
print("the price is set on the pool that buys or the pool is made the population.")

stdout (executed)

text
customers                       : 100, expected claims 1 to 100
population average claim        : 50

round one, price                : 50
  who buys                      : risks 51 to 100, 50 customers
  average claim of the pool     : 75
  loss per policy               : 25
round two, price                : 75
  who buys                      : risks 76 to 100, 25 customers
  average claim of the pool     : 88
  loss per policy               : 13
round three, price              : 88, buyers 12
population still covered        : 1200 per ten thousand

the average-cost price
  each customer's expected claim : known exactly
  price : the honest mean over all 100
  fairness : nobody charged above the population average
  intent : a fair price that covers the claims
  customers mispriced relative to the population : 0
  verdict : THE PRICE EQUALS THE AVERAGE CLAIM

  computing the exact population mean is the part done
  right here, and it is why the price would cover the
  claims if everyone bought

the customer's decision
  a customer with risk below 50 : pays more than their
    expected claim, declines
  a customer with risk above 50 : pays less than their
    expected claim, buys
  so the pool : is the top half, averaging 75
  the price that covered the population : loses 25 per
    policy on the pool
  repricing to 75 : repeats it - the pool is the top
    quarter, averaging 88

the spiral
  buyers by round : 100 assumed, 50, 25, 12
  is the average miscomputed : no; each mean is exact
  does the average price cover the average customer : yes,
    and the average customer does not buy
  does it cover the customers who buy : no; they are the
    ones for whom it was a bargain

null control - price the pool that buys, or make the pool the population
  loss per policy, average price, self-selected pool : 25
  loss per policy, pool equals population : 0
  customers covered, pool equals population : 100
  no risk and no claim changed; the price stopped selecting
  the people it would lose money on

what a population-average price guarantees
  the price equals the mean expected claim of everyone :
    exactly, every risk known, honest mean
  the price covers the claims of the buyers : not addressed;
    the average is a bargain only above it, so the pool is
    the top half at 75, then the top quarter at 88,
    and 1200 per ten thousand of the population is covered by round three

a price set on everyone is accepted only by those it undercharges, and the
average of those who accept is higher than the average it was set on; each
correction chases a pool that moves away as fast as the price approaches it

It prices at the exact population mean of 50 - fair to the population. But
only risks above 50 buy, the pool averages 75 and loses 25 a policy; repricing to
75 leaves a pool averaging 88, and by round three 12 of 100 are covered, until
the price is set on the pool that buys or the pool is made the population.

Trace event types

eml:run:starteml:assigneml:outputeml:run:done