<!-- canonical: efficientnewlanguage.org/ai/examples/932-one-in-ten-thousand-per-transaction-was-a-hundred-a-day | ai_layer_version: 0.1.0 | updated: 2026-09-20 -->

# Example 932 — One in ten thousand per transaction was a hundred a day

`one_in_ten_thousand_per_transaction_was_a_hundred_a_day.eml` - A payment step fails one time in ten thousand, the rate is real and well measured, and the failure is filed as rare and left unhandled. How often a rare thing happens to a busy system is computed below.

## EML

```eml
# Self-authored for the EML case corpus (no external origin). A payment step
# fails one time in ten thousand, the rate is real and well measured, and the
# failure is filed as rare and left unhandled. How often a rare thing happens
# to a busy system is computed below.
#
# The classification is careful. The rate is measured on real traffic; one in
# ten thousand is genuinely small; the failure mode is correctly described; and
# the intent is exactly 'is this worth handling'.
#
# The system does a million transactions a day, so a one-in-ten-thousand
# failure is a hundred failures a day, three thousand a month - rare per
# transaction and routine per system.

1 => failures_per_ten_thousand_transactions
10000 => transactions_per_failure
1000000 => transactions_per_day
30 => days_per_month
20 => minutes_of_support_per_failure

int(transactions_per_day / transactions_per_failure) => failures_per_day
failures_per_day * days_per_month => failures_per_month
failures_per_month * minutes_of_support_per_failure => support_minutes_per_month
int(support_minutes_per_month / 60) => support_hours_per_month
int(24 * 60 / failures_per_day) => minutes_between_failures

"failure rate                    : " + str(failures_per_ten_thousand_transactions) + " per ten thousand transactions" ^0
"transactions per day            : " + str(transactions_per_day) ^0
"" ^0
"failures per day                : " + str(failures_per_day) ^0
"minutes between failures        : " + str(minutes_between_failures) ^0
"failures per month              : " + str(failures_per_month) ^0
"support hours per month         : " + str(support_hours_per_month) + " (at " + str(minutes_of_support_per_failure) + " minutes each)" ^0
"" ^0

# ---- what the classification verified ----

"the rare-failure classification" ^0
"  rate : measured on real traffic" ^0
"  magnitude : one in ten thousand, genuinely small" ^0
"  description : the failure mode, correctly stated" ^0
"  intent : is this worth handling" ^0
"  facts wrong : 0" ^0
"  verdict : RARE, LEAVE IT" ^0
"" ^0
"  measuring the real per-transaction rate is the part done" ^0
"  right here, and it is why one in ten thousand is a true" ^0
"  statement about any single transaction" ^0
"" ^0

# ---- how often rare happens to a busy system ----

"rate times volume" ^0
"  per transaction : one in " + str(transactions_per_failure) ^0
"  transactions a day : " + str(transactions_per_day) ^0
"  so failures a day : " + str(failures_per_day) + ", one every " + str(minutes_between_failures) + " minutes" ^0
"  what 'rare' described : a transaction's view" ^0
"  what the system sees : a steady stream" ^0
"" ^0

# ---- what the team got ----

"the unhandled failure" ^0
"  events per month : " + str(failures_per_month) ^0
"  support time per month : " + str(support_hours_per_month) + " hours" ^0
"  is the rate wrong : no" ^0
"  is a small rate a small number of events : only at a" ^0
"    small volume, and the volume is a million" ^0
"" ^0

# ---- null control ----

# The same decision made on expected events per day (rate times volume)
# instead of on the per-transaction rate alone.
1 => nc_events_the_rate_alone_suggests_per_day
100 => nc_events_rate_times_volume_gives_per_day
1 => nc_failure_now_handled

"null control - decide on rate times volume" ^0
"  events per day, reading the rate alone : about " + str(nc_events_the_rate_alone_suggests_per_day) ^0
"  events per day, rate times volume : " + str(nc_events_rate_times_volume_gives_per_day) ^0
"  failure now handled : " + str(nc_failure_now_handled) ^0
"  no rate and no traffic changed; the decision stopped" ^0
"  looking at the fraction and started looking at the count" ^0
"" ^0

# ---- the rule ----

"what a well-measured per-transaction rate guarantees" ^0
"  any one transaction fails one time in ten thousand :" ^0
"    exactly, measured on real traffic" ^0
"  the failure is rare for the system : not addressed; at" ^0
"    " + str(transactions_per_day) + " transactions a day it is " + str(failures_per_day) + " failures a day, " + str(failures_per_month) ^0
"    a month, " + str(support_hours_per_month) + " hours of support" ^0
"" ^0

"rarity is a ratio and a count is a ratio times a volume; what almost never" ^0
"happens to any one of a million things happens to a hundred of them every" ^0
"day, and a system lives in the count" ^0
"" ^0

"One in ten thousand is right for every transaction - measured on real traffic." ^0
"But there are " + str(transactions_per_day) + " a day, so the rare failure is " + str(failures_per_day) + " failures a day," ^0
"one every " + str(minutes_between_failures) + " minutes, " + str(failures_per_month) + " a month and " + str(support_hours_per_month) + " hours of support, until the" ^0
"decision is made on the count and not the fraction." ^0
```

## Python (deterministic transpilation)

