Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- bowl1 = 0
- bowl2 = 0
- bowl3 = 0
- prop1 =[]
- probBowl1 = []
- prop2 = []
- probBowl2 = []
- prop3 = []
- probBowl3 = []
- bolatepat1 = 0
- bolatepat2 = 0
- bolatepat3 = 0
- for i in range (1,10001):
- bowl = random.randint(1,6)
- if (bowl==1 or bowl ==2):
- bowl1+=1
- ball = random.randint(1,6)
- prop2.append (0)
- prop3.append (0)
- if (ball==1 or ball==2):
- bolatepat1 += 1
- temp1 = bolatepat1/ i
- temp2 = bowl1/ i
- temp3 = temp1*temp2
- prop1.append(temp3)
- suma = temp3+ prop2[len(prop2)-1] + prop3[len(prop3)-1]
- if (suma==0):
- probBowl1.append(0)
- else:
- probBowl1.append(temp3/suma)
- else:
- temp1 = bolatepat1/ i
- temp2 = bowl1/ i
- temp3 = temp1*temp2
- prop1.append(temp3)
- suma = temp3+ prop2[len(prop2)-1] + prop3[len(prop3)-1]
- if (suma==0):
- probBowl1.append(0)
- else:
- probBowl1.append(temp3/suma)
- elif(bowl==3):
- bowl2+=1
- ball = random.randint(1,6)
- prop1.append (0)
- prop3.append (0)
- if (ball==1):
- bolatepat2 += 1
- temp1 = bolatepat2/ i
- temp2 = bowl2/ i
- temp3 = temp1*temp2
- prop2.append(temp3)
- suma = temp3+ prop1[len(prop1)-1] + prop3[len(prop3)-1]
- if (suma==0):
- probBowl2.append(0)
- else:
- probBowl2.append(temp3/suma)
- else:
- temp1 = bolatepat2/ i
- temp2 = bowl2/ i
- temp3 = temp1*temp2
- prop2.append(temp3)
- suma = temp3+ prop1[len(prop1)-1] + prop3[len(prop3)-1]
- if (suma==0):
- probBowl2.append(0)
- else:
- probBowl2.append(temp3/suma)
- elif (bowl==4 or bowl ==5 or bowl ==6):
- prop1.append (0)
- prop2.append (0)
- bowl3+=1
- ball = random.randint(1,6)
- if (ball==1 or ball==2 or ball==3 or ball==4 or ball==5):
- bolatepat3 += 1
- temp1 = bolatepat3/ i
- temp2 = bowl3/ i
- temp3 = temp1*temp2
- prop3.append(temp3)
- suma = temp3+ prop1[len(prop1)-1] + prop2[len(prop2)-1]
- if (suma==0):
- probBowl3.append(0)
- else:
- probBowl3.append(temp3/suma)
- else:
- temp1 = bolatepat3/ i
- temp2 = bowl3/ i
- temp3 = temp1*temp2
- prop3.append(temp3)
- suma = temp3+ prop1[len(prop1)-1] + prop2[len(prop2)-1]
- if (suma==0):
- probBowl3.append(0)
- else:
- probBowl3.append(temp3/suma)
- print (probBowl1[len(probBowl1)-1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement