Execution speed question
Matthew Fitzgibbons
elessar at nienna.org
Fri Jul 25 12:09:52 EDT 2008
Iain King wrote:
> On Jul 25, 4:22 pm, Matthew Fitzgibbons <eles... at nienna.org> wrote:
>> It seems like the probability calculation applies to all three equally,
>> and can therefore be ignored for the simulations.
>
> The probability affects (1) more. My reasoning for this being: as
> probability gets lower the number of times you have to loop over the
> list increases. (1) always loops over the full list, but with each
> successive iteration (2) and (3) are looping over smaller and smaller
> lists. In the end this adds up, with (1) becoming slower than (2),
> even though it starts out quicker.
>
> Iain
> --
> http://mail.python.org/mailman/listinfo/python-list
>
I meant the _calculation_ of the probability affects all three equally,
not the value itself. As your simulations show, different probabilities
affect the algorithms differently; I'm talking about the algorithm to
arrive at the probability value.
-Matt
More information about the Python-list
mailing list