Created
June 5, 2019 06:48
-
-
Save tristanstraub/08fa33fcbe2959bd370b50f4428a8309 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def values | |
[[(/ 1.0 2.0) | |
(/ 1.0 2.0)] | |
[(/ 1.0 3.0) | |
(/ 1.0 3.0) | |
(/ 1.0 3.0)]]) | |
(defn mean | |
[xs] | |
(/ (double (reduce + xs)) (count xs))) | |
(clojure.test/deftest mean-of-means-not-mean | |
(clojure.test/is (not (= (mean (map mean values)) | |
(mean (flatten values)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment