Created
April 10, 2018 17:24
-
-
Save kesava/784f2777ebfa8751ac5a2c936a3fc0ea to your computer and use it in GitHub Desktop.
Distribution of `(rand)` function in clojure
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
(map (fn [[key value]] [key (count value)]) | |
(group-by identity (take 6000000 (repeatedly #(str (rand-int 10)))))) | |
;; (["9" 598517] ["3" 599137] ["4" 601005] ["8" 601573] ["7" 599983] ["5" 600287] ["6" 600611] ["1" 599224] ["0" 599582] ["2" 600081]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment