• (zipf s n)
Returns the Zipf distribution in which the numbers k=1..n have
probabilities proportional to 1/k^s.

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

(defn zipf
  "Returns the Zipf distribution in which the numbers k=1..n have
   probabilities proportional to 1/k^s."
  [s n]
  (make-distribution (range 1 (inc n)) #(/ (java.lang.Math/pow % s))))
Vars in clojure.contrib.probabilities.finite-distributions/zipf: / defn inc range
Used in 0 other vars

Comments top

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