Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ecsvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!mcnc!ecsvax!hes From: hes@ecsvax.UUCP (Henry Schaffer) Newsgroups: net.puzzle Subject: Re: random number wanted between neg inf and pos inf Message-ID: <947@ecsvax.UUCP> Date: Wed, 18-Dec-85 10:21:23 EST Article-I.D.: ecsvax.947 Posted: Wed Dec 18 10:21:23 1985 Date-Received: Fri, 20-Dec-85 03:31:51 EST References: <33@decwrl.UUCP> Organization: NC State Univ. Lines: 60 > >> > Now he tells us that it's got to be uniformly distributed? If such > >> >a function exists, the probability of it generating a number between any > >> >two arbitrarily large, but finite limits is exactly 0! Why would > >> >anyone want a random number generator like that? This does make the correct point. (discussed more below) > >> Not zero, since the random number generator will in fact come up with a > >> number. The chances are infinitesimal. The difference is admittedly > >> very subtle. Even more subtle - since a probability of zero doesn't mean it can't happen! > > > >I haven't been able to market this, so here, ABSOLUTELY FREE, is my > >generator! It's GUARANTEED to generate ALL positive integers with > >equal frequency, if you only run it long enough. ^^^^^^^^^^^^^^^^^^ > > [generator omitted] > >Col. G. L. Sicherman postnews should know when to append the :-) symbol :-) > > I disagree that this one's output is evenly distributed. There will be > a rather high spike at x=6. you just didn't wait long enough :-) > > I'm the original poser of the problem. I'm surprised at the high > smart-ass/serious ratio on the responses. you might have done better in net.math.stat than net.puzzle > > The best I've thought of so far for a random number between neg inf and > pos inf is: ... It is no problem to generate a random number between neg inf and pos inf. The normal distribution has these limits and therefore all you need is to generate a random number in [0,1] (uniform distribution) and apply a transformation. > > However, I don't think this is evenly distributed. (If not, what is > it's distribution ??) Can we scale this function to make it evenly > distributed ? > Of course it's not evenly (uniformly) distributed. A probability distribution integrates to unity between its limits. You are asking for a (non-negative) function which is of equal amplitude (uniform) between neg inf and pos inf and has a finite (unity) integral. Let's do this by taking limits: A uniform distribution between -L/2 and +L/2 has height 1/L, and one can generate a number from this distribution by taking one from a uniform [0,1] (which is the usual one which random number generators named RAND approximate), subtracting 1/2 and then multiplying by L. Now we have exactly what you want as we let L get larger and approach inf. We approach a uniform distribution of infinite width and zero height. In the limit, you have trouble since L becomes infinite and you have a step of multiplication by L in your generation. However this is exactly what you want (since inf is not your usual kind of number) since nearly all (in the measure theory sense) of your distribution is out past any finite range you care to specify. So the real question is why you want a random number generator which (except for a set of outcomes with measure zero) always gives an infinite result? > /Eric --henry schaffer (feel free to use mail, if you'ld like to discuss this more)