Post Reply 
HP 12C Random Integer Number Generator
11-04-2018, 06:02 PM (This post was last modified: 11-04-2018 06:04 PM by Dieter.)
Post: #8
RE: HP 12C Random Integer Number Generator
(11-04-2018 04:03 PM)SlideRule Wrote:  It took a little time to research, but this routine for the Sharp PC-1211 from the October 1981 edition of Your Computer (pg.54) matches your range requirement of integers from one to six.

The relevant part here is not the range of the random integers but the random number generator itself (whose results are then scaled to 1...6). If I understand this correctly, the method is

r := frac[ (r+77) · pi5 ]

Here pi5 is 306,0196848 so that before the FRC command the intermediate result is between 23563,5... and 23869,5..., which in turn means that on a 10-digit calculator the resulting random number (between 0 and 1) has merely five significant digits.

Can someone say something about other properties of this generator? How does it compare to the simple and fast frac[(r+pi)²] generator?

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 12C Random Integer Number Generator - Dieter - 11-04-2018 06:02 PM



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