How often will you draw the miss/crit? The reshuffle metric introduces a bias. How strong is that bias with a 20 card deck?
import random
def sim(deck, draws):
ret = 0
size = deck
for i in range(0, draws):
j = random.randint(0, size - 1)
if j == 0:
ret = ret + 1
if j <= 1:
size = deck
else:
size -= 1
return ret
def simbatch(deck, draws, sims):
total = 0
for i in range(0, sims):
total = total + sim(deck, draws)
return total / sims
for i in range(1, 60):
print('{}: {:7.5f}'.format(i, simbatch(20, i, 100000)/i))
1: 0.05112 2: 0.05097 3: 0.05213 4: 0.05365 5: 0.05497 6: 0.05586 7: 0.05709 8: 0.05804 9: 0.05925 10: 0.06003 11: 0.06091 12: 0.06197 13: 0.06247 14: 0.06329 15: 0.06409 16: 0.06448 17: 0.06505 18: 0.06588 19: 0.06605 20: 0.06604 21: 0.06660 22: 0.06662 23: 0.06657 24: 0.06698 25: 0.06719 26: 0.06731 27: 0.06783 28: 0.06773 29: 0.06782 30: 0.06780 31: 0.06789 32: 0.06812 33: 0.06824 34: 0.06842 35: 0.06842 36: 0.06833 37: 0.06864 38: 0.06865 39: 0.06867 40: 0.06878 41: 0.06881 42: 0.06876 43: 0.06881 44: 0.06883 45: 0.06893 46: 0.06911 47: 0.06917 48: 0.06915 49: 0.06920 50: 0.06942 51: 0.06933 52: 0.06936 53: 0.06951 54: 0.06933 55: 0.06934 56: 0.06948 57: 0.06966 58: 0.06962 59: 0.06967