Article View: sci.math.stat
Article #403Generating a set of random bits
From: Bill Hart
Date: Tue, 18 Aug 1992 22:46
Date: Tue, 18 Aug 1992 22:46
14 lines
927 bytes
927 bytes
I have an application for which I need to generate a random 'vector' of bits of length N. I have looked at stuff in Numerical Recipies for generating a random sequence of bits, but it remains unclear whether such a generator would be appropriate for generating a random vector of bits. I need/want to have the distribution of vectors remain 'random'. Right now I'm generating a random float in [0,1> and testing to see if it is less than 0.5 or not. This works, but I'm sure there is a better way of doing this. Any ideas or pointers? --Bill
Technical Details
Message-ID:
<36984@sdcc12.ucsd.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!usc!orion.oac.uci.edu!network.ucsd.edu!sdcc12!cs!whartShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!usc!orion.oac.uci.edu!network.ucsd.edu!sdcc12!cs!whart From: whart@cs.ucsd.edu (Bill Hart) Newsgroups: sci.math.stat Subject: Generating a set of random bits Message-ID: <36984@sdcc12.ucsd.edu> Date: 18 Aug 92 22:46:06 GMT Sender: news@sdcc12.ucsd.edu Lines: 14 Nntp-Posting-Host: roland.ucsd.edu