Function getRandomIntWithRecursiveProbability

  • Gets a random int, r, with the probability P(r) = (base)**r For example, with a probability of 1/2: P(1) = 1/2, P(2) = 1/4, etc.

    Parameters

    • probability: number = 0.5

      the probability

    Returns number