Re: number generator



On Sat, 10 Mar 2007 08:29:09 -0800, Paul Rubin wrote:

Steven D'Aprano <steve@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> writes:
Doesn't mean that it isn't random. After all, the first four numbers are
random, therefore their sum is random. 50 - (something random) is also
random.

What does it mean for the first 4 numbers to be random? For example,
is 27 random?

In isolation, no, but 27 could have been chosen at random and hence would
have been unpredictable. That was my point: if we generate four
unpredictable numbers (using random.randint or similar) and sum them, the
sum is also unpredictable, and hence the difference between 50 and that
sum is unpredictable.


By your method, what is the probability of the first number being
higher than 30? What is the probability of the fifth number being
higher than 30? If these probabilities are unequal, can we really say
the sequences are random?

Of course we can! "Uniform probability distribution" is a special case of
random. Most random quantities are far from uniform. The Python random
module includes a couple of non-uniform distributions, including
exponential distribution (random.expovariate) and the famous bell curve
distribution (random.normalvariate).

One common distribution which seems to have been missed is the Poisson
distribution, which applies to (among many, many others) the number of
18th Century Prussian cavalry officers who fell off their horse and broke
a limb, and the number of cars arriving at a petrol station in any hour.



--
Steven.

.



Relevant Pages

  • Re: Pain in the ass
    ... then you can get rid of them since the sum of r_i and the sum of (r_i ... One thing you definitely should say is the distribution for the r_i's. ... distribution is uniform on [0,1/n), then the probability the equation ... is zero, as well.) ...
    (sci.math)
  • Re: Calculus XOR Probability
    ... If one of the elements is to be chosen from the set, then the probability of one being chosen is 1. ... then that 1 representing the fact that one of those will be chosen is defined to be the sum of the probabilities of each. ... If you can establish a uniform probability distribution, then you can say each possibility has the same probability. ... the question is why the standard system can't accomodate the infinite case, with an infinite number of equally likely outcomes, one of which will definitely happen. ...
    (sci.math)
  • Re: Calculus XOR Probability
    ... the sum of a countable number of 0's; he simply "wants" it to be 1. ... then the probability of one being chosen is 1. ... If you can establish a uniform probability distribution, ...
    (sci.math)
  • Re: Probability in an infinite sample space
    ... It is often assumed that if no distribution is specified, ... no such thing as a uniform probability distribution on a countably ... example, there is a uniform distribution on the unit interval, ... I can't form the sum of the probability of a randomly selected element ...
    (sci.math)
  • Re: poisson variance
    ... David Jones wrote: ... sum to one). ... The technique David is using is often used in probability - it's one I ... known distribution, with some constants out the front. ...
    (sci.stat.consult)