DEN Discussion List Archive
[Date Prev][Date Next][Date Index]
[Thread Index]
[Author Index]
Re: Benford's Law
- Subject: Re: Benford's Law
- From: Myron Tribus <mtribus@home.com>
- Date: Fri, 1 Dec 2000 20:41:46 -0800
At 4:54 PM -0500 11/30/00, Kromkowski@aol.com wrote:
>Any thoughts about the use of Benford's law to ferret out faked data. (<A
>HREF="http://www.newscientist.com/ns/19990710/thepowerof.html">The Power of
>One</A> is a quick and dirty summary of its use.)
Prompted by John's post, I wrote the following program in True BAsic
to generate a set of numbers
========= begin program ==========
dim X(1000), y(1000), z$(1000), N(0:9), LDigit(1000), p(0:9)
for i = 1 to 1000 ! Generate 1000 pairs of numbers
let x(i) = rnd ! from table of random nbrs
let y(i) = rnd
let z$(i) = str$(int(100000 * X(i) * Y(i))) ! Take their product
let LDigit(i) = int(val(z$(i)(1:1))) ! and look at the leading digit
let N(LDigit(i)) = N(LDigit(i)) + 1 ! count number of times
next i !
this LDigit occurs
for i = 0 to 9
let p(i) = N(i)/1000 ! compute the fraction
print p(i);","; ! display result
next i
end
============== end program =======
RESULT:
! 0 , .271 , .195 , .134 , .108 , .093 , .077 , .053 , .04 , .029
Prediction of Benford's law
.30, 176 -----left for student exercise --- .046
Not bad, eh?
Try multiplying two large numbers together and you will see why the
leading digit is more likely to be a "1" than a "9".
Myron Tribus, 350 Britto Terrace, Fremont, CA 94539
Ph:510 651 3641 Fax: 510 656 9875 e-mail: mtribus@home.com
(Quality Consultant's Prayer) Dear Lord, grant me patience. RIGHT NOW!
DEN Home |
Main Index |
Thread Index |
Author Index