1 2 Previous Next 15 Replies Latest reply: Aug 26, 2008 7:58 AM by 807589 Go to original post RSS
      • 15. Re: trouble generating random numbers with a certain distribution
        uj_ wrote:
        phineasgage wrote:
        The continuous distribution from uj_ works great. Although it isn't perfect in the discrete case, it can still be used if the size of N is large and the application doesn't demand perfect accuracy in the lower range.
        I haven't been doing calculus for a while but I suddently realized that this,

        X = e^[ln(N)*U]

        can be further reduced to,

        X = [e^[ln(N)]]^U = N^U

        This means that the pow method can be used for the simulation code, like
        Random rand = new Random();
        int n = 100;
        double dU = rand.nextDouble();
        double dX = Math.pow(n,  dU); // dX is the random number on the distribution
        Considering that this distribution is so easy to simulate (in the continous case) it's quite astonishing that there are so few references to it. I haven't found a single one.

        And the distribution is interesting. Every number in the range 1 to N comes up with a probability that's proportional to the inverse of the number. Informally this corresponds to the notion that "the shorter/smaller/sooner the more probable, the longer/larger/later the less probable". This should be a common situation in "nature". Doesn't stuff tend to split up in many small and few large? Doesn't people prefer sooner rather than later?

        Further the distribution has a "fat tail". This means that numbers far away from the average still has a substantial probability of occuring. This is not the case in the Gaussian/Normal distribution for example where probabilities quickly get extremely small (like not even once in the lifetime of the universe).

        The distribution also is mathematically truncated. It's limited to a specific range. Again, this is not the case with the Gaussian/Normal distribution. It must be artificially truncated in principle skewing it.

        Now what should this good cigarr be called? Well I suggest the Truncated Harmonic Distribution until someone manages to Google up its given name -:)
        I was surprised as well not to find a discrete version of this distribution, at least somewhere. Kleinberg's results are interesting, that in small world networks the optimal random link distribution is 1/d^r, where d is the distance between the nodes, and r is effectively the number of dimensions in the network. The r=1 case is interesting in how it breaks calculations for existing power law distributions, probably because integrating 1/x is a special case from the general 1/x^r(?) The Harmonic Series is also interesting in that if you remove terms that have specific digits in it, like 9, suddenly it doesn't diverge anymore.

        But I like Truncated Harmonic Distribution. Once someone finds out an existing name for it, it will become the Distribution Formerly Known as the Truncated Harmonic Distribution, of course. :)
        1 2 Previous Next