mariuscomper.uk Română

Public procurement · SEAP data 2022–2024 · a century-old statistical law

Romania’s direct public purchases and Benford’s law: what the first-digit test sees and what it misses

In the fourth quarter of 2023, Romanian public authorities awarded 594,448 direct purchases of goods and services (SEAP data published by the Authority for Digitalisation). 30.4% of their amounts start with the digit 1, almost exactly what Benford’s law predicts. The legal cap, which cuts the amounts off sharply at 135,060 lei and, from 10 September 2022, at 270,120, shows plainly in the amounts. In the digits, quarters differ by half a percentage point at most.

In a set of numbers that follows Benford’s law, the digit 1 opens 30.1% of them and the digit 9 only 4.6%. Many sets spanning several orders of magnitude follow it. Auditors use it as a first filter; a good fit does not show that the amounts are sound. Here it meets Romanian public data, with the data, formulas and scripts in the open. (Lei is the Romanian currency; SEAP is the national electronic public-procurement system.)

594,448direct purchases of goods and services in Q4 2023
30.4% / 30,1%start with the digit 1: in the data / by the law
90%are under 10,000 lei; the 270,120-lei cap cuts only the top end

One quarter of direct purchases: the cap shows in the amounts, not in the digits

A direct purchase is a public purchase without a tender, allowed when the estimated value, without VAT, is under a cap; the law still requires publicity, through the electronic catalogue or a notice. Until 9 September 2022 the cap for goods and services was 135,060 lei; from 10 September 2022 it is 270,120 (Law 208/2022). Romania’s Authority for Digitalisation publishes quarterly exports from the electronic procurement system on data.gov.ro.

Below, the same purchases seen two ways. Left: how many sit at each amount, between 100,000 and 400,000 lei. Right: which digit their amounts start with. Pick a quarter; the cap moves, the digits stay.

The amounts, by bin

The first digit of the same amounts

  • in the data
  • Benford's law
  • chance band (±2σ) for the size of the set

Q4 2023: 594,448 direct purchases of goods and services; the first digit is 1 in 30.4% of them; MAD 0.0018.

Sources: SEAP exports on data.gov.ro (Q1 2022, Q4 2023, Q2 2024), the "awarded value" column, accepted offers only, duplicates removed. Different quarters: compare the shape, not the volume. Values are as published; the legal cap is stated without VAT and the drop sits exactly at it.

Why the cap does not show in the digits

Two reasons. First, the cap cuts only the top end of the amounts: in Q4 2023, 90% of the awards are under 10,000 lei. The first digit follows the size of the need: a 150-lei toner cartridge, 37,000 lei of firewood, a 2,500-lei service. A register is a mixture of needs at very different scales, and such a mixture can come close to the law (a plausible explanation, not a proof for this register).

The second reason: a small adjustment near the cap often leaves the first digit unchanged. 269,999 and 270,000 both start with 2, just as 135,000 and 134,999 start with 1. The cap does leave its mark in the amounts. In Q1 2022, 448 awards are exactly 135,000 lei, and 211 fall from 135,060 to 270,119 lei. In Q4 2023 there are 3,625 in that interval and 165 at exactly 270,000 lei; in Q2 2024, 4,755 and 268. The first digit moves between quarters by at most 0.5 percentage points. Amounts above the general cap exist too (279 in Q1 2022, 149 in Q4 2023, 263 in Q2 2024); I did not look into why: possible explanations are a different rule for some entities, amounts entered with VAT, or entry errors.

In Q2 2024 the 132,500–135,000 bin holds 780 awards, against 293 and 202 in its neighbours; three repeated amounts (134,397, 134,331, 134,375) account for 129. I did not look into where they come from.

Counting the amounts that sit exactly under a threshold in the electronic catalogue is the subject of One leu below the line. The question here is different: what the first digit can say about them.

The digit table, Q4 2023
First digit, Q4 2023
DigitAwardsShareLaw
1180,46030.4%30.1%
2107,05818.0%17.6%
373,08912.3%12.5%
457,8369.7%9.7%
545,9997.7%7.9%
638,4716.5%6.7%
733,2225.6%5.8%
831,1675.2%5.1%
927,1464.6%4.6%

Why would amounts start with 1 more often than with 9?

Because on a logarithmic ruler the digit 1 has the longest segment. From 1 to 2 is 30.1% of the ruler’s length; from 9 to 10, only 4.6%. A number growing by a fixed percentage spends equal time on each centimetre of ruler, so it lands most often in the long segment. The formula is P(d) = log₁₀(1 + 1/d).

130.1%217.6%312.5%49.7%57.9%66.7%75.8%85.1%94.6%12345678910
Each segment’s length, in percent, is that digit’s share by the law.

The mechanism can be watched. The number below starts at 1 and grows by 8% at each step, like compound interest; the bars count the digit each step stood on.

calculation, not data

1,00step 0
After 300 steps, the digit 1 led in 30.6% of them and the digit 9 in 4.3%; the law: 30.1% and 4.6%.

