Last active
October 3, 2019 18:39
-
-
Save gameguy43/2c547fe784f327d092c1d5eac1779938 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
from collections import Counter | |
all_possible_results = [] | |
for first_roll_result in range(1, 8): | |
for second_roll_result in range(1, 8): | |
for third_roll_result in range(1, 8): | |
for fourth_roll_result in range(1, 8): | |
for fifth_roll_result in range(1, 8): | |
result = (first_roll_result + | |
second_roll_result + | |
third_roll_result + | |
fourth_roll_result + | |
fifth_roll_result) % 5 + 1 | |
all_possible_results.append(result) | |
counter = Counter(all_possible_results) | |
print(counter) # Counter({3: 3365, 4: 3365, 2: 3360, 5: 3360, 1: 3357}) | |
print(len(all_possible_results) / 5) # 3361.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment