HP Forums
Your Opinion about Jean-Marc Baillard's RNGs - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: Your Opinion about Jean-Marc Baillard's RNGs (/thread-7828.html)



Your Opinion about Jean-Marc Baillard's RNGs - Namir - 02-25-2017 10:02 PM

Hi,

I was browsing in the old HP-41C program library and I found this link for "Random Number Generators for the HP-41" by Jean-Marc Baillard. This link points out to five PRNGs (the first four are more serious). The first four HP-1C programs seem very usable. Has anyone used these PRNGs? Your take on these algorithms?

Namir


RE: Your Opinion about Jean-Marc Baillard's RNGs - ttw - 02-26-2017 06:51 AM

Just looking quickly leads me to guess that program #2 is best. Which number to use for the multiplier depends on the continued fraction expansion of that multiplier and 9,999,999,967. One with smaller partial quotients will generally be better.

Program #1 isn't too bad; the multiplier (9821 in this case) seems designed to give the longest period modulo a power of 10. Again, one should choose a pair with a continued fraction expansion with small partial quotients.


RE: Your Opinion about Jean-Marc Baillard's RNGs - John Keith - 02-26-2017 03:17 PM

Note that though it references the well-known formula xn+1 = FRC ( 9821 xn + 0.211327 ), his program 1 is actually xn+1 = FRC ( 9^8 xn + 0.236067977 ).

Programs 1 and 2 both sound interesting. As Jean-Marc's post is 13 years old, I wonder if anyone has tested these RNG's using Knuth's spectral test or other methods?

John


RE: Your Opinion about Jean-Marc Baillard's RNGs - Ángel Martin - 02-26-2017 03:23 PM

(02-26-2017 03:17 PM)John Keith Wrote:  Programs 1 and 2 both sound interesting. As Jean-Marc's post is 13 years old, I wonder if anyone has tested these RNG's using Knuth's spectral test or other methods?

Here's the current link to his own web site, likely to be more current that the one in the forum:

http://hp41programs.yolasite.com/alea.php


RE: Your Opinion about Jean-Marc Baillard's RNGs - Namir - 02-27-2017 12:15 PM

(02-26-2017 03:23 PM)Ángel Martin Wrote:  
(02-26-2017 03:17 PM)John Keith Wrote:  Programs 1 and 2 both sound interesting. As Jean-Marc's post is 13 years old, I wonder if anyone has tested these RNG's using Knuth's spectral test or other methods?

Here's the current link to his own web site, likely to be more current that the one in the forum:

http://hp41programs.yolasite.com/alea.php

Jean-Marc's site has mainly put the same information in a nicer and colored format. I did not see any significant change. Still good code in my book!!

Namir


RE: Your Opinion about Jean-Marc Baillard's RNGs - Chris Hanson - 03-03-2017 01:18 AM

There has been a lot of work in PRNGs in the last decade or so.

Many older PRNGs, particularly the simpler ones, are no longer considered adequate for many purposes, despite the fact that they pass the spectral test.

While there are many prominent researchers in this area, I have appreciated the work done by George Marsaglia. See the Wikipedia page for more information.


RE: Your Opinion about Jean-Marc Baillard's RNGs - Namir - 03-03-2017 05:56 AM

(03-03-2017 01:18 AM)Chris Hanson Wrote:  There has been a lot of work in PRNGs in the last decade or so.

Many older PRNGs, particularly the simpler ones, are no longer considered adequate for many purposes, despite the fact that they pass the spectral test.

While there are many prominent researchers in this area, I have appreciated the work done by George Marsaglia. See the Wikipedia page for more information.

I do make a big distinction between simpler PRNGs for calculators and PRNGs for computer aplications. The two PRNGs belong in two different classes. The PRNGs by J.M Bailliard belong to vintage calculators and, in most likelihood, will not provide high-standard randomness for computer applications. Nevertheless, calculator PRNGs provide adequate random numbers for calculator games and simulations where the total number of random number generated is relatively small, compared to computer applications.


RE: Your Opinion about Jean-Marc Baillard's RNGs - Ángel Martin - 03-03-2017 06:04 AM

(03-03-2017 05:56 AM)Namir Wrote:  I do make a big distinction between simpler PRNGs for calculators and PRNGs for computer aplications. The two PRNGs belong in two different classes. The PRNGs by J.M Bailliard belong to vintage calculators and, in most likelihood, will not provide high-standard randomness for computer applications. Nevertheless, calculator PRNGs provide adequate random numbers for calculator games and simulations where the total number of random number generated is relatively small, compared to computer applications.

Complete agreement.

On the CX of course the dilemma is non-existing: TIME does the randomness for you...


RE: Your Opinion about Jean-Marc Baillard's RNGs - Paul Dale - 03-03-2017 08:09 AM

The 34S has a reasonably modern Tausworthe generator. I'd have liked to have included a Mersenne twister based RAND but there wasn't enough RAM for it. Neither of these is up to cryptographic standards but they are decent enough for other purposes.


Pauli


RE: Your Opinion about Jean-Marc Baillard's RNGs - Namir - 03-03-2017 11:01 PM

(03-03-2017 08:09 AM)Paul Dale Wrote:  The 34S has a reasonably modern Tausworthe generator. I'd have liked to have included a Mersenne twister based RAND but there wasn't enough RAM for it. Neither of these is up to cryptographic standards but they are decent enough for other purposes.


Pauli

Pauli,

I agree that the 34S has the best PRNG. The WP-42S is in a class apart.

Namir


RE: Your Opinion about Jean-Marc Baillard's RNGs - emece67 - 03-04-2017 12:10 AM

The microcontroller inside the dm42/wp43 does have a true random number generator inside it. We are at the threshold of a new kind of "randomness" in our machines.


RE: Your Opinion about Jean-Marc Baillard's RNGs - brickviking - 03-04-2017 03:06 AM

(03-03-2017 11:01 PM)Namir Wrote:  ...
I agree that the 34S has the best PRNG. The WP-24S is in a class apart.
...

I've never seen a WP-24S. I'm guessing this was a WP-34S instead?

(Post 55)


RE: Your Opinion about Jean-Marc Baillard's RNGs - Paul Dale - 03-04-2017 09:08 AM

(03-04-2017 12:10 AM)emece67 Wrote:  The microcontroller inside the dm42/wp43 does have a true random number generator inside it. We are at the threshold of a new kind of "randomness" in our machines.

I'm actually be a bit sceptical of TRNGs in hardware -- I've seen more than a few that were biassed and that needed software assistance to produce good random output. Of course this fix is entirely possible in the dm42/wp34. I'd be more than able to implement a NIST SP 800-90b compliant RNG.


- Pauli


RE: Your Opinion about Jean-Marc Baillard's RNGs - Namir - 03-04-2017 03:37 PM

(03-04-2017 03:06 AM)brickviking Wrote:  
(03-03-2017 11:01 PM)Namir Wrote:  ...
I agree that the 34S has the best PRNG. The WP-24S is in a class apart.
...

I've never seen a WP-24S. I'm guessing this was a WP-34S instead?

(Post 55)

I do have my own unique version of the WP-24S ... I just took an existing WP-34S and relabeled it WP-24S ... :-)

Namir