def pick
            tst = rand
            sum = 0
            @map.each do |value, prob|
                sum += prob
                return value,prob if tst < sum
            end
            return nil
        end
def pick
            tst = rand
            sum = 0
            @map.each do |value, prob|
                sum += prob
                return value,prob if tst < sum
            end
            return nil
        end
randomly pick a key-value with respect to its probability
 in given distribution