Return a distribution in which each of the elements of coll
has the same probability.
(defn uniform
"Return a distribution in which each of the elements of coll
has the same probability."
[coll]
(let [n (count coll)
p (/ 1 n)]
(into {} (for [x (seq coll)] [x p]))))
Comments top
No comments for uniform. Log in to add a comment.