Giter VIP home page Giter VIP logo

benford's Introduction

Illustrate Benford's law: In random / naturally occurring distributions, numbers that start with "1" are more common than other numbers (following a downsloping scale to "9.")

Idea: generate a bunch of random distributions, and then draw random numbers from those distributions. Those distributions are more likely to include numbers starting with "1", because drawing a top of "1999" is as likely as drawing a top of "9999" but of course the former has many more numbers starting with "1."

result:

/tmp/benford$ make
g++ -g -Wall -o benford -O1 benford.cpp
./benford
[0] =        0
[1] =   246070
[2] =   171387
[3] =   137249
[4] =   112211
[5] =    96732
[6] =    81642
[7] =    65368
[8] =    53049
[9] =    36292

jwatte 20201013

benford's People

Contributors

jwatte avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.