On 2013-05-24 14:43, Chris Angelico wrote:
On Fri, May 24, 2013 at 11:23 PM, Peter Brooks
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 sou
> 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 ma
On Fri, May 24, 2013 at 11:23 PM, Peter Brooks
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 /dev/random (on
Unix systems)
On 05/25/2013 09:49 PM, Roy Smith wrote:
In article <15a1bb3a-514c-454e-a966-243c84123...@googlegroups.com>,
John Ladasky 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
In article <15a1bb3a-514c-454e-a966-243c84123...@googlegroups.com>,
John Ladasky 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 generation to
unders
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
On May 24, 11:33 pm, Carlos Nepomuceno
wrote:
>
>
>
>
>
>
>
>
>
>
> > Date: Fri, 24 May 2013 12:01:35 -0700
> > Subject: Re: Simple algorithm question - how to reorder a sequence
> > economically
>
> 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
>
On May 24, 5:00 pm, Carlos Nepomuceno
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 that there is a
causa
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
> 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-
On 24/05/13 10:11, Chris Angelico wrote:
On Fri, May 24, 2013 at 6:47 PM, Fábio Santos wrote:
On 24 May 2013 09:41, "Chris Angelico" wrote:
On Fri, May 24, 2013 at 6:14 PM, Peter Brooks
wrote:
What is the easiest way to reorder a sequence pseudo-randomly?
That is, for a sequence 1,2,3,4
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 o
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 warnings
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 not.
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 produ
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 order
On Fri, May 24, 2013 at 6:47 PM, Fábio Santos wrote:
>
> On 24 May 2013 09:41, "Chris Angelico" wrote:
>>
>> On Fri, May 24, 2013 at 6:14 PM, 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 arbitra
On 24 May 2013 09:41, "Chris Angelico" wrote:
>
> On Fri, May 24, 2013 at 6:14 PM, 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.
> >
..
On Fri, May 24, 2013 at 6:14 PM, 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
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 remo
21 matches
Mail list logo