News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Ian Barber's Blog:
Benford's Law
April 05, 2011 @ 09:12:46

In a recent post to his blog Ian Barber looks at applying Benford's Law in PHP to determine if the dataset you're working with is "real" or not.

Benfords Law is not an exciting new John Nettles based detective show, but an interesting observation about the distribution of the first digit in sets of numbers originating from various processes. It says, roughly, that in a big collection of data you should expect to see a number starting with 1 about 30% of the time, but starting with 9 only about 5% of the time.

He pulls data from the data.uk.gov site to illustrate and includes a simple PHP script to run through the data looking scoring it with a "Benford" rating. He plots these on a graph along side the data to show the (almost exact) match between the data and the Benford numbers. You can find more details on the law on Wikipedia.

0 comments voice your opinion now!
benfordslaw real fake data evaluate


blog comments powered by Disqus

Similar Posts

Jim Plush\'s Blog: AJAX, PHP and Javascript Errors - How to get more data

DevShed: Centralizing the Validation of Data with the Observer Pattern in PHP

Kore Nordmann's Blog: Generating XML schemas from XML data

NetTuts.com: Best Practices When Working With Sensitive Data: Securing Your Application

Zend Developer Zone: PHP Abstract Podcast Episode 40: Data Importing


Community Events





Don't see your event here?
Let us know!


list threedevsandamaybe refactor series install code api unittest introduction framework podcast release developer interview language opinion community testing laravel wordpress

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework