[Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register]

Author Message
Newbie

Joined: 30 Jun 2009
Posts: 2

 Posted: Tue Jun 30, 2009 11:05 pm    Post subject: Flaw of random number generator A pseudo random number generator's (PRNG) primary output are integer numbers which are normalized (i.e. divided by the maximum value of the PRNG) giving floating point numbers x between 0 and 1. The flaw of the PRNG used in OOO is: The less significant bits of the number x are cut off, which means there are only 32768 different numbers the function RAND() returns. 32768 is by far too small a number to use this PRNG to solve serious problems. With this generator we are back in the time of 16bit processors. To prove what I'm writing, just multiply a random number by 32768 and you will always get an integer number between 0 and 32767. Is there another function available for Calc which returns better random numbers? Since I've been dealing a lot with PRNGs I could write my own PRNG code in C, C++ etc.. Is there a way to make this code available for OOO Calc? Thank you for responding rademur
Villeroy
Super User

Joined: 04 Oct 2004
Posts: 10065
Location: Germany

 Posted: Tue Jun 30, 2009 11:16 pm    Post subject: http://development.openoffice.org_________________Rest in peace, oooforum.org Get help on http://forum.openoffice.org
Newbie

Joined: 30 Jun 2009
Posts: 2

 Posted: Wed Jul 01, 2009 2:55 am    Post subject: Meanwhile I found this thread in another OOo forum, which covers the same topic. http://user.services.openoffice.org/en/forum/viewtopic.php?f=9&t=5010&p=23134&hilit=+random#p23134 The very poor properties of Calc's built-in rand() function seem to have been an issue since years as acknak is stating. Like him I'm wondering why nothing happened to improve the situation. If Calc is intended to be used for serious statistical investigations an up-to-date pseudo random number generator is overdue. This need not be a Mersenne twister. Considering the limited number of cells in a spreadsheet which can be handled in reasonable computing time, even linear congruential generators with carfully chosen modulus and multiplier, would do a god job. rademur
Villeroy
Super User

Joined: 04 Oct 2004
Posts: 10065
Location: Germany

jrkrideau
Super User

Joined: 08 Aug 2005
Posts: 6733

Posted: Thu Jul 02, 2009 6:42 am    Post subject:

 rademur wrote: Meanwhile I found this thread in another OOo forum, which covers the same topic. http://user.services.openoffice.org/en/forum/viewtopic.php?f=9&t=5010&p=23134&hilit=+random#p23134 The very poor properties of Calc's built-in rand() function seem to have been an issue since years as acknak is stating. Like him I'm wondering why nothing happened to improve the situation. If Calc is intended to be used for serious statistical investigations an up-to-date pseudo random number generator is overdue. This need not be a Mersenne twister. Considering the limited number of cells in a spreadsheet which can be handled in reasonable computing time, even linear congruential generators with carfully chosen modulus and multiplier, would do a god job. rademur

I don't think that Calc is intended for serious statistical investigations any more than Excel is. It certainly should not be used. At last report it is a bit better than Excel, probably not a good as gnumeric but spreadsheets are just not intended for statistical analysis. See http://www.burns-stat.com/pages/Tutor/spreadsheet_addiction.html for some discussion of this.

That said, it looks like we really do need a better random number generator.
_________________
jrkrideau
Currently using Windows 7 & OOo 3.4.0 and Ubuntu 12.04 & LibreOffice 3.5.2.2
David
Super User

Joined: 24 Oct 2003
Posts: 5668

Posted: Thu Jul 02, 2009 6:50 pm    Post subject: Re: Flaw of random number generator

 rademur wrote: 32768 is by far too small a number to use this PRNG to solve serious problems.

For serious math, use a serious math program. This is an OFFICE suite. Think of people who work in offices, not in physics labs.

David.
jrkrideau
Super User

Joined: 08 Aug 2005
Posts: 6733

Posted: Sun Jul 05, 2009 8:15 am    Post subject: Re: Flaw of random number generator

David wrote:
 rademur wrote: 32768 is by far too small a number to use this PRNG to solve serious problems.

For serious math, use a serious math program. This is an OFFICE suite. Think of people who work in offices, not in physics labs.

David.

If the only tool you have is a hammer, you tend to see every problem as a nail.
Abraham Maslow
_________________
jrkrideau
Currently using Windows 7 & OOo 3.4.0 and Ubuntu 12.04 & LibreOffice 3.5.2.2
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 8 Hours Page 1 of 1

 Jump to: Select a forum OpenOffice.org Forums----------------Setup and TroubleshootingOpenOffice.org WriterOpenOffice.org CalcOpenOffice.org ImpressOpenOffice.org DrawOpenOffice.org MathOpenOffice.org BaseOpenOffice.org Macros and APIOpenOffice.org Code Snippets Community Forums----------------General DiscussionSite Feedback
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum