Re: generating random tuples in python

2009-04-22 Thread Michael Spencer
Robert Kern wrote: On 2009-04-20 23:04, per wrote: to be more formal by very different, i would be happy if they were maximally distant in ordinary euclidean space... so if you just plot the 3-tuples on x, y, z i want them to all be very different from each other. i realize this is obviously b

Re: generating random tuples in python

2009-04-21 Thread Raymond Hettinger
[per] > i realize my example in the original post was misleading. i dont want > to maximize the difference between individual members of a single > tuple -- i want to maximize the difference between distinct tuples. in > other words, it's ok to have (.332, .334, .38), as long as the other > tuple i

Re: generating random tuples in python

2009-04-21 Thread Robert Kern
On 2009-04-20 23:04, per wrote: to be more formal by very different, i would be happy if they were maximally distant in ordinary euclidean space... so if you just plot the 3-tuples on x, y, z i want them to all be very different from each other. i realize this is obviously biased and that the t

Re: generating random tuples in python

2009-04-21 Thread Steven D'Aprano
On Tue, 21 Apr 2009 07:53:29 +, Steven D'Aprano wrote: > Third strategy: divide the cube into eight half-cubes. Label then A > through H: Sheesh. Obviously they're not *half* cubes if there are eight of them. What I meant was that their edges are half as long as the edge of the 1x1x1 cube.

Re: generating random tuples in python

2009-04-21 Thread Steven D'Aprano
On Mon, 20 Apr 2009 21:04:25 -0700, per wrote: > i realize my example in the original post was misleading. i dont want to > maximize the difference between individual members of a single tuple -- > i want to maximize the difference between distinct tuples. in other > words, it's ok to have (.332,

Re: generating random tuples in python

2009-04-21 Thread Aaron Brady
On Apr 20, 11:04 pm, per wrote: > On Apr 20, 11:08 pm, Steven D'Aprano > > > > wrote: > > On Mon, 20 Apr 2009 11:39:35 -0700, per wrote: > > > hi all, > > > > i am generating a list of random tuples of numbers between 0 and 1 using > > > the rand() function, as follows: > > > > for i in range(0,

Re: generating random tuples in python

2009-04-21 Thread Paul Rubin
per writes: > to be more formal by very different, i would be happy if they were > maximally distant in ordinary euclidean space... In that case you want them placed very carefully, not even slightly random. So you are making conflicting requests. -- http://mail.python.org/mailman/listinfo/pyth

Re: generating random tuples in python

2009-04-20 Thread Tim Roberts
per wrote: > >i am generating a list of random tuples of numbers between 0 and 1 >using the rand() function, as follows: >... >how can i maximize the amount of "numeric distance" between the >elements of this list, but still make sure that all the tuples >have numbers strictly between 0 and 1 (in

Re: generating random tuples in python

2009-04-20 Thread per
On Apr 20, 11:08 pm, Steven D'Aprano wrote: > On Mon, 20 Apr 2009 11:39:35 -0700, per wrote: > > hi all, > > > i am generating a list of random tuples of numbers between 0 and 1 using > > the rand() function, as follows: > > > for i in range(0, n): > >   rand_tuple = (rand(), rand(), rand()) mylis

Re: generating random tuples in python

2009-04-20 Thread Steven D'Aprano
On Mon, 20 Apr 2009 11:39:35 -0700, per wrote: > hi all, > > i am generating a list of random tuples of numbers between 0 and 1 using > the rand() function, as follows: > > for i in range(0, n): > rand_tuple = (rand(), rand(), rand()) mylist.append(rand_tuple) > > when i generate this list, s

Re: generating random tuples in python

2009-04-20 Thread Arnaud Delobelle
per writes: > hi all, > > i am generating a list of random tuples of numbers between 0 and 1 > using the rand() function, as follows: > > for i in range(0, n): > rand_tuple = (rand(), rand(), rand()) > mylist.append(rand_tuple) > > when i generate this list, some of the random tuples might be

Re: generating random tuples in python

2009-04-20 Thread bearophileHUGS
per: > in other words i want the list of random numbers to be arbitrarily > different (which is why i am using rand()) but as different from other > tuples in the list as possible. This is more or less the problem of packing n equal spheres in a cube. There is a lot of literature on this. You can

generating random tuples in python

2009-04-20 Thread per
hi all, i am generating a list of random tuples of numbers between 0 and 1 using the rand() function, as follows: for i in range(0, n): rand_tuple = (rand(), rand(), rand()) mylist.append(rand_tuple) when i generate this list, some of the random tuples might be very close to each other, nume