# Dual-unit quantity pairs in the Code of Federal Regulations

Federal regulations habitually write a quantity once and repeat it parenthetically in the
other measurement system: *not more than 100 mg (0.0035 ounce) of gallium*. This dataset is
every such pair in all forty-nine published titles of the eCFR, 21,807 of them,
each with the exact conversion computed from defined factors and the residual attached.

**Every row carries its own ground truth.** That is the unusual property. In an ordinary
measurement-extraction corpus somebody has to label the answers; here the regulation labels
them itself, because arithmetic decides whether the two halves of a pair agree. A system that
reads quantities out of legal text can be scored against this without any hand-labelling at
all, and the 19,419 rows where the two halves DO agree are
as useful for that as the ones where they do not.

## What the numbers came out at

| | |
|---|---|
| pairs | 21,807 |
| agree at the precision written | 19,419 |
| outside the rounding rules but within five per cent | 1,865 |
| outside both | 298 |
| not a conversion at all (an alternative, a repeated unit, a percentage) | 99 |
| read by a person, one sentence at a time | 99 |
| **judged a contradiction: two numbers that cannot both be right** | **74 rows, 66 sentences** |

## Read this before you use the verdict column

- **A verdict is about two numbers, not about a regulation.** "Contradiction" means the
  sentence as published states two values that cannot both be right. It does not say which
  is wrong, and it says nothing about whether the provision is valid or whether anyone has
  been harmed.
- **Only 99 rows were read by a person.** Those are the ones far
  enough outside any rounding to be worth reading: a quarter or more apart for an ordinary
  quantity, ten or more units of the last written place for a temperature. Every one of them
  was located in the source XML by byte offset and read whole. The rest carry the machine's
  verdict and nothing more.
- **Eighteen of the reviewed sentences turned out not to be errors**, and they are the most
  useful rows in the file. Fifteen are the numerator of a compound unit whose denominator
  arrives after the parenthetical (*37.5 kg (7.5 pounds) of combustibles per square meter*,
  which is correct per square metre against per square foot). Two are a provision restated
  whole in customary units rather than converted. One is mangled markup in the published XML.
  Their `review_note` says which, and they are what a false-positive rate looks like.
- **A unit that names more than one quantity never produces an error.** BTU names at least
  three, calorie two, horsepower three. Those rows carry `definition_dependent: true`.
- **Temperature is judged differently and the column says so.** Celsius and Fahrenheit are
  affine scales with different zeros, so the ratio of two readings is an artefact of where
  the zero was put. Temperature rows are judged on `last_place_error` instead, and a
  temperature written as a *difference* converts with no offset at all, which the
  `reading` column records as `temperature-interval`.

## Files

- `pairs.jsonl`: one JSON object per line, one per pair.
- `schema.json`: JSON Schema draft 2020-12 for a row.
- `sources.json`: where each column came from, and the licence status of each source.
- `validate.mjs`: a dependency-free validator that re-checks every row against the schema
  and re-checks the digests and row count in `manifest.json`.

## The edition

The eCFR is amended daily and govinfo builds each title on its own schedule, so this is not
"the CFR" but a specific state of it: 49 titles,
824,364,968 bytes, fetched 2026-09-13, each with its
sha256 and its govinfo build date recorded. Re-running the extractor next month will give
different numbers, and the point of recording the digests is that you can tell which.

## Reproducing it

```sh
node research/the-laws-own-arithmetic/fetch.mjs      # ~825 MB from govinfo bulkdata
node research/the-laws-own-arithmetic/extract.mjs    # about a minute
node research/the-laws-own-arithmetic/verify.mjs
```

Licence: CC0 1.0 for everything this project added. The underlying text is a work of the
United States Government and an edict of government, uncopyrightable under 17 U.S.C. 105 and
*Georgia v. Public.Resource.Org*.
