comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Lotto simulation
Date: Mon, 16 Jun 2014 09:49:36 +0200
Date: 2014-06-16T09:49:36+02:00	[thread overview]
Message-ID: <lnm7ie$4s0$1@dont-email.me> (raw)
In-Reply-To: <alpine.DEB.2.10.1406160715490.4637@debian>

Le 16/06/2014 07:25, Stefan.Lucks@uni-weimar.de a écrit :
> I am not aware of that discussion, 
AFAIK, it's archived somewhere...

> but mathematically, given a uniformly
> distributed real number F between 0.0 and 1.0, one can get a uniformly
> distributed discrete D between Low and high: D := Truncate(Low + F *
> (High-Low + 1)).
I think it all depends on the definition of "uniformly distributed". If
it is uniformly distributed among all representable floating point
numbers (which you get if you take an integer random number and
unchecked-convert it to Float), you'll get many more values below 0.5
than above (since the range 0.5..1.0 is represented with only one value
of the exponent).

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr


  reply	other threads:[~2014-06-16  7:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-15 17:07 Lotto simulation montgrimpulo
2014-06-15 18:54 ` Stefan.Lucks
2014-06-15 19:53   ` J-P. Rosen
2014-06-16  5:25     ` Stefan.Lucks
2014-06-16  7:49       ` J-P. Rosen [this message]
2014-06-16 11:15         ` Stefan.Lucks
2014-06-16 13:40           ` J-P. Rosen
2014-06-16 14:13             ` Natasha Kerensikova
2014-06-16 17:51             ` Randy Brukardt
2014-06-15 19:56 ` Denis McMahon
2014-06-15 20:10 ` Dirk Heinrichs
2014-06-15 20:43   ` Simon Wright
2014-06-16 20:22     ` Dirk Heinrichs
2014-06-15 20:54 ` Simon Wright
2014-06-15 22:09 ` Jeffrey Carter
2014-06-16 11:40 ` Markus Schöpflin
2014-06-16 14:25   ` Jacob Sparre Andersen
2014-06-16 12:02 ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox