[Jprogramming] Benford's law
Linda Alvord
lindaalvord at verizon.net
Wed May 15 05:32:25 UTC 2013
Here's the actual distribution (rather than a percentage):
newfib2=: (,{: + [: {: }:)^:((2 -~ ])`([: * 2 # ]))
FIBS=:newfib2 1000
F=:("."1) 1{."1 ":"1 |."1 ,.FIBS
$F
1000
20{.F
1 1 2 3 5 8 1 2 3 5 8 1 2 3 6 9 1 2 4 6
fd=: [: /:~ ({. , #)/.~
fd F
1 301
2 177
3 125
4 96
5 80
6 67
7 56
8 53
9 45
At the moment I've forgotten how to get the expected frequency. Maybe in
the morning...
Linda
-----Original Message-----
From: programming-bounces at forums.jsoftware.com
[mailto:programming-bounces at forums.jsoftware.com] On Behalf Of David Ward
Lambert
Sent: Tuesday, May 14, 2013 5:58 PM
To: programming
Subject: [Jprogramming] Benford's law
http://rosettacode.org/wiki/Benford%27s_law#J
When trying to recover a padlock combination my father told me to start with
1. "Most combinations start with 1."
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list