Last active
February 23, 2019 04:49
-
-
Save meereeum/b417bc4d7d2f6e27c1aa6e15a6a78973 to your computer and use it in GitHub Desktop.
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
#!/usr/local/bin/bash | |
# a million random digits with 100,000 normal deviates | |
[ -f digits.txt ] || ( | |
wget https://www.rand.org/content/dam/rand/pubs/monograph_reports/MR1418/MR1418.digits.txt.zip && | |
unzip MR1418.digits.txt.zip) | |
rando=$( cat digits.txt | cut --complement -f1 -d' ' | xargs | sed 's/ *//g' ) | |
for n in {00..99}; do | |
echo -e "$n\t$( grep -o $n <<< $rando | wc -l )" # num occurences | |
done | sort -n -k2,2 --reverse | grep -n --color ^47 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment