From Wikipedia, Benford's Law is an observation that in many real-life sets of numerical data, the leading digit is likely to be small. In sets that obey the law, the number 1 appears as the leading significant digit about 30% of the time, while 9 appears as the leading significant digit less than 5% of the time.
Here's a graph generated from the publicly available data of surface area of countries:
Optionally set up a Virtual Environment if you need by:
$ python3 -m venv .venv
$ source .venv/bin/activateInstall the dependencies by:
$ pip3 install -r requirements.txtRun:
$ python3 benford.pyThe script uses a publicly available data from this repository. You can try out different data available in the repository, or any other data source.
Copyright (c) 2023 Vishnu Haridas
This software is published under MIT License. See LICENSE.md for more details.
