Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Random Number Generator

Can someone post a RNG better than the one is provided by Microsoft?

TIA,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 733
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default 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

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
random number generator pat67 Excel Worksheet Functions 7 May 7th 10 07:42 PM
random number generator johnny vino Excel Discussion (Misc queries) 8 April 25th 07 05:51 PM
Random number generator deelee Excel Worksheet Functions 3 October 12th 06 07:46 PM
Random Number Generator STEVEB Excel Worksheet Functions 7 July 25th 05 11:41 PM
Random number generator Philippe L. Balmanno Excel Worksheet Functions 4 December 17th 04 07:42 AM


All times are GMT +1. The time now is 04:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"