1.2.0 permalink Arrow_down_16x16
  • (prob pred dist)
Return the probability that the predicate pred is satisfied in the
distribution dist, i.e. the sum of the probabilities of the values
that satisfy pred.

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:197 top

(defn prob
  "Return the probability that the predicate pred is satisfied in the
   distribution dist, i.e. the sum of the probabilities of the values
   that satisfy pred."
  [pred dist]
  (apply + (for [[x p] dist :when (pred x)] p)))
Vars in clojure.contrib.probabilities.finite-distributions/prob: + apply defn for
Used in 0 other vars

Comments top

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