Last active
March 26, 2020 19:16
-
-
Save JacobFischer/00febcc809e42c95f172d93c6f0698b6 to your computer and use it in GitHub Desktop.
AC: NH bells gained by chances
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
import matplotlib.pyplot as plt | |
# all bells are in thousands (k) | |
CHANCES = [0.20, 0.25, 0.30, 0.333, 0.35, 0.40] # some nice round %s to plot | |
MAX_AMOUNT = 10 | |
MAX_BELLS = 100 | |
for chance in CHANCES: | |
all_bells = [] | |
for bells in range(MAX_BELLS): | |
prob = chance if bells > MAX_AMOUNT else 1 | |
expected_bells = 3 * bells * prob + MAX_AMOUNT * 3 * (1 - prob) - bells | |
all_bells.append(expected_bells) | |
plt.plot([r for r in range(MAX_BELLS)], all_bells) | |
if chance == CHANCES[0]: | |
maximized = max(all_bells) | |
plt.text(all_bells.index(maximized), maximized,'{}k bells'.format(all_bells.index(maximized))) | |
plt.title('Animal Crossing New Horizons\nexpected bells gained by chances'.format(MAX_AMOUNT)) | |
plt.legend(['prob {:.1%}'.format(c) for c in CHANCES]) | |
plt.ylabel('Expected Bells Gained (in thousands)') | |
plt.xlabel('Bells Planted (in thousands)') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment