'Generate a discrete probability distribution.
The parameter `genSingleton\' is a function which is used to generate
singletons for the probability distribution.'

def genDistribution(self, genSingleton):

    dist = {}
    bins = self.prng.randint(const.MIN_BINS, const.MAX_BINS)
    cumulProb = 0
    for _ in xrange(bins):
        prob = self.prng.uniform(0, (1 - cumulProb))
        cumulProb += prob
        singleton = genSingleton()
        dist[singleton] = prob
        self.sampleList.append((cumulProb, singleton))
    dist[genSingleton()] = (1 - cumulProb)
    return dist
