def prob_h_to_ao h
      rmin,rmax = h.keys.minmax
      o = rmin
      s = 1 + rmax - rmin
      raise ArgumentError, "Range of possible results too large" if s > 1000000
      a = Array.new( s, 0.0 )
      h.each { |k,v| a[k-rmin] = Float(v) }
      [a,o]
    end
def prob_h_to_ao h
      rmin,rmax = h.keys.minmax
      o = rmin
      s = 1 + rmax - rmin
      raise ArgumentError, "Range of possible results too large" if s > 1000000
      a = Array.new( s, 0.0 )
      h.each { |k,v| a[k-rmin] = Float(v) }
      [a,o]
    end
Convert hash to array,offset notation