Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- def lmao(die_vals):
- chances_either = []
- for first_roll in die_vals:
- for second_roll in die_vals:
- chances_either.append(max(first_roll, second_roll))
- print("average for either:", np.mean(chances_either))
- chances_new = []
- for first_roll in die_vals:
- for second_roll in die_vals:
- if first_roll < np.mean(die_vals):
- chances_new.append(second_roll)
- else:
- chances_new.append(first_roll)
- print("average for new:", np.mean(chances_new))
- print("Ratio:", np.mean(chances_either) / np.mean(chances_new))
- def rofl(die):
- print("Dice:", die)
- chances_either = []
- for first_roll in range(1,die+1):
- for second_roll in range(1,die+1):
- chances_either.append(max(first_roll, second_roll))
- print("average for either:", np.mean(chances_either))
- chances_new = []
- for first_roll in range(1,die+1):
- for second_roll in range(1,die+1):
- if first_roll < (die + 1) / 2:
- chances_new.append(second_roll)
- else:
- chances_new.append(first_roll)
- print("average for new:", np.mean(chances_new))
- print("Ratio:", np.mean(chances_either) / np.mean(chances_new))
- rofl(4)
- rofl(6)
- rofl(8)
- rofl(10)
- rofl(12)
- rofl(20)
- #test values for 2d6
- lmao([2,3,4,5,6,7,
- 3,4,5,6,7,8,
- 4,5,6,7,8,9,
- 5,6,7,8,9,10,
- 6,7,8,9,10,11,
- 7,8,9,10,11,12])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement