Skip to main content
12-Amethyst
April 15, 2010
Question

Random generator

  • April 15, 2010
  • 3 replies
  • 8739 views
I'm searching for a code to generate pseudo random numbers, but can't find any one just that simple and with some robustness; or are coded in hard fortran with callings to pre-developed libraries. I'm also looking for a randomless test.

Does any one have coded this into mathcad?

I'm specially interested in functions that generate pseudo random numbers; that's because they are more easy to explain how it works, or recursions but not with big degrees of levels. Also want to generate some few distributions, not only normal distributed numbers.

Just looks like a joke, but after a device working for 36 hr there are some guys that claim to generate the first 42 (42!) true random numbers:

http://www.nature.com/news/2010/100414/full/news.2010.181.html

Regards. Alvaro.

3 replies

1-Visitor
April 15, 2010
>I'm searching for a code to generate pseudo random numbers< [Alvaro]
_______________________

Not sure what you [or who else] means by "pseudo random". A pseudo thing is a borrowed thing and that fits well in the mathematical language because everything in maths is pseudo. In fact, "pseudo random" does not mean much whereas true randomness does not exist in the nature, simply a conjecture. Each phenomenon is however associated with some sort of characteristic randomness, like the thermal noise.
A good reading on that is Knuth [Semi Numerical Algorithms]. In addition to the Mersenne twister, here are two more. The Mircea random was programmed by Richard, it works well and of good demonstration as applied to Valery Pi. I got lucky playing a bit with Pi = 3.1416. It would be interesting to design a program that could be stopped and register the eventual Pi min/max. It will certainly bracket between 3 and 3.3, but that's just a guess.

jmG


12-Amethyst
April 15, 2010
On 4/15/2010 11:06:47 AM, jmG wrote:

>Not sure what you [or who
>else] means by "pseudo
>random".

Pseudo things are things that even not have the properties of the true equivalent thing are taken as a set of the true thing. Pseudo code is used replacing true code in some programming language because it is more easy to read and understand; pseudo random numbers are used because there is not easy to generate true random numbers.

>... true randomness does not exist in the nature,
>simply a conjecture.

Recentelly proved conjeture, as it is prove in the Nature's article, and if we trust in it prove.

>the Mersenne twister, here are
>two more. The Mircea random
>was programmed by Richard, it
>works well and of good
>demonstration as applied to
>Valery Pi.

Thanks, this kind of code is what I'm searching for.

Regards. Alvaro.
1-Visitor
April 15, 2010
On 4/15/2010 4:53:14 PM, adiaz wrote:
>On 4/15/2010 11:06:47 AM, jmG wrote:
>
...
>Thanks, this kind of code is what I'm
>searching for.
>
>Regards. Alvaro.
______________________________________

Pseudo in english is correct,
but neither nuanced nor as subtile as pseudo in french.
About matrices, there are several versions of "PseudoInverse". The version used in balancing chemical components is really a tool that obeys more rules than the simple matrix inverse. So, in that case it is a true solver.

Une pseudo-science (Du grec pseud�s ψευδἡς : � faux � ) est une d�marche pr�tendument scientifique qui ne respecte pas les canons de la m�thode scientifique, dont celui de r�futabilit�.

Ce terme, de connotation normative, est utilis� dans le but de d�noncer certaines disciplines en les d�marquant des d�marches au caract�re scientifique reconnu.

The prefix pseudo- (from Greek ψευδής "lying, false") is used to mark something as false, fraudulent, or pretending to be something it is not.

Cheers, Jean




1-Visitor
April 15, 2010
Alvaro.

Search for Mersenne primes on the forum - Stuart Bruff did some good work on them.

Philip Oakley
12-Amethyst
April 15, 2010
Catched. Thanks.

Alvaro.
1-Visitor
May 7, 2010
I strongly suggest anyone who is serious about generation of random numbers consult Press, et. al., Numerical Recipes (3rd edition) Cambridge University Press, ISBN 978-0-521-88068-8. One can obtain a CD with all the source code in C or FORTRAN.
For testing, the authoritative reference is Knuth, The Art of COmputer Programming, Volume 2, 2nd edition, Addison Wesley, ISBN 0-201-03822-6.

Incidentally, I came to this forum looking for some insight into how the Mathcad uniform random number generator runif works. There is zero documentation on it.

Experience tells me that if there is no documentation, it probably means that the routine is junk. In the case of random number generators, this may be true even if there is documentation, as you will see should you read either of the two references above.
1-Visitor
May 7, 2010
"... it probably means that the routine is junk".
______________________

Sorry my friend !

There has never been junk in Mathcad at least up to version 11. Mathcad is essentially based on "Numerical Recipes" and more advanced stuff. The only known weak point in Mathcad up to version 11 was the numerical integration.

Read me next or soon on that.

jmG