Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- from copy import copy
- import numpy as np
- from matplotlib import pyplot as plt
- import math
- paper = 8755+370# +800+1000
- gold = 6
- res = []
- res2 = []
- res3 = []
- for i in range(10000):
- total = 0
- for j in range(math.floor(paper/100)):
- total += random.randint(1,6)
- total += gold*6
- res.append(total)
- for i in range(10000):
- total = 0
- for j in range(math.floor((paper+500)/100)):
- total += random.randint(1,6)
- total += gold*6
- res2.append(total)
- for i in range(10000):
- total = 0
- for j in range(math.floor((paper+1000)/100)):
- total += random.randint(1,6)
- total += gold*6
- res3.append(total)
- showplot = True
- if showplot:
- label = "Distribution"
- rmin = min(res)
- rmax = max(res)+1
- fig, ax = plt.subplots(3,1,figsize=(5,5))
- fig.suptitle("Tenth Anniversary")
- ax[0].hist(res, edgecolor='white', color="darkorange", bins=range(rmin, rmax, 1))
- ax[0].axvline(x=352,linewidth=2,label="Required Tiles with Surprise Box",color="blue")
- ax[0].axvline(x=416,linewidth=2,label="Required Tiles without Surprise Box",color="red")
- ax[0].set_yticklabels([])
- ax[0].set_title("Number of tiles with " +str(paper) + " Paper Money & " + str(gold) + " Golden Dice (6 tiles each)")
- # ax[0].set_ylabel("Probability")
- # ax[0].set_xlabel("Tiles")
- label1 = "Distribution"
- rmin1 = min(res2)
- rmax1 = max(res2)+1
- ax[1].hist(res2, edgecolor='white', color="darkorange", bins=range(rmin1, rmax1, 1))
- ax[1].axvline(x=352,linewidth=2,label="Required Tiles with Surprise Box",color="blue")
- ax[1].axvline(x=416,linewidth=2,label="Required Tiles without Surprise Box",color="red")
- ax[1].set_yticklabels([])
- ax[1].set_title("Number of tiles with " +str(paper+500) + " Paper Money & " + str(gold) + " Golden Dice (6 tiles each)")
- # ax[1].set_ylabel("Probability")
- # ax[1].set_xlabel("Tiles")
- label2 = "Distribution"
- rmin2 = min(res3)
- rmax2 = max(res3)+1
- ax[2].hist(res3, edgecolor='white', color="darkorange", bins=range(rmin2, rmax2, 1))
- ax[2].axvline(x=352,linewidth=2,label="Required Tiles with Surprise Box",color="blue")
- ax[2].axvline(x=416,linewidth=2,label="Required Tiles without Surprise Box",color="red")
- ax[2].set_yticklabels([])
- ax[2].set_title("Number of tiles with " +str(paper+1000) + " Paper Money & " + str(gold) + " Golden Dice (6 tiles each)")
- # ax[2].set_ylabel("Probability")
- # ax[2].set_xlabel("Tiles")
- plt.legend()
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment