Created
December 19, 2020 19:06
-
-
Save erelson/56a0f3bbab8c8a903743be1b94aefd8c to your computer and use it in GitHub Desktop.
PoGo rocket balloon math
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
import random | |
count = 1000 | |
print("For {0} leaders at each balloon chance...".format(count)) | |
for jj_frac in [0.15, 0.2, 0.25, 0.3, 0.4, 0.45, 0.5]: | |
tally = 0 # radar pieces accumulated | |
balloons = 0 # of balloon visits | |
for n in range(count): | |
pieces = 0 | |
leader = False | |
cnt = 0 | |
while not leader: | |
cnt += 1 | |
roll = random.random() | |
if roll <= jj_frac: | |
pieces += 2 | |
elif pieces < 6: | |
pieces += 1 | |
else: | |
leader = True | |
tally += pieces | |
balloons += cnt | |
#print("\t", pieces)#tally) | |
print("At J&J balloon chance of:", jj_frac, "; Balloons per leader:", balloons/count, "; Average radar pieces:", tally/count) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment