On 05/25/2013 09:49 PM, Roy Smith wrote:
In article 15a1bb3a-514c-454e-a966-243c84123...@googlegroups.com,
John Ladasky john_lada...@sbcglobal.net wrote:
Because someone's got to say it... The generation of random numbers is too
important to be left to chance. ‹ Robert R. Coveyou
On Fri, May 24, 2013 at 11:23 PM, Peter Brooks
peter.h.m.bro...@gmail.com wrote:
Actually, thinking about
it, there is probably a source of non-algorithmically-derived 'random'
numbers somewhere on the net that would do the job nicely.
True entropy is usually provided by a source such as
Date: Fri, 24 May 2013 17:28:07 -0700
Subject: Re: Simple algorithm question - how to reorder a sequence
economically
From: peter.h.m.bro...@gmail.com
To: python-list@python.org
[...]
If the scenario could be modelled mathematically, then there'd
On 2013-05-24 14:43, Chris Angelico wrote:
On Fri, May 24, 2013 at 11:23 PM, Peter Brooks
peter.h.m.bro...@gmail.com wrote:
Actually, thinking about
it, there is probably a source of non-algorithmically-derived 'random'
numbers somewhere on the net that would do the job nicely.
True entropy
On Friday, May 24, 2013 10:33:47 AM UTC-7, Yours Truly wrote:
If you don't reshuffle p, it guarantees the maximum interval between reusing
the same permutation.
Of course, that comes at a certain price. Given two permutations p[x] and
p[x+1], they will ALWAYS be adjacent, in every repetition
In article 15a1bb3a-514c-454e-a966-243c84123...@googlegroups.com,
John Ladasky john_lada...@sbcglobal.net wrote:
Because someone's got to say it... The generation of random numbers is too
important to be left to chance. Robert R. Coveyou
Absolutely. I know just enough about random number
What is the easiest way to reorder a sequence pseudo-randomly?
That is, for a sequence 1,2,3,4 to produce an arbitrary ordering (eg
2,1,4,3) that is different each time.
I'm writing a simulation and would like to visit all the nodes in a
different order at each iteration of the simulation to
On Fri, May 24, 2013 at 6:14 PM, Peter Brooks
peter.h.m.bro...@gmail.com wrote:
What is the easiest way to reorder a sequence pseudo-randomly?
That is, for a sequence 1,2,3,4 to produce an arbitrary ordering (eg
2,1,4,3) that is different each time.
I'm writing a simulation and would like to
On 24 May 2013 09:41, Chris Angelico ros...@gmail.com wrote:
On Fri, May 24, 2013 at 6:14 PM, Peter Brooks
peter.h.m.bro...@gmail.com wrote:
What is the easiest way to reorder a sequence pseudo-randomly?
That is, for a sequence 1,2,3,4 to produce an arbitrary ordering (eg
2,1,4,3) that
On Fri, May 24, 2013 at 6:47 PM, Fábio Santos fabiosantos...@gmail.com wrote:
On 24 May 2013 09:41, Chris Angelico ros...@gmail.com wrote:
On Fri, May 24, 2013 at 6:14 PM, Peter Brooks
peter.h.m.bro...@gmail.com wrote:
What is the easiest way to reorder a sequence pseudo-randomly?
That
On 5/24/2013 4:14 AM, Peter Brooks wrote:
What is the easiest way to reorder a sequence pseudo-randomly?
That is, for a sequence 1,2,3,4 to produce an arbitrary ordering (eg
2,1,4,3) that is different each time.
I'm writing a simulation and would like to visit all the nodes in a
different
On Fri, 24 May 2013 01:14:45 -0700, Peter Brooks wrote:
What is the easiest way to reorder a sequence pseudo-randomly?
import random
random.shuffle(sequence)
The sequence is modified in place, so it must be mutable. Lists are okay,
tuples are not.
That is, for a sequence 1,2,3,4 to
On 5/24/2013 6:52 AM, Steven D'Aprano wrote:
On Fri, 24 May 2013 01:14:45 -0700, Peter Brooks wrote:
What is the easiest way to reorder a sequence pseudo-randomly?
import random
random.shuffle(sequence)
The sequence is modified in place, so it must be mutable. Lists are okay,
tuples are
Thank you all for those most helpful suggestions! random.shuffle does
precisely the job that I need quickly. Thank you for introducing me to
itertools, though, I should have remembered APL did this in a symbol
or two and I'm sure that itertools will come in handy in future.
Thanks for the
On Fri, 24 May 2013 06:23:14 -0700, Peter Brooks wrote:
Thanks for the warnings about random numbers too - I hope my lists will
be short enough for the permutations of the function to be irrelevant. I
don't need every single sequence to be unique, only that the same
sequence only occurs
On 24/05/13 10:11, Chris Angelico wrote:
On Fri, May 24, 2013 at 6:47 PM, Fábio Santos fabiosantos...@gmail.com wrote:
On 24 May 2013 09:41, Chris Angelico ros...@gmail.com wrote:
On Fri, May 24, 2013 at 6:14 PM, Peter Brooks
peter.h.m.bro...@gmail.com wrote:
What is the easiest way to
Date: Fri, 24 May 2013 01:14:45 -0700
Subject: Simple algorithm question - how to reorder a sequence economically
From: peter.h.m.bro...@gmail.com
To: python-list@python.org
What is the easiest way to reorder a sequence pseudo-randomly
On Friday, May 24, 2013 3:52:18 AM UTC-7, Steven D'Aprano wrote:
On Fri, 24 May 2013 01:14:45 -0700, Peter Brooks wrote:
That is, for a sequence 1,2,3,4 to produce an arbitrary ordering (eg
2,1,4,3) that is different each time.
You can't *guarantee* that it will be different each time.
On May 24, 5:00 pm, Carlos Nepomuceno carlosnepomuc...@outlook.com
wrote:
I don't know what spurious evidence of correlation is. Can you give a
mathematical definition?
If I run the simulation with the same sequence, then, because event E1
always comes before event E2, somebody might believe
Date: Fri, 24 May 2013 12:01:35 -0700
Subject: Re: Simple algorithm question - how to reorder a sequence
economically
From: peter.h.m.bro...@gmail.com
To: python-list@python.org
On May 24, 5:00 pm, Carlos Nepomuceno carlosnepomuc...@outlook.com
On May 24, 11:33 pm, Carlos Nepomuceno carlosnepomuc...@outlook.com
wrote:
Date: Fri, 24 May 2013 12:01:35 -0700
Subject: Re: Simple algorithm question - how to reorder a sequence
economically
From: peter.h.m.bro...@gmail.com
To: python
21 matches
Mail list logo