```python
failures_per_ten_thousand_transactions = 1
transactions_per_failure = 10000
transactions_per_day = 1000000
days_per_month = 30
minutes_of_support_per_failure = 20
failures_per_day = int(transactions_per_day / transactions_per_failure)
failures_per_month = failures_per_day * days_per_month
support_minutes_per_month = failures_per_month * minutes_of_support_per_failure
support_hours_per_month = int(support_minutes_per_month / 60)
minutes_between_failures = int(24 * 60 / failures_per_day)
print("failure rate                    : " + str(failures_per_ten_thousand_transactions) + " per ten thousand transactions")
print("transactions per day            : " + str(transactions_per_day))
print("")
print("failures per day                : " + str(failures_per_day))
print("minutes between failures        : " + str(minutes_between_failures))
print("failures per month              : " + str(failures_per_month))
print("support hours per month         : " + str(support_hours_per_month) + " (at " + str(minutes_of_support_per_failure) + " minutes each)")
print("")
print("the rare-failure classification")
print("  rate : measured on real traffic")
print("  magnitude : one in ten thousand, genuinely small")
print("  description : the failure mode, correctly stated")
print("  intent : is this worth handling")
print("  facts wrong : 0")
print("  verdict : RARE, LEAVE IT")
print("")
print("  measuring the real per-transaction rate is the part done")
print("  right here, and it is why one in ten thousand is a true")
print("  statement about any single transaction")
print("")
print("rate times volume")
print("  per transaction : one in " + str(transactions_per_failure))
print("  transactions a day : " + str(transactions_per_day))
print("  so failures a day : " + str(failures_per_day) + ", one every " + str(minutes_between_failures) + " minutes")
print("  what 'rare' described : a transaction's view")
print("  what the system sees : a steady stream")
print("")
print("the unhandled failure")
print("  events per month : " + str(failures_per_month))
print("  support time per month : " + str(support_hours_per_month) + " hours")
print("  is the rate wrong : no")
print("  is a small rate a small number of events : only at a")
print("    small volume, and the volume is a million")
print("")
nc_events_the_rate_alone_suggests_per_day = 1
nc_events_rate_times_volume_gives_per_day = 100
nc_failure_now_handled = 1
print("null control - decide on rate times volume")
print("  events per day, reading the rate alone : about " + str(nc_events_the_rate_alone_suggests_per_day))
print("  events per day, rate times volume : " + str(nc_events_rate_times_volume_gives_per_day))
print("  failure now handled : " + str(nc_failure_now_handled))
print("  no rate and no traffic changed; the decision stopped")
print("  looking at the fraction and started looking at the count")
print("")
print("what a well-measured per-transaction rate guarantees")
print("  any one transaction fails one time in ten thousand :")
print("    exactly, measured on real traffic")
print("  the failure is rare for the system : not addressed; at")
print("    " + str(transactions_per_day) + " transactions a day it is " + str(failures_per_day) + " failures a day, " + str(failures_per_month))
print("    a month, " + str(support_hours_per_month) + " hours of support")
print("")
print("rarity is a ratio and a count is a ratio times a volume; what almost never")
print("happens to any one of a million things happens to a hundred of them every")
print("day, and a system lives in the count")
print("")
print("One in ten thousand is right for every transaction - measured on real traffic.")
print("But there are " + str(transactions_per_day) + " a day, so the rare failure is " + str(failures_per_day) + " failures a day,")
print("one every " + str(minutes_between_failures) + " minutes, " + str(failures_per_month) + " a month and " + str(support_hours_per_month) + " hours of support, until the")
print("decision is made on the count and not the fraction.")
```

## stdout (executed)

```text
failure rate                    : 1 per ten thousand transactions
transactions per day            : 1000000

failures per day                : 100
minutes between failures        : 14
failures per month              : 3000
support hours per month         : 1000 (at 20 minutes each)

the rare-failure classification
  rate : measured on real traffic
  magnitude : one in ten thousand, genuinely small
  description : the failure mode, correctly stated
  intent : is this worth handling
  facts wrong : 0
  verdict : RARE, LEAVE IT

  measuring the real per-transaction rate is the part done
  right here, and it is why one in ten thousand is a true
  statement about any single transaction

rate times volume
  per transaction : one in 10000
  transactions a day : 1000000
  so failures a day : 100, one every 14 minutes
  what 'rare' described : a transaction's view
  what the system sees : a steady stream

the unhandled failure
  events per month : 3000
  support time per month : 1000 hours
  is the rate wrong : no
  is a small rate a small number of events : only at a
    small volume, and the volume is a million

null control - decide on rate times volume
  events per day, reading the rate alone : about 1
  events per day, rate times volume : 100
  failure now handled : 1
  no rate and no traffic changed; the decision stopped
  looking at the fraction and started looking at the count

what a well-measured per-transaction rate guarantees
  any one transaction fails one time in ten thousand :
    exactly, measured on real traffic
  the failure is rare for the system : not addressed; at
    1000000 transactions a day it is 100 failures a day, 3000
    a month, 1000 hours of support

rarity is a ratio and a count is a ratio times a volume; what almost never
happens to any one of a million things happens to a hundred of them every
day, and a system lives in the count

One in ten thousand is right for every transaction - measured on real traffic.
But there are 1000000 a day, so the rare failure is 100 failures a day,
one every 14 minutes, 3000 a month and 1000 hours of support, until the
decision is made on the count and not the fraction.
```

## Round-trip

`ok: true` — round-trip fixpoint reached (python1 == python2)

## Trace event types

eml:run:start · eml:assign · eml:output · eml:run:done