Simon Newcomb noticed the pattern in 1881 from the wear on the pages of a logarithm table. Frank Benford checked it in 1938 on 20,229 values from 20 lists (river areas, populations, costs). Theodore Hill showed in 1995 that mixtures of distributions, sampled without favouring any one scale, tend toward the same law.

Where the test fails: same formulas, other sets of numbers

Distance from the law is measured by the mean absolute deviation (MAD): the average gap between each digit’s share and the law. Mark Nigrini, who wrote the auditors’ handbook, proposes the cut-offs 0.006 (close conformity), 0.012 (acceptable) and 0.015 (marginal). The dashed line on each row shows the MAD a perfect series of that size would average: 0.0159 at 217 values, 0.0003 at 594,448. A MAD near the dashed line is what a perfect series would give too; one far beyond it shows a real gap.

low MAD: near the lawlog scale, 0.0003 to 0.3high MAD: far

  • green zone: under 0.006
  • amber: up to 0.015
  • red: above
  • dashed line: the average MAD of a perfect series of the same size; a dot a little beyond it can still be chance (GDP, p = 0.22)

Three lessons from the chart above

The size of the set changes everything. Country populations (217 values) have a MAD of 0.0152, above 0.015, but a perfect series of 217 values would average 0.0159: the gap is within chance (p = 0.50). Nigrini’s cut-offs are empirical conventions, not tests calibrated to the size of the set. At 594,448 rows it is the other way round: even a small gap like the one observed here (MAD 0.0018) gives p below 10⁻⁴⁰, so what counts is the size of the gap, not p.

A set that does not span several scales has no reason to follow the law. The 3,181 communes, towns and cities (88 to 1,716,961 residents at the 2021 census) are 89% between 1,000 and 10,000 residents. The digit 2 opens 25.5% of them, against 17.6% by the law (MAD 0.030). Life expectancy, between 54 and 86 years, starts only with 5, 6, 7 or 8.

Small sets come out further. Subsequent contracts (n = 85,504) have a MAD of 0.0025, framework agreements (n = 27,429) 0.0055, direct purchases of works (n = 13,669) 0.0053: all under 0.006, but further from the dashed line than the direct register. The value of a framework agreement is often an estimate, not a payment; the three contract types are counted separately, never pooled. Rows with the same authority, number, lot and value (usually one framework agreement listed once per supplier) count once; I did not test counting each supplier.

What the human hand leaves: the last digits

The first digit shows the size of the need. The last digits show how the amount was written. In a natural process the last digit would be close to uniform: 10% each. In procurement it is not.

Q4 2023: of 530,816 whole-lei amounts above 100, 34.1% end in 0 and 9.8% in 5; each other digit has 6 to 8%. Of the whole-lei amounts above 1,000 (291,839), 9.0% are multiples of 1,000 and 21.2% of 100. If the last digits were uniform, it would be 0.1% and 1%.

Whole-lei amounts above 100, direct purchases of goods and services.

Round prices are natural: people ask for and offer 2,500 lei, not 2,487. In a register like this they prove nothing about any single contract. They only show where the human hand leaves its print, and that the print is not in the first digit.

How much would have to change before the verdict moves?

The test measures the shape of the whole register. For the MAD verdict to move, many rows must change their first digit. Set below how many awards change their first digit: how many would it take to push the Q4 2023 MAD (0.0018) out of "close conformity"? At least 11,169 of 594,448, or 1.9%, however the moves are chosen. If all of them move from digit 1 to digit 9, as in the chart, it takes 12,737.

0

A hundred awards of 2xx,xxx lei brought to exactly 270,000, or a thousand, move nothing here: they keep their digit 2. What piles up under a threshold shows in the exact values, not in the digits.

By authority: why a traffic light would raise false alarms

1,016 authorities have at least 110 direct purchases in Q4 2023, enough for every digit to have at least 5 expected occurrences. Of these, 310 (30.5%) deviate from the law by more than chance allows at the 5% level, and 117 (11.5%) at the 0.1% level. A perfect register would give 5% and 0.1%. Each dot is one authority, unnamed; the test assumes independent values, and repeated purchases by one authority are not always that; the grey dots are the 3,003 authorities with between 30 and 109 purchases, too few to judge; the red curve is the average MAD of a perfect series. The amber and red dots are those that exceed chance.

A school that buys only textbooks or a town hall that buys only fuel probably buys on a narrow scale, so it is unlikely to follow the law. A plausible explanation for the deviations is what each authority buys; I did not test it. A "deviating" row is not a finding about an authority. That is why no name appears on this page.

Your numbers: the real sets above, or your own

Paste at least 20 positive values (amounts, populations, lengths) or pick a real set. The page shows the first digit with the chance band for your sample size, the MAD, what a perfect series would give, and warns when the law has no reason to apply. Nothing leaves your browser.

    What the test cannot show

    • It neither proves nor rules out fraud. A series with doctored amounts can follow the law, and an honest authority buying one category may not.
    • It cannot see movement inside a digit: 269,999 or 270,000, 121 or 120 lei under the 270,120 cap.
    • The MAD classification does not change until at least 1.9% of the rows change their first digit (11,169 awards in a quarter). The χ² test rejects any tiny gap at this many rows anyway.
    • Three quarters (Q1 2022, Q4 2023, Q2 2024), fixed before the calculation, not the whole year. Q4 2023 and Q2 2024 differ by at most 0.13 percentage points on any digit.
    • Values are as published. I dropped zero or negative amounts (1,512 in Q4 2023, 6,296 in Q2 2024) and malformed rows (27 and 31); the export format differs from one quarter to the next. I did not check individual contracts.

    What I predicted before seeing the data

    Wrong Published contracts fit the law better than direct purchases. By effect size (w), direct purchases are closer: 0.019, against 0.031 for subsequent contracts, 0.063 for framework agreements and 0.054 for contracts without a framework agreement.
    Wrong Direct purchases do not conform, with MAD above 0.015, in every window. In fact their MAD is under 0.006 in all three.
    Right, on the counts The share of awards from 135,060 lei up is 0.05% in Q1 2022, 0.63% in Q4 2023 and 0.84% in Q2 2024. The other half of the prediction, a notch moving along the ruler, was not evaluated.
    Not refuted The homogeneity test does not reject equal digits in Q4 2023 and Q2 2024 (χ², p = 0.09, largest gap 0.13 percentage points). Q1 2022 differs from Q4 2023 (p below 0.001), but the effect is small: w = 0.009, at most 0.46 points on one digit.

    Sources, and how to repeat the calculation

    1. Romania’s Authority for Digitalisation, Public procurement 2022, 2023, 2024 (SEAP exports, CC BY 4.0). The files used, with SHA-256, are in the manifest.
    2. Law 208/2022, Official Gazette no. 697 of 12 July 2022, applicable from 10 September 2022: text on the ANAP site (in Romanian); the consolidated Law 98/2016, art. 7.
    3. World Bank indicators SP.POP.TOTL, AG.SRF.TOTL.K2, NY.GDP.MKTP.CD, SP.DYN.LE00.IN; regional aggregates excluded.
    4. INS (Romania’s statistics institute), 2021 Population and Housing Census (recensamantromania.ro): residents per administrative unit, 3,181 units.
    5. Mark J. Nigrini, Benford’s Law: Applications for Forensic Accounting, Auditing, and Fraud Detection, Wiley, 2012 (the MAD cut-offs); Simon Newcomb, American Journal of Mathematics, 1881; Frank Benford, Proceedings of the American Philosophical Society, 1938; Theodore P. Hill, Statistical Science, 1995.

    The calculation has four steps, each with its own script: downloading the eight exports, reading them row by row, counting the control sets, and computing the numbers on the page. The rules (column, filters, deduplication, statistic) were written in the pre-registration before the first histogram; changes after that are listed there. All files: /reproduce/.

    Every set

    SetValuesMADMAD of a perfect seriesEffect size wp (χ², 8 df)
    Direct purchases, goods and services, Q4 2023594,4480.00180.00030.019below 0.001
    Direct purchases, goods and services, Q2 2024597,2870.00140.00030.015below 0.001
    Direct purchases, goods and services, Q1 2022532,9220.00080.00030.008below 0.001
    Subsequent contracts (framework agreements), Q4 202385,5040.00250.00080.031below 0.001
    Framework agreements, Q4 202327,4290.00550.00140.063below 0.001
    Contracts without a framework agreement, Q4 202311,3870.00530.00220.054below 0.001
    Subsequent contracts, Q2 202482,7880.00320.00080.033below 0.001
    Framework agreements, Q2 202431,9810.00350.00130.042below 0.001
    Contracts without a framework agreement, Q2 202414,2090.00400.00200.046below 0.001
    Subsequent contracts, Q1 2022126,1330.00150.00070.020below 0.001
    Framework agreements, Q1 202237,9670.00310.00120.037below 0.001
    Contracts without a framework agreement, Q1 20229,7230.00970.00240.101below 0.001
    Direct purchases of works, Q4 202313,6690.00530.00200.080below 0.001
    Direct purchases of works, Q2 202414,8840.00780.00190.104below 0.001
    Direct purchases of works, Q1 20229,0030.00970.00250.104below 0.001
    Direct purchases, goods and services, Q3 2023 (different export layout)512,9830.00140.00030.016below 0.001
    Country populations, 20242170.01520.01590.1840.50
    Country surface areas, 20232150.00580.01600.0731.00
    Country GDP, 20242000.01820.01660.2310.22
    Residents of Romania's communes, towns and cities, 20213,1810.02990.00420.332below 0.001
    Life expectancy at birth, 20232170.17690.01592.213below 0.001
    Fibonacci numbers, terms 3 to 2001980.00520.01670.0621.00

    MAD: the mean of the nine absolute gaps between a digit’s share and Benford’s law. w: the square root of χ²/n, an effect size that does not grow with n. p: the probability that a perfect series would deviate at least this much (χ², 8 degrees of freedom); with hundreds of thousands of rows it comes close to zero even for small gaps.

    More on this site