def mk_distribution(*args)
      flat = args.flatten
      raw = flat.first.is_a?(String) ? flat.first.split : flat

      hash = raw.each_with_object(Hash.new(0)) do |v, sum|
        sum[v] += 1
        sum
      end

      hash.to_a.map { |a, b| [b, a.to_f] }
    end
def mk_distribution(*args)
      flat = args.flatten
      raw = flat.first.is_a?(String) ? flat.first.split : flat

      hash = raw.each_with_object(Hash.new(0)) do |v, sum|
        sum[v] += 1
        sum
      end

      hash.to_a.map { |a, b| [b, a.to_f] }
    end
Make a distribution from a lot of numbers. The returned
 distribution is an array of arrays ready for dropping into
 #write. If you need a "real" Wavefront representation of the
 distribution, use #mk_wf_distribution.
 @param args [String, Array] numbers. Can be multiple
   arguments, a whitespace-separated string, or one or more
   arrays.
 @return [Array[Array]] of the form [[1, 3], [4, 5]...]