cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Translate the entire conversation x

Random generator

AlvaroDíaz
12-Amethyst

Random generator

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.
12 REPLIES 12

Alvaro.

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

Philip Oakley

Catched. Thanks.

Alvaro.

>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


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.

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




On 4/15/2010 7:40:03 PM, jmG wrote:

>Pseudo in english is correct,
>but neither nuanced nor as subtile as
>pseudo in french.

From french wikipedia:

"Le terme pseudo-al�atoire est utilis� en math�matiques et en informatique pour d�signer une suite de nombres qui s'approche d'un al�a statistiquement parfait. De par les proc�d�s algorithmiques utilis�s pour la g�n�rer et les sources employ�es, la suite ne peut �tre compl�tement consid�r�e comme al�atoire."

Regards. Alvaro.

On 4/15/2010 11:19:34 PM, adiaz wrote:
>On 4/15/2010 7:40:03 PM, jmG wrote:
>
>>Pseudo in english is correct,
>>but neither nuanced nor as subtile as
>>pseudo in french.
>
>From french wikipedia:
>
>"Le terme pseudo-al�atoire est utilis�
>en math�matiques et en informatique pour
>d�signer une suite de nombres qui
>s'approche d'un al�a statistiquement
>parfait. De par les proc�d�s
>algorithmiques utilis�s pour la g�n�rer
>et les sources employ�es, la suite ne
>peut �tre compl�tement consid�r�e comme
>al�atoire."
>
>Regards. Alvaro.
______________________________

Very good, I expected somebody would be curious.
In fact, pseudo or not so pseudo, any random is "pseudo" because true randomness is an unsolved conjecture. Very interesting. That B�zier deterministic chaos posted about 2 weeks ago is probably much closer because it does not involve any random algorithm.
Thanks Alvaro for your interest & collaboration.

jmG



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.

"... 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

On 5/7/2010 6:13:10 PM, Schiffs wrote:

>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.
>

see
http://collab.mathsoft.com/~Mathcad2000/read?134647,12


jmG
StuartBruff
23-Emerald IV
(To:Schiffs)

On 5/7/2010 6:13:10 PM, Schiffs wrote:
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.


According to the Mathcad 11 User Guide, rnd and runif use Knuth's Linear Congruence Method.

Stuart
Announcements

Top Tags