Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Number Generator
Can someone post a RNG better than the one is provided by Microsoft?
TIA, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Number Generator
Better in what respect ?
"Sophia" wrote in message le.rogers.com... Can someone post a RNG better than the one is provided by Microsoft? TIA, |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Number Generator
"Nigel" wrote...
Better in what respect ? Perhaps randomness. The PRNG in XL2003 (after applying service packs and other updates) is a huge improvement over the PRNG in previous versions in terms of Diehard performance. For the OP: there are thousands of websites with open source software containing variations of the Berkeley PRNG. I'm most familiar with the gawk source code, and here's a url for it in a web page. http://wuarchive.wustl.edu/mirrors/N.../gawk/random.c |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Number Generator
The formulas for the XL2003 generator is given at
http://support.microsoft.com/default.aspx?scid=828795 Fortran code from the original Journal of the Royal Statistical Society, Series 3 (Applied Statistics) article is available from http://lib.stat.cmu.edu/apstat/183 Jerry Harlan Grove wrote: "Nigel" wrote... Better in what respect ? Perhaps randomness. The PRNG in XL2003 (after applying service packs and other updates) is a huge improvement over the PRNG in previous versions in terms of Diehard performance. For the OP: there are thousands of websites with open source software containing variations of the Berkeley PRNG. I'm most familiar with the gawk source code, and here's a url for it in a web page. http://wuarchive.wustl.edu/mirrors/N.../gawk/random.c |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Number Generator
Sophia wrote ...
Can someone post a RNG better than the one is provided by Microsoft? Does the following qualify? Microsoft Knowledge Base Article - 44738 Generating a Random Number without RAND() in Excel http://support.microsoft.com/default...kb;en-us;44738 -- |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Number Generator
To know whether it is better, you would have to do a number of tests of
randomness in the actual context of use. Particular calculation operations take a set number of cycles (modified by any other applications that are sharing the CPU). Clock based RNGs have the potential to have serious autocorrelation problems. Jerry onedaywhen wrote: Sophia wrote ... Can someone post a RNG better than the one is provided by Microsoft? Does the following qualify? Microsoft Knowledge Base Article - 44738 Generating a Random Number without RAND() in Excel http://support.microsoft.com/default...kb;en-us;44738 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Number Generator
Can an Excel guru answer this?
Knowledge Base Article 44738, states that the expression (NOW()*100000 - INT(NOW()*100000)) can be used as an alternative to the RAND() function for generating random numbers. My question is, when Excel evaluates the above formula in any one instance, is the value of the NOW() function on the left going to be the same as that on the right, or are they going to be different cause they are each evaluated a microsecond apart in time? -- Dennis Eisen |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Number Generator
|
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Number Generator
onedaywhen wrote:
wrote ... Can an Excel guru answer this? Knowledge Base Article 44738, states that the expression (NOW()*100000 - INT(NOW()*100000)) can be used as an alternative to the RAND() function for generating random numbers. My question is, when Excel evaluates the above formula in any one instance, is the value of the NOW() function on the left going to be the same as that on the right, or are they going to be different cause they are each evaluated a microsecond apart in time? In lieu of a guru, I'll have a stab. If you use the same formula in different cells you get exactly the same formula. So I conclude the formula uses the same value for NOW(). Not true. NOW() only resolves down to the seconds level, which is a very long time span in computer terms. You have to have a lot of recalculation going on to see the difference, but =NOW() in different cells will return different times if there is enough calculation taking place between the two cell evaluations. The following is conjecture, but I would be surprised if it is not accurate. I would expect that each call to NOW() is individually evaluated, so using NOW() twice in a cell has the potential to return different values. In practice, I would expect that occurrence to be extremely rare. I would expect that the final evaluation of a cell (Excel may start evaluating it, and realize that there are precedents that must be evaluated first, go do them, and come back) would take place in its entirety, before moving on to the next cell in the order of evaluation. Thus you would have to be extremely close to crossing a second boundary to observe a difference in the two NOW() calls of (NOW()*100000 - INT(NOW()*100000)) Jerry Excel MVP |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
random number generator | Excel Worksheet Functions | |||
random number generator | Excel Discussion (Misc queries) | |||
Random number generator | Excel Worksheet Functions | |||
Random Number Generator | Excel Worksheet Functions | |||
Random number generator | Excel Worksheet Functions |