[racket] a small programming exercise

From: Jos Koot (jos.koot at telefonica.net)
Date: Fri Oct 15 07:33:21 EDT 2010

 

> -----Original Message-----
> From: users-bounces at racket-lang.org 
> [mailto:users-bounces at racket-lang.org] On Behalf Of Chris Stephenson
> Sent: 15 October 2010 11:13
> To: users at racket-lang.org
> Subject: Re: [racket] a small programming exercise
> 
snip
> 
> Think about the decimal numbers in the range 1-200. How many 
> start with
> 1?- More than half. The range 1-1000 is an exception. But 

The exceptions are flat distributions of natural numbers in a range from 1
to a power of the base, right?
For example:
(test 1000000 (expt 5 5) 5) -> (250490 249654 249630 250226)
distribution of 1000000 natural numbers in the range 1 to (expt 5 5) and
base 5.
1000000/4=250000

> natural distributions are not uniform over a fixed range. 
> They are bell curves of one sort or another. If you have a 
> natural random distribution there will always be a skew 
> toward the smaller digits. It is quantified as Benford's law.
> 
> --
> Chris Stephenson
> cs at cs.bilgi.edu.tr
> _________________________________________________
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/users




Posted on the users mailing list.