Last active
August 29, 2015 14:23
-
-
Save mamonu/65c0cc723cbb85fd1903 to your computer and use it in GitHub Desktop.
entropy calculation
This file contains hidden or 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
| ;; Get a 1Mn random numbers to calculate entropy over | |
| (def ps (vec (repeatedly 1e6 rand))) | |
| ;; entropy function | |
| (defn entropy [p] | |
| (* p (Math/log p))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment