loading
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import random
#this function gets you the win/loss rate given C's relationship to the distributions A & B are selected from
def main(aRange,bRange,cRange):
  N_trials=100000
  wins, losses=0, 0
  for _ in range(N_trials):
    a=random.randint(aRange[0],aRange[1])
    b=random.randint(bRange[0],bRange[1])
    c=random.randint(cRange[0],cRange[1])
    if a<c:
      if a<b:
        wins+=1
      else:
        losses+=1
    else:
      if a>b:
        wins+=1
      else:
        losses+=1
  print(*['Simulation of',N_trials,'trials:'])
  print(*['aRange:',aRange])
  print(*['bRange:',bRange])
  print(*['cRange:',cRange])
  print(*['Wins:',wins,' Losses:',losses," Win Percentage:",wins/(wins+losses)])
  print('------------------------')

main([740000,800000],[740000,800000],[-1000000,1000000])
main([740000,800000],[740000,800000],[740000,800000])
main([740000,800000],[740000,800000],[770000,770000])