Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site x.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!harvard!godot!mit-eddie!cybvax0!frog!x!john From: john@x.UUCP (John Woods) Newsgroups: net.crypt Subject: Re: Re: Why no hardware random numbers? Message-ID: <458@x.UUCP> Date: Thu, 4-Apr-85 12:44:59 EST Article-I.D.: x.458 Posted: Thu Apr 4 12:44:59 1985 Date-Received: Sun, 7-Apr-85 09:33:16 EST References: <868@utcsri.UUCP> <464@lll-crg.ARPA> <442@x.UUCP> <483@lll-crg.ARPA> Distribution: net Organization: Charles River Data Systems, Framingham MA Lines: 48 > > seems silly to you, check out the Table of 10,000 Random Digits in your > > Rubber Bible (you *do* have the CRC Handbook of Mathmatics, don't you?). > > to get lists of seeds.) The same goes for using disk to read a random > number list from. The disk is a bit faster but not quite fast enough. > I suppose I should have put a smiley on my CRC Handbook comment, I didn't intend it to be a serious suggestion for a Monte Carlo simulation (after all, it doesn't take long to go through 10,000 digits). However, the statement "The disk is a bit faster but not quite fast enough" is not necessarily always true. Consider the following C code: int fd; main() { int i,t; fd = open("randoms",0); for (i = 0; i < 50000; i++) Rand(); /* or just "rand()" */ rand(); } int buf[5000], nb; Rand() { if (nb == 0) nb = read(fd,buf,sizeof buf) >> 2; return buf[--nb]; } Thanks to the `huge' buffer I use (20Kb on my 68000), it turns out that this program runs marginally faster using the disk table than when using the "rand()" function directly. OBVIOUSLY, your mileage may vary, but if your system has good disk throughput and a computationally expensive rand(), then you will likely see similar results, if you can afford a big buffer. It will also help if you don't mind having several megabytes of random data on your disk (but if you have netnews...). @Begin[ :-) ] By the way, back in college, we discovered that the Rubber Bible bounces, when dropped on an appropriate carpet. @END[ :-) ] -- John Woods, Charles River Data Systems, Framingham MA, (617) 626-1101 ...!decvax!frog!john, ...!mit-eddie!jfw, jfw%mit-ccc@MIT-XX.ARPA You can't spell "vile" without "vi".