Post Reply 
Your Opinion about Jean-Marc Baillard's RNGs
02-25-2017, 10:02 PM (This post was last modified: 02-26-2017 08:04 AM by Namir.)
Post: #1
Your Opinion about Jean-Marc Baillard's RNGs
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
Find all posts by this user
Quote this message in a reply
02-26-2017, 06:51 AM
Post: #2
RE: Your Opinion about Jean-Marc Baillard's RNGs
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.
Find all posts by this user
Quote this message in a reply
02-26-2017, 03:17 PM
Post: #3
RE: Your Opinion about Jean-Marc Baillard's RNGs
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
Find all posts by this user
Quote this message in a reply
02-26-2017, 03:23 PM (This post was last modified: 02-26-2017 03:23 PM by Ángel Martin.)
Post: #4
RE: Your Opinion about Jean-Marc Baillard's RNGs
(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

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
02-27-2017, 12:15 PM
Post: #5
RE: Your Opinion about Jean-Marc Baillard's RNGs
(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
Find all posts by this user
Quote this message in a reply
03-03-2017, 01:18 AM
Post: #6
RE: Your Opinion about Jean-Marc Baillard's RNGs
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.
Find all posts by this user
Quote this message in a reply
03-03-2017, 05:56 AM
Post: #7
RE: Your Opinion about Jean-Marc Baillard's RNGs
(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.
Find all posts by this user
Quote this message in a reply
03-03-2017, 06:04 AM (This post was last modified: 03-03-2017 06:04 AM by Ángel Martin.)
Post: #8
RE: Your Opinion about Jean-Marc Baillard's RNGs
(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...

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
03-03-2017, 08:09 AM
Post: #9
RE: Your Opinion about Jean-Marc Baillard's RNGs
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
Find all posts by this user
Quote this message in a reply
03-03-2017, 11:01 PM (This post was last modified: 03-04-2017 04:19 AM by Namir.)
Post: #10
RE: Your Opinion about Jean-Marc Baillard's RNGs
(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
Find all posts by this user
Quote this message in a reply
03-04-2017, 12:10 AM
Post: #11
RE: Your Opinion about Jean-Marc Baillard's RNGs
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.
Find all posts by this user
Quote this message in a reply
03-04-2017, 03:06 AM
Post: #12
RE: Your Opinion about Jean-Marc Baillard's RNGs
(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)

Regards, BrickViking
HP-50g |Casio fx-9750G+ |Casio fx-9750GII (SH4a)
Visit this user's website Find all posts by this user
Quote this message in a reply
03-04-2017, 09:08 AM
Post: #13
RE: Your Opinion about Jean-Marc Baillard's RNGs
(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
Find all posts by this user
Quote this message in a reply
03-04-2017, 03:37 PM
Post: #14
RE: Your Opinion about Jean-Marc Baillard's RNGs
(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
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)