Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Compare two methods of random permutations
Replies: 8   Last Post: Jul 28, 2015 12:29 PM

 Messages: [ Previous | Next ]
 David Jones Posts: 80 Registered: 2/9/12
Re: Compare two methods of random permutations
Posted: May 12, 2013 1:41 PM

"Mok-Kong Shen" wrote in message news:kmks1l\$52h\$1@news.albasani.net...

Am 10.05.2013 20:30, schrieb Gordon Sande:

> Usually the time spent in the random number generator is a very small
> portion of a real task. It is only when the real task is empty, like when
> testing randon numbers, that the speed of the randomization is of much
> concern. The difference between small and a bit bigger matters when
> compared to nothing but is of no concern when compared to something real
> that is much larger. Usually much faster is reserved for things like
> 1000*1000 compared to 1000*log(1000)=1000*10. I believe that Python is
> an interpreted langauge so is noticably slower that a compiled language
> which one would use for a real task where timeing was important.

Yes, Python is normally interpreted, but IMHO an interpreted run could
in some measure reflect the results in optimized runs in other
languages (though this of course must remain speculative without hard
facts). You are certainly right that my use of "much faster" is highly
problematic. (In fact for common programmers a 50% speed increase of
his codes may be something, but for persons in theoretical computer
science generally only exponential time improvements of algorithms
would be of significance.)

M. K. Shen

===============================================================

It is not clear what the real purpose is here, but there seems to be an
emphasis on computing time, and there needs to be a balance depending on the
actual context. There seems scope for introducing a pre-computed list of
permutations held in a file, so that multiple random selections (in
real-time) can be avoided. Different strategies can be thought up depending
on whether the file contents were themselves generated systematically or
randomly. In some applications it might be enough to do a single "full"
(expensive) randomisation to initialize, and then to read permutations of
this result from a file (or array) ... re-initialising every so often would
mean that the file need not be too large ( a 1000 permutations would/could
reduce computation time by a factor of 1000). I guess such ideas must be
fairly standard, but perhaps modern computing scenarios of file-space
limitations may have changed relevant balances.

David Jones

Date Subject Author
5/8/13 Mok-Kong Shen
5/10/13 Ray Koopman
5/10/13 Richard Ulrich
5/10/13 Mok-Kong Shen
5/10/13 Gordon Sande
5/11/13 Mok-Kong Shen
5/12/13 David Jones
5/13/13 Mok-Kong Shen
7/28/15 sean.c4s.vn@gmail.com