• (uniform coll)
Return a distribution in which each of the elements of coll
has the same probability.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/probabilities/finite_distributions.clj:84 top

(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]))))
Vars in clojure.contrib.probabilities.finite-distributions/uniform: defn for into let
Used in 0 other vars

Comments top

No comments for uniform. Log in to add a comment.