Last active
March 1, 2017 17:57
-
-
Save ryantuck/80271a10e3ef209dacf11bad5355923b 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
from __future__ import division | |
from collections import Counter | |
import itertools | |
import six | |
n_dice = 6 | |
n_sides_per_die = 6 | |
options = range(1, n_sides_per_die+1) | |
all_combos = itertools.product(*(n_dice*[options])) | |
uniques = [len(set(c)) for c in all_combos] | |
c = Counter(uniques) | |
for k,v in c.items(): | |
print('{0: <2} | {1: >10} | {2}'.format(k, v, v/len(uniques))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment