Tool to verify the Benford's law : test numerical data (numbers) whether they are random or not. This test is used in particular for the detection of fraud, such as accounting or finance.
Benford's Law - dCode
Tag(s) : Statistics, Data Processing
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
Benford's law states that in the majority of natural collections of numbers (ie. lists of numbers derived from reality and not created artificially), the first significant digit is usually small. This law applies very well to numbers representing orders of magnitude: prices, populations, lengths, etc.
The digit 0 is excluded because it is not significant. The law therefore applies to numbers between 1 and 9.
Mathematically the probability that a digit is the first significant digit of a number in a collection of numbers can be described by the formula:
$$ P(d)=\log_{10} \left(1+\frac{1}{d}\right) $$
The corresponding percentages are:
x | P(x) |
---|---|
1 | 0.301 (30.1%) |
2 | 0.176 (17.6%) |
3 | 0.125 (12.5%) |
4 | 0.097 (9.7%) |
5 | 0.079 (7.9%) |
6 | 0.067 (6.7%) |
7 | 0.058 (5.8%) |
8 | 0.051 (5.1%) |
9 | 0.046 (4.6%) |
A priori, any distribution of digits too much away from these numbers is not natural, thus abnormal.
dCode uses the Chi2 test (χ²). Enter the data in the text box, dCode will calculate the frequency of occurrence of the first significant digits.
dCode considers that the data are correlated with the distribution of Benford's law, when the p-value is superior to 95%.
Bendord's law is used to check whether data obeying this law have not been artificially modified. If this is the case, and random numbers have been used, their distribution no longer follows Benford's law. Its main use is therefore for audits in the event of suspicion of fraud, generally in accounting or finance.
Data obeying the Benford law:
— The numbers resulting from transactions, accounting data: turnover, refunds, sales, excel tables, etc.
— Results of addition, multiplication or exponentiation
Example: Fibonacci numbers, powers, factorials, etc.
Data not obeying the Benford law:
— Sequential numbers: street numbers, invoices, etc.
— Significant numbers, ie. numbers that contents is defined by a nomenclature (for example: card number), or whose value is defined by human thinking (for example: a price of $9.99)
— Numbers coming from a collection limited by a minimum or a maximum or another criterion that can introduce a statistical bias.
Example: During elections, the data from the ballot boxes for the constituencies do not obey Benford's law because they have been created in order to limit the total number of voters (most often between 100 and 1000), the data for each city in the country on the other hand will obey Benford's law.
dCode retains ownership of the "Benford's Law" source code. Except explicit open source licence (indicated Creative Commons / free), the "Benford's Law" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Benford's Law" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Benford's Law" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.
The copy-paste of the page "Benford's Law" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Benford's Law on dCode.fr [online website], retrieved on 2024-11-18,