random number including 1 - i.e. [0,1]

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Sun Jun 14 05:36:39 EDT 2009

In message <mailman.1366.1244592006.8015.python-list at python.org>, Esmail 

> I'm implementing a Particle Swarm Optimizer. Depending on what paper you
> read you'll see mention of required random values "between 0 and 1"
> which is somewhat ambiguous. I came across one paper that specified
> the range [0,1], so inclusive 1, which was the reason for my question.

Sounds like some of their descriptions are a bit sloppy. Maybe best to clear 
it up by trying to think what a value of exactly or exactly 1 for the random 
value might mean: are those boundaries meant to be inside the set, or 
outside? Is it meaningful to concatenate two adjacent intervals? In that 
case any point can only belong to one of the intervals, not both.

More information about the Python-list mailing list